From a7b60962915b6b7468c5674cf5ec372c8fd105da Mon Sep 17 00:00:00 2001 From: RawDiamondMC Date: Sat, 21 Sep 2024 16:45:20 +0800 Subject: [PATCH] more changes --- ...uBaseEntrypointNeoforge.java => KessokuBaseNeoforge.java} | 4 ++-- .../java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java | 5 +++-- .../main/java/band/kessoku/lib/command/KessokuCommand.java | 2 +- ...ssokuCommandEntrypoint.java => KessokuCommandFabric.java} | 2 +- .../band/kessoku/lib/command/impl/KessokuCommandImpl.java | 2 +- command/fabric/src/main/resources/fabric.mod.json | 5 +++++ ...okuCommandEntrypoint.java => KessokuCommandNeoforge.java} | 5 ++--- .../band/kessoku/lib/command/impl/KessokuCommandImpl.java | 2 +- ...KessokuConfigEntrypoint.java => KessokuConfigFabric.java} | 2 +- config/fabric/src/main/resources/fabric.mod.json | 5 +++++ ...ssokuConfigEntrypoint.java => KessokuConfigNeoforge.java} | 4 ++-- .../{KessokuDataEntrypoint.java => KessokuDataFabric.java} | 2 +- data/fabric/src/main/resources/fabric.mod.json | 2 +- .../{KessokuDataEntrypoint.java => KessokuDataNeoforge.java} | 5 ++--- 14 files changed, 28 insertions(+), 19 deletions(-) rename base/neo/src/main/java/band/kessoku/lib/base/{KessokuBaseEntrypointNeoforge.java => KessokuBaseNeoforge.java} (89%) rename command/fabric/src/main/java/band/kessoku/lib/command/{KessokuCommandEntrypoint.java => KessokuCommandFabric.java} (93%) rename command/neo/src/main/java/band/kessoku/lib/command/{KessokuCommandEntrypoint.java => KessokuCommandNeoforge.java} (88%) rename config/fabric/src/main/java/band/kessoku/lib/config/{KessokuConfigEntrypoint.java => KessokuConfigFabric.java} (91%) rename config/neo/src/main/java/band/kessoku/lib/config/{KessokuConfigEntrypoint.java => KessokuConfigNeoforge.java} (90%) rename data/fabric/src/main/java/band/kessoku/lib/data/{KessokuDataEntrypoint.java => KessokuDataFabric.java} (78%) rename data/neo/src/main/java/band/kessoku/lib/data/{KessokuDataEntrypoint.java => KessokuDataNeoforge.java} (63%) diff --git a/base/neo/src/main/java/band/kessoku/lib/base/KessokuBaseEntrypointNeoforge.java b/base/neo/src/main/java/band/kessoku/lib/base/KessokuBaseNeoforge.java similarity index 89% rename from base/neo/src/main/java/band/kessoku/lib/base/KessokuBaseEntrypointNeoforge.java rename to base/neo/src/main/java/band/kessoku/lib/base/KessokuBaseNeoforge.java index a3a9cb14..af72492a 100644 --- a/base/neo/src/main/java/band/kessoku/lib/base/KessokuBaseEntrypointNeoforge.java +++ b/base/neo/src/main/java/band/kessoku/lib/base/KessokuBaseNeoforge.java @@ -18,8 +18,8 @@ import net.neoforged.fml.common.Mod; @Mod(KessokuBase.MOD_ID) -public final class KessokuBaseEntrypointNeoforge { - public KessokuBaseEntrypointNeoforge() { +public final class KessokuBaseNeoforge { + public KessokuBaseNeoforge() { ModUtils.getLogger().info(KessokuBase.MARKER, "KessokuLib-Base is loaded!"); } } diff --git a/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java b/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java index c2a9f33f..111b98c9 100644 --- a/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java +++ b/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java @@ -10,7 +10,7 @@ import java.util.List; -public class KessokuGradlePlugin implements Plugin { +public final class KessokuGradlePlugin implements Plugin { private static final List NEO_GROUPS = List.of( "net.neoforged", "cpw.mods", @@ -35,7 +35,8 @@ public void apply(@NotNull PluginAware target) { case Gradle gradle -> { return; } - default -> throw new IllegalArgumentException("Expected target to be a Project or Settings, but was a " + target.getClass()); + default -> + throw new IllegalArgumentException("Expected target to be a Project or Settings, but was a " + target.getClass()); } } diff --git a/command/common/src/main/java/band/kessoku/lib/command/KessokuCommand.java b/command/common/src/main/java/band/kessoku/lib/command/KessokuCommand.java index 736475e2..51ed6b96 100644 --- a/command/common/src/main/java/band/kessoku/lib/command/KessokuCommand.java +++ b/command/common/src/main/java/band/kessoku/lib/command/KessokuCommand.java @@ -18,7 +18,7 @@ import org.slf4j.Marker; import org.slf4j.MarkerFactory; -public class KessokuCommand { +public final class KessokuCommand { public static final String MOD_ID = "kessoku_command"; public static final Marker MARKER = MarkerFactory.getMarker("[KessokuCommand]"); } diff --git a/command/fabric/src/main/java/band/kessoku/lib/command/KessokuCommandEntrypoint.java b/command/fabric/src/main/java/band/kessoku/lib/command/KessokuCommandFabric.java similarity index 93% rename from command/fabric/src/main/java/band/kessoku/lib/command/KessokuCommandEntrypoint.java rename to command/fabric/src/main/java/band/kessoku/lib/command/KessokuCommandFabric.java index e37cd1f3..92ed96a2 100644 --- a/command/fabric/src/main/java/band/kessoku/lib/command/KessokuCommandEntrypoint.java +++ b/command/fabric/src/main/java/band/kessoku/lib/command/KessokuCommandFabric.java @@ -19,7 +19,7 @@ import band.kessoku.lib.command.impl.KessokuCommandImpl; import net.fabricmc.api.ModInitializer; -public class KessokuCommandEntrypoint implements ModInitializer { +public final class KessokuCommandFabric implements ModInitializer { @Override public void onInitialize() { ModUtils.getLogger().info(KessokuCommand.MARKER, "KessokuLib-Command is Loaded!"); diff --git a/command/fabric/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.java b/command/fabric/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.java index 565b0902..7619741c 100644 --- a/command/fabric/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.java +++ b/command/fabric/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.java @@ -18,7 +18,7 @@ import band.kessoku.lib.command.api.events.CommandRegistryEvent; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; -public class KessokuCommandImpl { +public final class KessokuCommandImpl { public static void registerCommonEvents() { CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> { CommandRegistryEvent.EVENT.invoker().register(dispatcher, registryAccess, environment); diff --git a/command/fabric/src/main/resources/fabric.mod.json b/command/fabric/src/main/resources/fabric.mod.json index 04fadd51..815057c5 100644 --- a/command/fabric/src/main/resources/fabric.mod.json +++ b/command/fabric/src/main/resources/fabric.mod.json @@ -14,6 +14,11 @@ }, "license": "LGPL-3.0-only", "icon": "icon.png", + "entrypoints": { + "main": [ + "band.kessoku.lib.command.KessokuCommandFabric" + ] + }, "environment": "*", "depends": { "fabricloader": ">=0.16.0", diff --git a/command/neo/src/main/java/band/kessoku/lib/command/KessokuCommandEntrypoint.java b/command/neo/src/main/java/band/kessoku/lib/command/KessokuCommandNeoforge.java similarity index 88% rename from command/neo/src/main/java/band/kessoku/lib/command/KessokuCommandEntrypoint.java rename to command/neo/src/main/java/band/kessoku/lib/command/KessokuCommandNeoforge.java index 581e8ad9..35f9ee23 100644 --- a/command/neo/src/main/java/band/kessoku/lib/command/KessokuCommandEntrypoint.java +++ b/command/neo/src/main/java/band/kessoku/lib/command/KessokuCommandNeoforge.java @@ -17,13 +17,12 @@ import band.kessoku.lib.base.ModUtils; import band.kessoku.lib.command.impl.KessokuCommandImpl; -import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; @Mod(KessokuCommand.MOD_ID) -public class KessokuCommandEntrypoint { - public KessokuCommandEntrypoint(IEventBus modEventBus) { +public final class KessokuCommandNeoforge { + public KessokuCommandNeoforge() { var forgeEventBus = NeoForge.EVENT_BUS; ModUtils.getLogger().info(KessokuCommand.MARKER, "KessokuLib-Command is Loaded!"); KessokuCommandImpl.registerCommonEvents(forgeEventBus); diff --git a/command/neo/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.java b/command/neo/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.java index 66c0dae9..534155d2 100644 --- a/command/neo/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.java +++ b/command/neo/src/main/java/band/kessoku/lib/command/impl/KessokuCommandImpl.java @@ -20,7 +20,7 @@ import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.event.RegisterCommandsEvent; -public class KessokuCommandImpl { +public final class KessokuCommandImpl { public static void registerCommonEvents(IEventBus forgeEventBus) { NeoEventUtils.registerEvent(forgeEventBus, RegisterCommandsEvent.class, event -> { CommandRegistryEvent.EVENT.invoker().register(event.getDispatcher(), event.getBuildContext(), event.getCommandSelection()); diff --git a/config/fabric/src/main/java/band/kessoku/lib/config/KessokuConfigEntrypoint.java b/config/fabric/src/main/java/band/kessoku/lib/config/KessokuConfigFabric.java similarity index 91% rename from config/fabric/src/main/java/band/kessoku/lib/config/KessokuConfigEntrypoint.java rename to config/fabric/src/main/java/band/kessoku/lib/config/KessokuConfigFabric.java index 9ca29101..d8bb5de3 100644 --- a/config/fabric/src/main/java/band/kessoku/lib/config/KessokuConfigEntrypoint.java +++ b/config/fabric/src/main/java/band/kessoku/lib/config/KessokuConfigFabric.java @@ -17,7 +17,7 @@ import net.fabricmc.api.ModInitializer; -public class KessokuConfigEntrypoint implements ModInitializer { +public final class KessokuConfigFabric implements ModInitializer { @Override public void onInitialize() { } diff --git a/config/fabric/src/main/resources/fabric.mod.json b/config/fabric/src/main/resources/fabric.mod.json index ff234944..8785bc8f 100644 --- a/config/fabric/src/main/resources/fabric.mod.json +++ b/config/fabric/src/main/resources/fabric.mod.json @@ -14,6 +14,11 @@ }, "license": "LGPL-3.0-only", "icon": "icon.png", + "entrypoints": { + "main": [ + "band.kessoku.lib.config.KessokuConfigFabric" + ] + }, "environment": "*", "depends": { "fabricloader": ">=0.16.0", diff --git a/config/neo/src/main/java/band/kessoku/lib/config/KessokuConfigEntrypoint.java b/config/neo/src/main/java/band/kessoku/lib/config/KessokuConfigNeoforge.java similarity index 90% rename from config/neo/src/main/java/band/kessoku/lib/config/KessokuConfigEntrypoint.java rename to config/neo/src/main/java/band/kessoku/lib/config/KessokuConfigNeoforge.java index a90fee90..6051eba6 100644 --- a/config/neo/src/main/java/band/kessoku/lib/config/KessokuConfigEntrypoint.java +++ b/config/neo/src/main/java/band/kessoku/lib/config/KessokuConfigNeoforge.java @@ -18,7 +18,7 @@ import net.neoforged.fml.common.Mod; @Mod(KessokuConfig.MOD_ID) -public class KessokuConfigEntrypoint { - public KessokuConfigEntrypoint() { +public final class KessokuConfigNeoforge { + public KessokuConfigNeoforge() { } } diff --git a/data/fabric/src/main/java/band/kessoku/lib/data/KessokuDataEntrypoint.java b/data/fabric/src/main/java/band/kessoku/lib/data/KessokuDataFabric.java similarity index 78% rename from data/fabric/src/main/java/band/kessoku/lib/data/KessokuDataEntrypoint.java rename to data/fabric/src/main/java/band/kessoku/lib/data/KessokuDataFabric.java index 65b5e3bf..252838ce 100644 --- a/data/fabric/src/main/java/band/kessoku/lib/data/KessokuDataEntrypoint.java +++ b/data/fabric/src/main/java/band/kessoku/lib/data/KessokuDataFabric.java @@ -3,7 +3,7 @@ import band.kessoku.lib.base.ModUtils; import net.fabricmc.api.ModInitializer; -public final class KessokuDataEntrypoint implements ModInitializer { +public final class KessokuDataFabric implements ModInitializer { @Override public void onInitialize() { ModUtils.getLogger().info(KessokuData.MARKER, "KessokuLib-BlockEntity is Loaded!"); diff --git a/data/fabric/src/main/resources/fabric.mod.json b/data/fabric/src/main/resources/fabric.mod.json index bd0db670..bd40f96a 100644 --- a/data/fabric/src/main/resources/fabric.mod.json +++ b/data/fabric/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "icon": "icon.png", "entrypoints": { "main": [ - "band.kessoku.lib.data.KessokuDataEntrypoint" + "band.kessoku.lib.data.KessokuDataFabric" ] }, "environment": "*", diff --git a/data/neo/src/main/java/band/kessoku/lib/data/KessokuDataEntrypoint.java b/data/neo/src/main/java/band/kessoku/lib/data/KessokuDataNeoforge.java similarity index 63% rename from data/neo/src/main/java/band/kessoku/lib/data/KessokuDataEntrypoint.java rename to data/neo/src/main/java/band/kessoku/lib/data/KessokuDataNeoforge.java index d6558b67..ff8ab42a 100644 --- a/data/neo/src/main/java/band/kessoku/lib/data/KessokuDataEntrypoint.java +++ b/data/neo/src/main/java/band/kessoku/lib/data/KessokuDataNeoforge.java @@ -1,12 +1,11 @@ package band.kessoku.lib.data; import band.kessoku.lib.base.ModUtils; -import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; @Mod(KessokuData.MOD_ID) -public class KessokuDataEntrypoint { - public KessokuDataEntrypoint(IEventBus modEventBus) { +public final class KessokuDataNeoforge { + public KessokuDataNeoforge() { ModUtils.getLogger().info(KessokuData.MARKER, "KessokuLib-BlockEntity is Loaded!"); } }