diff options
author | Luck <git@lucko.me> | 2021-05-16 12:36:07 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2021-05-16 12:36:07 +0100 |
commit | 7a3e2809f4f8f9f130ca6eb3efe986b0f4f418f7 (patch) | |
tree | d1835212b77d9a288d735bd14ef4af22c8afb08e /spark-forge/src/main/java/me | |
parent | dd64274ca04b457241ce69eaac7c4a01472747e7 (diff) | |
download | spark-7a3e2809f4f8f9f130ca6eb3efe986b0f4f418f7.tar.gz spark-7a3e2809f4f8f9f130ca6eb3efe986b0f4f418f7.tar.bz2 spark-7a3e2809f4f8f9f130ca6eb3efe986b0f4f418f7.zip |
Update to ForgeGradle 4
Diffstat (limited to 'spark-forge/src/main/java/me')
4 files changed, 7 insertions, 7 deletions
diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java index 9470e65..574ca3a 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgeCommandSender.java @@ -59,15 +59,15 @@ public class ForgeCommandSender extends AbstractCommandSender<ICommandSource> { @Override public UUID getUniqueId() { if (super.delegate instanceof PlayerEntity) { - return ((PlayerEntity) super.delegate).getUniqueID(); + return ((PlayerEntity) super.delegate).getUUID(); } return null; } @Override public void sendMessage(Component message) { - IFormattableTextComponent component = ITextComponent.Serializer.getComponentFromJson(GsonComponentSerializer.gson().serialize(message)); - super.delegate.sendMessage(component, Util.DUMMY_UUID); + IFormattableTextComponent component = ITextComponent.Serializer.fromJson(GsonComponentSerializer.gson().serialize(message)); + super.delegate.sendMessage(component, Util.NIL_UUID); } @Override diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlatformInfo.java b/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlatformInfo.java index fbe99ce..60294be 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlatformInfo.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/ForgePlatformInfo.java @@ -34,7 +34,7 @@ public class ForgePlatformInfo extends AbstractPlatformInfo { @Override public Type getType() { - return type; + return this.type; } @Override diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java index a97a0bf..90d35ee 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeClientSparkPlugin.java @@ -77,7 +77,7 @@ public class ForgeClientSparkPlugin extends ForgeSparkPlugin implements Suggesti private CommandDispatcher<ISuggestionProvider> getPlayerCommandDispatcher() { return Optional.ofNullable(this.minecraft.player) .map(player -> player.connection) - .map(ClientPlayNetHandler::getCommandDispatcher) + .map(ClientPlayNetHandler::getCommands) .orElse(null); } @@ -106,7 +106,7 @@ public class ForgeClientSparkPlugin extends ForgeSparkPlugin implements Suggesti this.threadDumper.ensureSetup(); this.platform.executeCommand(new ForgeCommandSender(this.minecraft.player, this), args); - this.minecraft.ingameGUI.getChatGUI().addToSentMessages(event.getMessage()); + this.minecraft.gui.getChat().addRecentChat(event.getMessage()); event.setCanceled(true); } diff --git a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java index f6ea346..3a077d6 100644 --- a/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java +++ b/spark-forge/src/main/java/me/lucko/spark/forge/plugin/ForgeServerSparkPlugin.java @@ -102,7 +102,7 @@ public class ForgeServerSparkPlugin extends ForgeSparkPlugin implements Command< return Suggestions.empty(); } - ServerPlayerEntity player = context.getSource().asPlayer(); + ServerPlayerEntity player = context.getSource().getPlayerOrException(); return CompletableFuture.supplyAsync(() -> { for (String suggestion : this.platform.tabCompleteCommand(new ForgeCommandSender(player, this), args)) { builder.suggest(suggestion); |