diff --git a/base/common/src/main/java/band/kessoku/lib/api/KessokuLib.java b/base/common/src/main/java/band/kessoku/lib/api/KessokuLib.java index 71e472a0..7eeabc58 100644 --- a/base/common/src/main/java/band/kessoku/lib/api/KessokuLib.java +++ b/base/common/src/main/java/band/kessoku/lib/api/KessokuLib.java @@ -16,16 +16,12 @@ package band.kessoku.lib.api; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; -import band.kessoku.lib.impl.base.KessokuUtils; import org.jetbrains.annotations.UnmodifiableView; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public final class KessokuLib { private static final List> initializedModules = new ArrayList<>(); @@ -33,7 +29,7 @@ public final class KessokuLib { private KessokuLib() { } - public static void loadModule(Class moduleCommonClass, Object... args) { + public static void loadModule(Class moduleCommonClass) { // Try to get module name String moduleName; try { @@ -43,46 +39,14 @@ public static void loadModule(Class moduleCommonClass, Object... args) { field.setAccessible(true); moduleName = (String) field.get(null); } catch (NoSuchFieldException e) { - KessokuUtils.getLogger().warn("no NAME found for {}! Using package name", moduleCommonClass.getPackageName()); + getLogger().warn("no NAME found for {}! Using package name", moduleCommonClass.getPackageName()); moduleName = moduleCommonClass.getPackageName(); } catch (IllegalAccessException e) { // Already set accessible, shouldn't be called moduleName = moduleCommonClass.getPackageName(); } - - // Modules shouldn't be able to load for multiple times - if (isModuleLoaded(moduleCommonClass)) { - throw new UnsupportedOperationException(moduleName + " is already loaded!"); - } - - // Get init method - Class[] argClasses = (Class[]) Arrays.stream(args).map(Object::getClass).toArray(); - Method method; - try { - method = moduleCommonClass.getMethod("init", argClasses); - } catch (NoSuchMethodException e) { - // The module doesn't need to be initialized - initializedModules.add(moduleCommonClass); - KessokuUtils.getLogger().info("{} loaded!", moduleName); - return; - } - - // init method should be static - if (!Modifier.isStatic(method.getModifiers())) { - KessokuUtils.getLogger().error("init method of {} is not static!", moduleName); - return; - } - - method.setAccessible(true); - - // initialize module - try { - method.invoke(null, args); - } catch (IllegalAccessException | InvocationTargetException e) { - throw new RuntimeException("Failed to initialize Kessoku Module " + moduleName + " !"); - } initializedModules.add(moduleCommonClass); - KessokuUtils.getLogger().info("{} loaded!", moduleName); + getLogger().info("{} loaded!", moduleName); } public static boolean isModuleLoaded(Class moduleCommonClass) { @@ -93,4 +57,12 @@ public static boolean isModuleLoaded(Class moduleCommonClass) { public static List> getActiveModules() { return Collections.unmodifiableList(initializedModules); } + + public static T loadService(final Class clazz) { + return ServiceLoader.load(clazz).findFirst().orElseThrow(() -> new AssertionError("No impl found for " + clazz.getPackageName())); + } + + public static Logger getLogger() { + return LoggerFactory.getLogger("[Kessoku Lib]"); + } } diff --git a/base/common/src/main/java/band/kessoku/lib/impl/base/KessokuUtils.java b/base/common/src/main/java/band/kessoku/lib/api/base/KessokuUtils.java similarity index 80% rename from base/common/src/main/java/band/kessoku/lib/impl/base/KessokuUtils.java rename to base/common/src/main/java/band/kessoku/lib/api/base/KessokuUtils.java index 2ddbbd29..d05cbb5e 100644 --- a/base/common/src/main/java/band/kessoku/lib/impl/base/KessokuUtils.java +++ b/base/common/src/main/java/band/kessoku/lib/api/base/KessokuUtils.java @@ -13,27 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.impl.base; +package band.kessoku.lib.api.base; import java.lang.reflect.Constructor; import java.util.*; import org.jetbrains.annotations.NotNull; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; public final class KessokuUtils { private KessokuUtils() { } - public static T loadService(final Class clazz) { - return ServiceLoader.load(clazz).findFirst().orElseThrow(() -> new AssertionError("No impl found for " + clazz.getPackageName())); - } - - public static Logger getLogger() { - return LoggerFactory.getLogger("[Kessoku Lib]"); - } - public static boolean isType(final List list, final Class type) { for (final Object element : list) { if (!(type.isInstance(element))) { diff --git a/event-base/neo/src/main/java/band/kessoku/lib/event/api/util/neo/NeoEventUtils.java b/base/neo/src/main/java/band/kessoku/lib/api/base/neoforge/NeoEventUtils.java similarity index 95% rename from event-base/neo/src/main/java/band/kessoku/lib/event/api/util/neo/NeoEventUtils.java rename to base/neo/src/main/java/band/kessoku/lib/api/base/neoforge/NeoEventUtils.java index d62961f9..067012a0 100644 --- a/event-base/neo/src/main/java/band/kessoku/lib/event/api/util/neo/NeoEventUtils.java +++ b/base/neo/src/main/java/band/kessoku/lib/api/base/neoforge/NeoEventUtils.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.event.api.util.neo; +package band.kessoku.lib.api.base.neoforge; import java.util.function.Consumer; diff --git a/command/common/src/main/java/band/kessoku/lib/api/events/command/CommandRegistryEvent.java b/command/common/src/main/java/band/kessoku/lib/api/event/command/CommandRegistryEvent.java similarity index 97% rename from command/common/src/main/java/band/kessoku/lib/api/events/command/CommandRegistryEvent.java rename to command/common/src/main/java/band/kessoku/lib/api/event/command/CommandRegistryEvent.java index a3f941b8..ca36d488 100644 --- a/command/common/src/main/java/band/kessoku/lib/api/events/command/CommandRegistryEvent.java +++ b/command/common/src/main/java/band/kessoku/lib/api/event/command/CommandRegistryEvent.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.command; +package band.kessoku.lib.api.event.command; import band.kessoku.lib.event.api.Event; import com.mojang.brigadier.CommandDispatcher; diff --git a/command/common/src/test/java/kessoku/testmod/command/KessokuTestCommand.java b/command/common/src/test/java/kessoku/testmod/command/KessokuTestCommand.java index 0a0b3e74..62189cce 100644 --- a/command/common/src/test/java/kessoku/testmod/command/KessokuTestCommand.java +++ b/command/common/src/test/java/kessoku/testmod/command/KessokuTestCommand.java @@ -16,7 +16,7 @@ package kessoku.testmod.command; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; -import band.kessoku.lib.api.events.command.CommandRegistryEvent; +import band.kessoku.lib.api.event.command.CommandRegistryEvent; import net.minecraft.server.command.CommandManager; import net.minecraft.text.Text; diff --git a/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandImpl.java b/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandImpl.java index 076d2509..e4509235 100644 --- a/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandImpl.java +++ b/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandImpl.java @@ -15,7 +15,7 @@ */ package band.kessoku.lib.impl.command.fabric; -import band.kessoku.lib.api.events.command.CommandRegistryEvent; +import band.kessoku.lib.api.event.command.CommandRegistryEvent; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; diff --git a/command/neo/build.gradle b/command/neo/build.gradle index 7e33f334..2df96647 100644 --- a/command/neo/build.gradle +++ b/command/neo/build.gradle @@ -6,7 +6,7 @@ base.archivesName = rootProject.name + "-command" kessoku { modules(["base", "event-base"], "common") - module("event-base", "neo") + module("base", "neo") common("command", ModPlatform.NEOFORGE) shadowBundle("command", ModPlatform.NEOFORGE) diff --git a/command/neo/src/main/java/band/kessoku/lib/impl/command/neoforge/KessokuCommandImpl.java b/command/neo/src/main/java/band/kessoku/lib/impl/command/neoforge/KessokuCommandImpl.java index 745a5525..a6373e58 100644 --- a/command/neo/src/main/java/band/kessoku/lib/impl/command/neoforge/KessokuCommandImpl.java +++ b/command/neo/src/main/java/band/kessoku/lib/impl/command/neoforge/KessokuCommandImpl.java @@ -15,8 +15,8 @@ */ package band.kessoku.lib.impl.command.neoforge; -import band.kessoku.lib.api.events.command.CommandRegistryEvent; -import band.kessoku.lib.event.api.util.neo.NeoEventUtils; +import band.kessoku.lib.api.base.neoforge.NeoEventUtils; +import band.kessoku.lib.api.event.command.CommandRegistryEvent; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.event.RegisterCommandsEvent; diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/AbstractConfig.java b/config/common/src/main/java/band/kessoku/lib/api/config/AbstractConfig.java index d88d2722..dee3d9be 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/AbstractConfig.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/AbstractConfig.java @@ -26,10 +26,10 @@ import java.util.function.BiConsumer; import java.util.function.Consumer; +import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.config.annotations.Comment; import band.kessoku.lib.api.config.annotations.Comments; import band.kessoku.lib.api.config.annotations.Name; -import band.kessoku.lib.impl.base.KessokuUtils; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import org.apache.commons.io.FileUtils; @@ -92,13 +92,13 @@ public boolean load() { ConfigValue.Type type = ConfigValue.Type.asType(cValue); // Check if the type is valid to deserialize if (type == ConfigValue.Type.NULL) { - KessokuUtils.getLogger().error(KessokuConfig.MARKER, "Illegal type`{}` found in the file!", cValue.getClass().getName()); + KessokuLib.getLogger().error(KessokuConfig.MARKER, "Illegal type`{}` found in the file!", cValue.getClass().getName()); continue; } // Check if the type matches the value's type if (value.getType() != type) { - KessokuUtils.getLogger().error(KessokuConfig.MARKER, "Illegal type`{}` found in the file! Expect {}.", type.toString().toLowerCase(), value.getType().toString().toLowerCase()); + KessokuLib.getLogger().error(KessokuConfig.MARKER, "Illegal type`{}` found in the file! Expect {}.", type.toString().toLowerCase(), value.getType().toString().toLowerCase()); continue; } @@ -215,7 +215,7 @@ private Map serialize() { AbstractConfig category = (AbstractConfig) fieldValue; if (this.split) { if (!category.save()) { - KessokuUtils.getLogger().error(KessokuConfig.MARKER, "Failed to save category `{}!`", category.getSimpleName()); + KessokuLib.getLogger().error(KessokuConfig.MARKER, "Failed to save category `{}!`", category.getSimpleName()); } continue; } diff --git a/data/common/src/main/java/band/kessoku/lib/api/data/AbstractDataStructure.java b/data/common/src/main/java/band/kessoku/lib/api/data/AbstractDataStructure.java deleted file mode 100644 index 21ae82bb..00000000 --- a/data/common/src/main/java/band/kessoku/lib/api/data/AbstractDataStructure.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2024 KessokuTeaTime - * - * Licensed under the GNU Lesser General Pubic License, Version 3 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.gnu.org/licenses/lgpl-3.0.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package band.kessoku.lib.api.data; - -import java.util.ArrayList; -import java.util.List; - -public abstract class AbstractDataStructure implements DataStructure { - protected final List> dataList = new ArrayList<>(); - protected final List dataStructureList = new ArrayList<>(); - - @Override - public > K integrate(K data) { - dataList.add(data); - return data; - } - - @Override - public K integrate(K dataStructure) { - dataStructureList.add(dataStructure); - return dataStructure; - } -} diff --git a/data/common/src/main/java/band/kessoku/lib/api/data/BlockEntityStructure.java b/data/common/src/main/java/band/kessoku/lib/api/data/BlockEntityStructure.java deleted file mode 100644 index b819d7d1..00000000 --- a/data/common/src/main/java/band/kessoku/lib/api/data/BlockEntityStructure.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2024 KessokuTeaTime - * - * Licensed under the GNU Lesser General Pubic License, Version 3 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.gnu.org/licenses/lgpl-3.0.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package band.kessoku.lib.api.data; - -import band.kessoku.lib.mixins.data.BlockEntityMixin; - -/** - * Use this to realize interface injection for {@link net.minecraft.block.entity.BlockEntity BlockEntity}. - * @see BlockEntityMixin - */ -public interface BlockEntityStructure extends DataStructure { - /** - * Use to integrate a {@link DataStructure DataStructure} to {@link BlockEntityStructure}. - * @see BlockEntityMixin#integrate(DataStructure) - */ - @Override - default K integrate(K dataStructure) { - return dataStructure; - } - - /** - * Use to integrate a {@link Data Data} to {@link BlockEntityStructure}. - * @see BlockEntityMixin#integrate(Data) - */ - @Override - default > K integrate(K data) { - return data; - } -} diff --git a/data/common/src/main/java/band/kessoku/lib/api/data/DataStructure.java b/data/common/src/main/java/band/kessoku/lib/api/data/DataStructure.java index c1c13751..24922dad 100644 --- a/data/common/src/main/java/band/kessoku/lib/api/data/DataStructure.java +++ b/data/common/src/main/java/band/kessoku/lib/api/data/DataStructure.java @@ -21,7 +21,6 @@ * When building structure, data must be member variable and {@link DataStructure#integrate(Data) "integrate()"} * can be used to hold data for other usages. *

- * @see AbstractNBTStructure There also is an abstract structure for using. */ public interface DataStructure { > K integrate(K data); diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/KessokuData.java b/data/common/src/main/java/band/kessoku/lib/api/data/KessokuData.java similarity index 96% rename from data/common/src/main/java/band/kessoku/lib/impl/data/KessokuData.java rename to data/common/src/main/java/band/kessoku/lib/api/data/KessokuData.java index 385c7b84..23357e84 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/KessokuData.java +++ b/data/common/src/main/java/band/kessoku/lib/api/data/KessokuData.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.impl.data; +package band.kessoku.lib.api.data; import org.slf4j.Marker; import org.slf4j.MarkerFactory; diff --git a/data/common/src/main/java/band/kessoku/lib/data/api/DataStructure.java b/data/common/src/main/java/band/kessoku/lib/data/api/DataStructure.java deleted file mode 100644 index 0778f2ba..00000000 --- a/data/common/src/main/java/band/kessoku/lib/data/api/DataStructure.java +++ /dev/null @@ -1,13 +0,0 @@ -package band.kessoku.lib.data.api; - -/** - * This is an interface used to abstract a structure holding some data and implement processing logic. - *

- * When building structure, data must be member variable and {@link DataStructure#integrate(Data) "integrate()"} - * can be used to hold data for other usages. - *

- */ -public interface DataStructure { - > K integrate(K data); - K integrate(K dataStructure); -} diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/collection/Element.java b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/Element.java deleted file mode 100644 index db84c682..00000000 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/collection/Element.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2024 KessokuTeaTime - * - * Licensed under the GNU Lesser General Pubic License, Version 3 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.gnu.org/licenses/lgpl-3.0.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package band.kessoku.lib.impl.data.collection; - -import band.kessoku.lib.api.data.MutableData; -import org.jetbrains.annotations.NotNull; - -public class Element implements MutableData { - public final String id; - public final int index; - protected final ListData listData; - - public Element(String id, int index, ListData listData) { - this.id = id; - this.index = index; - this.listData = listData; - } - - @Override - public void set(T newValue) { - listData.set(index, newValue); - } - - @Override - public T get() { - return listData.get(index); - } - - @Override - public @NotNull String id() { - return id; - } -} diff --git a/data/common/src/main/resources/kessoku_data.mixins.json b/data/common/src/main/resources/kessoku_data.mixins.json index dcafd85f..77d01231 100644 --- a/data/common/src/main/resources/kessoku_data.mixins.json +++ b/data/common/src/main/resources/kessoku_data.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "band.kessoku.lib.mixins.data", + "package": "band.kessoku.lib.mixin.data", "compatibilityLevel": "JAVA_21", "injectors": { "defaultRequire": 1 diff --git a/data/fabric/src/main/java/band/kessoku/lib/impl/data/fabric/KessokuDataFabric.java b/data/fabric/src/main/java/band/kessoku/lib/impl/data/fabric/KessokuDataFabric.java index ffa72bfb..443bd49a 100644 --- a/data/fabric/src/main/java/band/kessoku/lib/impl/data/fabric/KessokuDataFabric.java +++ b/data/fabric/src/main/java/band/kessoku/lib/impl/data/fabric/KessokuDataFabric.java @@ -16,7 +16,7 @@ package band.kessoku.lib.impl.data.fabric; import band.kessoku.lib.api.KessokuLib; -import band.kessoku.lib.impl.data.KessokuData; +import band.kessoku.lib.api.data.KessokuData; import net.fabricmc.api.ModInitializer; diff --git a/data/neo/src/main/java/band/kessoku/lib/impl/data/neoforge/KessokuDataNeoforge.java b/data/neo/src/main/java/band/kessoku/lib/impl/data/neoforge/KessokuDataNeoforge.java index 9b83e985..c37265be 100644 --- a/data/neo/src/main/java/band/kessoku/lib/impl/data/neoforge/KessokuDataNeoforge.java +++ b/data/neo/src/main/java/band/kessoku/lib/impl/data/neoforge/KessokuDataNeoforge.java @@ -16,7 +16,7 @@ package band.kessoku.lib.impl.data.neoforge; import band.kessoku.lib.api.KessokuLib; -import band.kessoku.lib.impl.data.KessokuData; +import band.kessoku.lib.api.data.KessokuData; import net.neoforged.fml.common.Mod; diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/EntityElytraEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntityElytraEvent.java similarity index 97% rename from entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/EntityElytraEvent.java rename to entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntityElytraEvent.java index b6ce4fed..86473085 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/EntityElytraEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntityElytraEvent.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.entity; +package band.kessoku.lib.api.event.entity; -import band.kessoku.lib.api.events.entity.item.KessokuElytraItem; +import band.kessoku.lib.api.event.entity.item.KessokuElytraItem; import band.kessoku.lib.event.api.Event; import org.jetbrains.annotations.ApiStatus; diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/EntitySleepEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntitySleepEvent.java similarity index 99% rename from entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/EntitySleepEvent.java rename to entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntitySleepEvent.java index a7b8e042..b6456327 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/EntitySleepEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntitySleepEvent.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.entity; +package band.kessoku.lib.api.event.entity; import band.kessoku.lib.event.api.Event; import org.jetbrains.annotations.ApiStatus; diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/KessokuEntityEvents.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/KessokuEntityEvents.java similarity index 86% rename from entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/KessokuEntityEvents.java rename to entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/KessokuEntityEvents.java index 06e01191..1c80bc4d 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/KessokuEntityEvents.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/KessokuEntityEvents.java @@ -13,10 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.entity; +package band.kessoku.lib.api.event.entity; -import band.kessoku.lib.api.events.entity.item.KessokuElytraItem; -import org.jetbrains.annotations.ApiStatus; +import band.kessoku.lib.api.event.entity.item.KessokuElytraItem; import org.slf4j.Marker; import org.slf4j.MarkerFactory; @@ -28,8 +27,7 @@ public final class KessokuEntityEvents { public static final String NAME = "Kessoku Entity Events API"; public static final Marker MARKER = MarkerFactory.getMarker("[" + NAME + "]"); - @ApiStatus.Internal - public static void init() { + static { EntityElytraEvent.CUSTOM.register((entity, tickElytra) -> { ItemStack chestStack = entity.getEquippedStack(EquipmentSlot.CHEST); diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerEntityCombatEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityCombatEvent.java similarity index 97% rename from entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerEntityCombatEvent.java rename to entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityCombatEvent.java index 7fa6de49..7dbd04a1 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerEntityCombatEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityCombatEvent.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.entity; +package band.kessoku.lib.api.event.entity; import band.kessoku.lib.event.api.Event; import org.jetbrains.annotations.ApiStatus; diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerEntityWorldChangeEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityWorldChangeEvent.java similarity index 98% rename from entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerEntityWorldChangeEvent.java rename to entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityWorldChangeEvent.java index f6b51c1f..a4bcba97 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerEntityWorldChangeEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityWorldChangeEvent.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.entity; +package band.kessoku.lib.api.event.entity; import band.kessoku.lib.event.api.Event; import org.jetbrains.annotations.ApiStatus; diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerLivingEntityEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerLivingEntityEvent.java similarity index 99% rename from entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerLivingEntityEvent.java rename to entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerLivingEntityEvent.java index 961c8c69..c7696ab2 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerLivingEntityEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerLivingEntityEvent.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.entity; +package band.kessoku.lib.api.event.entity; import band.kessoku.lib.event.api.Event; import org.jetbrains.annotations.ApiStatus; diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerPlayerEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerPlayerEvent.java similarity index 98% rename from entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerPlayerEvent.java rename to entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerPlayerEvent.java index 6747214a..002db24e 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/ServerPlayerEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerPlayerEvent.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.entity; +package band.kessoku.lib.api.event.entity; import band.kessoku.lib.event.api.Event; import org.jetbrains.annotations.ApiStatus; diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/item/KessokuElytraItem.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/item/KessokuElytraItem.java similarity index 98% rename from entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/item/KessokuElytraItem.java rename to entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/item/KessokuElytraItem.java index 7f56bebb..2f1af087 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/events/entity/item/KessokuElytraItem.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/item/KessokuElytraItem.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.api.events.entity.item; +package band.kessoku.lib.api.event.entity.item; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; diff --git a/entity-events/fabric/src/main/java/band/kessoku/lib/impl/events/entity/fabric/KessokuEntityEventsFabric.java b/entity-events/fabric/src/main/java/band/kessoku/lib/impl/events/entity/fabric/KessokuEntityEventsFabric.java index e8d0b52b..d7913413 100644 --- a/entity-events/fabric/src/main/java/band/kessoku/lib/impl/events/entity/fabric/KessokuEntityEventsFabric.java +++ b/entity-events/fabric/src/main/java/band/kessoku/lib/impl/events/entity/fabric/KessokuEntityEventsFabric.java @@ -16,9 +16,9 @@ package band.kessoku.lib.impl.events.entity.fabric; import band.kessoku.lib.api.KessokuLib; -import band.kessoku.lib.api.events.entity.EntityElytraEvent; -import band.kessoku.lib.api.events.entity.EntitySleepEvent; -import band.kessoku.lib.api.events.entity.KessokuEntityEvents; +import band.kessoku.lib.api.event.entity.EntityElytraEvent; +import band.kessoku.lib.api.event.entity.EntitySleepEvent; +import band.kessoku.lib.api.event.entity.KessokuEntityEvents; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.entity.event.v1.EntityElytraEvents; diff --git a/entity-events/neo/build.gradle b/entity-events/neo/build.gradle index 212d472a..60191b46 100644 --- a/entity-events/neo/build.gradle +++ b/entity-events/neo/build.gradle @@ -10,7 +10,7 @@ loom { kessoku { modules(["base", "event-base"], "common") - module("event-base", "neo") + module("base", "neo") common("entity-events", ModPlatform.NEOFORGE) shadowBundle("entity-events", ModPlatform.NEOFORGE) diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/impl/events/entity/KessokuEntityEventsNeoforge.java b/entity-events/neo/src/main/java/band/kessoku/lib/impl/event/entity/KessokuEntityEventsNeoforge.java similarity index 90% rename from entity-events/neo/src/main/java/band/kessoku/lib/impl/events/entity/KessokuEntityEventsNeoforge.java rename to entity-events/neo/src/main/java/band/kessoku/lib/impl/event/entity/KessokuEntityEventsNeoforge.java index 83883604..d2edcb68 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/impl/events/entity/KessokuEntityEventsNeoforge.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/impl/event/entity/KessokuEntityEventsNeoforge.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.impl.events.entity; +package band.kessoku.lib.impl.event.entity; import band.kessoku.lib.api.KessokuLib; -import band.kessoku.lib.api.events.entity.EntitySleepEvent; -import band.kessoku.lib.api.events.entity.KessokuEntityEvents; -import band.kessoku.lib.api.events.entity.ServerLivingEntityEvent; -import band.kessoku.lib.api.events.entity.ServerPlayerEvent; -import band.kessoku.lib.event.api.util.neo.NeoEventUtils; +import band.kessoku.lib.api.base.neoforge.NeoEventUtils; +import band.kessoku.lib.api.event.entity.EntitySleepEvent; +import band.kessoku.lib.api.event.entity.KessokuEntityEvents; +import band.kessoku.lib.api.event.entity.ServerLivingEntityEvent; +import band.kessoku.lib.api.event.entity.ServerPlayerEvent; import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.player.PlayerEntity; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/EntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/EntityMixin.java similarity index 95% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/EntityMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/EntityMixin.java index 167c114b..d95c13c3 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/EntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/EntityMixin.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity; +package band.kessoku.lib.mixin.event.entity; import java.util.Set; -import band.kessoku.lib.api.events.entity.ServerEntityWorldChangeEvent; +import band.kessoku.lib.api.event.entity.ServerEntityWorldChangeEvent; import com.llamalad7.mixinextras.sugar.Local; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/IItemExtensionMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/IItemExtensionMixin.java similarity index 92% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/IItemExtensionMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/IItemExtensionMixin.java index e597e2d8..93dca60b 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/IItemExtensionMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/IItemExtensionMixin.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity; +package band.kessoku.lib.mixin.event.entity; -import band.kessoku.lib.api.events.entity.item.KessokuElytraItem; +import band.kessoku.lib.api.event.entity.item.KessokuElytraItem; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/LivingEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/LivingEntityMixin.java similarity index 97% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/LivingEntityMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/LivingEntityMixin.java index 7342d7b5..2d5e1495 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/LivingEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/LivingEntityMixin.java @@ -13,13 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity; +package band.kessoku.lib.mixin.event.entity; import java.util.Optional; -import band.kessoku.lib.api.events.entity.EntitySleepEvent; -import band.kessoku.lib.api.events.entity.ServerEntityCombatEvent; -import band.kessoku.lib.api.events.entity.ServerLivingEntityEvent; +import band.kessoku.lib.api.event.entity.EntitySleepEvent; +import band.kessoku.lib.api.event.entity.ServerEntityCombatEvent; +import band.kessoku.lib.api.event.entity.ServerLivingEntityEvent; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import com.llamalad7.mixinextras.sugar.Local; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/MobEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/MobEntityMixin.java similarity index 92% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/MobEntityMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/MobEntityMixin.java index 89576022..66435c6a 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/MobEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/MobEntityMixin.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity; +package band.kessoku.lib.mixin.event.entity; -import band.kessoku.lib.api.events.entity.ServerLivingEntityEvent; +import band.kessoku.lib.api.event.entity.ServerLivingEntityEvent; import com.llamalad7.mixinextras.sugar.Local; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/PlayerEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerEntityMixin.java similarity index 92% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/PlayerEntityMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerEntityMixin.java index d719b5f6..c6625b49 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/PlayerEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerEntityMixin.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity; +package band.kessoku.lib.mixin.event.entity; -import band.kessoku.lib.api.events.entity.EntitySleepEvent; +import band.kessoku.lib.api.event.entity.EntitySleepEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/PlayerManagerMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerManagerMixin.java similarity index 92% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/PlayerManagerMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerManagerMixin.java index e0ce52d5..df146c29 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/PlayerManagerMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerManagerMixin.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity; +package band.kessoku.lib.mixin.event.entity; -import band.kessoku.lib.api.events.entity.ServerPlayerEvent; +import band.kessoku.lib.api.event.entity.ServerPlayerEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/ServerPlayerEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/ServerPlayerEntityMixin.java similarity index 98% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/ServerPlayerEntityMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/ServerPlayerEntityMixin.java index 26f4c887..78c2c25d 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/ServerPlayerEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/ServerPlayerEntityMixin.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity; +package band.kessoku.lib.mixin.event.entity; import java.util.List; -import band.kessoku.lib.api.events.entity.*; +import band.kessoku.lib.api.event.entity.*; import com.llamalad7.mixinextras.sugar.Local; import com.mojang.datafixers.util.Either; import org.jetbrains.annotations.Nullable; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/elytra/LivingEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/LivingEntityMixin.java similarity index 95% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/elytra/LivingEntityMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/LivingEntityMixin.java index fe2e48d3..56688e93 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/elytra/LivingEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/LivingEntityMixin.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity.elytra; +package band.kessoku.lib.mixin.event.entity.elytra; -import band.kessoku.lib.api.events.entity.EntityElytraEvent; +import band.kessoku.lib.api.event.entity.EntityElytraEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/elytra/PlayerEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/PlayerEntityMixin.java similarity index 95% rename from entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/elytra/PlayerEntityMixin.java rename to entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/PlayerEntityMixin.java index 2b923884..9b3d1ac8 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixins/events/entity/elytra/PlayerEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/PlayerEntityMixin.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.events.entity.elytra; +package band.kessoku.lib.mixin.event.entity.elytra; -import band.kessoku.lib.api.events.entity.EntityElytraEvent; +import band.kessoku.lib.api.event.entity.EntityElytraEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; diff --git a/entity-events/neo/src/main/resources/META-INF/neoforge.mods.toml b/entity-events/neo/src/main/resources/META-INF/neoforge.mods.toml index cf179790..59495499 100644 --- a/entity-events/neo/src/main/resources/META-INF/neoforge.mods.toml +++ b/entity-events/neo/src/main/resources/META-INF/neoforge.mods.toml @@ -15,7 +15,7 @@ authors = "Kessoku Tea Time" displayURL = "https://modrinth.com/mod/kessoku-lib" [[mixins]] -config = "kessoku_entity_events-neo.mixins.json" +config = "kessoku_entity_events.neoforge.mixins.json" [[dependencies.kessoku_entity_events]] modId = "neoforge" diff --git a/entity-events/neo/src/main/resources/kessoku_entity_events-neo.json b/entity-events/neo/src/main/resources/kessoku_entity_events.neoforge.mixins.json similarity index 86% rename from entity-events/neo/src/main/resources/kessoku_entity_events-neo.json rename to entity-events/neo/src/main/resources/kessoku_entity_events.neoforge.mixins.json index 0254f8d8..e0ac9813 100644 --- a/entity-events/neo/src/main/resources/kessoku_entity_events-neo.json +++ b/entity-events/neo/src/main/resources/kessoku_entity_events.neoforge.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "band.kessoku.lib.mixins.events.entity", + "package": "band.kessoku.lib.mixin.event.entity", "compatibilityLevel": "JAVA_21", "mixins": [ "EntityMixin", diff --git a/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuEntrypoint.java b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuEntrypoint.java index b0f8db4d..a1413052 100644 --- a/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuEntrypoint.java +++ b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuEntrypoint.java @@ -19,9 +19,9 @@ import java.nio.file.Path; import java.util.*; +import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.platform.ModData; import band.kessoku.lib.api.platform.ModLoader; -import band.kessoku.lib.impl.base.KessokuUtils; import band.kessoku.lib.impl.entrypoint.JavaLanguageAdapter; import band.kessoku.lib.impl.entrypoint.exceptions.LanguageAdapterException; import club.someoneice.json.JSON; @@ -42,9 +42,8 @@ private KessokuEntrypoint() { private static final Map adapters = new HashMap<>(); private static final Map> entryMap = new HashMap<>(); - @SuppressWarnings("unused") - private static void init() { - KessokuUtils.getLogger().info(MARKER, "Start loading Kessoku Entrypoint API."); + static { + KessokuLib.getLogger().info(MARKER, "Start loading Kessoku Entrypoint API."); Map modInfoMap = new HashMap<>(); for (ModData modData : ModLoader.getMods()) { final String modid = modData.getModId(); diff --git a/entrypoint/neo/src/main/java/band/kessoku/lib/impl/entrypoint/neoforge/KessokuEntrypointNeoforge.java b/entrypoint/neo/src/main/java/band/kessoku/lib/impl/entrypoint/neoforge/KessokuEntrypointNeoforge.java index 010c32ea..480fc9d1 100644 --- a/entrypoint/neo/src/main/java/band/kessoku/lib/impl/entrypoint/neoforge/KessokuEntrypointNeoforge.java +++ b/entrypoint/neo/src/main/java/band/kessoku/lib/impl/entrypoint/neoforge/KessokuEntrypointNeoforge.java @@ -15,7 +15,6 @@ */ package band.kessoku.lib.impl.entrypoint.neoforge; -import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.entrypoint.KessokuEntrypoint; import net.neoforged.fml.common.Mod; @@ -24,8 +23,4 @@ public final class KessokuEntrypointNeoforge { public KessokuEntrypointNeoforge() { } - - public static void init() { - KessokuLib.loadModule(KessokuEntrypoint.class); - } } diff --git a/entrypoint/neo/src/main/java/band/kessoku/lib/mixins/entrypoint/neoforge/FMLLoaderMixin.java b/entrypoint/neo/src/main/java/band/kessoku/lib/mixin/entrypoint/neoforge/FMLLoaderMixin.java similarity index 83% rename from entrypoint/neo/src/main/java/band/kessoku/lib/mixins/entrypoint/neoforge/FMLLoaderMixin.java rename to entrypoint/neo/src/main/java/band/kessoku/lib/mixin/entrypoint/neoforge/FMLLoaderMixin.java index 63465d27..3c63e600 100644 --- a/entrypoint/neo/src/main/java/band/kessoku/lib/mixins/entrypoint/neoforge/FMLLoaderMixin.java +++ b/entrypoint/neo/src/main/java/band/kessoku/lib/mixin/entrypoint/neoforge/FMLLoaderMixin.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.entrypoint.neoforge; +package band.kessoku.lib.mixin.entrypoint.neoforge; -import band.kessoku.lib.impl.entrypoint.neoforge.KessokuEntrypointNeoforge; +import band.kessoku.lib.api.KessokuLib; +import band.kessoku.lib.api.entrypoint.KessokuEntrypoint; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -27,6 +28,6 @@ public class FMLLoaderMixin { @Inject(method = "beforeStart", at = @At("HEAD")) private static void preLaunch(ModuleLayer gameLayer, CallbackInfo ci) { - KessokuEntrypointNeoforge.init(); + KessokuLib.loadModule(KessokuEntrypoint.class); } } diff --git a/entrypoint/neo/src/main/resources/META-INF/neoforge.mods.toml b/entrypoint/neo/src/main/resources/META-INF/neoforge.mods.toml index df6edd7e..b5d6916a 100644 --- a/entrypoint/neo/src/main/resources/META-INF/neoforge.mods.toml +++ b/entrypoint/neo/src/main/resources/META-INF/neoforge.mods.toml @@ -29,4 +29,4 @@ ordering = "NONE" side = "BOTH" [[mixins]] -config = "kessoku_entrypoint.mixins.json" \ No newline at end of file +config = "kessoku_entrypoint.neoforge.mixins.json" \ No newline at end of file diff --git a/entrypoint/neo/src/main/resources/kessoku_entrypoint.mixins.json b/entrypoint/neo/src/main/resources/kessoku_entrypoint.neoforge.mixins.json similarity index 70% rename from entrypoint/neo/src/main/resources/kessoku_entrypoint.mixins.json rename to entrypoint/neo/src/main/resources/kessoku_entrypoint.neoforge.mixins.json index b2295853..975d2dff 100644 --- a/entrypoint/neo/src/main/resources/kessoku_entrypoint.mixins.json +++ b/entrypoint/neo/src/main/resources/kessoku_entrypoint.neoforge.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "band.kessoku.lib.mixins.entrypoint.neoforge", + "package": "band.kessoku.lib.mixin.entrypoint.neoforge", "compatibilityLevel": "JAVA_21", "mixins": [ "FMLLoaderMixin" diff --git a/event-base/common/src/main/java/band/kessoku/lib/event/KessokuEventBase.java b/event-base/common/src/main/java/band/kessoku/lib/event/api/KessokuEventBase.java similarity index 87% rename from event-base/common/src/main/java/band/kessoku/lib/event/KessokuEventBase.java rename to event-base/common/src/main/java/band/kessoku/lib/event/api/KessokuEventBase.java index 01e21a74..8a1b187b 100644 --- a/event-base/common/src/main/java/band/kessoku/lib/event/KessokuEventBase.java +++ b/event-base/common/src/main/java/band/kessoku/lib/event/api/KessokuEventBase.java @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.event; +package band.kessoku.lib.event.api; import org.slf4j.Marker; import org.slf4j.MarkerFactory; public final class KessokuEventBase { public static final String MOD_ID = "kessoku_event_base"; - public static final Marker MARKER = MarkerFactory.getMarker("[KessokuEventBase]"); + public static final String NAME = "Kessoku Event Base"; + public static final Marker MARKER = MarkerFactory.getMarker("[" + NAME + "]"); } diff --git a/event-base/fabric/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.java b/event-base/fabric/src/main/java/band/kessoku/lib/impl/event/fabric/KessokuEventBaseFabric.java similarity index 73% rename from event-base/fabric/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.java rename to event-base/fabric/src/main/java/band/kessoku/lib/impl/event/fabric/KessokuEventBaseFabric.java index 8ec06c22..18881f19 100644 --- a/event-base/fabric/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.java +++ b/event-base/fabric/src/main/java/band/kessoku/lib/impl/event/fabric/KessokuEventBaseFabric.java @@ -13,15 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.event; +package band.kessoku.lib.impl.event.fabric; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.KessokuLib; +import band.kessoku.lib.event.api.KessokuEventBase; import net.fabricmc.api.ModInitializer; -public final class KessokuEventBaseEntrypoint implements ModInitializer { +public final class KessokuEventBaseFabric implements ModInitializer { @Override public void onInitialize() { - KessokuUtils.getLogger().info(KessokuEventBase.MARKER, "KessokuLib-EventBase is Loaded!"); + KessokuLib.loadModule(KessokuEventBase.class); } } diff --git a/event-base/fabric/src/main/resources/fabric.mod.json b/event-base/fabric/src/main/resources/fabric.mod.json index 6f5a1da0..200b47db 100644 --- a/event-base/fabric/src/main/resources/fabric.mod.json +++ b/event-base/fabric/src/main/resources/fabric.mod.json @@ -16,7 +16,7 @@ "icon": "icon.png", "entrypoints": { "main": [ - "band.kessoku.lib.event.KessokuEventBaseEntrypoint" + "band.kessoku.lib.impl.event.fabric.KessokuEventBaseFabric" ] }, "environment": "*", diff --git a/event-base/neo/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.java b/event-base/neo/src/main/java/band/kessoku/lib/impl/event/neoforge/KessokuEventBaseNeoforge.java similarity index 71% rename from event-base/neo/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.java rename to event-base/neo/src/main/java/band/kessoku/lib/impl/event/neoforge/KessokuEventBaseNeoforge.java index 82f54fe2..d889595f 100644 --- a/event-base/neo/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.java +++ b/event-base/neo/src/main/java/band/kessoku/lib/impl/event/neoforge/KessokuEventBaseNeoforge.java @@ -13,12 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.event; +package band.kessoku.lib.impl.event.neoforge; + +import band.kessoku.lib.api.KessokuLib; +import band.kessoku.lib.event.api.KessokuEventBase; import net.neoforged.fml.common.Mod; @Mod(KessokuEventBase.MOD_ID) -public class KessokuEventBaseEntrypoint { - public KessokuEventBaseEntrypoint() { +public class KessokuEventBaseNeoforge { + public KessokuEventBaseNeoforge() { + KessokuLib.loadModule(KessokuEventBase.class); } } diff --git a/keybinding/common/src/main/java/band/kessoku/lib/api/keybinding/client/KeyBindingRegister.java b/keybinding/common/src/main/java/band/kessoku/lib/api/keybinding/client/KeyBindingRegister.java index 18fe8ede..3681b5d9 100644 --- a/keybinding/common/src/main/java/band/kessoku/lib/api/keybinding/client/KeyBindingRegister.java +++ b/keybinding/common/src/main/java/band/kessoku/lib/api/keybinding/client/KeyBindingRegister.java @@ -18,9 +18,9 @@ import java.util.Map; import java.util.Set; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.base.KessokuUtils; import band.kessoku.lib.impl.keybinding.client.CategoryOrderMap; -import band.kessoku.lib.services.keybinding.client.KeyBindingRegisterService; +import band.kessoku.lib.service.keybinding.client.KeyBindingRegisterService; import org.jetbrains.annotations.Nullable; import net.minecraft.client.option.KeyBinding; diff --git a/keybinding/common/src/main/java/band/kessoku/lib/impl/keybinding/client/CategoryOrderMap.java b/keybinding/common/src/main/java/band/kessoku/lib/impl/keybinding/client/CategoryOrderMap.java index bc9eaf68..c5ca4646 100644 --- a/keybinding/common/src/main/java/band/kessoku/lib/impl/keybinding/client/CategoryOrderMap.java +++ b/keybinding/common/src/main/java/band/kessoku/lib/impl/keybinding/client/CategoryOrderMap.java @@ -18,7 +18,7 @@ import java.util.HashMap; import java.util.Map; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.KessokuLib; import org.jetbrains.annotations.ApiStatus; import net.minecraft.text.Text; @@ -43,7 +43,7 @@ public static CategoryOrderMap of(Map map) { @Override public Integer put(String key, Integer value) { if (this.containsValue(value) && value != Integer.MAX_VALUE && value != Integer.MIN_VALUE) - KessokuUtils.getLogger().warn(KessokuKeybinding.MARKER, "Duplicate category index found! Category: {} Index: {}", Text.translatable(key), value); + KessokuLib.getLogger().warn(KessokuKeybinding.MARKER, "Duplicate category index found! Category: {} Index: {}", Text.translatable(key), value); return super.put(key, value); } diff --git a/keybinding/common/src/main/java/band/kessoku/lib/mixins/keybinding/client/KeyBindingMixin.java b/keybinding/common/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingMixin.java similarity index 96% rename from keybinding/common/src/main/java/band/kessoku/lib/mixins/keybinding/client/KeyBindingMixin.java rename to keybinding/common/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingMixin.java index 3e923fb3..52961710 100644 --- a/keybinding/common/src/main/java/band/kessoku/lib/mixins/keybinding/client/KeyBindingMixin.java +++ b/keybinding/common/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.keybinding.client; +package band.kessoku.lib.mixin.keybinding.client; import java.util.Collections; import java.util.Map; diff --git a/keybinding/common/src/main/java/band/kessoku/lib/services/keybinding/client/KeyBindingRegisterService.java b/keybinding/common/src/main/java/band/kessoku/lib/service/keybinding/client/KeyBindingRegisterService.java similarity index 81% rename from keybinding/common/src/main/java/band/kessoku/lib/services/keybinding/client/KeyBindingRegisterService.java rename to keybinding/common/src/main/java/band/kessoku/lib/service/keybinding/client/KeyBindingRegisterService.java index 248cd1b2..9a237883 100644 --- a/keybinding/common/src/main/java/band/kessoku/lib/services/keybinding/client/KeyBindingRegisterService.java +++ b/keybinding/common/src/main/java/band/kessoku/lib/service/keybinding/client/KeyBindingRegisterService.java @@ -13,15 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.services.keybinding.client; +package band.kessoku.lib.service.keybinding.client; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.KessokuLib; import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; public interface KeyBindingRegisterService { - KeyBindingRegisterService INSTANCE = KessokuUtils.loadService(KeyBindingRegisterService.class); + KeyBindingRegisterService INSTANCE = KessokuLib.loadService(KeyBindingRegisterService.class); KeyBinding register(KeyBinding keyBinding); diff --git a/keybinding/common/src/main/resources/kessoku_keybinding.mixins.json b/keybinding/common/src/main/resources/kessoku_key_binding.mixins.json similarity index 71% rename from keybinding/common/src/main/resources/kessoku_keybinding.mixins.json rename to keybinding/common/src/main/resources/kessoku_key_binding.mixins.json index daf050e6..ac16eea2 100644 --- a/keybinding/common/src/main/resources/kessoku_keybinding.mixins.json +++ b/keybinding/common/src/main/resources/kessoku_key_binding.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "band.kessoku.lib.mixins.keybinding.client", + "package": "band.kessoku.lib.mixin.keybinding.client", "compatibilityLevel": "JAVA_21", "client": [ "KeyBindingMixin" diff --git a/keybinding/common/src/test/java/kessoku/testmod/keybinding/KessokuTestKeybinding.java b/keybinding/common/src/test/java/kessoku/testmod/keybinding/KessokuTestKeybinding.java index 6a04831c..890c47c9 100644 --- a/keybinding/common/src/test/java/kessoku/testmod/keybinding/KessokuTestKeybinding.java +++ b/keybinding/common/src/test/java/kessoku/testmod/keybinding/KessokuTestKeybinding.java @@ -16,7 +16,7 @@ package kessoku.testmod.keybinding; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; -import band.kessoku.lib.services.keybinding.client.KeyBindingRegisterService; +import band.kessoku.lib.service.keybinding.client.KeyBindingRegisterService; import net.minecraft.client.option.KeyBinding; diff --git a/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/KessokuKeybindingFabric.java b/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KessokuKeyBindingFabric.java similarity index 76% rename from keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/KessokuKeybindingFabric.java rename to keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KessokuKeyBindingFabric.java index 3e5c293c..97a329b2 100644 --- a/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/KessokuKeybindingFabric.java +++ b/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KessokuKeyBindingFabric.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.keybinding; +package band.kessoku.lib.impl.keybinding.fabric; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.impl.keybinding.client.KessokuKeybinding; import net.fabricmc.api.ClientModInitializer; -public final class KessokuKeybindingFabric implements ClientModInitializer { +public final class KessokuKeyBindingFabric implements ClientModInitializer { @Override public void onInitializeClient() { - KessokuUtils.getLogger().info(KessokuKeybinding.MARKER, "Kessoku Keybinding API is loaded!"); + KessokuLib.loadModule(KessokuKeybinding.class); } } diff --git a/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java b/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KeyBindingRegisterImpl.java similarity index 84% rename from keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java rename to keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KeyBindingRegisterImpl.java index 2f487d89..6e5565f2 100644 --- a/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java +++ b/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KeyBindingRegisterImpl.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.keybinding.impl; +package band.kessoku.lib.impl.keybinding.fabric; -import band.kessoku.lib.services.keybinding.client.KeyBindingRegisterService; +import band.kessoku.lib.service.keybinding.client.KeyBindingRegisterService; import com.google.auto.service.AutoService; import net.minecraft.client.option.KeyBinding; @@ -24,7 +24,7 @@ import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; @AutoService(KeyBindingRegisterService.class) -public final class KeyBindRegisterImpl implements KeyBindingRegisterService { +public final class KeyBindingRegisterImpl implements KeyBindingRegisterService { @Override public KeyBinding register(KeyBinding keyBinding) { return KeyBindingHelper.registerKeyBinding(keyBinding); diff --git a/keybinding/fabric/src/main/resources/fabric.mod.json b/keybinding/fabric/src/main/resources/fabric.mod.json index 03706e4d..7834baa1 100644 --- a/keybinding/fabric/src/main/resources/fabric.mod.json +++ b/keybinding/fabric/src/main/resources/fabric.mod.json @@ -16,10 +16,13 @@ "icon": "icon.png", "entrypoints": { "client": [ - "band.kessoku.lib.keybind.KessokuKeybindingFabric" + "band.kessoku.lib.impl.keybinding.fabric.KessokuKeyBindingFabric" ] }, - "environment": "*", + "environment": "client", + "mixins": [ + "kessoku_key_binding.mixins.json" + ], "depends": { "fabricloader": ">=0.16.0", "minecraft": "1.21", diff --git a/keybinding/neo/build.gradle b/keybinding/neo/build.gradle index a03831b7..23e36f3e 100644 --- a/keybinding/neo/build.gradle +++ b/keybinding/neo/build.gradle @@ -6,7 +6,7 @@ base.archivesName = rootProject.name + "-keybinding" kessoku { module("base", "common") - module("event-base", "neo") + module("base", "neo") common("keybinding", ModPlatform.NEOFORGE) shadowBundle("keybinding", ModPlatform.NEOFORGE) diff --git a/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/KessokuKeyBindEntrypoint.java b/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KessokuKeyBindingNeoforge.java similarity index 70% rename from keybinding/neo/src/main/java/band/kessoku/lib/keybinding/KessokuKeyBindEntrypoint.java rename to keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KessokuKeyBindingNeoforge.java index 4b196d2d..f5e20f5e 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/KessokuKeyBindEntrypoint.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KessokuKeyBindingNeoforge.java @@ -13,11 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.keybinding; +package band.kessoku.lib.impl.keybinding.neoforge; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.impl.keybinding.client.KessokuKeybinding; -import band.kessoku.lib.keybinding.impl.KeyBindRegisterImpl; import net.neoforged.api.distmarker.Dist; import net.neoforged.bus.api.IEventBus; @@ -25,11 +24,11 @@ import net.neoforged.fml.loading.FMLLoader; @Mod(value = KessokuKeybinding.MOD_ID, dist = Dist.CLIENT) -public final class KessokuKeyBindEntrypoint { - public KessokuKeyBindEntrypoint(IEventBus modEventBus) { +public final class KessokuKeyBindingNeoforge { + public KessokuKeyBindingNeoforge(IEventBus modEventBus) { if (FMLLoader.getDist().isClient()) { - KessokuUtils.getLogger().info(KessokuKeybinding.MARKER, "KessokuKeybind is loaded!"); - KeyBindRegisterImpl.registerEvent(modEventBus); + KessokuLib.loadModule(KessokuKeybinding.class); + KeyBindingRegisterImpl.registerEvent(modEventBus); } } } diff --git a/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java b/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KeyBindingRegisterImpl.java similarity index 88% rename from keybinding/neo/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java rename to keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KeyBindingRegisterImpl.java index 52c423a3..669351bc 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KeyBindingRegisterImpl.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.keybinding.impl; +package band.kessoku.lib.impl.keybinding.neoforge; import java.util.List; +import band.kessoku.lib.api.base.neoforge.NeoEventUtils; import band.kessoku.lib.api.keybinding.client.KeyBindingRegister; -import band.kessoku.lib.event.api.util.neo.NeoEventUtils; -import band.kessoku.lib.mixins.keybinding.KeyBindingAccessor; -import band.kessoku.lib.services.keybinding.client.KeyBindingRegisterService; +import band.kessoku.lib.mixin.keybinding.client.KeyBindingAccessor; +import band.kessoku.lib.service.keybinding.client.KeyBindingRegisterService; import com.google.auto.service.AutoService; import it.unimi.dsi.fastutil.objects.ReferenceArrayList; @@ -31,7 +31,7 @@ import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; @AutoService(KeyBindingRegisterService.class) -public final class KeyBindRegisterImpl implements KeyBindingRegisterService { +public final class KeyBindingRegisterImpl implements KeyBindingRegisterService { private static final List KEY_BINDINGS = new ReferenceArrayList<>(); private static boolean processed; diff --git a/keybinding/neo/src/main/java/band/kessoku/lib/mixins/keybinding/KeyBindingAccessor.java b/keybinding/neo/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingAccessor.java similarity index 82% rename from keybinding/neo/src/main/java/band/kessoku/lib/mixins/keybinding/KeyBindingAccessor.java rename to keybinding/neo/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingAccessor.java index 9b4eec69..3c47fcb8 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/mixins/keybinding/KeyBindingAccessor.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingAccessor.java @@ -13,9 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.keybinding; - -import java.util.Map; +package band.kessoku.lib.mixin.keybinding.client; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; @@ -25,11 +23,6 @@ @Mixin(KeyBinding.class) public interface KeyBindingAccessor { - @Accessor("CATEGORY_ORDER_MAP") - static Map kessoku$getCategoryMap() { - throw new AssertionError(); - } - @Accessor("boundKey") InputUtil.Key kessoku$getBoundKey(); } diff --git a/keybinding/neo/src/main/resources/META-INF/neoforge.mods.toml b/keybinding/neo/src/main/resources/META-INF/neoforge.mods.toml index 246deded..fe7fa585 100644 --- a/keybinding/neo/src/main/resources/META-INF/neoforge.mods.toml +++ b/keybinding/neo/src/main/resources/META-INF/neoforge.mods.toml @@ -4,7 +4,7 @@ license = "LGPL-3.0-only" issueTrackerURL = "https://github.com/KessokuTeaTime/KessokuLib/issues" [[mods]] -modId = "kessoku_keybind" +modId = "kessoku_key_binding" version = "${version}" displayName = "Kessoku Keybind" description = ''' @@ -15,16 +15,19 @@ authors = "Kessoku Tea Time" displayURL = "https://modrinth.com/mod/kessoku-lib" [[mixins]] -config = "kessoku-keybind.mixins.json" +config = "kessoku_key_binding.neoforge.mixins.json" -[[dependencies.kessoku_keybind]] +[[mixins]] +config = "kessoku_key_binding.mixins.json" + +[[dependencies.kessoku_key_binding]] modId = "neoforge" type = "required" versionRange = "[21.0,)" ordering = "NONE" side = "BOTH" -[[dependencies.kessoku_keybind]] +[[dependencies.kessoku_key_binding]] modId = "minecraft" type = "required" versionRange = "[1.21,)" diff --git a/keybinding/neo/src/main/resources/kessoku_keybinding.mixins.json b/keybinding/neo/src/main/resources/kessoku_key_binding.neoforge.mixins.json similarity index 72% rename from keybinding/neo/src/main/resources/kessoku_keybinding.mixins.json rename to keybinding/neo/src/main/resources/kessoku_key_binding.neoforge.mixins.json index 69b67a7b..06bf55f4 100644 --- a/keybinding/neo/src/main/resources/kessoku_keybinding.mixins.json +++ b/keybinding/neo/src/main/resources/kessoku_key_binding.neoforge.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "band.kessoku.lib.mixins.keybinding", + "package": "band.kessoku.lib.mixin.keybinding.client", "compatibilityLevel": "JAVA_17", "mixins": [ "KeyBindingAccessor" diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/mixins/lifecycle/WorldMixin.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/mixin/lifecycle/WorldMixin.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/mixins/lifecycle/WorldMixin.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/mixin/lifecycle/WorldMixin.java index 866c3f43..8adcacb6 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/mixins/lifecycle/WorldMixin.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/mixin/lifecycle/WorldMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.lifecycle; +package band.kessoku.lib.mixin.lifecycle; import java.util.HashSet; import java.util.Set; diff --git a/lifecycle-events/common/src/main/resources/kessoku-lifecycle-events.mixins.json b/lifecycle-events/common/src/main/resources/kessoku_lifecycle_events.mixins.json similarity index 76% rename from lifecycle-events/common/src/main/resources/kessoku-lifecycle-events.mixins.json rename to lifecycle-events/common/src/main/resources/kessoku_lifecycle_events.mixins.json index 2608166f..45be2a58 100644 --- a/lifecycle-events/common/src/main/resources/kessoku-lifecycle-events.mixins.json +++ b/lifecycle-events/common/src/main/resources/kessoku_lifecycle_events.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "band.kessoku.lib.mixins.lifecycle", + "package": "band.kessoku.lib.mixin.lifecycle", "compatibilityLevel": "JAVA_17", "mixins": [ "WorldMixin" diff --git a/lifecycle-events/fabric/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEventsEntrypoint.java b/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsFabric.java similarity index 67% rename from lifecycle-events/fabric/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEventsEntrypoint.java rename to lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsFabric.java index 3dfd3770..dd872426 100644 --- a/lifecycle-events/fabric/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEventsEntrypoint.java +++ b/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsFabric.java @@ -13,25 +13,24 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle; +package band.kessoku.lib.impl.event.lifecycle.fabric; -import band.kessoku.lib.events.lifecycle.impl.KessokuLifecycleEventsImplFabric; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.impl.event.lifecycle.KessokuLifecycleEvents; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ModInitializer; -public class KessokuLifecycleEventsEntrypoint implements ModInitializer, ClientModInitializer { +public class KessokuLifecycleEventsFabric implements ModInitializer, ClientModInitializer { @Override public void onInitialize() { - KessokuUtils.getLogger().info(KessokuLifecycleEvents.MARKER, "KessokuLib-LifecycleEvents is loaded!"); + KessokuLib.loadModule(KessokuLifecycleEvents.class); KessokuLifecycleEventsImplFabric.registerCommonEvents(); } @Override public void onInitializeClient() { - KessokuUtils.getLogger().info(KessokuLifecycleEvents.MARKER, "KessokuLib-LifecycleEvents is loaded on client!"); + KessokuLib.loadModule(KessokuLifecycleEvents.class); KessokuLifecycleEventsImplFabric.registerClientEvents(); } } diff --git a/lifecycle-events/fabric/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImplFabric.java b/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsImplFabric.java similarity index 99% rename from lifecycle-events/fabric/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImplFabric.java rename to lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsImplFabric.java index 7d442f6c..0e939fa9 100644 --- a/lifecycle-events/fabric/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImplFabric.java +++ b/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsImplFabric.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.impl; +package band.kessoku.lib.impl.event.lifecycle.fabric; import band.kessoku.lib.api.event.lifecycle.*; import band.kessoku.lib.api.event.lifecycle.client.*; diff --git a/lifecycle-events/fabric/src/main/resources/fabric.mod.json b/lifecycle-events/fabric/src/main/resources/fabric.mod.json index babb0eef..98afa6e7 100644 --- a/lifecycle-events/fabric/src/main/resources/fabric.mod.json +++ b/lifecycle-events/fabric/src/main/resources/fabric.mod.json @@ -17,10 +17,10 @@ "environment": "*", "entrypoints": { "main": [ - "band.kessoku.lib.events.lifecycle.KessokuLifecycleEventsEntrypoint::onInitialize" + "band.kessoku.lib.impl.event.lifecycle.fabric.KessokuLifecycleEventsFabric::onInitialize" ], "client": [ - "band.kessoku.lib.events.lifecycle.KessokuLifecycleEventsEntrypoint::onInitializeClient" + "band.kessoku.lib.impl.event.lifecycle.fabric.KessokuLifecycleEventsFabric::onInitializeClient" ] }, "depends": { @@ -30,7 +30,7 @@ "fabric-api": "*" }, "mixins": [ - "kessoku-lifecycle-events.mixins.json" + "kessoku_lifecycle_events.mixins.json" ], "custom": { "modmenu": { diff --git a/lifecycle-events/neo/build.gradle b/lifecycle-events/neo/build.gradle index c754ee24..266e8fee 100644 --- a/lifecycle-events/neo/build.gradle +++ b/lifecycle-events/neo/build.gradle @@ -5,17 +5,17 @@ apply from: rootProject.file("gradle/scripts/klib-neo.gradle") base.archivesName = rootProject.name + "-lifecycle-events" loom { - accessWidenerPath = file("src/main/resources/kessoku-lifecycle-events.accesswidener") + accessWidenerPath = file("src/main/resources/kessoku_lifecycle_events.accesswidener") } kessoku { modules(["base", "event-base"], "common") - module("event-base", "neo") + module("base", "neo") common("lifecycle-events", ModPlatform.NEOFORGE) shadowBundle("lifecycle-events", ModPlatform.NEOFORGE) } remapJar { - atAccessWideners.add("kessoku-lifecycle-events.accesswidener") + atAccessWideners.add("kessoku_lifecycle_events.accesswidener") } diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImplNeo.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/impl/event/lifecycle/neoforge/KessokuLifecycleEventsImplNeo.java similarity index 98% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImplNeo.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/impl/event/lifecycle/neoforge/KessokuLifecycleEventsImplNeo.java index f9dcf0cc..c504c26d 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImplNeo.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/impl/event/lifecycle/neoforge/KessokuLifecycleEventsImplNeo.java @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.impl; +package band.kessoku.lib.impl.event.lifecycle.neoforge; +import band.kessoku.lib.api.base.neoforge.NeoEventUtils; import band.kessoku.lib.api.event.lifecycle.*; import band.kessoku.lib.api.event.lifecycle.client.ClientChunkEvent; -import band.kessoku.lib.event.api.util.neo.NeoEventUtils; import band.kessoku.lib.impl.event.lifecycle.KessokuLifecycleEvents; import net.minecraft.client.MinecraftClient; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEventsEntrypoint.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/impl/event/lifecycle/neoforge/KessokuLifecycleEventsNeoforge.java similarity index 68% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEventsEntrypoint.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/impl/event/lifecycle/neoforge/KessokuLifecycleEventsNeoforge.java index 744e4826..762cf958 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEventsEntrypoint.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/impl/event/lifecycle/neoforge/KessokuLifecycleEventsNeoforge.java @@ -13,10 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle; +package band.kessoku.lib.impl.event.lifecycle.neoforge; -import band.kessoku.lib.events.lifecycle.impl.KessokuLifecycleEventsImplNeo; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.impl.event.lifecycle.KessokuLifecycleEvents; import net.neoforged.bus.api.IEventBus; @@ -26,13 +25,13 @@ import net.neoforged.neoforge.common.NeoForge; @Mod(KessokuLifecycleEvents.MOD_ID) -public class KessokuLifecycleEventsEntrypoint { - public KessokuLifecycleEventsEntrypoint(IEventBus modEventBus, ModContainer modContainer) { +public class KessokuLifecycleEventsNeoforge { + public KessokuLifecycleEventsNeoforge(IEventBus modEventBus, ModContainer modContainer) { var forgeEventBus = NeoForge.EVENT_BUS; - KessokuUtils.getLogger().info(KessokuLifecycleEvents.MARKER, "KessokuLib-LifecycleEvents is loaded!"); + KessokuLib.getLogger().info(KessokuLifecycleEvents.MARKER, "KessokuLib-LifecycleEvents is loaded!"); KessokuLifecycleEventsImplNeo.registerCommonEvents(forgeEventBus); if (FMLLoader.getDist().isClient()) { - KessokuUtils.getLogger().info(KessokuLifecycleEvents.MARKER, "KessokuLib-LifecycleEvents is loaded on client!"); + KessokuLib.getLogger().info(KessokuLifecycleEvents.MARKER, "KessokuLib-LifecycleEvents is loaded on client!"); KessokuLifecycleEventsImplNeo.registerClientEvents(forgeEventBus); } } diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/MinecraftServerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/MinecraftServerMixin.java similarity index 97% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/MinecraftServerMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/MinecraftServerMixin.java index 1fbf46bd..3fd95812 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/MinecraftServerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/MinecraftServerMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo; +package band.kessoku.lib.mixin.event.lifecycle.neoforge; import java.util.Collection; import java.util.concurrent.CompletableFuture; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/ServerEntityHandlerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerEntityHandlerMixin.java similarity index 97% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/ServerEntityHandlerMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerEntityHandlerMixin.java index 744a195f..ef6e8adf 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/ServerEntityHandlerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerEntityHandlerMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo; +package band.kessoku.lib.mixin.event.lifecycle.neoforge; import band.kessoku.lib.api.event.lifecycle.ServerEntityEvent; import org.spongepowered.asm.mixin.Final; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/ServerWorldMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerWorldMixin.java similarity index 96% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/ServerWorldMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerWorldMixin.java index b0ca800f..3c94a5c2 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/ServerWorldMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerWorldMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo; +package band.kessoku.lib.mixin.event.lifecycle.neoforge; import java.util.function.BooleanSupplier; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientChunkManagerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientChunkManagerMixin.java similarity index 97% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientChunkManagerMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientChunkManagerMixin.java index 8609ac53..57870571 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientChunkManagerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientChunkManagerMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo.client; +package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; import java.util.function.Consumer; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientEntityHandlerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientEntityHandlerMixin.java similarity index 96% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientEntityHandlerMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientEntityHandlerMixin.java index 844eecb0..d09dca24 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientEntityHandlerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientEntityHandlerMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo.client; +package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; import band.kessoku.lib.api.event.lifecycle.client.ClientEntityEvent; import org.spongepowered.asm.mixin.Final; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientPlayNetworkHandlerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientPlayNetworkHandlerMixin.java similarity index 98% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientPlayNetworkHandlerMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientPlayNetworkHandlerMixin.java index 885120e6..43454762 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/ClientPlayNetworkHandlerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientPlayNetworkHandlerMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo.client; +package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; import band.kessoku.lib.api.event.lifecycle.client.ClientBlockEntityEvent; import band.kessoku.lib.api.event.lifecycle.client.ClientEntityEvent; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/MinecraftClientMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/MinecraftClientMixin.java similarity index 96% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/MinecraftClientMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/MinecraftClientMixin.java index a47574ad..357fec64 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/MinecraftClientMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/MinecraftClientMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo.client; +package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; import band.kessoku.lib.api.event.lifecycle.client.ClientLifecycleEvent; import org.spongepowered.asm.mixin.Mixin; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/WorldChunkMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/WorldChunkMixin.java similarity index 98% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/WorldChunkMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/WorldChunkMixin.java index cf859e80..8f6d4fd7 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/client/WorldChunkMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/WorldChunkMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo.client; +package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; import java.util.Map; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/server/WorldChunkMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/server/WorldChunkMixin.java similarity index 98% rename from lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/server/WorldChunkMixin.java rename to lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/server/WorldChunkMixin.java index fc448a6f..1a245c75 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/events/lifecycle/mixin/neo/server/WorldChunkMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/server/WorldChunkMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin.neo.server; +package band.kessoku.lib.mixin.event.lifecycle.neoforge.server; import java.util.Map; diff --git a/lifecycle-events/neo/src/main/resources/META-INF/neoforge.mods.toml b/lifecycle-events/neo/src/main/resources/META-INF/neoforge.mods.toml index 7267445e..41778550 100644 --- a/lifecycle-events/neo/src/main/resources/META-INF/neoforge.mods.toml +++ b/lifecycle-events/neo/src/main/resources/META-INF/neoforge.mods.toml @@ -15,10 +15,10 @@ authors = "Kessoku Tea Time" displayURL = "https://modrinth.com/mod/kessoku-lib" [[mixins]] -config = "kessoku-lifecycle-events.mixins.json" +config = "kessoku_lifecycle-events.mixins.json" [[mixins]] -config = "kessoku-lifecycle-events.neo.mixins.json" +config = "kessoku_lifecycle_events.neoforge.mixins.json" [[accessTransformers]] file = "META-INF/accesstransformer.cfg" diff --git a/lifecycle-events/neo/src/main/resources/kessoku-lifecycle-events.accesswidener b/lifecycle-events/neo/src/main/resources/kessoku_lifecycle_events.accesswidener similarity index 100% rename from lifecycle-events/neo/src/main/resources/kessoku-lifecycle-events.accesswidener rename to lifecycle-events/neo/src/main/resources/kessoku_lifecycle_events.accesswidener diff --git a/lifecycle-events/neo/src/main/resources/kessoku-lifecycle-events.neo.mixins.json b/lifecycle-events/neo/src/main/resources/kessoku_lifecycle_events.neoforge.mixins.json similarity index 88% rename from lifecycle-events/neo/src/main/resources/kessoku-lifecycle-events.neo.mixins.json rename to lifecycle-events/neo/src/main/resources/kessoku_lifecycle_events.neoforge.mixins.json index 8c4c7bb7..8bbf62a3 100644 --- a/lifecycle-events/neo/src/main/resources/kessoku-lifecycle-events.neo.mixins.json +++ b/lifecycle-events/neo/src/main/resources/kessoku_lifecycle_events.neoforge.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "band.kessoku.lib.events.lifecycle.mixin.neo", + "package": "band.kessoku.lib.mixin.event.lifecycle.neoforge", "compatibilityLevel": "JAVA_17", "mixins": [ "MinecraftServerMixin", diff --git a/platform/common/src/main/java/band/kessoku/lib/api/platform/ModDependencyInfo.java b/platform/common/src/main/java/band/kessoku/lib/api/platform/ModDependencyInfo.java index 3f86651a..e98d16e2 100644 --- a/platform/common/src/main/java/band/kessoku/lib/api/platform/ModDependencyInfo.java +++ b/platform/common/src/main/java/band/kessoku/lib/api/platform/ModDependencyInfo.java @@ -15,7 +15,7 @@ */ package band.kessoku.lib.api.platform; -import band.kessoku.lib.services.platform.ModLoaderService; +import band.kessoku.lib.service.platform.ModLoaderService; import org.jetbrains.annotations.Nullable; public interface ModDependencyInfo { diff --git a/platform/common/src/main/java/band/kessoku/lib/api/platform/ModLoader.java b/platform/common/src/main/java/band/kessoku/lib/api/platform/ModLoader.java index 4320e74f..7dec0e5c 100644 --- a/platform/common/src/main/java/band/kessoku/lib/api/platform/ModLoader.java +++ b/platform/common/src/main/java/band/kessoku/lib/api/platform/ModLoader.java @@ -18,7 +18,7 @@ import java.nio.file.Path; import java.util.Collection; -import band.kessoku.lib.services.platform.ModLoaderService; +import band.kessoku.lib.service.platform.ModLoaderService; public final class ModLoader { private ModLoader() { diff --git a/platform/common/src/main/java/band/kessoku/lib/services/platform/ModLoaderService.java b/platform/common/src/main/java/band/kessoku/lib/service/platform/ModLoaderService.java similarity index 88% rename from platform/common/src/main/java/band/kessoku/lib/services/platform/ModLoaderService.java rename to platform/common/src/main/java/band/kessoku/lib/service/platform/ModLoaderService.java index 2ec63ed2..6b71ec32 100644 --- a/platform/common/src/main/java/band/kessoku/lib/services/platform/ModLoaderService.java +++ b/platform/common/src/main/java/band/kessoku/lib/service/platform/ModLoaderService.java @@ -13,18 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.services.platform; +package band.kessoku.lib.service.platform; import java.nio.file.Path; import java.util.Collection; +import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.platform.Env; import band.kessoku.lib.api.platform.ModData; -import band.kessoku.lib.impl.base.KessokuUtils; public interface ModLoaderService { static ModLoaderService getInstance() { - return KessokuUtils.loadService(ModLoaderService.class); + return KessokuLib.loadService(ModLoaderService.class); } ModData getModData(String modid); diff --git a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModLoaderImpl.java b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModLoaderImpl.java index ce7a7b7b..323f774d 100644 --- a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModLoaderImpl.java +++ b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModLoaderImpl.java @@ -22,7 +22,7 @@ import band.kessoku.lib.api.platform.Env; import band.kessoku.lib.api.platform.ModData; -import band.kessoku.lib.services.platform.ModLoaderService; +import band.kessoku.lib.service.platform.ModLoaderService; import com.google.auto.service.AutoService; import net.fabricmc.api.EnvType; diff --git a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModLoaderImpl.java b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModLoaderImpl.java index 2fa00dc3..cad8b2df 100644 --- a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModLoaderImpl.java +++ b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModLoaderImpl.java @@ -22,7 +22,7 @@ import band.kessoku.lib.api.platform.Env; import band.kessoku.lib.api.platform.ModData; -import band.kessoku.lib.services.platform.ModLoaderService; +import band.kessoku.lib.service.platform.ModLoaderService; import com.google.auto.service.AutoService; import net.neoforged.fml.ModList; diff --git a/registry/common/build.gradle b/registry/common/build.gradle index e993c8c5..096e500d 100644 --- a/registry/common/build.gradle +++ b/registry/common/build.gradle @@ -3,7 +3,7 @@ apply from: rootProject.file("gradle/scripts/klib-common.gradle") base.archivesName = rootProject.name + "-registry" loom { - accessWidenerPath = file("src/main/resources/kessoku-registry.accesswidener") + accessWidenerPath = file("src/main/resources/kessoku_registry.accesswidener") } kessoku { diff --git a/registry/common/src/main/java/band/kessoku/lib/api/registry/Registry.java b/registry/common/src/main/java/band/kessoku/lib/api/registry/Registry.java index 65b81b0b..52545a47 100644 --- a/registry/common/src/main/java/band/kessoku/lib/api/registry/Registry.java +++ b/registry/common/src/main/java/band/kessoku/lib/api/registry/Registry.java @@ -15,7 +15,7 @@ */ package band.kessoku.lib.api.registry; -import band.kessoku.lib.services.RegistryService; +import band.kessoku.lib.service.registry.RegistryService; import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; diff --git a/registry/common/src/main/java/band/kessoku/lib/services/RegistryService.java b/registry/common/src/main/java/band/kessoku/lib/service/registry/RegistryService.java similarity index 85% rename from registry/common/src/main/java/band/kessoku/lib/services/RegistryService.java rename to registry/common/src/main/java/band/kessoku/lib/service/registry/RegistryService.java index 9dacae91..6fe48832 100644 --- a/registry/common/src/main/java/band/kessoku/lib/services/RegistryService.java +++ b/registry/common/src/main/java/band/kessoku/lib/service/registry/RegistryService.java @@ -13,16 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.services; +package band.kessoku.lib.service.registry; -import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.api.KessokuLib; import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; public interface RegistryService { static RegistryService getInstance() { - return KessokuUtils.loadService(RegistryService.class); + return KessokuLib.loadService(RegistryService.class); } T register(Registry registry, Identifier id, T entry); } \ No newline at end of file diff --git a/registry/common/src/main/resources/kessoku-registry.accesswidener b/registry/common/src/main/resources/kessoku_registry.accesswidener similarity index 100% rename from registry/common/src/main/resources/kessoku-registry.accesswidener rename to registry/common/src/main/resources/kessoku_registry.accesswidener diff --git a/registry/fabric/src/main/java/band/kessoku/lib/impl/registry/fabric/RegistryImpl.java b/registry/fabric/src/main/java/band/kessoku/lib/impl/registry/fabric/RegistryImpl.java index 45f4fb71..dc25c516 100644 --- a/registry/fabric/src/main/java/band/kessoku/lib/impl/registry/fabric/RegistryImpl.java +++ b/registry/fabric/src/main/java/band/kessoku/lib/impl/registry/fabric/RegistryImpl.java @@ -15,7 +15,7 @@ */ package band.kessoku.lib.impl.registry.fabric; -import band.kessoku.lib.services.RegistryService; +import band.kessoku.lib.service.registry.RegistryService; import com.google.auto.service.AutoService; import net.minecraft.registry.Registry; diff --git a/registry/fabric/src/main/java/band/kessoku/lib/mixins/registry/fabric/AbstractFurnaceBlockEntityMixin.java b/registry/fabric/src/main/java/band/kessoku/lib/mixin/registry/fabric/AbstractFurnaceBlockEntityMixin.java similarity index 97% rename from registry/fabric/src/main/java/band/kessoku/lib/mixins/registry/fabric/AbstractFurnaceBlockEntityMixin.java rename to registry/fabric/src/main/java/band/kessoku/lib/mixin/registry/fabric/AbstractFurnaceBlockEntityMixin.java index a961e3f7..65491dd5 100644 --- a/registry/fabric/src/main/java/band/kessoku/lib/mixins/registry/fabric/AbstractFurnaceBlockEntityMixin.java +++ b/registry/fabric/src/main/java/band/kessoku/lib/mixin/registry/fabric/AbstractFurnaceBlockEntityMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.mixins.registry.fabric; +package band.kessoku.lib.mixin.registry.fabric; import band.kessoku.lib.api.registry.FuelRegistry; import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; diff --git a/registry/fabric/src/main/resources/fabric.mod.json b/registry/fabric/src/main/resources/fabric.mod.json index f9b0bf16..e6dd34e8 100644 --- a/registry/fabric/src/main/resources/fabric.mod.json +++ b/registry/fabric/src/main/resources/fabric.mod.json @@ -21,9 +21,9 @@ }, "environment": "*", "mixins": [ - "kessoku-registry-fabric.mixins.json" + "kessoku_registry.fabric.mixins.json" ], - "accessWidener": "kessoku-registry.accesswidener", + "accessWidener": "kessoku_registry.accesswidener", "depends": { "fabricloader": ">=0.16.0", "minecraft": "1.21", diff --git a/registry/fabric/src/main/resources/kessoku-registry-fabric.mixins.json b/registry/fabric/src/main/resources/kessoku_registry.fabric.mixins.json similarity index 74% rename from registry/fabric/src/main/resources/kessoku-registry-fabric.mixins.json rename to registry/fabric/src/main/resources/kessoku_registry.fabric.mixins.json index d6804d8b..3da4a0d0 100644 --- a/registry/fabric/src/main/resources/kessoku-registry-fabric.mixins.json +++ b/registry/fabric/src/main/resources/kessoku_registry.fabric.mixins.json @@ -1,6 +1,6 @@ { "required": true, - "package": "band.kessoku.lib.mixins.registry.fabric", + "package": "band.kessoku.lib.mixin.registry.fabric", "compatibilityLevel": "JAVA_21", "mixins": [ "AbstractFurnaceBlockEntityMixin" diff --git a/registry/neo/build.gradle b/registry/neo/build.gradle index ba618453..092c9ee8 100644 --- a/registry/neo/build.gradle +++ b/registry/neo/build.gradle @@ -2,7 +2,7 @@ import net.fabricmc.loom.util.ModPlatform apply from: rootProject.file("gradle/scripts/klib-neo.gradle") -base.archivesName = "kessoku-registry" +base.archivesName = rootProject.name + "-registry" loom { accessWidenerPath = project(":registry-common").loom.accessWidenerPath @@ -10,12 +10,12 @@ loom { kessoku { module("base", "common") - module("event-base", "neo") + module("base", "neo") common("registry", ModPlatform.NEOFORGE) shadowBundle("registry", ModPlatform.NEOFORGE) } remapJar { - atAccessWideners.add("kessoku-registry.accesswidener") + atAccessWideners.add("kessoku_registry.accesswidener") } diff --git a/registry/neo/src/main/java/band/kessoku/lib/impl/registry/neoforge/KessokuRegistryNeoforge.java b/registry/neo/src/main/java/band/kessoku/lib/impl/registry/neoforge/KessokuRegistryNeoforge.java index a6ff1d31..bd95f9b8 100644 --- a/registry/neo/src/main/java/band/kessoku/lib/impl/registry/neoforge/KessokuRegistryNeoforge.java +++ b/registry/neo/src/main/java/band/kessoku/lib/impl/registry/neoforge/KessokuRegistryNeoforge.java @@ -17,10 +17,10 @@ import java.util.Objects; +import band.kessoku.lib.api.KessokuLib; +import band.kessoku.lib.api.base.neoforge.NeoEventUtils; import band.kessoku.lib.api.registry.FuelRegistry; import band.kessoku.lib.api.registry.KessokuRegistry; -import band.kessoku.lib.event.api.util.neo.NeoEventUtils; -import band.kessoku.lib.impl.base.KessokuUtils; import net.minecraft.item.ItemStack; import net.minecraft.recipe.RecipeType; @@ -34,7 +34,7 @@ @Mod(KessokuRegistry.MOD_ID) public final class KessokuRegistryNeoforge { public KessokuRegistryNeoforge(IEventBus modEventBus) { - KessokuUtils.getLogger().info(KessokuRegistry.MARKER, "KessokuLib-Registry is loaded!"); + KessokuLib.loadModule(KessokuRegistry.class); NeoEventUtils.registerEvent(modEventBus, RegisterEvent.class, RegistryImpl::onRegister); NeoEventUtils.registerEvent(NeoForge.EVENT_BUS, FurnaceFuelBurnTimeEvent.class, event -> { final ItemStack stack = event.getItemStack(); diff --git a/registry/neo/src/main/java/band/kessoku/lib/impl/registry/neoforge/RegistryImpl.java b/registry/neo/src/main/java/band/kessoku/lib/impl/registry/neoforge/RegistryImpl.java index 652b4e7a..3ae00930 100644 --- a/registry/neo/src/main/java/band/kessoku/lib/impl/registry/neoforge/RegistryImpl.java +++ b/registry/neo/src/main/java/band/kessoku/lib/impl/registry/neoforge/RegistryImpl.java @@ -19,7 +19,7 @@ import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; -import band.kessoku.lib.services.RegistryService; +import band.kessoku.lib.service.registry.RegistryService; import com.google.auto.service.AutoService; import com.google.common.collect.Maps; import org.jetbrains.annotations.ApiStatus;