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 5202c0f0..71e472a0 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 @@ -1,8 +1,20 @@ +/* + * 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; -import band.kessoku.lib.impl.base.KessokuUtils; -import org.jetbrains.annotations.UnmodifiableView; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -12,6 +24,9 @@ import java.util.Collections; import java.util.List; +import band.kessoku.lib.impl.base.KessokuUtils; +import org.jetbrains.annotations.UnmodifiableView; + public final class KessokuLib { private static final List> initializedModules = new ArrayList<>(); diff --git a/base/common/src/main/java/band/kessoku/lib/impl/base/KessokuUtils.java b/base/common/src/main/java/band/kessoku/lib/impl/base/KessokuUtils.java index eb2dfc11..2ddbbd29 100644 --- a/base/common/src/main/java/band/kessoku/lib/impl/base/KessokuUtils.java +++ b/base/common/src/main/java/band/kessoku/lib/impl/base/KessokuUtils.java @@ -15,13 +15,13 @@ */ package band.kessoku.lib.impl.base; +import java.lang.reflect.Constructor; +import java.util.*; + import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.lang.reflect.Constructor; -import java.util.*; - public final class KessokuUtils { private KessokuUtils() { } diff --git a/base/fabric/src/main/java/band/kessoku/lib/impl/base/fabric/KessokuBaseFabric.java b/base/fabric/src/main/java/band/kessoku/lib/impl/base/fabric/KessokuBaseFabric.java index 07101e99..4b940120 100644 --- a/base/fabric/src/main/java/band/kessoku/lib/impl/base/fabric/KessokuBaseFabric.java +++ b/base/fabric/src/main/java/band/kessoku/lib/impl/base/fabric/KessokuBaseFabric.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.base.KessokuBase; + import net.fabricmc.api.ModInitializer; public final class KessokuBaseFabric implements ModInitializer { diff --git a/base/neo/src/main/java/band/kessoku/lib/impl/base/neoforge/KessokuBaseNeoforge.java b/base/neo/src/main/java/band/kessoku/lib/impl/base/neoforge/KessokuBaseNeoforge.java index f9ddf137..19d9f773 100644 --- a/base/neo/src/main/java/band/kessoku/lib/impl/base/neoforge/KessokuBaseNeoforge.java +++ b/base/neo/src/main/java/band/kessoku/lib/impl/base/neoforge/KessokuBaseNeoforge.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.base.KessokuBase; + import net.neoforged.fml.common.Mod; @Mod(KessokuBase.MOD_ID) diff --git a/buildSrc/src/main/java/band/kessoku/gradle/plugin/KesssokuExtension.java b/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuExtension.java similarity index 99% rename from buildSrc/src/main/java/band/kessoku/gradle/plugin/KesssokuExtension.java rename to buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuExtension.java index c0bf0ae5..c37b9c8c 100644 --- a/buildSrc/src/main/java/band/kessoku/gradle/plugin/KesssokuExtension.java +++ b/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuExtension.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.Map; -public abstract class KesssokuExtension { +public abstract class KessokuExtension { @Inject protected abstract Project getProject(); diff --git a/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java b/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java index 111b98c9..f4bf5c63 100644 --- a/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java +++ b/buildSrc/src/main/java/band/kessoku/gradle/plugin/KessokuGradlePlugin.java @@ -11,6 +11,19 @@ import java.util.List; public final class KessokuGradlePlugin implements Plugin { + public static final List MODULES = List.of( + "base", + "command", + "config", + "data", + "entity-events", + "entrypoint", + "event-base", + "keybinding", + "lifecycle-events", + "platform", + "registry" + ); private static final List NEO_GROUPS = List.of( "net.neoforged", "cpw.mods", @@ -28,7 +41,7 @@ public void apply(@NotNull PluginAware target) { settings.getGradle().getPluginManager().apply(KessokuGradlePlugin.class); } case Project project -> { - project.getExtensions().create("kessoku", KesssokuExtension.class); + project.getExtensions().create("kessoku", KessokuExtension.class); additionalRepositories(project.getRepositories()); } 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/events/command/CommandRegistryEvent.java index 3342db4d..a3f941b8 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/events/command/CommandRegistryEvent.java @@ -17,10 +17,11 @@ import band.kessoku.lib.event.api.Event; import com.mojang.brigadier.CommandDispatcher; +import org.jetbrains.annotations.ApiStatus; + import net.minecraft.command.CommandRegistryAccess; import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; -import org.jetbrains.annotations.ApiStatus; @ApiStatus.NonExtendable public interface CommandRegistryEvent { 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 3599aba5..0a0b3e74 100644 --- a/command/common/src/test/java/kessoku/testmod/command/KessokuTestCommand.java +++ b/command/common/src/test/java/kessoku/testmod/command/KessokuTestCommand.java @@ -15,8 +15,8 @@ */ package kessoku.testmod.command; -import band.kessoku.lib.api.events.command.CommandRegistryEvent; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; +import band.kessoku.lib.api.events.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/KessokuCommandFabric.java b/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandFabric.java index 144bc37c..bc8d056c 100644 --- a/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandFabric.java +++ b/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandFabric.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.command.KessokuCommand; + import net.fabricmc.api.ModInitializer; public final class KessokuCommandFabric implements ModInitializer { 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 d30ccb63..076d2509 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 @@ -16,6 +16,7 @@ package band.kessoku.lib.impl.command.fabric; import band.kessoku.lib.api.events.command.CommandRegistryEvent; + import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; public final class KessokuCommandImpl { 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 40368941..745a5525 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 @@ -17,6 +17,7 @@ import band.kessoku.lib.api.events.command.CommandRegistryEvent; import band.kessoku.lib.event.api.util.neo.NeoEventUtils; + import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.event.RegisterCommandsEvent; diff --git a/command/neo/src/main/java/band/kessoku/lib/impl/command/neoforge/KessokuCommandNeoforge.java b/command/neo/src/main/java/band/kessoku/lib/impl/command/neoforge/KessokuCommandNeoforge.java index 34cc8f2a..29543947 100644 --- a/command/neo/src/main/java/band/kessoku/lib/impl/command/neoforge/KessokuCommandNeoforge.java +++ b/command/neo/src/main/java/band/kessoku/lib/impl/command/neoforge/KessokuCommandNeoforge.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.command.KessokuCommand; + import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; 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 e0bfd5f6..d88d2722 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 @@ -15,16 +15,6 @@ */ package band.kessoku.lib.api.config; -import band.kessoku.lib.impl.base.KessokuUtils; -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 com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.FilenameUtils; -import org.apache.logging.log4j.core.util.ReflectionUtil; - import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -36,6 +26,16 @@ import java.util.function.BiConsumer; import java.util.function.Consumer; +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; +import org.apache.commons.io.FilenameUtils; +import org.apache.logging.log4j.core.util.ReflectionUtil; + @SuppressWarnings({"rawtypes", "unused"}) public abstract class AbstractConfig { private final List> preSave = new ArrayList<>(); diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/KessokuConfig.java b/config/common/src/main/java/band/kessoku/lib/api/config/KessokuConfig.java index 23c94ce2..33b167d2 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/KessokuConfig.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/KessokuConfig.java @@ -15,6 +15,11 @@ */ package band.kessoku.lib.api.config; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + import org.apache.commons.io.FileUtils; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; @@ -22,11 +27,6 @@ import org.slf4j.Marker; import org.slf4j.MarkerFactory; -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - public final class KessokuConfig { private static final Map> configs = new HashMap<>(); private static final Map, ConfigSerializer> serializerCache = new HashMap<>(); diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/serializers/Json5Serializer.java b/config/common/src/main/java/band/kessoku/lib/api/config/serializers/Json5Serializer.java index ee9448a3..e27b59df 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/serializers/Json5Serializer.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/serializers/Json5Serializer.java @@ -15,14 +15,14 @@ */ package band.kessoku.lib.api.config.serializers; +import java.util.Map; + import band.kessoku.lib.api.config.AbstractConfig; import band.kessoku.lib.api.config.ConfigSerializer; import club.someoneice.json.JSON; import club.someoneice.json.node.JsonNode; import club.someoneice.json.processor.Json5Builder; -import java.util.Map; - // TODO public class Json5Serializer implements ConfigSerializer { @Override diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/serializers/JsonSerializer.java b/config/common/src/main/java/band/kessoku/lib/api/config/serializers/JsonSerializer.java index 94af3ca4..0d8be82e 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/serializers/JsonSerializer.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/serializers/JsonSerializer.java @@ -15,6 +15,8 @@ */ package band.kessoku.lib.api.config.serializers; +import java.util.Map; + import band.kessoku.lib.api.config.AbstractConfig; import band.kessoku.lib.api.config.ConfigSerializer; import club.someoneice.json.JSON; @@ -23,8 +25,6 @@ import club.someoneice.json.node.MapNode; import club.someoneice.json.processor.JsonBuilder; -import java.util.Map; - public class JsonSerializer implements ConfigSerializer { @Override public String serialize(Map value) { diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/serializers/TomlSerializer.java b/config/common/src/main/java/band/kessoku/lib/api/config/serializers/TomlSerializer.java index 4db8345e..f4ad88b8 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/serializers/TomlSerializer.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/serializers/TomlSerializer.java @@ -15,12 +15,12 @@ */ package band.kessoku.lib.api.config.serializers; +import java.util.Map; + import band.kessoku.lib.api.config.AbstractConfig; import band.kessoku.lib.api.config.ConfigSerializer; import com.electronwill.nightconfig.core.CommentedConfig; -import java.util.Map; - //todo public class TomlSerializer implements ConfigSerializer { @Override diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/BooleanValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/BooleanValue.java index 193820a0..2e0b35cf 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/BooleanValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/BooleanValue.java @@ -15,11 +15,11 @@ */ package band.kessoku.lib.api.config.values; +import java.util.function.Supplier; + import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import java.util.function.Supplier; - public final class BooleanValue extends DefaultConfigValue { private BooleanValue(Supplier defaultValue) { super(defaultValue); diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/DefaultConfigValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/DefaultConfigValue.java index 133f7675..cc3f8f76 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/DefaultConfigValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/DefaultConfigValue.java @@ -15,10 +15,10 @@ */ package band.kessoku.lib.api.config.values; -import band.kessoku.lib.api.config.ConfigValue; - import java.util.function.Supplier; +import band.kessoku.lib.api.config.ConfigValue; + sealed abstract class DefaultConfigValue implements ConfigValue permits BooleanValue, DoubleValue, FloatValue, IntegerValue, ListValue, LongValue, MapValue, StringValue { public final Supplier defaultValue; public T value; diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/DoubleValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/DoubleValue.java index 5b375664..84714e41 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/DoubleValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/DoubleValue.java @@ -15,11 +15,11 @@ */ package band.kessoku.lib.api.config.values; +import java.util.function.Supplier; + import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import java.util.function.Supplier; - public final class DoubleValue extends DefaultConfigValue { private DoubleValue(Supplier defaultValue) { super(defaultValue); diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/FloatValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/FloatValue.java index 819fa024..07c5909b 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/FloatValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/FloatValue.java @@ -15,11 +15,11 @@ */ package band.kessoku.lib.api.config.values; +import java.util.function.Supplier; + import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import java.util.function.Supplier; - public final class FloatValue extends DefaultConfigValue { private FloatValue(Supplier defaultValue) { super(defaultValue); diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/IntegerValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/IntegerValue.java index d5c0a2d3..b2f81974 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/IntegerValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/IntegerValue.java @@ -15,11 +15,11 @@ */ package band.kessoku.lib.api.config.values; +import java.util.function.Supplier; + import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import java.util.function.Supplier; - public final class IntegerValue extends DefaultConfigValue { private IntegerValue(Supplier defaultValue) { super(defaultValue); diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/ListValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/ListValue.java index 3e1492a8..43ed0d08 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/ListValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/ListValue.java @@ -15,14 +15,14 @@ */ package band.kessoku.lib.api.config.values; +import java.util.*; +import java.util.function.Supplier; + import com.google.common.collect.ImmutableList; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Unmodifiable; -import java.util.*; -import java.util.function.Supplier; - @SuppressWarnings({"rawtypes"}) public final class ListValue extends DefaultConfigValue> implements List { private ListValue(Supplier> defaultValue) { diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/LongValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/LongValue.java index c61dcb05..4418a959 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/LongValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/LongValue.java @@ -15,11 +15,11 @@ */ package band.kessoku.lib.api.config.values; +import java.util.function.Supplier; + import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import java.util.function.Supplier; - public final class LongValue extends DefaultConfigValue { private LongValue(Supplier defaultValue) { super(defaultValue); diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/MapValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/MapValue.java index ae24a01a..c937ccae 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/MapValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/MapValue.java @@ -15,18 +15,18 @@ */ package band.kessoku.lib.api.config.values; -import com.google.common.collect.ImmutableMap; -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.annotations.Unmodifiable; - import java.util.Collection; import java.util.HashMap; import java.util.Map; import java.util.Set; import java.util.function.Supplier; +import com.google.common.collect.ImmutableMap; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.annotations.Unmodifiable; + public final class MapValue extends DefaultConfigValue> implements Map { private MapValue(Supplier> defaultValue) { super(defaultValue); diff --git a/config/common/src/main/java/band/kessoku/lib/api/config/values/StringValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/values/StringValue.java index d2973437..8d0ff915 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/values/StringValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/values/StringValue.java @@ -15,11 +15,11 @@ */ package band.kessoku.lib.api.config.values; +import java.util.function.Supplier; + import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; -import java.util.function.Supplier; - public final class StringValue extends DefaultConfigValue { private StringValue(Supplier defaultValue) { super(defaultValue); diff --git a/config/fabric/src/main/java/band/kessoku/lib/impl/config/fabric/KessokuConfigFabric.java b/config/fabric/src/main/java/band/kessoku/lib/impl/config/fabric/KessokuConfigFabric.java index 6609eeee..0212b577 100644 --- a/config/fabric/src/main/java/band/kessoku/lib/impl/config/fabric/KessokuConfigFabric.java +++ b/config/fabric/src/main/java/band/kessoku/lib/impl/config/fabric/KessokuConfigFabric.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.config.KessokuConfig; + import net.fabricmc.api.ModInitializer; public final class KessokuConfigFabric implements ModInitializer { diff --git a/config/neo/src/main/java/band/kessoku/lib/impl/config/neoforge/KessokuConfigNeoforge.java b/config/neo/src/main/java/band/kessoku/lib/impl/config/neoforge/KessokuConfigNeoforge.java index b589afcc..7c5043d1 100644 --- a/config/neo/src/main/java/band/kessoku/lib/impl/config/neoforge/KessokuConfigNeoforge.java +++ b/config/neo/src/main/java/band/kessoku/lib/impl/config/neoforge/KessokuConfigNeoforge.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.config.KessokuConfig; + import net.neoforged.fml.common.Mod; @Mod(KessokuConfig.MOD_ID) 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 index 8deec434..21ae82bb 100644 --- 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 @@ -1,3 +1,18 @@ +/* + * 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; diff --git a/data/common/src/main/java/band/kessoku/lib/api/data/AbstractNBTStructure.java b/data/common/src/main/java/band/kessoku/lib/api/data/AbstractNBTStructure.java index 1609ac40..e09c9e6b 100644 --- a/data/common/src/main/java/band/kessoku/lib/api/data/AbstractNBTStructure.java +++ b/data/common/src/main/java/band/kessoku/lib/api/data/AbstractNBTStructure.java @@ -1,3 +1,18 @@ +/* + * 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 net.minecraft.nbt.NbtCompound; 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 index 2325f1b0..b819d7d1 100644 --- 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 @@ -1,3 +1,18 @@ +/* + * 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; diff --git a/data/common/src/main/java/band/kessoku/lib/api/data/Data.java b/data/common/src/main/java/band/kessoku/lib/api/data/Data.java index 58096a04..adbd1ab2 100644 --- a/data/common/src/main/java/band/kessoku/lib/api/data/Data.java +++ b/data/common/src/main/java/band/kessoku/lib/api/data/Data.java @@ -1,3 +1,18 @@ +/* + * 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 org.jetbrains.annotations.NotNull; 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 cf8b69e4..c1c13751 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 @@ -1,3 +1,18 @@ +/* + * 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; /** diff --git a/data/common/src/main/java/band/kessoku/lib/api/data/MutableData.java b/data/common/src/main/java/band/kessoku/lib/api/data/MutableData.java index 429578ca..81972ec8 100644 --- a/data/common/src/main/java/band/kessoku/lib/api/data/MutableData.java +++ b/data/common/src/main/java/band/kessoku/lib/api/data/MutableData.java @@ -1,3 +1,18 @@ +/* + * 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; /** diff --git a/data/common/src/main/java/band/kessoku/lib/api/data/NBTSerializable.java b/data/common/src/main/java/band/kessoku/lib/api/data/NBTSerializable.java index cca8224f..70f188ca 100644 --- a/data/common/src/main/java/band/kessoku/lib/api/data/NBTSerializable.java +++ b/data/common/src/main/java/band/kessoku/lib/api/data/NBTSerializable.java @@ -1,3 +1,18 @@ +/* + * 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 net.minecraft.nbt.NbtCompound; diff --git a/data/common/src/main/java/band/kessoku/lib/data/example/SimpleFunraceBlockEntity.java b/data/common/src/main/java/band/kessoku/lib/data/example/SimpleFunraceBlockEntity.java index bc177fd3..f7b082e3 100644 --- a/data/common/src/main/java/band/kessoku/lib/data/example/SimpleFunraceBlockEntity.java +++ b/data/common/src/main/java/band/kessoku/lib/data/example/SimpleFunraceBlockEntity.java @@ -1,9 +1,25 @@ +/* + * 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.data.example; import band.kessoku.lib.impl.data.collection.Access; import band.kessoku.lib.impl.data.structure.IntPropertyStructure; import band.kessoku.lib.impl.data.structure.ProgressStructure; import band.kessoku.lib.impl.data.structure.SidedInventoryStructure; + import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.entity.BlockEntityType; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/BaseData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/BaseData.java index dfac5f3f..9db0f77a 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/BaseData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/BaseData.java @@ -1,10 +1,25 @@ +/* + * 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; +import java.util.Objects; + import band.kessoku.lib.api.data.MutableData; import org.jetbrains.annotations.NotNull; -import java.util.Objects; - public class BaseData implements MutableData { private final String id; private T value; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/KessokuData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/KessokuData.java index 621f030e..385c7b84 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/KessokuData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/KessokuData.java @@ -1,3 +1,18 @@ +/* + * 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; import org.slf4j.Marker; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/ByteData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/ByteData.java index 47924826..830390d9 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/ByteData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/ByteData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/DoubleData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/DoubleData.java index 35881666..d8091a44 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/DoubleData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/DoubleData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/FloatData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/FloatData.java index 1d4ab744..ca2d4afb 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/FloatData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/FloatData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/IdentifierData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/IdentifierData.java index bb320f82..25b3fe22 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/IdentifierData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/IdentifierData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; import net.minecraft.util.Identifier; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/IntData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/IntData.java index ca605c62..1866e19f 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/IntData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/IntData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/ItemStackData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/ItemStackData.java index 03cffabe..b0063f13 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/ItemStackData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/ItemStackData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/LongData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/LongData.java index 47aafced..b812f75e 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/LongData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/LongData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/ShortData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/ShortData.java index f5af2096..f294eb87 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/ShortData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/ShortData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/StringData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/StringData.java index 9a24bdbe..31ea8d75 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/StringData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/StringData.java @@ -1,7 +1,23 @@ +/* + * 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.base; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/base/TextData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/TextData.java index daf2a14c..39bcd0b4 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/base/TextData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/base/TextData.java @@ -1,13 +1,29 @@ +/* + * 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.base; +import static net.minecraft.block.entity.BlockEntity.tryParseCustomName; + import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.BaseData; + import net.minecraft.nbt.NbtCompound; import net.minecraft.registry.RegistryWrapper; import net.minecraft.text.Text; -import static net.minecraft.block.entity.BlockEntity.tryParseCustomName; - public final class TextData extends BaseData implements NBTSerializable { private TextData(String id, Text defaultValue) { super(id, defaultValue); diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/collection/Access.java b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/Access.java index 4a917ed0..7f11e55f 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/collection/Access.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/Access.java @@ -1,10 +1,25 @@ +/* + * 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 java.util.function.Predicate; + import net.minecraft.item.ItemStack; import net.minecraft.util.math.Direction; -import java.util.function.Predicate; - public class Access extends Element { public Predicate input = direction -> true; public Predicate output = direction -> true; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/collection/DefaultedListData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/DefaultedListData.java index 4f2dbaca..8bdd3086 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/collection/DefaultedListData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/DefaultedListData.java @@ -1,10 +1,25 @@ +/* + * 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 org.jetbrains.annotations.NotNull; - import java.util.Collections; import java.util.ListIterator; +import org.jetbrains.annotations.NotNull; + public final class DefaultedListData extends ListData { private final @NotNull T defaultValue; 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 index 583136c8..db84c682 100644 --- 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 @@ -1,3 +1,18 @@ +/* + * 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; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/collection/ListData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/ListData.java index 8417ed80..53c98d10 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/collection/ListData.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/ListData.java @@ -1,12 +1,27 @@ +/* + * 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.Data; -import org.jetbrains.annotations.NotNull; - import java.util.AbstractList; import java.util.ArrayList; import java.util.List; +import band.kessoku.lib.api.data.Data; +import org.jetbrains.annotations.NotNull; + public class ListData extends AbstractList implements Data> { private final List list = new ArrayList<>(); private final String id; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/structure/IntPropertyStructure.java b/data/common/src/main/java/band/kessoku/lib/impl/data/structure/IntPropertyStructure.java index bc344e40..ed3f062c 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/structure/IntPropertyStructure.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/structure/IntPropertyStructure.java @@ -1,10 +1,26 @@ +/* + * 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.structure; +import java.util.List; + import band.kessoku.lib.api.data.AbstractDataStructure; import band.kessoku.lib.api.data.MutableData; -import net.minecraft.screen.PropertyDelegate; -import java.util.List; +import net.minecraft.screen.PropertyDelegate; @SuppressWarnings("unchecked") public final class IntPropertyStructure extends AbstractDataStructure implements PropertyDelegate { diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/structure/InventoryStructure.java b/data/common/src/main/java/band/kessoku/lib/impl/data/structure/InventoryStructure.java index bd6c42d5..118049f2 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/structure/InventoryStructure.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/structure/InventoryStructure.java @@ -1,9 +1,27 @@ +/* + * 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.structure; +import java.util.List; + import band.kessoku.lib.api.data.AbstractDataStructure; import band.kessoku.lib.api.data.NBTSerializable; import band.kessoku.lib.impl.data.collection.DefaultedListData; import band.kessoku.lib.impl.data.collection.Element; + import net.minecraft.component.type.ContainerComponent; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.inventory.Inventories; @@ -13,8 +31,6 @@ import net.minecraft.nbt.NbtList; import net.minecraft.registry.RegistryWrapper; -import java.util.List; - public class InventoryStructure extends AbstractDataStructure implements NBTSerializable, Inventory { public final DefaultedListData inventory; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/structure/ProgressStructure.java b/data/common/src/main/java/band/kessoku/lib/impl/data/structure/ProgressStructure.java index 2453e180..78756d28 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/structure/ProgressStructure.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/structure/ProgressStructure.java @@ -1,3 +1,18 @@ +/* + * 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.structure; import band.kessoku.lib.api.data.AbstractNBTStructure; diff --git a/data/common/src/main/java/band/kessoku/lib/impl/data/structure/SidedInventoryStructure.java b/data/common/src/main/java/band/kessoku/lib/impl/data/structure/SidedInventoryStructure.java index f91da4ad..048241b8 100644 --- a/data/common/src/main/java/band/kessoku/lib/impl/data/structure/SidedInventoryStructure.java +++ b/data/common/src/main/java/band/kessoku/lib/impl/data/structure/SidedInventoryStructure.java @@ -1,13 +1,29 @@ +/* + * 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.structure; +import java.util.ArrayList; +import java.util.List; + import band.kessoku.lib.impl.data.collection.Access; +import org.jetbrains.annotations.Nullable; + import net.minecraft.inventory.SidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.math.Direction; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; public final class SidedInventoryStructure extends InventoryStructure implements SidedInventory { private final List list = new ArrayList<>(); diff --git a/data/common/src/main/java/band/kessoku/lib/mixins/data/BlockEntityMixin.java b/data/common/src/main/java/band/kessoku/lib/mixins/data/BlockEntityMixin.java index 0d05322e..285ae273 100644 --- a/data/common/src/main/java/band/kessoku/lib/mixins/data/BlockEntityMixin.java +++ b/data/common/src/main/java/band/kessoku/lib/mixins/data/BlockEntityMixin.java @@ -1,20 +1,36 @@ +/* + * 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.mixins.data; +import java.util.ArrayList; +import java.util.List; + import band.kessoku.lib.api.data.BlockEntityStructure; import band.kessoku.lib.api.data.Data; import band.kessoku.lib.api.data.DataStructure; import band.kessoku.lib.api.data.NBTSerializable; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.registry.RegistryWrapper; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.ArrayList; -import java.util.List; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.RegistryWrapper; @SuppressWarnings("AddedMixinMembersNamePattern") @Mixin(BlockEntity.class) 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 4e4a99fc..ffa72bfb 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 @@ -1,7 +1,23 @@ +/* + * 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.fabric; import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.impl.data.KessokuData; + import net.fabricmc.api.ModInitializer; public final class KessokuDataFabric implements 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 3e47f064..9b83e985 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 @@ -1,7 +1,23 @@ +/* + * 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.neoforge; import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.impl.data.KessokuData; + import net.neoforged.fml.common.Mod; @Mod(KessokuData.MOD_ID) 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/events/entity/EntityElytraEvent.java index 19d55b8f..b6ce4fed 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/events/entity/EntityElytraEvent.java @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package band.kessoku.lib.api.events.entity; -import band.kessoku.lib.event.api.Event; import band.kessoku.lib.api.events.entity.item.KessokuElytraItem; -import net.minecraft.entity.LivingEntity; +import band.kessoku.lib.event.api.Event; import org.jetbrains.annotations.ApiStatus; +import net.minecraft.entity.LivingEntity; + /** * Events related to elytra flight for living entities. Elytra flight is also known as "fall flying". */ 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/events/entity/EntitySleepEvent.java index 0dfc67e7..a7b8e042 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/events/entity/EntitySleepEvent.java @@ -16,6 +16,9 @@ package band.kessoku.lib.api.events.entity; import band.kessoku.lib.event.api.Event; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.Nullable; + import net.minecraft.block.BlockState; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.player.PlayerEntity; @@ -23,8 +26,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.Nullable; /** 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/events/entity/KessokuEntityEvents.java index 54435a7d..06e01191 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/events/entity/KessokuEntityEvents.java @@ -16,12 +16,13 @@ package band.kessoku.lib.api.events.entity; import band.kessoku.lib.api.events.entity.item.KessokuElytraItem; -import net.minecraft.entity.EquipmentSlot; -import net.minecraft.item.ItemStack; import org.jetbrains.annotations.ApiStatus; import org.slf4j.Marker; import org.slf4j.MarkerFactory; +import net.minecraft.entity.EquipmentSlot; +import net.minecraft.item.ItemStack; + public final class KessokuEntityEvents { public static final String MOD_ID = "kessoku_entity_events"; public static final String NAME = "Kessoku Entity Events API"; 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/events/entity/ServerEntityCombatEvent.java index dea74e23..7fa6de49 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/events/entity/ServerEntityCombatEvent.java @@ -16,10 +16,11 @@ package band.kessoku.lib.api.events.entity; import band.kessoku.lib.event.api.Event; +import org.jetbrains.annotations.ApiStatus; + import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; import net.minecraft.server.world.ServerWorld; -import org.jetbrains.annotations.ApiStatus; /** * Events related to entities in combat. 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/events/entity/ServerEntityWorldChangeEvent.java index 205abf02..f6b51c1f 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/events/entity/ServerEntityWorldChangeEvent.java @@ -16,10 +16,11 @@ package band.kessoku.lib.api.events.entity; import band.kessoku.lib.event.api.Event; +import org.jetbrains.annotations.ApiStatus; + import net.minecraft.entity.Entity; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import org.jetbrains.annotations.ApiStatus; /** * Events related to an entity being moved to another world. 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/events/entity/ServerLivingEntityEvent.java index 83961357..961c8c69 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/events/entity/ServerLivingEntityEvent.java @@ -16,10 +16,11 @@ package band.kessoku.lib.api.events.entity; import band.kessoku.lib.event.api.Event; +import org.jetbrains.annotations.ApiStatus; + import net.minecraft.entity.LivingEntity; import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.mob.MobEntity; -import org.jetbrains.annotations.ApiStatus; /** * Various server-side only events related to living entities. 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/events/entity/ServerPlayerEvent.java index d36bf081..6747214a 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/events/entity/ServerPlayerEvent.java @@ -16,9 +16,10 @@ package band.kessoku.lib.api.events.entity; import band.kessoku.lib.event.api.Event; -import net.minecraft.server.network.ServerPlayerEntity; import org.jetbrains.annotations.ApiStatus; +import net.minecraft.server.network.ServerPlayerEntity; + @ApiStatus.NonExtendable public interface ServerPlayerEvent { /** 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/events/entity/item/KessokuElytraItem.java index 8c5f20de..7f56bebb 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/events/entity/item/KessokuElytraItem.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package band.kessoku.lib.api.events.entity.item; import net.minecraft.entity.EquipmentSlot; 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 261a2ebb..e8d0b52b 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 @@ -19,6 +19,7 @@ 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 net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.entity.event.v1.EntityElytraEvents; import net.fabricmc.fabric.api.entity.event.v1.EntitySleepEvents; 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/events/entity/KessokuEntityEventsNeoforge.java index 67f22dcc..83883604 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/events/entity/KessokuEntityEventsNeoforge.java @@ -16,15 +16,17 @@ package band.kessoku.lib.impl.events.entity; import band.kessoku.lib.api.KessokuLib; -import band.kessoku.lib.api.events.entity.KessokuEntityEvents; -import band.kessoku.lib.event.api.util.neo.NeoEventUtils; 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 net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.ActionResult; + import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.entity.living.LivingConversionEvent; 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/mixins/events/entity/EntityMixin.java index ce7a751f..167c114b 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/mixins/events/entity/EntityMixin.java @@ -15,20 +15,21 @@ */ package band.kessoku.lib.mixins.events.entity; +import java.util.Set; + import band.kessoku.lib.api.events.entity.ServerEntityWorldChangeEvent; import com.llamalad7.mixinextras.sugar.Local; -import net.minecraft.entity.Entity; -import net.minecraft.network.packet.s2c.play.PositionFlag; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.world.TeleportTarget; -import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import java.util.Set; +import net.minecraft.entity.Entity; +import net.minecraft.network.packet.s2c.play.PositionFlag; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.world.TeleportTarget; +import net.minecraft.world.World; @Mixin(Entity.class) abstract class EntityMixin { 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/mixins/events/entity/IItemExtensionMixin.java index 20d54f7c..e597e2d8 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/mixins/events/entity/IItemExtensionMixin.java @@ -16,14 +16,16 @@ package band.kessoku.lib.mixins.events.entity; import band.kessoku.lib.api.events.entity.item.KessokuElytraItem; -import net.minecraft.entity.LivingEntity; -import net.minecraft.item.ItemStack; -import net.neoforged.neoforge.common.extensions.IItemExtension; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import net.minecraft.entity.LivingEntity; +import net.minecraft.item.ItemStack; + +import net.neoforged.neoforge.common.extensions.IItemExtension; + @Mixin(IItemExtension.class) public interface IItemExtensionMixin { @Inject(method = "canElytraFly", at = @At("HEAD"), cancellable = true) 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/mixins/events/entity/LivingEntityMixin.java index 2fe8a2cc..7342d7b5 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/mixins/events/entity/LivingEntityMixin.java @@ -15,12 +15,25 @@ */ package band.kessoku.lib.mixins.events.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 com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import com.llamalad7.mixinextras.sugar.Local; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Dynamic; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.ModifyVariable; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + import net.minecraft.block.BedBlock; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -36,18 +49,6 @@ import net.minecraft.world.CollisionView; import net.minecraft.world.World; import net.minecraft.world.WorldView; -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Dynamic; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.ModifyVariable; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import java.util.Optional; @Mixin(LivingEntity.class) 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/mixins/events/entity/MobEntityMixin.java index 299337d8..89576022 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/mixins/events/entity/MobEntityMixin.java @@ -17,12 +17,13 @@ import band.kessoku.lib.api.events.entity.ServerLivingEntityEvent; import com.llamalad7.mixinextras.sugar.Local; -import net.minecraft.entity.Entity; -import net.minecraft.entity.mob.MobEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.ModifyArg; +import net.minecraft.entity.Entity; +import net.minecraft.entity.mob.MobEntity; + @Mixin(MobEntity.class) public class MobEntityMixin { @ModifyArg(method = "convertTo", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;spawnEntity(Lnet/minecraft/entity/Entity;)Z")) 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/mixins/events/entity/PlayerEntityMixin.java index bebab8e0..d719b5f6 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/mixins/events/entity/PlayerEntityMixin.java @@ -16,12 +16,13 @@ package band.kessoku.lib.mixins.events.entity; import band.kessoku.lib.api.events.entity.EntitySleepEvent; -import net.minecraft.entity.player.PlayerEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import net.minecraft.entity.player.PlayerEntity; + @Mixin(PlayerEntity.class) abstract class PlayerEntityMixin { @Inject(method = "canResetTimeBySleeping", at = @At("RETURN"), cancellable = true) 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/mixins/events/entity/PlayerManagerMixin.java index 4f706fd0..e0ce52d5 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/mixins/events/entity/PlayerManagerMixin.java @@ -16,14 +16,15 @@ package band.kessoku.lib.mixins.events.entity; import band.kessoku.lib.api.events.entity.ServerPlayerEvent; -import net.minecraft.entity.Entity; -import net.minecraft.server.PlayerManager; -import net.minecraft.server.network.ServerPlayerEntity; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import net.minecraft.entity.Entity; +import net.minecraft.server.PlayerManager; +import net.minecraft.server.network.ServerPlayerEntity; + @Mixin(PlayerManager.class) abstract class PlayerManagerMixin { @Inject(method = "respawnPlayer", at = @At("TAIL")) 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/mixins/events/entity/ServerPlayerEntityMixin.java index f6f1f78e..26f4c887 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/mixins/events/entity/ServerPlayerEntityMixin.java @@ -15,9 +15,20 @@ */ package band.kessoku.lib.mixins.events.entity; +import java.util.List; + import band.kessoku.lib.api.events.entity.*; import com.llamalad7.mixinextras.sugar.Local; import com.mojang.datafixers.util.Either; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.LivingEntity; @@ -33,16 +44,6 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import java.util.List; @Mixin(ServerPlayerEntity.class) abstract class ServerPlayerEntityMixin extends LivingEntityMixin { 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/mixins/events/entity/elytra/LivingEntityMixin.java index ea7921ea..fe2e48d3 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/mixins/events/entity/elytra/LivingEntityMixin.java @@ -16,15 +16,16 @@ package band.kessoku.lib.mixins.events.entity.elytra; import band.kessoku.lib.api.events.entity.EntityElytraEvent; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.LivingEntity; -import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; +import net.minecraft.world.World; + @SuppressWarnings("unused") @Mixin(LivingEntity.class) abstract class LivingEntityMixin extends Entity { 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/mixins/events/entity/elytra/PlayerEntityMixin.java index 4e1c6242..2b923884 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/mixins/events/entity/elytra/PlayerEntityMixin.java @@ -16,16 +16,17 @@ package band.kessoku.lib.mixins.events.entity.elytra; import band.kessoku.lib.api.events.entity.EntityElytraEvent; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.world.World; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.world.World; + @SuppressWarnings("unused") @Mixin(PlayerEntity.class) abstract class PlayerEntityMixin extends LivingEntity { diff --git a/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/EntrypointMetadata.java b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/EntrypointMetadata.java index fae81674..0cd57cd8 100644 --- a/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/EntrypointMetadata.java +++ b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/EntrypointMetadata.java @@ -1,3 +1,18 @@ +/* + * 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.entrypoint; public interface EntrypointMetadata { 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 bc9d417d..b0f8db4d 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,11 +19,11 @@ import java.nio.file.Path; import java.util.*; +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 band.kessoku.lib.api.platform.ModData; -import band.kessoku.lib.api.platform.ModLoader; import club.someoneice.json.JSON; import club.someoneice.json.node.JsonNode; import club.someoneice.json.node.MapNode; diff --git a/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuMetadata.java b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuMetadata.java index 0a470786..1b4afd5d 100644 --- a/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuMetadata.java +++ b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuMetadata.java @@ -15,6 +15,9 @@ */ package band.kessoku.lib.api.entrypoint; +import java.lang.reflect.InvocationTargetException; +import java.util.*; + import band.kessoku.lib.impl.entrypoint.exceptions.KessokuParseException; import club.someoneice.json.Pair; import club.someoneice.json.api.exception.NodeCastException; @@ -22,9 +25,6 @@ import club.someoneice.json.node.JsonNode; import club.someoneice.json.node.MapNode; -import java.lang.reflect.InvocationTargetException; -import java.util.*; - public record KessokuMetadata(Map> entrypoints, Map languageAdapters, String modid) { public KessokuMetadata(Map> entrypoints, Map languageAdapters, String modid) { diff --git a/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/LanguageAdapter.java b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/LanguageAdapter.java index d998bb25..de547d90 100644 --- a/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/LanguageAdapter.java +++ b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/LanguageAdapter.java @@ -1,8 +1,23 @@ +/* + * 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.entrypoint; +import band.kessoku.lib.api.platform.ModData; import band.kessoku.lib.impl.entrypoint.JavaLanguageAdapter; import band.kessoku.lib.impl.entrypoint.exceptions.LanguageAdapterException; -import band.kessoku.lib.api.platform.ModData; public interface LanguageAdapter { /** diff --git a/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/JavaLanguageAdapter.java b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/JavaLanguageAdapter.java index a1fbb146..d603650c 100644 --- a/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/JavaLanguageAdapter.java +++ b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/JavaLanguageAdapter.java @@ -1,14 +1,29 @@ +/* + * 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.entrypoint; -import band.kessoku.lib.api.entrypoint.LanguageAdapter; -import band.kessoku.lib.impl.entrypoint.exceptions.LanguageAdapterException; -import band.kessoku.lib.api.platform.ModData; - import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; +import band.kessoku.lib.api.entrypoint.LanguageAdapter; +import band.kessoku.lib.api.platform.ModData; +import band.kessoku.lib.impl.entrypoint.exceptions.LanguageAdapterException; + public final class JavaLanguageAdapter implements LanguageAdapter { public static final LanguageAdapter INSTANCE = new JavaLanguageAdapter(); diff --git a/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/KessokuEntrypointException.java b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/KessokuEntrypointException.java index 803a4604..227e06f5 100644 --- a/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/KessokuEntrypointException.java +++ b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/KessokuEntrypointException.java @@ -1,3 +1,18 @@ +/* + * 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.entrypoint.exceptions; import org.jetbrains.annotations.ApiStatus; diff --git a/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/KessokuParseException.java b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/KessokuParseException.java index cd690cff..14d99a50 100644 --- a/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/KessokuParseException.java +++ b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/KessokuParseException.java @@ -1,3 +1,18 @@ +/* + * 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.entrypoint.exceptions; import org.jetbrains.annotations.NotNull; diff --git a/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/LanguageAdapterException.java b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/LanguageAdapterException.java index 73bb673c..e30b1627 100644 --- a/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/LanguageAdapterException.java +++ b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/exceptions/LanguageAdapterException.java @@ -1,3 +1,18 @@ +/* + * 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.entrypoint.exceptions; public final class LanguageAdapterException extends Exception { 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 30776844..010c32ea 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 @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.entrypoint.KessokuEntrypoint; + import net.neoforged.fml.common.Mod; @Mod(KessokuEntrypoint.MOD_ID) diff --git a/event-base/common/src/main/java/band/kessoku/lib/event/api/Event.java b/event-base/common/src/main/java/band/kessoku/lib/event/api/Event.java index a92de160..123d59cd 100644 --- a/event-base/common/src/main/java/band/kessoku/lib/event/api/Event.java +++ b/event-base/common/src/main/java/band/kessoku/lib/event/api/Event.java @@ -15,11 +15,11 @@ */ package band.kessoku.lib.event.api; -import band.kessoku.lib.event.impl.EventImpl; - import java.util.List; import java.util.function.Function; +import band.kessoku.lib.event.impl.EventImpl; + public interface Event { T invoker(); diff --git a/event-base/common/src/main/java/band/kessoku/lib/event/impl/EventImpl.java b/event-base/common/src/main/java/band/kessoku/lib/event/impl/EventImpl.java index efaab66e..ff1f1681 100644 --- a/event-base/common/src/main/java/band/kessoku/lib/event/impl/EventImpl.java +++ b/event-base/common/src/main/java/band/kessoku/lib/event/impl/EventImpl.java @@ -15,15 +15,15 @@ */ package band.kessoku.lib.event.impl; -import band.kessoku.lib.event.api.Event; -import band.kessoku.lib.event.api.EventPhase; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.function.Function; +import band.kessoku.lib.event.api.Event; +import band.kessoku.lib.event.api.EventPhase; + public final class EventImpl implements Event { private final Map> listeners = new HashMap<>(); private final Function, T> invokerFunc; 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/event/KessokuEventBaseEntrypoint.java index 404d82e9..8ec06c22 100644 --- a/event-base/fabric/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.java +++ b/event-base/fabric/src/main/java/band/kessoku/lib/event/KessokuEventBaseEntrypoint.java @@ -16,6 +16,7 @@ package band.kessoku.lib.event; import band.kessoku.lib.impl.base.KessokuUtils; + import net.fabricmc.api.ModInitializer; public final class KessokuEventBaseEntrypoint implements ModInitializer { diff --git a/event-base/neo/src/main/java/band/kessoku/lib/event/api/util/neo/NeoEventUtils.java b/event-base/neo/src/main/java/band/kessoku/lib/event/api/util/neo/NeoEventUtils.java index 10b8f3c0..d62961f9 100644 --- a/event-base/neo/src/main/java/band/kessoku/lib/event/api/util/neo/NeoEventUtils.java +++ b/event-base/neo/src/main/java/band/kessoku/lib/event/api/util/neo/NeoEventUtils.java @@ -15,12 +15,12 @@ */ package band.kessoku.lib.event.api.util.neo; +import java.util.function.Consumer; + import net.neoforged.bus.api.Event; import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.IEventBus; -import java.util.function.Consumer; - public final class NeoEventUtils { private NeoEventUtils() { } 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 8f9d8dce..18fe8ede 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 @@ -1,14 +1,30 @@ +/* + * 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.keybinding.client; +import java.util.Map; +import java.util.Set; + import band.kessoku.lib.impl.base.KessokuUtils; import band.kessoku.lib.impl.keybinding.client.CategoryOrderMap; import band.kessoku.lib.services.keybinding.client.KeyBindingRegisterService; -import net.minecraft.client.option.KeyBinding; -import net.minecraft.client.util.InputUtil; import org.jetbrains.annotations.Nullable; -import java.util.Map; -import java.util.Set; +import net.minecraft.client.option.KeyBinding; +import net.minecraft.client.util.InputUtil; public final class KeyBindingRegister { private KeyBindingRegister() { 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 28090e51..bc9eaf68 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 @@ -1,11 +1,27 @@ +/* + * 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.keybinding.client; +import java.util.HashMap; +import java.util.Map; + import band.kessoku.lib.impl.base.KessokuUtils; -import net.minecraft.text.Text; import org.jetbrains.annotations.ApiStatus; -import java.util.HashMap; -import java.util.Map; +import net.minecraft.text.Text; // RawDiamondMC Note: // Maybe some hacky changes to implement insertAfter and insertBefore? 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/mixins/keybinding/client/KeyBindingMixin.java index b3318536..3e923fb3 100644 --- a/keybinding/common/src/main/java/band/kessoku/lib/mixins/keybinding/client/KeyBindingMixin.java +++ b/keybinding/common/src/main/java/band/kessoku/lib/mixins/keybinding/client/KeyBindingMixin.java @@ -1,15 +1,31 @@ +/* + * 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.mixins.keybinding.client; +import java.util.Collections; +import java.util.Map; +import java.util.function.Consumer; + import band.kessoku.lib.impl.keybinding.client.CategoryOrderMap; -import net.minecraft.client.option.KeyBinding; -import net.minecraft.util.Util; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Redirect; -import java.util.Collections; -import java.util.Map; -import java.util.function.Consumer; +import net.minecraft.client.option.KeyBinding; +import net.minecraft.util.Util; @Mixin(KeyBinding.class) public class KeyBindingMixin { 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/services/keybinding/client/KeyBindingRegisterService.java index 47cf2b7a..248cd1b2 100644 --- a/keybinding/common/src/main/java/band/kessoku/lib/services/keybinding/client/KeyBindingRegisterService.java +++ b/keybinding/common/src/main/java/band/kessoku/lib/services/keybinding/client/KeyBindingRegisterService.java @@ -16,6 +16,7 @@ package band.kessoku.lib.services.keybinding.client; import band.kessoku.lib.impl.base.KessokuUtils; + import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; 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 f73c2c6c..6a04831c 100644 --- a/keybinding/common/src/test/java/kessoku/testmod/keybinding/KessokuTestKeybinding.java +++ b/keybinding/common/src/test/java/kessoku/testmod/keybinding/KessokuTestKeybinding.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; import band.kessoku.lib.services.keybinding.client.KeyBindingRegisterService; + import net.minecraft.client.option.KeyBinding; public class KessokuTestKeybinding implements KessokuModInitializer { diff --git a/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/KessokuKeybindingFabric.java b/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/KessokuKeybindingFabric.java index c6009f4d..3e5c293c 100644 --- a/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/KessokuKeybindingFabric.java +++ b/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/KessokuKeybindingFabric.java @@ -17,6 +17,7 @@ import band.kessoku.lib.impl.base.KessokuUtils; import band.kessoku.lib.impl.keybinding.client.KessokuKeybinding; + import net.fabricmc.api.ClientModInitializer; public final class KessokuKeybindingFabric implements ClientModInitializer { diff --git a/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java b/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java index 5e8cb0f5..2f487d89 100644 --- a/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java +++ b/keybinding/fabric/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java @@ -17,10 +17,12 @@ import band.kessoku.lib.services.keybinding.client.KeyBindingRegisterService; import com.google.auto.service.AutoService; -import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; + import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; +import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper; + @AutoService(KeyBindingRegisterService.class) public final class KeyBindRegisterImpl implements KeyBindingRegisterService { @Override diff --git a/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/KessokuKeyBindEntrypoint.java b/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/KessokuKeyBindEntrypoint.java index 2d5aaec5..4b196d2d 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/KessokuKeyBindEntrypoint.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/KessokuKeyBindEntrypoint.java @@ -18,6 +18,7 @@ import band.kessoku.lib.impl.base.KessokuUtils; 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; import net.neoforged.fml.common.Mod; diff --git a/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java b/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java index 8cbdd82c..52c423a3 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/keybinding/impl/KeyBindRegisterImpl.java @@ -15,19 +15,21 @@ */ package band.kessoku.lib.keybinding.impl; -import band.kessoku.lib.event.api.util.neo.NeoEventUtils; +import java.util.List; + import band.kessoku.lib.api.keybinding.client.KeyBindingRegister; -import band.kessoku.lib.services.keybinding.client.KeyBindingRegisterService; +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 com.google.auto.service.AutoService; import it.unimi.dsi.fastutil.objects.ReferenceArrayList; + import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; + import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.client.event.RegisterKeyMappingsEvent; -import java.util.List; - @AutoService(KeyBindingRegisterService.class) public final class KeyBindRegisterImpl implements KeyBindingRegisterService { private static final List KEY_BINDINGS = new ReferenceArrayList<>(); diff --git a/keybinding/neo/src/main/java/band/kessoku/lib/mixins/keybinding/KeyBindingAccessor.java b/keybinding/neo/src/main/java/band/kessoku/lib/mixins/keybinding/KeyBindingAccessor.java index 17c33136..9b4eec69 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/mixins/keybinding/KeyBindingAccessor.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/mixins/keybinding/KeyBindingAccessor.java @@ -15,12 +15,13 @@ */ package band.kessoku.lib.mixins.keybinding; -import net.minecraft.client.option.KeyBinding; -import net.minecraft.client.util.InputUtil; +import java.util.Map; + import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; -import java.util.Map; +import net.minecraft.client.option.KeyBinding; +import net.minecraft.client.util.InputUtil; @Mixin(KeyBinding.class) public interface KeyBindingAccessor { diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/LifecycleEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/LifecycleEvent.java similarity index 96% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/LifecycleEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/LifecycleEvent.java index 8da71c44..41d896c9 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/LifecycleEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/LifecycleEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api; +package band.kessoku.lib.api.event.lifecycle; import band.kessoku.lib.event.api.Event; + import net.minecraft.registry.DynamicRegistryManager; public class LifecycleEvent { diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerBlockEntityEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerBlockEntityEvent.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerBlockEntityEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerBlockEntityEvent.java index be8f5023..7203cd1f 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerBlockEntityEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerBlockEntityEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api; +package band.kessoku.lib.api.event.lifecycle; import band.kessoku.lib.event.api.Event; + import net.minecraft.block.entity.BlockEntity; import net.minecraft.server.world.ServerWorld; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerChunkEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerChunkEvent.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerChunkEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerChunkEvent.java index 56281165..c9313f14 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerChunkEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerChunkEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api; +package band.kessoku.lib.api.event.lifecycle; import band.kessoku.lib.event.api.Event; + import net.minecraft.server.world.ServerWorld; import net.minecraft.world.chunk.WorldChunk; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerEntityEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerEntityEvent.java similarity index 98% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerEntityEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerEntityEvent.java index 541e7f99..3c71839a 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerEntityEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerEntityEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api; +package band.kessoku.lib.api.event.lifecycle; import band.kessoku.lib.event.api.Event; + import net.minecraft.entity.Entity; import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerLifecycleEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerLifecycleEvent.java similarity index 99% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerLifecycleEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerLifecycleEvent.java index 83855139..ddef5e86 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerLifecycleEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerLifecycleEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api; +package band.kessoku.lib.api.event.lifecycle; import band.kessoku.lib.event.api.Event; + import net.minecraft.resource.LifecycledResourceManager; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerTickEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerTickEvent.java similarity index 98% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerTickEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerTickEvent.java index ff4ff747..83ab8c34 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerTickEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerTickEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api; +package band.kessoku.lib.api.event.lifecycle; import band.kessoku.lib.event.api.Event; + import net.minecraft.server.MinecraftServer; import net.minecraft.server.world.ServerWorld; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerWorldEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerWorldEvent.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerWorldEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerWorldEvent.java index ab56c956..786fd40c 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/ServerWorldEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerWorldEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api; +package band.kessoku.lib.api.event.lifecycle; import band.kessoku.lib.event.api.Event; + import net.minecraft.server.MinecraftServer; import net.minecraft.server.world.ServerWorld; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientBlockEntityEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientBlockEntityEvent.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientBlockEntityEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientBlockEntityEvent.java index 8236ef45..0ef4a1c8 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientBlockEntityEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientBlockEntityEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api.client; +package band.kessoku.lib.api.event.lifecycle.client; import band.kessoku.lib.event.api.Event; + import net.minecraft.block.entity.BlockEntity; import net.minecraft.client.world.ClientWorld; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientChunkEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientChunkEvent.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientChunkEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientChunkEvent.java index 902aa49e..37011043 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientChunkEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientChunkEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api.client; +package band.kessoku.lib.api.event.lifecycle.client; import band.kessoku.lib.event.api.Event; + import net.minecraft.client.world.ClientWorld; import net.minecraft.world.chunk.WorldChunk; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientEntityEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientEntityEvent.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientEntityEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientEntityEvent.java index f7723e72..5fd99be4 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientEntityEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientEntityEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api.client; +package band.kessoku.lib.api.event.lifecycle.client; import band.kessoku.lib.event.api.Event; + import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.Entity; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientLifecycleEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientLifecycleEvent.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientLifecycleEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientLifecycleEvent.java index c86a245b..b47508cc 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientLifecycleEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientLifecycleEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api.client; +package band.kessoku.lib.api.event.lifecycle.client; import band.kessoku.lib.event.api.Event; + import net.minecraft.client.MinecraftClient; public class ClientLifecycleEvent { diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientTickEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientTickEvent.java similarity index 97% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientTickEvent.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientTickEvent.java index 16afe29a..d304cbd9 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/api/client/ClientTickEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientTickEvent.java @@ -13,9 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.api.client; +package band.kessoku.lib.api.event.lifecycle.client; import band.kessoku.lib.event.api.Event; + import net.minecraft.client.MinecraftClient; import net.minecraft.client.world.ClientWorld; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEvents.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEvents.java deleted file mode 100644 index 0f761cb5..00000000 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/KessokuLifecycleEvents.java +++ /dev/null @@ -1,24 +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.events.lifecycle; - -import org.slf4j.Marker; -import org.slf4j.MarkerFactory; - -public class KessokuLifecycleEvents { - public static final String MOD_ID = "kessoku_lifecycle_events"; - public static final Marker MARKER = MarkerFactory.getMarker("[KessokuLifecycleEvents]"); -} diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImpl.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/KessokuLifecycleEvents.java similarity index 78% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImpl.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/KessokuLifecycleEvents.java index 9e6a35ea..2196de13 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/impl/KessokuLifecycleEventsImpl.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/KessokuLifecycleEvents.java @@ -13,19 +13,25 @@ * 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; + +import band.kessoku.lib.api.event.lifecycle.ServerBlockEntityEvent; +import band.kessoku.lib.api.event.lifecycle.ServerChunkEvent; +import band.kessoku.lib.api.event.lifecycle.ServerEntityEvent; +import band.kessoku.lib.api.event.lifecycle.ServerWorldEvent; +import org.slf4j.Marker; +import org.slf4j.MarkerFactory; -import band.kessoku.lib.events.lifecycle.api.ServerBlockEntityEvent; -import band.kessoku.lib.events.lifecycle.api.ServerChunkEvent; -import band.kessoku.lib.events.lifecycle.api.ServerEntityEvent; -import band.kessoku.lib.events.lifecycle.api.ServerWorldEvent; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.Entity; import net.minecraft.world.chunk.WorldChunk; -public class KessokuLifecycleEventsImpl { - public static void clientInit() { +public class KessokuLifecycleEvents { + public static final String MOD_ID = "kessoku_lifecycle_events"; + public static final String NAME = "Kessoku Lifecycle Events API"; + public static final Marker MARKER = MarkerFactory.getMarker("[" + NAME + "]"); + public static void clientInit() { } public static void init() { diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/impl/LoadedChunksCache.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/LoadedChunksCache.java similarity index 95% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/impl/LoadedChunksCache.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/LoadedChunksCache.java index 8a0140ef..bbeeb8c8 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/impl/LoadedChunksCache.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/LoadedChunksCache.java @@ -13,12 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.impl; - -import net.minecraft.world.chunk.WorldChunk; +package band.kessoku.lib.impl.event.lifecycle; import java.util.Set; +import net.minecraft.world.chunk.WorldChunk; + /** * A simple marker interface which holds references to chunks which block entities may be loaded or unloaded from. */ diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/mixin/WorldMixin.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/mixins/lifecycle/WorldMixin.java similarity index 92% rename from lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/mixin/WorldMixin.java rename to lifecycle-events/common/src/main/java/band/kessoku/lib/mixins/lifecycle/WorldMixin.java index 68a19b0c..866c3f43 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/events/lifecycle/mixin/WorldMixin.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/mixins/lifecycle/WorldMixin.java @@ -13,16 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package band.kessoku.lib.events.lifecycle.mixin; +package band.kessoku.lib.mixins.lifecycle; -import band.kessoku.lib.events.lifecycle.impl.LoadedChunksCache; -import net.minecraft.world.World; -import net.minecraft.world.chunk.WorldChunk; +import java.util.HashSet; +import java.util.Set; + +import band.kessoku.lib.impl.event.lifecycle.LoadedChunksCache; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; -import java.util.HashSet; -import java.util.Set; +import net.minecraft.world.World; +import net.minecraft.world.chunk.WorldChunk; @Mixin(World.class) public abstract class WorldMixin implements LoadedChunksCache { 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 index 7c1fc2a6..2608166f 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.events.lifecycle.mixin", + "package": "band.kessoku.lib.mixins.lifecycle", "compatibilityLevel": "JAVA_17", "mixins": [ "WorldMixin" diff --git a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/CommonLifecycleTest.java b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/CommonLifecycleTest.java index 4816ff8b..2dab231f 100644 --- a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/CommonLifecycleTest.java +++ b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/CommonLifecycleTest.java @@ -16,7 +16,7 @@ package kessoku.testmod.lifecycle; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; -import band.kessoku.lib.events.lifecycle.api.LifecycleEvent; +import band.kessoku.lib.api.event.lifecycle.LifecycleEvent; public class CommonLifecycleTest implements KessokuModInitializer { @Override diff --git a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/KessokuTestLifecycle.java b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/KessokuTestLifecycle.java index 0462da61..1cf93910 100644 --- a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/KessokuTestLifecycle.java +++ b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/KessokuTestLifecycle.java @@ -16,7 +16,8 @@ package kessoku.testmod.lifecycle; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; -import band.kessoku.lib.events.lifecycle.api.*; +import band.kessoku.lib.api.event.lifecycle.ServerChunkEvent; +import band.kessoku.lib.api.event.lifecycle.ServerLifecycleEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ResourceReloadTests.java b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ResourceReloadTests.java index 8fbe810d..32e193e3 100644 --- a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ResourceReloadTests.java +++ b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ResourceReloadTests.java @@ -16,7 +16,7 @@ package kessoku.testmod.lifecycle; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; -import band.kessoku.lib.events.lifecycle.api.ServerLifecycleEvent; +import band.kessoku.lib.api.event.lifecycle.ServerLifecycleEvent; public class ResourceReloadTests implements KessokuModInitializer { @Override diff --git a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerBlockEntityTests.java b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerBlockEntityTests.java index a62c9c8a..b0f6fb15 100644 --- a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerBlockEntityTests.java +++ b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerBlockEntityTests.java @@ -19,7 +19,7 @@ import java.util.List; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; -import band.kessoku.lib.events.lifecycle.api.ServerBlockEntityEvent; +import band.kessoku.lib.api.event.lifecycle.ServerBlockEntityEvent; import net.minecraft.block.entity.BlockEntity; import net.minecraft.registry.Registries; diff --git a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerEntityTests.java b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerEntityTests.java index 9940350e..8caa2af8 100644 --- a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerEntityTests.java +++ b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerEntityTests.java @@ -19,7 +19,7 @@ import java.util.List; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; -import band.kessoku.lib.events.lifecycle.api.ServerEntityEvent; +import band.kessoku.lib.api.event.lifecycle.ServerEntityEvent; import net.minecraft.entity.Entity; diff --git a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerTickTests.java b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerTickTests.java index ef1fdf04..90ba360d 100644 --- a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerTickTests.java +++ b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/ServerTickTests.java @@ -19,7 +19,7 @@ import java.util.Map; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; -import band.kessoku.lib.events.lifecycle.api.ServerTickEvent; +import band.kessoku.lib.api.event.lifecycle.ServerTickEvent; import net.minecraft.registry.RegistryKey; import net.minecraft.world.World; diff --git a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/client/ClientBlockEntityTests.java b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/client/ClientBlockEntityTests.java index d9604132..4b5b183c 100644 --- a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/client/ClientBlockEntityTests.java +++ b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/client/ClientBlockEntityTests.java @@ -16,7 +16,7 @@ package kessoku.testmod.lifecycle.client; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuClientModInitializer; -import band.kessoku.lib.events.lifecycle.api.client.ClientBlockEntityEvent; +import band.kessoku.lib.api.event.lifecycle.client.ClientBlockEntityEvent; public class ClientBlockEntityTests implements KessokuClientModInitializer { @Override diff --git a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/client/ClientChunkTests.java b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/client/ClientChunkTests.java index dca38454..575d892d 100644 --- a/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/client/ClientChunkTests.java +++ b/lifecycle-events/common/src/test/java/kessoku/testmod/lifecycle/client/ClientChunkTests.java @@ -16,7 +16,7 @@ package kessoku.testmod.lifecycle.client; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuClientModInitializer; -import band.kessoku.lib.events.lifecycle.api.client.ClientChunkEvent; +import band.kessoku.lib.api.event.lifecycle.client.ClientChunkEvent; public class ClientChunkTests implements KessokuClientModInitializer { @Override 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/events/lifecycle/KessokuLifecycleEventsEntrypoint.java index 3d31adb3..3dfd3770 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/events/lifecycle/KessokuLifecycleEventsEntrypoint.java @@ -15,8 +15,10 @@ */ package band.kessoku.lib.events.lifecycle; -import band.kessoku.lib.impl.base.KessokuUtils; import band.kessoku.lib.events.lifecycle.impl.KessokuLifecycleEventsImplFabric; +import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.impl.event.lifecycle.KessokuLifecycleEvents; + import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.ModInitializer; 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/events/lifecycle/impl/KessokuLifecycleEventsImplFabric.java index f08462a7..7d442f6c 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/events/lifecycle/impl/KessokuLifecycleEventsImplFabric.java @@ -15,14 +15,16 @@ */ package band.kessoku.lib.events.lifecycle.impl; -import band.kessoku.lib.events.lifecycle.api.*; -import band.kessoku.lib.events.lifecycle.api.client.*; +import band.kessoku.lib.api.event.lifecycle.*; +import band.kessoku.lib.api.event.lifecycle.client.*; +import band.kessoku.lib.impl.event.lifecycle.KessokuLifecycleEvents; + import net.fabricmc.fabric.api.client.event.lifecycle.v1.*; import net.fabricmc.fabric.api.event.lifecycle.v1.*; public class KessokuLifecycleEventsImplFabric { public static void registerClientEvents() { - KessokuLifecycleEventsImpl.clientInit(); + KessokuLifecycleEvents.clientInit(); ClientLifecycleEvents.CLIENT_STARTED.register(client -> ClientLifecycleEvent.STARTED.invoker().onClientStarted(client)); ClientLifecycleEvents.CLIENT_STOPPING.register(client -> ClientLifecycleEvent.STOPPING.invoker().onClientStopping(client)); @@ -43,7 +45,7 @@ public static void registerClientEvents() { } public static void registerCommonEvents() { - KessokuLifecycleEventsImpl.init(); + KessokuLifecycleEvents.init(); CommonLifecycleEvents.TAGS_LOADED.register((registries, client) -> LifecycleEvent.TAG_LOADED.invoker().onTagsLoaded(registries, client)); 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/events/lifecycle/KessokuLifecycleEventsEntrypoint.java index fe6eeaf0..744e4826 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/events/lifecycle/KessokuLifecycleEventsEntrypoint.java @@ -15,8 +15,10 @@ */ package band.kessoku.lib.events.lifecycle; -import band.kessoku.lib.impl.base.KessokuUtils; import band.kessoku.lib.events.lifecycle.impl.KessokuLifecycleEventsImplNeo; +import band.kessoku.lib.impl.base.KessokuUtils; +import band.kessoku.lib.impl.event.lifecycle.KessokuLifecycleEvents; + import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.ModContainer; import net.neoforged.fml.common.Mod; 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/events/lifecycle/impl/KessokuLifecycleEventsImplNeo.java index 2d39f51a..f9dcf0cc 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/events/lifecycle/impl/KessokuLifecycleEventsImplNeo.java @@ -15,14 +15,17 @@ */ package band.kessoku.lib.events.lifecycle.impl; +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.events.lifecycle.api.*; -import band.kessoku.lib.events.lifecycle.api.client.ClientChunkEvent; +import band.kessoku.lib.impl.event.lifecycle.KessokuLifecycleEvents; + import net.minecraft.client.MinecraftClient; import net.minecraft.client.world.ClientWorld; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; import net.minecraft.world.chunk.WorldChunk; + import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.client.event.ClientTickEvent; import net.neoforged.neoforge.event.OnDatapackSyncEvent; @@ -38,7 +41,7 @@ public class KessokuLifecycleEventsImplNeo { public static void registerClientEvents(IEventBus forgeEventBus) { - KessokuLifecycleEventsImpl.clientInit(); + KessokuLifecycleEvents.clientInit(); NeoEventUtils.registerEvent(forgeEventBus, ChunkEvent.Load.class, event -> { if (event.getLevel() instanceof ClientWorld world && event.getChunk() instanceof WorldChunk chunk) { @@ -52,26 +55,26 @@ public static void registerClientEvents(IEventBus forgeEventBus) { }); NeoEventUtils.registerEvent(forgeEventBus, ClientTickEvent.Pre.class, event -> { - band.kessoku.lib.events.lifecycle.api.client.ClientTickEvent.START_CLIENT_TICK.invoker().onStartTick(MinecraftClient.getInstance()); + band.kessoku.lib.api.event.lifecycle.client.ClientTickEvent.START_CLIENT_TICK.invoker().onStartTick(MinecraftClient.getInstance()); }); NeoEventUtils.registerEvent(forgeEventBus, ClientTickEvent.Post.class, event -> { - band.kessoku.lib.events.lifecycle.api.client.ClientTickEvent.END_CLIENT_TICK.invoker().onEndTick(MinecraftClient.getInstance()); + band.kessoku.lib.api.event.lifecycle.client.ClientTickEvent.END_CLIENT_TICK.invoker().onEndTick(MinecraftClient.getInstance()); }); NeoEventUtils.registerEvent(forgeEventBus, LevelTickEvent.Pre.class, event -> { if (event.getLevel() instanceof ClientWorld world) { - band.kessoku.lib.events.lifecycle.api.client.ClientTickEvent.START_WORLD_TICK.invoker().onStartTick(world); + band.kessoku.lib.api.event.lifecycle.client.ClientTickEvent.START_WORLD_TICK.invoker().onStartTick(world); } }); NeoEventUtils.registerEvent(forgeEventBus, LevelTickEvent.Post.class, event -> { if (event.getLevel() instanceof ClientWorld world) { - band.kessoku.lib.events.lifecycle.api.client.ClientTickEvent.END_WORLD_TICK.invoker().onEndTick(world); + band.kessoku.lib.api.event.lifecycle.client.ClientTickEvent.END_WORLD_TICK.invoker().onEndTick(world); } }); } public static void registerCommonEvents(IEventBus forgeEventBus) { - KessokuLifecycleEventsImpl.init(); + KessokuLifecycleEvents.init(); NeoEventUtils.registerEvent(forgeEventBus, TagsUpdatedEvent.class, event -> { LifecycleEvent.TAG_LOADED.invoker().onTagsLoaded(event.getRegistryAccess(), event.getUpdateCause() == TagsUpdatedEvent.UpdateCause.CLIENT_PACKET_RECEIVED); 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/events/lifecycle/mixin/neo/MinecraftServerMixin.java index 4d736c41..1fbf46bd 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/events/lifecycle/mixin/neo/MinecraftServerMixin.java @@ -15,16 +15,17 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo; -import band.kessoku.lib.events.lifecycle.api.ServerLifecycleEvent; -import net.minecraft.server.MinecraftServer; +import java.util.Collection; +import java.util.concurrent.CompletableFuture; + +import band.kessoku.lib.api.event.lifecycle.ServerLifecycleEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import java.util.Collection; -import java.util.concurrent.CompletableFuture; +import net.minecraft.server.MinecraftServer; @Mixin(MinecraftServer.class) public abstract class MinecraftServerMixin { 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/events/lifecycle/mixin/neo/ServerEntityHandlerMixin.java index c7de6c17..744a195f 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/events/lifecycle/mixin/neo/ServerEntityHandlerMixin.java @@ -15,9 +15,7 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo; -import band.kessoku.lib.events.lifecycle.api.ServerEntityEvent; -import net.minecraft.entity.Entity; -import net.minecraft.server.world.ServerWorld; +import band.kessoku.lib.api.event.lifecycle.ServerEntityEvent; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -25,6 +23,9 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import net.minecraft.entity.Entity; +import net.minecraft.server.world.ServerWorld; + @Mixin(targets = "net/minecraft/server/world/ServerWorld$ServerEntityHandler") public class ServerEntityHandlerMixin { // final synthetic Lnet/minecraft/server/world/ServerWorld; field_26936 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/events/lifecycle/mixin/neo/ServerWorldMixin.java index 2689b8ce..b0ca800f 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/events/lifecycle/mixin/neo/ServerWorldMixin.java @@ -15,15 +15,16 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo; -import band.kessoku.lib.events.lifecycle.api.ServerTickEvent; -import net.minecraft.server.world.ServerWorld; +import java.util.function.BooleanSupplier; + +import band.kessoku.lib.api.event.lifecycle.ServerTickEvent; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.function.BooleanSupplier; +import net.minecraft.server.world.ServerWorld; @Mixin(ServerWorld.class) public abstract class ServerWorldMixin { 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/events/lifecycle/mixin/neo/client/ClientChunkManagerMixin.java index bc38d367..8609ac53 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/events/lifecycle/mixin/neo/client/ClientChunkManagerMixin.java @@ -15,14 +15,9 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo.client; -import band.kessoku.lib.events.lifecycle.api.client.ClientChunkEvent; -import net.minecraft.client.world.ClientChunkManager; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.s2c.play.ChunkData; -import net.minecraft.util.math.ChunkPos; -import net.minecraft.world.chunk.WorldChunk; +import java.util.function.Consumer; + +import band.kessoku.lib.api.event.lifecycle.client.ClientChunkEvent; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -32,7 +27,13 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -import java.util.function.Consumer; +import net.minecraft.client.world.ClientChunkManager; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.s2c.play.ChunkData; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.world.chunk.WorldChunk; @Mixin(ClientChunkManager.class) public abstract class ClientChunkManagerMixin { 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/events/lifecycle/mixin/neo/client/ClientEntityHandlerMixin.java index 86012919..844eecb0 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/events/lifecycle/mixin/neo/client/ClientEntityHandlerMixin.java @@ -15,9 +15,7 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo.client; -import band.kessoku.lib.events.lifecycle.api.client.ClientEntityEvent; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.entity.Entity; +import band.kessoku.lib.api.event.lifecycle.client.ClientEntityEvent; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -25,6 +23,9 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.Entity; + @Mixin(targets = "net/minecraft/client/world/ClientWorld$ClientEntityHandler") public class ClientEntityHandlerMixin { // final synthetic Lnet/minecraft/client/world/ClientWorld; field_27735 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/events/lifecycle/mixin/neo/client/ClientPlayNetworkHandlerMixin.java index f3007179..885120e6 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/events/lifecycle/mixin/neo/client/ClientPlayNetworkHandlerMixin.java @@ -15,9 +15,15 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo.client; -import band.kessoku.lib.events.lifecycle.api.client.ClientBlockEntityEvent; -import band.kessoku.lib.events.lifecycle.api.client.ClientEntityEvent; -import band.kessoku.lib.events.lifecycle.impl.LoadedChunksCache; +import band.kessoku.lib.api.event.lifecycle.client.ClientBlockEntityEvent; +import band.kessoku.lib.api.event.lifecycle.client.ClientEntityEvent; +import band.kessoku.lib.impl.event.lifecycle.LoadedChunksCache; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + import net.minecraft.block.entity.BlockEntity; import net.minecraft.client.network.ClientPlayNetworkHandler; import net.minecraft.client.world.ClientWorld; @@ -25,11 +31,6 @@ import net.minecraft.network.packet.s2c.play.GameJoinS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerRespawnS2CPacket; import net.minecraft.world.chunk.WorldChunk; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ClientPlayNetworkHandler.class) abstract class ClientPlayNetworkHandlerMixin { 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/events/lifecycle/mixin/neo/client/MinecraftClientMixin.java index 5a726575..a47574ad 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/events/lifecycle/mixin/neo/client/MinecraftClientMixin.java @@ -15,13 +15,14 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo.client; -import band.kessoku.lib.events.lifecycle.api.client.ClientLifecycleEvent; -import net.minecraft.client.MinecraftClient; +import band.kessoku.lib.api.event.lifecycle.client.ClientLifecycleEvent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import net.minecraft.client.MinecraftClient; + @Mixin(MinecraftClient.class) public abstract class MinecraftClientMixin { @Inject(at = @At(value = "INVOKE", target = "Lorg/slf4j/Logger;info(Ljava/lang/String;)V", shift = At.Shift.AFTER, remap = false), method = "stop") 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/events/lifecycle/mixin/neo/client/WorldChunkMixin.java index f259450f..cf859e80 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/events/lifecycle/mixin/neo/client/WorldChunkMixin.java @@ -15,15 +15,11 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo.client; -import band.kessoku.lib.events.lifecycle.api.ServerBlockEntityEvent; -import band.kessoku.lib.events.lifecycle.api.client.ClientBlockEntityEvent; +import java.util.Map; + +import band.kessoku.lib.api.event.lifecycle.ServerBlockEntityEvent; +import band.kessoku.lib.api.event.lifecycle.client.ClientBlockEntityEvent; import com.llamalad7.mixinextras.sugar.Local; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.client.world.ClientWorld; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraft.world.chunk.WorldChunk; import org.jetbrains.annotations.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; @@ -35,7 +31,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -import java.util.Map; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.WorldChunk; @Mixin(WorldChunk.class) abstract class WorldChunkMixin { 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/events/lifecycle/mixin/neo/server/WorldChunkMixin.java index 89e7101e..fc448a6f 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/events/lifecycle/mixin/neo/server/WorldChunkMixin.java @@ -15,13 +15,10 @@ */ package band.kessoku.lib.events.lifecycle.mixin.neo.server; -import band.kessoku.lib.events.lifecycle.api.ServerBlockEntityEvent; +import java.util.Map; + +import band.kessoku.lib.api.event.lifecycle.ServerBlockEntityEvent; import com.llamalad7.mixinextras.sugar.Local; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraft.world.chunk.WorldChunk; import org.jetbrains.annotations.Nullable; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; @@ -33,7 +30,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -import java.util.Map; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; +import net.minecraft.world.chunk.WorldChunk; /** * This is a server only mixin for good reason: 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 30cc5e97..4320e74f 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 @@ -1,10 +1,25 @@ +/* + * 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.platform; -import band.kessoku.lib.services.platform.ModLoaderService; - import java.nio.file.Path; import java.util.Collection; +import band.kessoku.lib.services.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/services/platform/ModLoaderService.java index d26f4c8f..2ec63ed2 100644 --- a/platform/common/src/main/java/band/kessoku/lib/services/platform/ModLoaderService.java +++ b/platform/common/src/main/java/band/kessoku/lib/services/platform/ModLoaderService.java @@ -15,13 +15,13 @@ */ package band.kessoku.lib.services.platform; -import band.kessoku.lib.impl.base.KessokuUtils; -import band.kessoku.lib.api.platform.Env; -import band.kessoku.lib.api.platform.ModData; - import java.nio.file.Path; import java.util.Collection; +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); diff --git a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/KessokuPlatformFabric.java b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/KessokuPlatformFabric.java index 33c185f4..2ff617f2 100644 --- a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/KessokuPlatformFabric.java +++ b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/KessokuPlatformFabric.java @@ -17,7 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.platform.KessokuPlatform; -import band.kessoku.lib.impl.base.KessokuUtils; + import net.fabricmc.api.ModInitializer; public final class KessokuPlatformFabric implements ModInitializer { diff --git a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModDataImpl.java b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModDataImpl.java index eb3b9783..0d855670 100644 --- a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModDataImpl.java +++ b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModDataImpl.java @@ -15,19 +15,20 @@ */ package band.kessoku.lib.impl.platform.fabric; +import java.nio.file.Path; +import java.util.Collection; +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + import band.kessoku.lib.api.platform.ModData; import band.kessoku.lib.api.platform.ModDependencyInfo; + import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.metadata.ModMetadata; import net.fabricmc.loader.api.metadata.Person; -import java.nio.file.Path; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - public final class ModDataImpl implements ModData { private final ModContainer modContainer; private final ModMetadata modMetadata; diff --git a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModDependencyInfoImpl.java b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModDependencyInfoImpl.java index 03f46f51..8590b719 100644 --- a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModDependencyInfoImpl.java +++ b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/ModDependencyInfoImpl.java @@ -16,6 +16,7 @@ package band.kessoku.lib.impl.platform.fabric; import band.kessoku.lib.api.platform.ModDependencyInfo; + import net.fabricmc.loader.api.metadata.ModDependency; public final class ModDependencyInfoImpl implements ModDependencyInfo { 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 0efc8ba1..ce7a7b7b 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 @@ -15,20 +15,21 @@ */ package band.kessoku.lib.impl.platform.fabric; +import java.nio.file.Path; +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import band.kessoku.lib.api.platform.Env; import band.kessoku.lib.api.platform.ModData; import band.kessoku.lib.services.platform.ModLoaderService; import com.google.auto.service.AutoService; + import net.fabricmc.api.EnvType; import net.fabricmc.loader.api.FabricLoader; import net.fabricmc.loader.api.ModContainer; import net.fabricmc.loader.api.metadata.ModMetadata; -import java.nio.file.Path; -import java.util.Collection; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - @AutoService(ModLoaderService.class) public final class ModLoaderImpl implements ModLoaderService { private final Map modDataMap = new ConcurrentHashMap<>(); diff --git a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/KessokuPlatformNeoforge.java b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/KessokuPlatformNeoforge.java index c38678bf..581477c8 100644 --- a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/KessokuPlatformNeoforge.java +++ b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/KessokuPlatformNeoforge.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.platform.KessokuPlatform; + import net.neoforged.fml.common.Mod; @Mod(KessokuPlatform.MOD_ID) diff --git a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModDataImpl.java b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModDataImpl.java index 3c3e2754..3b8038c8 100644 --- a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModDataImpl.java +++ b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModDataImpl.java @@ -15,21 +15,22 @@ */ package band.kessoku.lib.impl.platform.neoforge; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Optional; + import band.kessoku.lib.api.platform.ModData; import band.kessoku.lib.api.platform.ModDependencyInfo; + import net.neoforged.fml.ModContainer; import net.neoforged.fml.ModList; import net.neoforged.fml.loading.moddiscovery.ModFileInfo; import net.neoforged.neoforgespi.language.IModFileInfo; import net.neoforged.neoforgespi.language.IModInfo; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Optional; - public final class ModDataImpl implements ModData { private final ModContainer modContainer; private final IModInfo modInfo; diff --git a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModDependencyInfoImpl.java b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModDependencyInfoImpl.java index 008d7996..c7913199 100644 --- a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModDependencyInfoImpl.java +++ b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/ModDependencyInfoImpl.java @@ -16,6 +16,7 @@ package band.kessoku.lib.impl.platform.neoforge; import band.kessoku.lib.api.platform.ModDependencyInfo; + import net.neoforged.neoforgespi.language.IModInfo; public final class ModDependencyInfoImpl implements ModDependencyInfo { 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 9474b64e..2fa00dc3 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 @@ -15,20 +15,21 @@ */ package band.kessoku.lib.impl.platform.neoforge; +import java.nio.file.Path; +import java.util.Collection; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + import band.kessoku.lib.api.platform.Env; import band.kessoku.lib.api.platform.ModData; import band.kessoku.lib.services.platform.ModLoaderService; import com.google.auto.service.AutoService; + import net.neoforged.fml.ModList; import net.neoforged.fml.loading.FMLLoader; import net.neoforged.fml.loading.FMLPaths; import net.neoforged.neoforgespi.language.IModInfo; -import java.nio.file.Path; -import java.util.Collection; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - @AutoService(ModLoaderService.class) public final class ModLoaderImpl implements ModLoaderService { private final Map modDataMap = new ConcurrentHashMap<>(); diff --git a/registry/common/src/main/java/band/kessoku/lib/api/registry/FuelRegistry.java b/registry/common/src/main/java/band/kessoku/lib/api/registry/FuelRegistry.java index 31b63d95..af9b2354 100644 --- a/registry/common/src/main/java/band/kessoku/lib/api/registry/FuelRegistry.java +++ b/registry/common/src/main/java/band/kessoku/lib/api/registry/FuelRegistry.java @@ -15,8 +15,15 @@ */ package band.kessoku.lib.api.registry; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + import it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenHashMap; import it.unimi.dsi.fastutil.objects.Object2IntMap; +import org.jetbrains.annotations.ApiStatus; +import org.jetbrains.annotations.NotNull; + import net.minecraft.block.AbstractFurnaceBlock; import net.minecraft.block.entity.AbstractFurnaceBlockEntity; import net.minecraft.block.entity.BlockEntity; @@ -29,12 +36,6 @@ import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.registry.tag.TagKey; import net.minecraft.util.math.BlockPos; -import org.jetbrains.annotations.ApiStatus; -import org.jetbrains.annotations.NotNull; - -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; /** * Poor compatibility in Fabric 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 00f17201..65b81b0b 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 @@ -1,6 +1,22 @@ +/* + * 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.registry; import band.kessoku.lib.services.RegistryService; + import net.minecraft.block.AbstractBlock; import net.minecraft.block.Block; import net.minecraft.item.BlockItem; diff --git a/registry/common/src/main/java/band/kessoku/lib/services/RegistryService.java b/registry/common/src/main/java/band/kessoku/lib/services/RegistryService.java index 624468ab..9dacae91 100644 --- a/registry/common/src/main/java/band/kessoku/lib/services/RegistryService.java +++ b/registry/common/src/main/java/band/kessoku/lib/services/RegistryService.java @@ -16,6 +16,7 @@ package band.kessoku.lib.services; import band.kessoku.lib.impl.base.KessokuUtils; + import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; diff --git a/registry/fabric/src/main/java/band/kessoku/lib/impl/registry/fabric/KessokuRegistryFabric.java b/registry/fabric/src/main/java/band/kessoku/lib/impl/registry/fabric/KessokuRegistryFabric.java index 7c3a605b..f0fbd2e8 100644 --- a/registry/fabric/src/main/java/band/kessoku/lib/impl/registry/fabric/KessokuRegistryFabric.java +++ b/registry/fabric/src/main/java/band/kessoku/lib/impl/registry/fabric/KessokuRegistryFabric.java @@ -17,6 +17,7 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.registry.KessokuRegistry; + import net.fabricmc.api.ModInitializer; public final class KessokuRegistryFabric implements ModInitializer { 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 6473e43d..45f4fb71 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 @@ -17,6 +17,7 @@ import band.kessoku.lib.services.RegistryService; import com.google.auto.service.AutoService; + import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; 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/mixins/registry/fabric/AbstractFurnaceBlockEntityMixin.java index 5ae41e4d..a961e3f7 100644 --- a/registry/fabric/src/main/java/band/kessoku/lib/mixins/registry/fabric/AbstractFurnaceBlockEntityMixin.java +++ b/registry/fabric/src/main/java/band/kessoku/lib/mixins/registry/fabric/AbstractFurnaceBlockEntityMixin.java @@ -18,6 +18,12 @@ import band.kessoku.lib.api.registry.FuelRegistry; import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + import net.minecraft.block.BlockState; import net.minecraft.block.entity.AbstractFurnaceBlockEntity; import net.minecraft.block.entity.BlockEntityType; @@ -25,11 +31,6 @@ import net.minecraft.recipe.AbstractCookingRecipe; import net.minecraft.recipe.RecipeType; import net.minecraft.util.math.BlockPos; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(AbstractFurnaceBlockEntity.class) public final class AbstractFurnaceBlockEntityMixin { diff --git a/registry/neo/build.gradle b/registry/neo/build.gradle index 4fd06591..ba618453 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 = rootProject.name + "-registry" +base.archivesName = "kessoku-registry" loom { accessWidenerPath = project(":registry-common").loom.accessWidenerPath 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 a28edad6..a6ff1d31 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 @@ -15,20 +15,22 @@ */ package band.kessoku.lib.impl.registry.neoforge; +import java.util.Objects; + +import band.kessoku.lib.api.registry.FuelRegistry; import band.kessoku.lib.api.registry.KessokuRegistry; -import band.kessoku.lib.impl.base.KessokuUtils; import band.kessoku.lib.event.api.util.neo.NeoEventUtils; -import band.kessoku.lib.api.registry.FuelRegistry; +import band.kessoku.lib.impl.base.KessokuUtils; + import net.minecraft.item.ItemStack; import net.minecraft.recipe.RecipeType; + import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.furnace.FurnaceFuelBurnTimeEvent; import net.neoforged.neoforge.registries.RegisterEvent; -import java.util.Objects; - @Mod(KessokuRegistry.MOD_ID) public final class KessokuRegistryNeoforge { public KessokuRegistryNeoforge(IEventBus modEventBus) { 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 46e7f786..652b4e7a 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 @@ -15,17 +15,19 @@ */ package band.kessoku.lib.impl.registry.neoforge; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.ConcurrentHashMap; + import band.kessoku.lib.services.RegistryService; import com.google.auto.service.AutoService; import com.google.common.collect.Maps; +import org.jetbrains.annotations.ApiStatus; + import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; -import net.neoforged.neoforge.registries.RegisterEvent; -import org.jetbrains.annotations.ApiStatus; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; +import net.neoforged.neoforge.registries.RegisterEvent; @AutoService(RegistryService.class) @SuppressWarnings({"unchecked", "rawtypes"}) diff --git a/wrapper/fabric/build.gradle b/wrapper/fabric/build.gradle index fba7110e..a53e1f71 100644 --- a/wrapper/fabric/build.gradle +++ b/wrapper/fabric/build.gradle @@ -2,10 +2,19 @@ import net.fabricmc.loom.util.ModPlatform apply from: rootProject.file("gradle/scripts/klib-fabric.gradle") -group = "band.kessoku.lib" base.archivesName = rootProject.name -var modules = ["base", "event-base", "lifecycle-events", "platform", "registry"] +var modules = ["base", + "command", + "config", + "data", + "entity-events", + "entrypoint", + "event-base", + "keybinding", + "lifecycle-events", + "platform", + "registry"] kessoku { moduleIncludes(modules, ModPlatform.FABRIC.id()) diff --git a/wrapper/neo/build.gradle b/wrapper/neo/build.gradle index 698f7850..a97f7848 100644 --- a/wrapper/neo/build.gradle +++ b/wrapper/neo/build.gradle @@ -1,9 +1,18 @@ apply from: rootProject.file("gradle/scripts/klib-neo.gradle") -group = "band.kessoku.lib" base.archivesName = rootProject.name -var modules = ["base", "event-base", "lifecycle-events", "platform", "registry"] +var modules = ["base", + "command", + "config", + "data", + "entity-events", + "entrypoint", + "event-base", + "keybinding", + "lifecycle-events", + "platform", + "registry"] kessoku { moduleIncludes(modules, "neo")