diff --git a/build.gradle b/build.gradle index bb79113..22280bb 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id "architectury-plugin" version "1.3.54" + id "architectury-plugin" version "2.0.56" id "forgified-fabric-loom" version "0.6.45" apply false } diff --git a/common/build.gradle b/common/build.gradle index 853c879..e3b30c0 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -5,7 +5,7 @@ repositories { } dependencies { - minecraft "com.mojang:minecraft:${rootProject.architect.minecraft}" + minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2") // We depend on fabric loader here to use the fabric @Environment annotations // Do NOT use other classes from fabric loader @@ -41,6 +41,6 @@ dependencies { include 'net.java.dev.jna:jna:5.5.0' } -architect { +architectury { common() } \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 8aa970b..46a45d7 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -30,15 +30,12 @@ dependencies { compileOnly(project(path: ":common")) { transitive = false - exclude(module: "fabric-api") } - runtimeOnly(project(path: ":common", configuration: "transformedRuntime")) { + runtimeOnly(project(path: ":common", configuration: "transformDevelopmentFabric")) { transitive = false - exclude(module: "fabric-api") } - shadow(project(path: ":common", configuration: "transformed")) { + shadow(project(path: ":common", configuration: "transformProductionFabric")) { transitive = false - exclude(module: "fabric-api") } 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 924573b..06c4fb9 100644 --- a/fabric/src/main/java/org/samo_lego/simpleauth/SimpleAuthFabric.java +++ b/fabric/src/main/java/org/samo_lego/simpleauth/SimpleAuthFabric.java @@ -6,13 +6,15 @@ import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.fabricmc.fabric.api.event.player.*; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.server.MinecraftServer; +import org.samo_lego.simpleauth.commands.*; +import org.samo_lego.simpleauth.event.AuthEventHandler; public class SimpleAuthFabric implements DedicatedServerModInitializer { @Override public void onInitializeServer() { SimpleAuth.init(FabricLoader.getInstance().getGameDir()); - + //FabricLoader.getInstance().isModLoaded("carpet"); // Registering the commands CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> { @@ -29,7 +31,7 @@ public class SimpleAuthFabric implements DedicatedServerModInitializer { UseItemCallback.EVENT.register((player, world, hand) -> AuthEventHandler.onUseItem(player)); AttackEntityCallback.EVENT.register((player, world, hand, entity, entityHitResult) -> AuthEventHandler.onAttackEntity(player)); UseEntityCallback.EVENT.register((player, world, hand, entity, entityHitResult) -> AuthEventHandler.onUseEntity(player)); - ServerLifecycleEvents.START_DATA_PACK_RELOAD.register((server, serverResourceManager) -> AuthEventHandler.reloadConfig(null)); + ServerLifecycleEvents.START_DATA_PACK_RELOAD.register((server, serverResourceManager) -> AuthCommand.reloadConfig(null)); ServerLifecycleEvents.SERVER_STOPPED.register(this::onStopServer); } diff --git a/forge/build.gradle b/forge/build.gradle index 717fb1a..ffd547f 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -17,19 +17,19 @@ loom { } dependencies { - minecraft("com.mojang:minecraft:${rootProject.architect.minecraft}") + minecraft("com.mojang:minecraft:${rootProject.minecraft_version}") mappings("net.fabricmc:yarn:${rootProject.yarn_mappings}:v2") - forge("net.minecraftforge:forge:${rootProject.architect.minecraft}-${rootProject.forge_version}") + forge("net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}") // Remove the next line if you don't want to depend on the API modCompile("me.shedaniel:architectury:${rootProject.architectury_version}:forge") compileOnly(project(path: ":common")) { transitive = false } - runtimeOnly(project(path: ":common", configuration: "transformForgeFakeMod")) { + runtimeOnly(project(path: ":common", configuration: "transformDevelopmentForge")) { transitive = false } - shadow(project(path: ":common", configuration: "transformForge")) { + shadow(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } }