From 839901ae3e3ddfd3f152641e2d8d406007a4504d Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Sun, 8 Nov 2020 20:10:55 +0100 Subject: [PATCH] Update to 20w45a --- build.gradle | 2 +- gradle.properties | 10 +++++----- .../ladysnake/pal/impl/VanillaAbilityTracker.java | 4 ++-- .../mixin/ServerPlayerInteractionManagerMixin.java | 8 ++++---- src/main/resources/fabric.mod.json | 2 +- .../io/github/ladysnake/paltest/BadFlightItem.java | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 558f0bb..ca404a9 100644 --- a/build.gradle +++ b/build.gradle @@ -3,7 +3,7 @@ import net.fabricmc.loom.task.RemapJarTask import java.time.Year plugins { - id 'fabric-loom' version '0.4-SNAPSHOT' + id 'fabric-loom' version '0.5-SNAPSHOT' id "net.minecrell.licenser" version "0.4.1" id 'com.matthewprenger.cursegradle' version '1.4.0' id "com.jfrog.bintray" version '1.8.4' diff --git a/gradle.properties b/gradle.properties index a64e27b..ef29c89 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.16.2 -yarn_mappings=1.16.2+build.6 -loader_version=0.9.1+build.205 -fabric_version=0.17.2+build.396-1.16 +minecraft_version=20w45a +yarn_mappings=20w45a+build.31 +loader_version=0.10.6+build.214 +fabric_version=0.25.4+1.17 # Mod Properties -mod_version = 1.2.1 +mod_version = 1.3.0-nightly.20w45a maven_group = io.github.ladysnake archives_base_name = Pal diff --git a/src/main/java/io/github/ladysnake/pal/impl/VanillaAbilityTracker.java b/src/main/java/io/github/ladysnake/pal/impl/VanillaAbilityTracker.java index fb7a398..3586cff 100644 --- a/src/main/java/io/github/ladysnake/pal/impl/VanillaAbilityTracker.java +++ b/src/main/java/io/github/ladysnake/pal/impl/VanillaAbilityTracker.java @@ -47,7 +47,7 @@ protected void updateState(boolean enabled) { } private void updateBacking(boolean enabled) { - this.setter.set(getGamemode(this.player), this.player.abilities, enabled); + this.setter.set(getGamemode(this.player), this.player.getAbilities(), enabled); } @Override @@ -57,7 +57,7 @@ protected void sync() { @Override public boolean isEnabled() { - return this.getter.test(this.player.abilities); + return this.getter.test(this.player.getAbilities()); } public void checkConflict() { diff --git a/src/main/java/io/github/ladysnake/pal/impl/mixin/ServerPlayerInteractionManagerMixin.java b/src/main/java/io/github/ladysnake/pal/impl/mixin/ServerPlayerInteractionManagerMixin.java index ff33de7..dee2ba3 100644 --- a/src/main/java/io/github/ladysnake/pal/impl/mixin/ServerPlayerInteractionManagerMixin.java +++ b/src/main/java/io/github/ladysnake/pal/impl/mixin/ServerPlayerInteractionManagerMixin.java @@ -39,24 +39,24 @@ public abstract class ServerPlayerInteractionManagerMixin { public ServerPlayerEntity player; @Inject( - method = "setGameMode", + method = "setGameMode(Lnet/minecraft/world/GameMode;Lnet/minecraft/world/GameMode;)V", at = @At( value = "INVOKE", target = "Lnet/minecraft/world/GameMode;setAbilities(Lnet/minecraft/entity/player/PlayerAbilities;)V" )) private void saveFlying(GameMode newMode, GameMode previousMode, CallbackInfo info) { - PAL_FLYING.set(player.abilities.flying); + PAL_FLYING.set(player.getAbilities().flying); } @Inject( - method = "setGameMode", + method = "setGameMode(Lnet/minecraft/world/GameMode;Lnet/minecraft/world/GameMode;)V", at = @At( value = "INVOKE", target = "Lnet/minecraft/world/GameMode;setAbilities(Lnet/minecraft/entity/player/PlayerAbilities;)V", shift = AFTER )) private void keepAbilities(GameMode newMode, GameMode previousMode, CallbackInfo info) { - player.abilities.flying = PAL_FLYING.get(); // will be overruled if unworthy + player.getAbilities().flying = PAL_FLYING.get(); // will be overruled if unworthy PlayerAbilityView.of(this.player).refreshAllPalAbilities(false); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 4805a6d..f20ad51 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -28,7 +28,7 @@ ], "depends": { "fabric": "*", - "minecraft": ">=1.16-" + "minecraft": ">=1.17-" }, "custom": { "modmenu:api": true diff --git a/src/testmod/java/io/github/ladysnake/paltest/BadFlightItem.java b/src/testmod/java/io/github/ladysnake/paltest/BadFlightItem.java index c040efd..275e25a 100644 --- a/src/testmod/java/io/github/ladysnake/paltest/BadFlightItem.java +++ b/src/testmod/java/io/github/ladysnake/paltest/BadFlightItem.java @@ -27,10 +27,10 @@ public BadFlightItem(Settings settings) { public TypedActionResult use(World world, PlayerEntity user, Hand hand) { if (!world.isClient) { // Direct ability access, issues abound ! - user.abilities.allowFlying = !user.abilities.allowFlying; - user.abilities.flying &= user.abilities.allowFlying; + user.getAbilities().allowFlying = !user.getAbilities().allowFlying; + user.getAbilities().flying &= user.getAbilities().allowFlying; user.sendAbilitiesUpdate(); - user.sendMessage(new LiteralText("Flight " + (user.abilities.allowFlying ? "enabled" : "disabled")), true); + user.sendMessage(new LiteralText("Flight " + (user.getAbilities().allowFlying ? "enabled" : "disabled")), true); } return TypedActionResult.success(user.getStackInHand(hand)); }