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 | |
parent | dd64274ca04b457241ce69eaac7c4a01472747e7 (diff) | |
download | spark-7a3e2809f4f8f9f130ca6eb3efe986b0f4f418f7.tar.gz spark-7a3e2809f4f8f9f130ca6eb3efe986b0f4f418f7.tar.bz2 spark-7a3e2809f4f8f9f130ca6eb3efe986b0f4f418f7.zip |
Update to ForgeGradle 4
Diffstat (limited to 'spark-forge')
5 files changed, 11 insertions, 10 deletions
diff --git a/spark-forge/build.gradle b/spark-forge/build.gradle index 06e674b..29782d8 100644 --- a/spark-forge/build.gradle +++ b/spark-forge/build.gradle @@ -1,9 +1,10 @@ buildscript { repositories { maven { url = "http://files.minecraftforge.net/maven" } + mavenCentral() } dependencies { - classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true + classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true } } @@ -14,7 +15,7 @@ plugins { apply plugin: 'net.minecraftforge.gradle' minecraft { - mappings channel: 'snapshot', version: '20200916-1.16.2' + mappings channel: 'official', version: '1.16.5' accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') } @@ -24,7 +25,7 @@ configurations { } dependencies { - minecraft 'net.minecraftforge:forge:1.16.4-35.0.3' + minecraft 'net.minecraftforge:forge:1.16.5-36.1.0' shade project(':spark-common') } 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); |