diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/CommaSeparatedValuesConverter.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/CommaSeparatedValuesConverter.java index 7479ff375..e02747c3e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/CommaSeparatedValuesConverter.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/argument/CommaSeparatedValuesConverter.java @@ -32,7 +32,7 @@ import org.enginehub.piston.inject.InjectedValueAccess; import java.util.List; import static com.google.common.base.Preconditions.checkArgument; -import static com.sk89q.worldedit.util.formatting.text.Component.space; +import static com.sk89q.worldedit.util.formatting.text.TextComponent.space; public class CommaSeparatedValuesConverter implements ArgumentConverter { @@ -61,7 +61,7 @@ public class CommaSeparatedValuesConverter implements ArgumentConverter { TextComponent.Builder result = TextComponent.builder(""); if (maximum > -1) { result.append(TextComponent.of("up to ")) - .append(Component.of(maximum)) + .append(TextComponent.of(maximum)) .append(space()); } result.append(TextComponent.of("comma separated values of: ")) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java index e1b889059..fd579c6fb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/CommandListBox.java @@ -87,16 +87,16 @@ public class CommandListBox extends PaginationBox { TextComponentProducer line = new TextComponentProducer(); if (!hideHelp) { line.append(SubtleFormat.wrap("? ") - .clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "//help " + insertion)) - .hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Additional Help")))); + .clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "//help " + insertion)) + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Additional Help")))); } TextComponent command = TextComponent.of(alias, TextColor.GOLD); if (insertion == null) { line.append(command); } else { line.append(command - .clickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, insertion)) - .hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to select")))); + .clickEvent(ClickEvent.of(ClickEvent.Action.SUGGEST_COMMAND, insertion)) + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to select")))); } return line.append(TextComponent.of(": ")).append(description).create(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java index 1497ddbaa..e5fceb008 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/MessageBox.java @@ -55,11 +55,11 @@ public class MessageBox extends TextComponentProducer { if (side > 1) { line.append(createBorder(side - 1)); } - line.append(Component.space()); + line.append(TextComponent.space()); } line.append(text); if (side > 0) { - line.append(Component.space()); + line.append(TextComponent.space()); if (side > 1) { line.append(createBorder(side - 1)); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java index 6d33d1a5f..9308d326c 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/PaginationBox.java @@ -105,15 +105,15 @@ public abstract class PaginationBox extends MessageBox { TextComponentProducer navProducer = new TextComponentProducer(); if (page > 1) { TextComponent prevComponent = TextComponent.of("<<< ", TextColor.GOLD) - .clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, pageCommand.replace("%page%", String.valueOf(page - 1)))) - .hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to navigate"))); + .clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND, pageCommand.replace("%page%", String.valueOf(page - 1)))) + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to navigate"))); navProducer.append(prevComponent); } navProducer.append(pageNumberComponent); if (page < pageCount) { TextComponent nextComponent = TextComponent.of(" >>>", TextColor.GOLD) - .clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, pageCommand.replace("%page%", String.valueOf(page + 1)))) - .hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to navigate"))); + .clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND, pageCommand.replace("%page%", String.valueOf(page + 1)))) + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to navigate"))); navProducer.append(nextComponent); } getContents().append(centerAndBorder(navProducer.create())); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SchematicPaginationBox.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SchematicPaginationBox.java index 9617b31dd..ae052d137 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SchematicPaginationBox.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/SchematicPaginationBox.java @@ -59,12 +59,12 @@ public class SchematicPaginationBox extends PaginationBox { .content("") .append(TextComponent.of("[L]") .color(TextColor.GOLD) - .clickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/schem load " + path)) - .hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to load")))) - .append(Component.space()) + .clickEvent(ClickEvent.of(ClickEvent.Action.RUN_COMMAND, "/schem load " + path)) + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of("Click to load")))) + .append(TextComponent.space()) .append(TextComponent.of(path) .color(TextColor.DARK_GREEN) - .hoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, TextComponent.of(format)))) + .hoverEvent(HoverEvent.of(HoverEvent.Action.SHOW_TEXT, TextComponent.of(format)))) .build(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java index fed34ea23..b22b44f08 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/util/formatting/component/TextComponentProducer.java @@ -58,7 +58,7 @@ public class TextComponentProducer { * @return The producer, for chaining */ public TextComponentProducer newline() { - getBuilder().append(Component.newline()); + getBuilder().append(TextComponent.newline()); return this; } diff --git a/worldedit-libs/build.gradle b/worldedit-libs/build.gradle index ec33995f5..c6a53795e 100644 --- a/worldedit-libs/build.gradle +++ b/worldedit-libs/build.gradle @@ -88,13 +88,14 @@ configure(subprojects + project("core:ap")) { build.dependsOn(jar, sourcesJar) } +def textVersion = "3.0.0" project("core") { - def pistonVersion = '0.1.2' + def pistonVersion = '0.2.0' dependencies { - shade 'net.kyori:text-api:2.0.0' - shade 'net.kyori:text-serializer-gson:2.0.0' - shade 'net.kyori:text-serializer-legacy:2.0.0' + shade "net.kyori:text-api:$textVersion" + shade "net.kyori:text-serializer-gson:$textVersion" + shade "net.kyori:text-serializer-legacy:$textVersion" shade('com.sk89q:jchronic:0.2.4a') { exclude(group: "junit", module: "junit") } @@ -113,13 +114,25 @@ project("core") { } } project("bukkit") { + repositories { + maven { + name = "SpigotMC" + url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" + } + } dependencies { - shade 'net.kyori:text-adapter-bukkit:2.0.0-SNAPSHOT' + shade "net.kyori:text-adapter-bukkit:$textVersion" } } project("sponge") { + repositories { + maven { + name = "Sponge" + url = "https://repo.spongepowered.org/maven" + } + } dependencies { - shade 'net.kyori:text-adapter-spongeapi:2.0.0-SNAPSHOT' + shade "net.kyori:text-adapter-spongeapi:$textVersion" } }