From 6920315952df65a3efe1fb7a577ad22b5d0c70e4 Mon Sep 17 00:00:00 2001 From: samolego <34912839+samolego@users.noreply.github.com> Date: Wed, 27 Jan 2021 11:21:38 +0100 Subject: [PATCH] MOre fabric changes --- build.gradle | 4 ++-- .../org/samo_lego/simpleauth/event/AuthEventHandler.java | 6 +++--- .../org/samo_lego/simpleauth/utils/PlatformSpecific.java | 2 +- .../java/org/samo_lego/simpleauth/SimpleAuthFabric.java | 1 - fabric/src/main/resources/fabric.mod.json | 3 +++ .../samo_lego/simpleauth/event/AuthEventHandlerForge.java | 3 --- gradle.properties | 4 ++-- 7 files changed, 11 insertions(+), 12 deletions(-) diff --git a/build.gradle b/build.gradle index 96ede2a..c928b97 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id "architectury-plugin" version "2.0.59" - id "forgified-fabric-loom" version "0.6.52" apply false + id "architectury-plugin" version "2.0.65" + id "forgified-fabric-loom" version "0.6.54" apply false } architectury { diff --git a/common/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java b/common/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java index fc60a7b..77e7b31 100644 --- a/common/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java +++ b/common/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandler.java @@ -132,7 +132,7 @@ public class AuthEventHandler { } // Player chatting - public static ActionResult onPlayerChat(PlayerEntity player, String message) { + public static ActionResult onPlayerChat(ServerPlayerEntity player, String message) { // Getting the message to then be able to check it if( !((PlayerAuth) player).isAuthenticated() && @@ -147,7 +147,7 @@ public class AuthEventHandler { } // Player movement - public static ActionResult onPlayerMove(PlayerEntity player) { + public static ActionResult onPlayerMove(ServerPlayerEntity player) { // Player will fall if enabled (prevent fly kick) boolean auth = ((PlayerAuth) player).isAuthenticated(); // Otherwise movement should be disabled @@ -195,7 +195,7 @@ public class AuthEventHandler { return ActionResult.PASS; } // Changing inventory (item moving etc.) - public static ActionResult onTakeItem(PlayerEntity player) { + public static ActionResult onTakeItem(ServerPlayerEntity player) { if(!((PlayerAuth) player).isAuthenticated() && !config.experimental.allowItemMoving) { player.sendMessage(((PlayerAuth) player).getAuthMessage(), false); return ActionResult.FAIL; diff --git a/common/src/main/java/org/samo_lego/simpleauth/utils/PlatformSpecific.java b/common/src/main/java/org/samo_lego/simpleauth/utils/PlatformSpecific.java index e2804bf..86c8c9b 100644 --- a/common/src/main/java/org/samo_lego/simpleauth/utils/PlatformSpecific.java +++ b/common/src/main/java/org/samo_lego/simpleauth/utils/PlatformSpecific.java @@ -7,6 +7,6 @@ public class PlatformSpecific { @ExpectPlatform public static boolean isPlayerFake(PlayerEntity player) { // Replaced by Architectury - throw new AssertionError(); + return false; } } diff --git a/fabric/src/main/java/org/samo_lego/simpleauth/SimpleAuthFabric.java b/fabric/src/main/java/org/samo_lego/simpleauth/SimpleAuthFabric.java index e70fb87..9e9036c 100644 --- a/fabric/src/main/java/org/samo_lego/simpleauth/SimpleAuthFabric.java +++ b/fabric/src/main/java/org/samo_lego/simpleauth/SimpleAuthFabric.java @@ -14,7 +14,6 @@ public class SimpleAuthFabric implements ModInitializer { @Override public void onInitialize() { SimpleAuth.init(FabricLoader.getInstance().getGameDir()); - //FabricLoader.getInstance().isModLoaded("carpet"); // Registering the commands CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> { diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index beed51e..cf991a4 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -20,6 +20,9 @@ "org.samo_lego.simpleauth.SimpleAuthFabric" ] }, + "mixins": [ + "mixins.simpleauth.json" + ], "depends": { "fabricloader": ">=0.8.8", "fabric": "*" diff --git a/forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java b/forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java index b6e0302..d94f2ab 100644 --- a/forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java +++ b/forge/src/main/java/org/samo_lego/simpleauth/event/AuthEventHandlerForge.java @@ -2,17 +2,14 @@ package org.samo_lego.simpleauth.event; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.ActionResult; -import net.minecraft.util.TypedActionResult; import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.event.entity.player.PlayerContainerEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; -import org.samo_lego.simpleauth.utils.PlayerAuth; import static net.minecraftforge.eventbus.api.EventPriority.HIGHEST; import static org.samo_lego.simpleauth.SimpleAuth.MOD_ID; -import static org.samo_lego.simpleauth.SimpleAuth.config; /** * This class will take care of actions players try to do, diff --git a/gradle.properties b/gradle.properties index 7c2bc2c..d05a9f2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,6 +12,8 @@ fabric_version=0.29.4+1.16 # Forge forge_version=36.0.4 +# Architectury +architectury_version=1.5.101 # Mod Properties mod_version = 1.7.5 @@ -23,8 +25,6 @@ argon2_version = 2.7 bcrypt_version = 0.9.0 bytes_version = 1.3.0 -# Architectury -architectury_version=1.3.81 # Carpet for debugging carpet_core_version = 1.4.16+v201105