mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-15 04:41:37 +08:00
parent
9d9aaac15a
commit
6845e86fdf
@ -3,7 +3,7 @@
|
||||
object Versions {
|
||||
const val TEXT = "3.0.4"
|
||||
const val TEXT_EXTRAS = "3.0.5"
|
||||
const val PISTON = "0.5.5"
|
||||
const val PISTON = "0.5.6"
|
||||
const val AUTO_VALUE = "1.7"
|
||||
const val JUNIT = "5.6.1"
|
||||
const val MOCKITO = "3.3.3"
|
||||
|
@ -22,12 +22,14 @@
|
||||
import com.sk89q.worldedit.WorldEdit;
|
||||
import com.sk89q.worldedit.util.formatting.text.Component;
|
||||
import org.enginehub.piston.config.ConfigHolder;
|
||||
import org.enginehub.piston.config.ConfigRenderer;
|
||||
import org.enginehub.piston.config.TextConfig;
|
||||
import org.enginehub.piston.util.TextHelper;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class WorldEditText {
|
||||
private static final ConfigRenderer RENDERER = ConfigRenderer.getInstance();
|
||||
public static final ConfigHolder CONFIG_HOLDER = ConfigHolder.create();
|
||||
|
||||
static {
|
||||
@ -35,7 +37,10 @@ public class WorldEditText {
|
||||
}
|
||||
|
||||
public static Component format(Component component, Locale locale) {
|
||||
return WorldEdit.getInstance().getTranslationManager().convertText(CONFIG_HOLDER.replace(component), locale);
|
||||
return WorldEdit.getInstance().getTranslationManager().convertText(
|
||||
RENDERER.render(component, CONFIG_HOLDER),
|
||||
locale
|
||||
);
|
||||
}
|
||||
|
||||
public static String reduceToText(Component component, Locale locale) {
|
||||
|
Loading…
Reference in New Issue
Block a user