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