build fixed :D

This commit is contained in:
samolego 2021-01-20 12:33:36 +01:00
parent 95dc259c48
commit 95a110be4d
5 changed files with 13 additions and 14 deletions

View File

@ -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
}

View File

@ -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()
}

View File

@ -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")
}

View File

@ -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);
}

View File

@ -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
}
}