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 7eeabc58..fc946c32 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 @@ -15,14 +15,17 @@ */ package band.kessoku.lib.api; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.*; - import org.jetbrains.annotations.UnmodifiableView; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.ServiceLoader; + public final class KessokuLib { private static final List> initializedModules = new ArrayList<>(); diff --git a/base/common/src/main/java/band/kessoku/lib/api/base/KessokuUtils.java b/base/common/src/main/java/band/kessoku/lib/api/base/KessokuUtils.java index d05cbb5e..a54495b0 100644 --- a/base/common/src/main/java/band/kessoku/lib/api/base/KessokuUtils.java +++ b/base/common/src/main/java/band/kessoku/lib/api/base/KessokuUtils.java @@ -15,11 +15,14 @@ */ package band.kessoku.lib.api.base; -import java.lang.reflect.Constructor; -import java.util.*; - import org.jetbrains.annotations.NotNull; +import java.lang.reflect.Constructor; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + 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 4b940120..07101e99 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,7 +17,6 @@ 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/api/base/neoforge/NeoEventUtils.java b/base/neo/src/main/java/band/kessoku/lib/api/base/neoforge/NeoEventUtils.java index 067012a0..efd975b3 100644 --- a/base/neo/src/main/java/band/kessoku/lib/api/base/neoforge/NeoEventUtils.java +++ b/base/neo/src/main/java/band/kessoku/lib/api/base/neoforge/NeoEventUtils.java @@ -15,12 +15,12 @@ */ package band.kessoku.lib.api.base.neoforge; -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/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 19d9f773..f9ddf137 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,7 +17,6 @@ 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/command/common/src/main/java/band/kessoku/lib/api/event/command/ClientCommandRegistryEvent.java b/command/common/src/main/java/band/kessoku/lib/api/event/command/ClientCommandRegistryEvent.java index ab0ff13d..0005f62d 100644 --- a/command/common/src/main/java/band/kessoku/lib/api/event/command/ClientCommandRegistryEvent.java +++ b/command/common/src/main/java/band/kessoku/lib/api/event/command/ClientCommandRegistryEvent.java @@ -18,9 +18,8 @@ import band.kessoku.lib.api.util.command.ClientCommandSourceExtension; import band.kessoku.lib.event.api.Event; import com.mojang.brigadier.CommandDispatcher; -import org.jetbrains.annotations.ApiStatus; - import net.minecraft.command.CommandRegistryAccess; +import org.jetbrains.annotations.ApiStatus; @ApiStatus.NonExtendable public interface ClientCommandRegistryEvent { diff --git a/command/common/src/main/java/band/kessoku/lib/api/event/command/CommandRegistryEvent.java b/command/common/src/main/java/band/kessoku/lib/api/event/command/CommandRegistryEvent.java index ca36d488..fad5d08b 100644 --- a/command/common/src/main/java/band/kessoku/lib/api/event/command/CommandRegistryEvent.java +++ b/command/common/src/main/java/band/kessoku/lib/api/event/command/CommandRegistryEvent.java @@ -17,11 +17,10 @@ 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/main/java/band/kessoku/lib/api/util/command/ClientCommandUtils.java b/command/common/src/main/java/band/kessoku/lib/api/util/command/ClientCommandUtils.java index 19c1ee92..bcab38f7 100644 --- a/command/common/src/main/java/band/kessoku/lib/api/util/command/ClientCommandUtils.java +++ b/command/common/src/main/java/band/kessoku/lib/api/util/command/ClientCommandUtils.java @@ -15,10 +15,6 @@ */ package band.kessoku.lib.api.util.command; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.command.KessokuCommand; import band.kessoku.lib.mixin.command.HelpCommandAccessor; @@ -34,11 +30,14 @@ import com.mojang.brigadier.exceptions.CommandExceptionType; import com.mojang.brigadier.exceptions.CommandSyntaxException; import com.mojang.brigadier.tree.CommandNode; -import org.jetbrains.annotations.Nullable; - import net.minecraft.client.MinecraftClient; import net.minecraft.text.Text; import net.minecraft.text.Texts; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; public final class ClientCommandUtils { private static @Nullable CommandDispatcher activeDispatcher; diff --git a/command/common/src/main/java/band/kessoku/lib/mixin/command/HelpCommandAccessor.java b/command/common/src/main/java/band/kessoku/lib/mixin/command/HelpCommandAccessor.java index 75ed0bd1..52a54999 100644 --- a/command/common/src/main/java/band/kessoku/lib/mixin/command/HelpCommandAccessor.java +++ b/command/common/src/main/java/band/kessoku/lib/mixin/command/HelpCommandAccessor.java @@ -16,11 +16,10 @@ package band.kessoku.lib.mixin.command; import com.mojang.brigadier.exceptions.SimpleCommandExceptionType; +import net.minecraft.server.command.HelpCommand; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; -import net.minecraft.server.command.HelpCommand; - @Mixin(HelpCommand.class) public interface HelpCommandAccessor { @Accessor("FAILED_EXCEPTION") 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 62189cce..217afe62 100644 --- a/command/common/src/test/java/kessoku/testmod/command/KessokuTestCommand.java +++ b/command/common/src/test/java/kessoku/testmod/command/KessokuTestCommand.java @@ -17,7 +17,6 @@ import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; import band.kessoku.lib.api.event.command.CommandRegistryEvent; - import net.minecraft.server.command.CommandManager; import net.minecraft.text.Text; diff --git a/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandFabric.java b/command/fabric/src/main/java/band/kessoku/lib/impl/command/fabric/KessokuCommandFabric.java index f7e83482..f8284248 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,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.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 edb66ce8..d07176b2 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 @@ -19,7 +19,6 @@ import band.kessoku.lib.api.event.command.CommandRegistryEvent; import band.kessoku.lib.api.util.command.ClientCommandSourceExtension; import com.mojang.brigadier.CommandDispatcher; - import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback; diff --git a/command/fabric/src/main/java/band/kessoku/lib/mixin/command/fabric/FabricClientCommandSourceMixin.java b/command/fabric/src/main/java/band/kessoku/lib/mixin/command/fabric/FabricClientCommandSourceMixin.java index 095af300..6848ef55 100644 --- a/command/fabric/src/main/java/band/kessoku/lib/mixin/command/fabric/FabricClientCommandSourceMixin.java +++ b/command/fabric/src/main/java/band/kessoku/lib/mixin/command/fabric/FabricClientCommandSourceMixin.java @@ -16,8 +16,7 @@ package band.kessoku.lib.mixin.command.fabric; import band.kessoku.lib.api.util.command.ClientCommandSourceExtension; -import org.spongepowered.asm.mixin.Mixin; - +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.world.ClientWorld; @@ -25,8 +24,7 @@ import net.minecraft.text.Text; import net.minecraft.util.math.Vec2f; import net.minecraft.util.math.Vec3d; - -import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; +import org.spongepowered.asm.mixin.Mixin; @Mixin(FabricClientCommandSource.class) public interface FabricClientCommandSourceMixin extends ClientCommandSourceExtension { 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 e448dbfe..bba64cb3 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 @@ -20,7 +20,6 @@ import band.kessoku.lib.api.event.command.CommandRegistryEvent; import band.kessoku.lib.api.util.command.ClientCommandSourceExtension; import com.mojang.brigadier.CommandDispatcher; - import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.client.event.RegisterClientCommandsEvent; 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 7bd2571b..68315b52 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,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.command.KessokuCommand; - import net.neoforged.fml.common.Mod; import net.neoforged.fml.loading.FMLLoader; import net.neoforged.neoforge.common.NeoForge; diff --git a/command/neo/src/main/java/band/kessoku/lib/mixin/command/neoforge/ClientCommandSourceMixin.java b/command/neo/src/main/java/band/kessoku/lib/mixin/command/neoforge/ClientCommandSourceMixin.java index 0e7a64bc..ecda8308 100644 --- a/command/neo/src/main/java/band/kessoku/lib/mixin/command/neoforge/ClientCommandSourceMixin.java +++ b/command/neo/src/main/java/band/kessoku/lib/mixin/command/neoforge/ClientCommandSourceMixin.java @@ -16,16 +16,15 @@ package band.kessoku.lib.mixin.command.neoforge; import band.kessoku.lib.api.util.command.ClientCommandSourceExtension; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - import net.minecraft.client.MinecraftClient; import net.minecraft.client.network.ClientCommandSource; import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.world.ClientWorld; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; @Mixin(ClientCommandSource.class) abstract class ClientCommandSourceMixin implements ClientCommandSourceExtension { 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 d3e35313..4bdf1f0f 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,17 +15,6 @@ */ package band.kessoku.lib.api.config; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import java.util.*; -import java.util.function.BiConsumer; -import java.util.function.Consumer; - import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.base.reflect.ModifiersUtil; import band.kessoku.lib.api.base.reflect.ReflectUtil; @@ -38,6 +27,17 @@ 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; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.nio.charset.StandardCharsets; +import java.nio.file.Path; +import java.util.*; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + @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/ConfigValue.java b/config/common/src/main/java/band/kessoku/lib/api/config/ConfigValue.java index 0a7f28fb..32f82095 100644 --- a/config/common/src/main/java/band/kessoku/lib/api/config/ConfigValue.java +++ b/config/common/src/main/java/band/kessoku/lib/api/config/ConfigValue.java @@ -55,7 +55,8 @@ public static Type asType(Object o) { case Float ignored -> FLOAT; case Double ignored -> DOUBLE; - /* AmarokIce Note: + /* + AmarokIce Note: try catch 对性能会造成额外影响。此处 throw 后在 { @code AbstractConfig } 中捕获是无意义的。 因此,改用 NULL 作为空置对象。 */ 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 33b167d2..23c94ce2 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,11 +15,6 @@ */ 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; @@ -27,6 +22,11 @@ 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 76920690..1ebb710b 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 0d8be82e..94af3ca4 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,8 +15,6 @@ */ 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; @@ -25,6 +23,8 @@ 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 f4ad88b8..4db8345e 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 2e0b35cf..193820a0 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 cc3f8f76..133f7675 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 java.util.function.Supplier; - import band.kessoku.lib.api.config.ConfigValue; +import java.util.function.Supplier; + 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 84714e41..5b375664 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 07c5909b..819fa024 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 b2f81974..d5c0a2d3 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 43ed0d08..3e1492a8 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 4418a959..c61dcb05 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 c937ccae..ae24a01a 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 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; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.function.Supplier; + 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 8d0ff915..d2973437 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 0212b577..6609eeee 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,7 +17,6 @@ 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 7c5043d1..b589afcc 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,7 +17,6 @@ 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/impl/data/BaseData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/BaseData.java index 9db0f77a..53a4aa00 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 @@ -15,11 +15,11 @@ */ 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/base/ByteData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/base/ByteData.java index 830390d9..e59342f6 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 @@ -17,7 +17,6 @@ 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 d8091a44..7391dcd2 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 @@ -17,7 +17,6 @@ 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 ca2d4afb..75884620 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 @@ -17,7 +17,6 @@ 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 25b3fe22..ff59c2bf 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 @@ -17,7 +17,6 @@ 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 1866e19f..c63792bc 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 @@ -17,7 +17,6 @@ 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 b0063f13..bd3906dd 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 @@ -17,7 +17,6 @@ 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 b812f75e..5fc45b61 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 @@ -17,7 +17,6 @@ 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 f294eb87..43c24581 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 @@ -17,7 +17,6 @@ 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 31ea8d75..c1b94a30 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 @@ -17,7 +17,6 @@ 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 39bcd0b4..59a2ef9c 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 @@ -15,15 +15,14 @@ */ 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/DefaultedListData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/DefaultedListData.java index 8bdd3086..0804716f 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 @@ -15,11 +15,11 @@ */ 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/ListData.java b/data/common/src/main/java/band/kessoku/lib/impl/data/collection/ListData.java index 5481cf9b..c27ab3bc 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 @@ -15,13 +15,13 @@ */ 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/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 443bd49a..90e6ff55 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 @@ -17,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.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 c37265be..a949e794 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 @@ -17,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.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/event/entity/EntityElytraEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntityElytraEvent.java index 86473085..2268300f 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntityElytraEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntityElytraEvent.java @@ -17,9 +17,8 @@ import band.kessoku.lib.api.event.entity.item.KessokuElytraItem; import band.kessoku.lib.event.api.Event; -import org.jetbrains.annotations.ApiStatus; - import net.minecraft.entity.LivingEntity; +import org.jetbrains.annotations.ApiStatus; /** * 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/event/entity/EntitySleepEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntitySleepEvent.java index b6456327..78bab80c 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntitySleepEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/EntitySleepEvent.java @@ -16,9 +16,6 @@ package band.kessoku.lib.api.event.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; @@ -26,6 +23,8 @@ 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/event/entity/KessokuEntityEvents.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/KessokuEntityEvents.java index 1c80bc4d..5bf35969 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/KessokuEntityEvents.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/KessokuEntityEvents.java @@ -16,11 +16,10 @@ package band.kessoku.lib.api.event.entity; import band.kessoku.lib.api.event.entity.item.KessokuElytraItem; -import org.slf4j.Marker; -import org.slf4j.MarkerFactory; - import net.minecraft.entity.EquipmentSlot; import net.minecraft.item.ItemStack; +import org.slf4j.Marker; +import org.slf4j.MarkerFactory; public final class KessokuEntityEvents { public static final String MOD_ID = "kessoku_entity_events"; diff --git a/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityCombatEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityCombatEvent.java index 7dbd04a1..4c45083f 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityCombatEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerEntityCombatEvent.java @@ -16,11 +16,10 @@ package band.kessoku.lib.api.event.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/event/entity/ServerPlayerEvent.java b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerPlayerEvent.java index 002db24e..a2967b35 100644 --- a/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerPlayerEvent.java +++ b/entity-events/common/src/main/java/band/kessoku/lib/api/event/entity/ServerPlayerEvent.java @@ -16,9 +16,8 @@ package band.kessoku.lib.api.event.entity; import band.kessoku.lib.event.api.Event; -import org.jetbrains.annotations.ApiStatus; - import net.minecraft.server.network.ServerPlayerEntity; +import org.jetbrains.annotations.ApiStatus; @ApiStatus.NonExtendable public interface ServerPlayerEvent { diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/impl/event/entity/KessokuEntityEventsNeoforge.java b/entity-events/neo/src/main/java/band/kessoku/lib/impl/event/entity/KessokuEntityEventsNeoforge.java index d2edcb68..a49aa7f7 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/impl/event/entity/KessokuEntityEventsNeoforge.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/impl/event/entity/KessokuEntityEventsNeoforge.java @@ -21,12 +21,10 @@ import band.kessoku.lib.api.event.entity.KessokuEntityEvents; import band.kessoku.lib.api.event.entity.ServerLivingEntityEvent; import band.kessoku.lib.api.event.entity.ServerPlayerEvent; - import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.player.PlayerEntity; 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/mixin/event/entity/EntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/EntityMixin.java index d95c13c3..ba56d8f2 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/EntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/EntityMixin.java @@ -15,21 +15,20 @@ */ package band.kessoku.lib.mixin.event.entity; -import java.util.Set; - import band.kessoku.lib.api.event.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 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 java.util.Set; @Mixin(Entity.class) abstract class EntityMixin { diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/IItemExtensionMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/IItemExtensionMixin.java index 93dca60b..1405b415 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/IItemExtensionMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/IItemExtensionMixin.java @@ -16,16 +16,14 @@ package band.kessoku.lib.mixin.event.entity; import band.kessoku.lib.api.event.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/mixin/event/entity/LivingEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/LivingEntityMixin.java index 2d5e1495..1ee2c1b3 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/LivingEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/LivingEntityMixin.java @@ -15,25 +15,12 @@ */ package band.kessoku.lib.mixin.event.entity; -import java.util.Optional; - import band.kessoku.lib.api.event.entity.EntitySleepEvent; import band.kessoku.lib.api.event.entity.ServerEntityCombatEvent; import band.kessoku.lib.api.event.entity.ServerLivingEntityEvent; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; import com.llamalad7.mixinextras.sugar.Local; -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; @@ -49,6 +36,18 @@ 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/mixin/event/entity/MobEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/MobEntityMixin.java index 66435c6a..e2002ffc 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/MobEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/MobEntityMixin.java @@ -17,13 +17,12 @@ import band.kessoku.lib.api.event.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/mixin/event/entity/PlayerEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerEntityMixin.java index c6625b49..d35ee1c5 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerEntityMixin.java @@ -16,13 +16,12 @@ package band.kessoku.lib.mixin.event.entity; import band.kessoku.lib.api.event.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/mixin/event/entity/PlayerManagerMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerManagerMixin.java index df146c29..13b39f3b 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerManagerMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/PlayerManagerMixin.java @@ -16,15 +16,14 @@ package band.kessoku.lib.mixin.event.entity; import band.kessoku.lib.api.event.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/mixin/event/entity/ServerPlayerEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/ServerPlayerEntityMixin.java index 78c2c25d..dc709135 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/ServerPlayerEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/ServerPlayerEntityMixin.java @@ -15,20 +15,9 @@ */ package band.kessoku.lib.mixin.event.entity; -import java.util.List; - import band.kessoku.lib.api.event.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; @@ -44,6 +33,16 @@ 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/mixin/event/entity/elytra/LivingEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/LivingEntityMixin.java index 56688e93..56f2d1c8 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/LivingEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/LivingEntityMixin.java @@ -16,15 +16,14 @@ package band.kessoku.lib.mixin.event.entity.elytra; import band.kessoku.lib.api.event.entity.EntityElytraEvent; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -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; +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; @SuppressWarnings("unused") @Mixin(LivingEntity.class) diff --git a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/PlayerEntityMixin.java b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/PlayerEntityMixin.java index 9b3d1ac8..86e810ea 100644 --- a/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/PlayerEntityMixin.java +++ b/entity-events/neo/src/main/java/band/kessoku/lib/mixin/event/entity/elytra/PlayerEntityMixin.java @@ -16,17 +16,16 @@ package band.kessoku.lib.mixin.event.entity.elytra; import band.kessoku.lib.api.event.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/KessokuEntrypoint.java b/entrypoint/common/src/main/java/band/kessoku/lib/api/entrypoint/KessokuEntrypoint.java index 53822f91..2b57dafb 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 @@ -15,12 +15,6 @@ */ package band.kessoku.lib.api.entrypoint; -import java.io.IOException; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.*; -import java.util.function.Consumer; - import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuPreLaunchEntrypoint; import band.kessoku.lib.api.platform.Loader; @@ -33,6 +27,12 @@ import org.slf4j.Marker; import org.slf4j.MarkerFactory; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; +import java.util.function.Consumer; + public final class KessokuEntrypoint { private KessokuEntrypoint() { } 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 e76f0246..559f26df 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,15 +15,15 @@ */ 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.node.ArrayNode; 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/impl/entrypoint/JavaLanguageAdapter.java b/entrypoint/common/src/main/java/band/kessoku/lib/impl/entrypoint/JavaLanguageAdapter.java index f28571c4..2cc7748a 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 @@ -15,15 +15,15 @@ */ package band.kessoku.lib.impl.entrypoint; +import band.kessoku.lib.api.entrypoint.LanguageAdapter; +import band.kessoku.lib.api.platform.Metadata; +import band.kessoku.lib.impl.entrypoint.exceptions.LanguageAdapterException; + 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.Metadata; -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/fabric/src/main/java/band/kessoku/lib/impl/entrypoint/fabric/KessokuEntrypointFabric.java b/entrypoint/fabric/src/main/java/band/kessoku/lib/impl/entrypoint/fabric/KessokuEntrypointFabric.java index a2cd4b32..59b491ef 100644 --- a/entrypoint/fabric/src/main/java/band/kessoku/lib/impl/entrypoint/fabric/KessokuEntrypointFabric.java +++ b/entrypoint/fabric/src/main/java/band/kessoku/lib/impl/entrypoint/fabric/KessokuEntrypointFabric.java @@ -21,7 +21,6 @@ import band.kessoku.lib.api.entrypoint.entrypoints.KessokuClientModInitializer; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuDedicatedServerModInitializer; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; - import net.fabricmc.api.ClientModInitializer; import net.fabricmc.api.DedicatedServerModInitializer; import net.fabricmc.api.ModInitializer; 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 44474dcf..b4d34210 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 @@ -19,7 +19,6 @@ import band.kessoku.lib.api.entrypoint.entrypoints.KessokuClientModInitializer; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuDedicatedServerModInitializer; import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; - import net.neoforged.api.distmarker.Dist; import net.neoforged.fml.common.Mod; diff --git a/entrypoint/neo/src/main/java/band/kessoku/lib/mixin/entrypoint/neoforge/FMLLoaderMixin.java b/entrypoint/neo/src/main/java/band/kessoku/lib/mixin/entrypoint/neoforge/FMLLoaderMixin.java index 3c63e600..ba684018 100644 --- a/entrypoint/neo/src/main/java/band/kessoku/lib/mixin/entrypoint/neoforge/FMLLoaderMixin.java +++ b/entrypoint/neo/src/main/java/band/kessoku/lib/mixin/entrypoint/neoforge/FMLLoaderMixin.java @@ -17,13 +17,12 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.entrypoint.KessokuEntrypoint; +import net.neoforged.fml.loading.FMLLoader; 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.neoforged.fml.loading.FMLLoader; - @Mixin(FMLLoader.class) public class FMLLoaderMixin { @Inject(method = "beforeStart", at = @At("HEAD")) 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 123d59cd..a92de160 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 ff1f1681..efaab66e 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/impl/event/fabric/KessokuEventBaseFabric.java b/event-base/fabric/src/main/java/band/kessoku/lib/impl/event/fabric/KessokuEventBaseFabric.java index 18881f19..82329b6d 100644 --- a/event-base/fabric/src/main/java/band/kessoku/lib/impl/event/fabric/KessokuEventBaseFabric.java +++ b/event-base/fabric/src/main/java/band/kessoku/lib/impl/event/fabric/KessokuEventBaseFabric.java @@ -17,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.event.api.KessokuEventBase; - import net.fabricmc.api.ModInitializer; public final class KessokuEventBaseFabric implements ModInitializer { diff --git a/event-base/neo/src/main/java/band/kessoku/lib/impl/event/neoforge/KessokuEventBaseNeoforge.java b/event-base/neo/src/main/java/band/kessoku/lib/impl/event/neoforge/KessokuEventBaseNeoforge.java index d889595f..a936aa03 100644 --- a/event-base/neo/src/main/java/band/kessoku/lib/impl/event/neoforge/KessokuEventBaseNeoforge.java +++ b/event-base/neo/src/main/java/band/kessoku/lib/impl/event/neoforge/KessokuEventBaseNeoforge.java @@ -17,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.event.api.KessokuEventBase; - import net.neoforged.fml.common.Mod; @Mod(KessokuEventBase.MOD_ID) 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 3681b5d9..f2ff46d1 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 @@ -15,16 +15,15 @@ */ package band.kessoku.lib.api.keybinding.client; -import java.util.Map; -import java.util.Set; - import band.kessoku.lib.api.base.KessokuUtils; import band.kessoku.lib.impl.keybinding.client.CategoryOrderMap; import band.kessoku.lib.service.keybinding.client.KeyBindingRegisterService; -import org.jetbrains.annotations.Nullable; - 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; 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 c5ca4646..c0ff2f77 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 @@ -15,13 +15,12 @@ */ package band.kessoku.lib.impl.keybinding.client; -import java.util.HashMap; -import java.util.Map; - import band.kessoku.lib.api.KessokuLib; +import net.minecraft.text.Text; import org.jetbrains.annotations.ApiStatus; -import net.minecraft.text.Text; +import java.util.HashMap; +import java.util.Map; // RawDiamondMC Note: // Maybe some hacky changes to implement insertAfter and insertBefore? diff --git a/keybinding/common/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingMixin.java b/keybinding/common/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingMixin.java index 52961710..4c57e2c0 100644 --- a/keybinding/common/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingMixin.java +++ b/keybinding/common/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingMixin.java @@ -15,17 +15,16 @@ */ package band.kessoku.lib.mixin.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 net.minecraft.client.option.KeyBinding; -import net.minecraft.util.Util; +import java.util.Collections; +import java.util.Map; +import java.util.function.Consumer; @Mixin(KeyBinding.class) public class KeyBindingMixin { diff --git a/keybinding/common/src/main/java/band/kessoku/lib/service/keybinding/client/KeyBindingRegisterService.java b/keybinding/common/src/main/java/band/kessoku/lib/service/keybinding/client/KeyBindingRegisterService.java index 9a237883..a01b722d 100644 --- a/keybinding/common/src/main/java/band/kessoku/lib/service/keybinding/client/KeyBindingRegisterService.java +++ b/keybinding/common/src/main/java/band/kessoku/lib/service/keybinding/client/KeyBindingRegisterService.java @@ -16,7 +16,6 @@ package band.kessoku.lib.service.keybinding.client; import band.kessoku.lib.api.KessokuLib; - 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 890c47c9..1e02ba7a 100644 --- a/keybinding/common/src/test/java/kessoku/testmod/keybinding/KessokuTestKeybinding.java +++ b/keybinding/common/src/test/java/kessoku/testmod/keybinding/KessokuTestKeybinding.java @@ -17,7 +17,6 @@ import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; import band.kessoku.lib.service.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/impl/keybinding/fabric/KessokuKeyBindingFabric.java b/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KessokuKeyBindingFabric.java index 97a329b2..deade0ee 100644 --- a/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KessokuKeyBindingFabric.java +++ b/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KessokuKeyBindingFabric.java @@ -17,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.impl.keybinding.client.KessokuKeybinding; - import net.fabricmc.api.ClientModInitializer; public final class KessokuKeyBindingFabric implements ClientModInitializer { diff --git a/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KeyBindingRegisterImpl.java b/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KeyBindingRegisterImpl.java index 6e5565f2..4dc2e757 100644 --- a/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KeyBindingRegisterImpl.java +++ b/keybinding/fabric/src/main/java/band/kessoku/lib/impl/keybinding/fabric/KeyBindingRegisterImpl.java @@ -17,12 +17,10 @@ import band.kessoku.lib.service.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 KeyBindingRegisterImpl implements KeyBindingRegisterService { @Override diff --git a/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KessokuKeyBindingNeoforge.java b/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KessokuKeyBindingNeoforge.java index f5e20f5e..24a5582e 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KessokuKeyBindingNeoforge.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KessokuKeyBindingNeoforge.java @@ -17,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.impl.keybinding.client.KessokuKeybinding; - 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/impl/keybinding/neoforge/KeyBindingRegisterImpl.java b/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KeyBindingRegisterImpl.java index 669351bc..5682826d 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KeyBindingRegisterImpl.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/impl/keybinding/neoforge/KeyBindingRegisterImpl.java @@ -15,21 +15,19 @@ */ package band.kessoku.lib.impl.keybinding.neoforge; -import java.util.List; - import band.kessoku.lib.api.base.neoforge.NeoEventUtils; import band.kessoku.lib.api.keybinding.client.KeyBindingRegister; import band.kessoku.lib.mixin.keybinding.client.KeyBindingAccessor; import band.kessoku.lib.service.keybinding.client.KeyBindingRegisterService; import com.google.auto.service.AutoService; import it.unimi.dsi.fastutil.objects.ReferenceArrayList; - 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 KeyBindingRegisterImpl implements KeyBindingRegisterService { private static final List KEY_BINDINGS = new ReferenceArrayList<>(); diff --git a/keybinding/neo/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingAccessor.java b/keybinding/neo/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingAccessor.java index 3c47fcb8..bbef8c1b 100644 --- a/keybinding/neo/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingAccessor.java +++ b/keybinding/neo/src/main/java/band/kessoku/lib/mixin/keybinding/client/KeyBindingAccessor.java @@ -15,11 +15,10 @@ */ package band.kessoku.lib.mixin.keybinding.client; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.gen.Accessor; - import net.minecraft.client.option.KeyBinding; import net.minecraft.client.util.InputUtil; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.gen.Accessor; @Mixin(KeyBinding.class) public interface KeyBindingAccessor { diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/LifecycleEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/LifecycleEvent.java index 41d896c9..f3cf6b3d 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/LifecycleEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/LifecycleEvent.java @@ -16,7 +16,6 @@ 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/api/event/lifecycle/ServerBlockEntityEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerBlockEntityEvent.java index 7203cd1f..89d65439 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerBlockEntityEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerBlockEntityEvent.java @@ -16,14 +16,13 @@ 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; public class ServerBlockEntityEvent { /** - * Called when an BlockEntity is loaded into a ServerWorld. + * Called when an {@link BlockEntity} is loaded into a {@link ServerWorld}. * *

When this is event is called, the block entity is already in the world. * However, its data might not be loaded yet, so don't rely on it. @@ -35,7 +34,7 @@ public class ServerBlockEntityEvent { }); /** - * Called when an BlockEntity is about to be unloaded from a ServerWorld. + * Called when an {@link BlockEntity} is about to be unloaded from a {@link ServerWorld}. * *

When this event is called, the block entity is still present on the world. */ diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerChunkEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerChunkEvent.java index c9313f14..a2d386a5 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerChunkEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerChunkEvent.java @@ -16,14 +16,14 @@ 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.Chunk; import net.minecraft.world.chunk.WorldChunk; public class ServerChunkEvent { /** - * Called when a chunk is loaded into a ServerWorld. + * Called when a {@link Chunk} is loaded into a {@link ServerWorld}. * *

When this event is called, the chunk is already in the world. */ @@ -34,7 +34,7 @@ public class ServerChunkEvent { }); /** - * Called when a chunk is unloaded from a ServerWorld. + * Called when a {@link Chunk} is unloaded from a {@link ServerWorld}. * *

When this event is called, the chunk is still present in the world. */ diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerEntityEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerEntityEvent.java index 3c71839a..c79e3cdf 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerEntityEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerEntityEvent.java @@ -16,7 +16,6 @@ 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; @@ -25,7 +24,7 @@ public class ServerEntityEvent { /** - * Called when an Entity is loaded into a ServerWorld. + * Called when an {@link Entity} is loaded into a {@link ServerWorld}. * *

When this event is called, the entity is already in the world. */ @@ -36,7 +35,7 @@ public class ServerEntityEvent { }); /** - * Called when an Entity is unloaded from a ServerWorld. + * Called when an {@link Entity} is unloaded from a {@link ServerWorld}. * *

This event is called before the entity is removed from the world. */ diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerLifecycleEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerLifecycleEvent.java index ddef5e86..758627e2 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerLifecycleEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerLifecycleEvent.java @@ -16,26 +16,28 @@ 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; +// TODO - Is anyone remember the Dedicated-Server's starting event? + public class ServerLifecycleEvent { /** - * Called when a Minecraft server is starting. + * This event will fire when Logical-Server is starting. * *

This occurs before the {@link net.minecraft.server.PlayerManager player manager} and any worlds are loaded. */ public static final Event STARTING = Event.of(startings -> server -> { for (Server.Starting serverStarting : startings) { serverStarting.onServerStarting(server); + } }); /** - * Called when a Minecraft server has started and is about to tick for the first time. + * This event will fire when a Logical-Server has started and is about to tick for the first time. * *

At this stage, all worlds are live. */ @@ -46,7 +48,7 @@ public class ServerLifecycleEvent { }); /** - * Called when a Minecraft server has started shutting down. + * This event will fire when a Logical-Server has started shutting down. * This occurs before the server's network channel is closed and before any players are disconnected. * *

For example, an integrated server will begin stopping, but its client may continue to run. @@ -60,11 +62,11 @@ public class ServerLifecycleEvent { }); /** - * Called when a Minecraft server has stopped. + * This event will fire when a Logical-Server has stopped. * All worlds have been closed and all (block)entities and players have been unloaded. * *

For example, an {@link net.fabricmc.api.EnvType#CLIENT integrated server} will begin stopping, but its client may continue to run. - * Meanwhile, for a {@link net.fabricmc.api.EnvType#SERVER dedicated server}, this will be the last event called. + * Meanwhile, for a {@link net.fabricmc.api.EnvType#SERVER dedicated server}, this will be the last event This event will fire. */ public static final Event STOPPED = Event.of(stoppeds -> server -> { for (Server.Stopped serverStopped : stoppeds) { @@ -73,7 +75,7 @@ public class ServerLifecycleEvent { }); /** - * Called when a Minecraft server is about to send tag and recipe data to a player. + * This event will fire when the Dedicated-Server is about to send tag and recipe data to a player. * @see Datapack.SyncContents */ public static final Event SYNC_DATA_PACK_CONTENTS = Event.of(syncContents -> (player, joined) -> { @@ -83,7 +85,7 @@ public class ServerLifecycleEvent { }); /** - * Called before a Minecraft server reloads data packs. + * This event will fire before the Dedicated-Server reloads data packs. */ public static final Event START_DATA_PACK_RELOAD = Event.of(startReloads -> (server, serverResourceManager) -> { for (Datapack.StartReload startDataPackReload : startReloads) { @@ -92,7 +94,7 @@ public class ServerLifecycleEvent { }); /** - * Called after a Minecraft server has reloaded data packs. + * This event fired after the Dedicated-Server has reloaded data packs. * *

If reloading data packs was unsuccessful, the current data packs will be kept. */ @@ -103,7 +105,7 @@ public class ServerLifecycleEvent { }); /** - * Called before a Minecraft server begins saving data. + * This event will fire before a Logical-Server begins saving data. */ public static final Event BEFORE_SAVE = Event.of(befores -> (server, flush, force) -> { for (SaveData.Before beforeSaveData : befores) { @@ -112,7 +114,7 @@ public class ServerLifecycleEvent { }); /** - * Called after a Minecraft server finishes saving data. + * This event will fire after a Logical-Server finishes saving data. */ public static final Event AFTER_SAVE = Event.of(afters -> (server, flush, force) -> { for (SaveData.After afterSaveData : afters) { @@ -146,9 +148,9 @@ public interface Datapack { @FunctionalInterface interface SyncContents { /** - * Called right before tags and recipes are sent to a player, + * This event will fire before tags and recipes are sent to a player, * either because the player joined, or because the server reloaded resources. - * The {@linkplain MinecraftServer#getResourceManager() server resource manager} is up-to-date when this is called. + * The {@linkplain MinecraftServer#getResourceManager() server resource manager} is up-to-date when this is This event will fire. * *

For example, this event can be used to sync data loaded with custom resource reloaders. * @@ -166,7 +168,7 @@ interface StartReload { @FunctionalInterface interface EndReload { /** - * Called after data packs on a Minecraft server have been reloaded. + * This event will fire after data packs on a Minecraft server have been reloaded. * *

If the reload was not successful, the old data packs will be kept. * @@ -182,7 +184,7 @@ public interface SaveData { @FunctionalInterface interface Before { /** - * Called before a Minecraft server begins saving data. + * This event will fire before a Logical-Server begins saving data. * * @param server the server * @param flush is true when all chunks are being written to disk, server will likely freeze during this time @@ -194,7 +196,7 @@ interface Before { @FunctionalInterface interface After { /** - * Called after a Minecraft server begins saving data. + * This event will fire after a Logical-Server begins saving data. * * @param server the server * @param flush is true when all chunks are being written to disk, server will likely freeze during this time diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerTickEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerTickEvent.java index 83ab8c34..c8355a2d 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerTickEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerTickEvent.java @@ -16,7 +16,6 @@ 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/api/event/lifecycle/ServerWorldEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerWorldEvent.java index 786fd40c..b7e25ff5 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerWorldEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/ServerWorldEvent.java @@ -16,14 +16,13 @@ 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; public class ServerWorldEvent { /** - * Called just after a world is loaded by a Minecraft server. + * Called just after a world is loaded by a Logical-Server. * *

This can be used to load world specific metadata or initialize a {@link net.minecraft.world.PersistentState} on a server world. */ @@ -34,7 +33,7 @@ public class ServerWorldEvent { }); /** - * Called before a world is unloaded by a Minecraft server. + * Called before a world is unloaded by a Logical-Server. * *

This typically occurs after a server has {@link ServerLifecycleEvent#STOPPING started shutting down}. * Mods which allow dynamic world (un)registration should call this event so mods can let go of world handles when a world is removed. diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientBlockEntityEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientBlockEntityEvent.java index 0ef4a1c8..847ed4a8 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientBlockEntityEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientBlockEntityEvent.java @@ -16,14 +16,13 @@ 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; public class ClientBlockEntityEvent { /** - * Called when a BlockEntity is loaded into a ClientWorld. + * Called when a {@link BlockEntity} is loaded into a {@link ClientWorld}. * *

When this event is called, the block entity is already in the world. * However, its data might not be loaded yet, so don't rely on it. @@ -35,7 +34,7 @@ public class ClientBlockEntityEvent { }); /** - * Called when a BlockEntity is about to be unloaded from a ClientWorld. + * Called when a {@link BlockEntity} is about to be unloaded from a {@link ClientWorld}. * *

When this event is called, the block entity is still present on the world. */ diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientChunkEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientChunkEvent.java index 37011043..9d137300 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientChunkEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientChunkEvent.java @@ -16,14 +16,14 @@ 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.Chunk; import net.minecraft.world.chunk.WorldChunk; public class ClientChunkEvent { /** - * Called when a chunk is loaded into a ClientWorld. + * Called when a {@link Chunk} is loaded into a {@link ClientWorld}. * *

When this event is called, the chunk is already in the world. */ @@ -34,7 +34,7 @@ public class ClientChunkEvent { }); /** - * Called when a chunk is about to be unloaded from a ClientWorld. + * Called when a {@link Chunk} is about to be unloaded from a {@link ClientWorld}. * *

When this event is called, the chunk is still present in the world. */ diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientEntityEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientEntityEvent.java index 5fd99be4..f279cf77 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientEntityEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientEntityEvent.java @@ -16,14 +16,13 @@ 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; public class ClientEntityEvent { /** - * Called when an Entity is loaded into a ClientWorld. + * Called when an {@link Entity} is loaded into a {@link ClientWorld}. * *

When this event is called, the chunk is already in the world. */ @@ -34,7 +33,7 @@ public class ClientEntityEvent { }); /** - * Called when an Entity is about to be unloaded from a ClientWorld. + * Called when an {@link Entity} is about to be unloaded from a {@link ClientWorld}. * *

This event is called before the entity is unloaded from the world. */ diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientLifecycleEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientLifecycleEvent.java index b47508cc..8acd3701 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientLifecycleEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientLifecycleEvent.java @@ -16,7 +16,6 @@ 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/api/event/lifecycle/client/ClientTickEvent.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientTickEvent.java index d304cbd9..6c580283 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientTickEvent.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/api/event/lifecycle/client/ClientTickEvent.java @@ -16,7 +16,6 @@ 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/impl/event/lifecycle/KessokuLifecycleEvents.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/KessokuLifecycleEvents.java index 2196de13..c01259b7 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/KessokuLifecycleEvents.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/KessokuLifecycleEvents.java @@ -19,12 +19,11 @@ 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 net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.Entity; import net.minecraft.world.chunk.WorldChunk; +import org.slf4j.Marker; +import org.slf4j.MarkerFactory; public class KessokuLifecycleEvents { public static final String MOD_ID = "kessoku_lifecycle_events"; diff --git a/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/LoadedChunksCache.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/LoadedChunksCache.java index bbeeb8c8..25cea804 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/LoadedChunksCache.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/impl/event/lifecycle/LoadedChunksCache.java @@ -15,10 +15,10 @@ */ package band.kessoku.lib.impl.event.lifecycle; -import java.util.Set; - import net.minecraft.world.chunk.WorldChunk; +import java.util.Set; + /** * 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/mixin/lifecycle/WorldMixin.java b/lifecycle-events/common/src/main/java/band/kessoku/lib/mixin/lifecycle/WorldMixin.java index 8adcacb6..d3cb3d9f 100644 --- a/lifecycle-events/common/src/main/java/band/kessoku/lib/mixin/lifecycle/WorldMixin.java +++ b/lifecycle-events/common/src/main/java/band/kessoku/lib/mixin/lifecycle/WorldMixin.java @@ -15,15 +15,14 @@ */ package band.kessoku.lib.mixin.lifecycle; -import java.util.HashSet; -import java.util.Set; - import band.kessoku.lib.impl.event.lifecycle.LoadedChunksCache; +import net.minecraft.world.World; +import net.minecraft.world.chunk.WorldChunk; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; -import net.minecraft.world.World; -import net.minecraft.world.chunk.WorldChunk; +import java.util.HashSet; +import java.util.Set; @Mixin(World.class) public abstract class WorldMixin implements LoadedChunksCache { 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 b0f6fb15..c2760073 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 @@ -15,15 +15,14 @@ */ package kessoku.testmod.lifecycle; -import java.util.ArrayList; -import java.util.List; - import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; import band.kessoku.lib.api.event.lifecycle.ServerBlockEntityEvent; - import net.minecraft.block.entity.BlockEntity; import net.minecraft.registry.Registries; +import java.util.ArrayList; +import java.util.List; + public class ServerBlockEntityTests implements KessokuModInitializer { private final List serverBlockEntities = new ArrayList<>(); 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 8caa2af8..87cacd2e 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 @@ -15,14 +15,13 @@ */ package kessoku.testmod.lifecycle; -import java.util.ArrayList; -import java.util.List; - import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; import band.kessoku.lib.api.event.lifecycle.ServerEntityEvent; - import net.minecraft.entity.Entity; +import java.util.ArrayList; +import java.util.List; + public class ServerEntityTests implements KessokuModInitializer { private final List serverEntities = new ArrayList<>(); 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 90ba360d..eee7270c 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 @@ -15,15 +15,14 @@ */ package kessoku.testmod.lifecycle; -import java.util.HashMap; -import java.util.Map; - import band.kessoku.lib.api.entrypoint.entrypoints.KessokuModInitializer; import band.kessoku.lib.api.event.lifecycle.ServerTickEvent; - import net.minecraft.registry.RegistryKey; import net.minecraft.world.World; +import java.util.HashMap; +import java.util.Map; + public class ServerTickTests implements KessokuModInitializer { private final Map, Integer> tickTracker = new HashMap<>(); diff --git a/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsFabric.java b/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsFabric.java index dd872426..7bedb616 100644 --- a/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsFabric.java +++ b/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsFabric.java @@ -17,7 +17,6 @@ import band.kessoku.lib.api.KessokuLib; 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/impl/event/lifecycle/fabric/KessokuLifecycleEventsImplFabric.java b/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsImplFabric.java index 0e939fa9..7b31b0eb 100644 --- a/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsImplFabric.java +++ b/lifecycle-events/fabric/src/main/java/band/kessoku/lib/impl/event/lifecycle/fabric/KessokuLifecycleEventsImplFabric.java @@ -18,7 +18,6 @@ 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.*; diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/MinecraftServerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/MinecraftServerMixin.java index 3fd95812..f5f68ff5 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/MinecraftServerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/MinecraftServerMixin.java @@ -15,17 +15,16 @@ */ package band.kessoku.lib.mixin.event.lifecycle.neoforge; -import java.util.Collection; -import java.util.concurrent.CompletableFuture; - import band.kessoku.lib.api.event.lifecycle.ServerLifecycleEvent; +import net.minecraft.server.MinecraftServer; 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.server.MinecraftServer; +import java.util.Collection; +import java.util.concurrent.CompletableFuture; @Mixin(MinecraftServer.class) public abstract class MinecraftServerMixin { diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerEntityHandlerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerEntityHandlerMixin.java index ef6e8adf..5de602d3 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerEntityHandlerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerEntityHandlerMixin.java @@ -16,6 +16,8 @@ package band.kessoku.lib.mixin.event.lifecycle.neoforge; import band.kessoku.lib.api.event.lifecycle.ServerEntityEvent; +import net.minecraft.entity.Entity; +import net.minecraft.server.world.ServerWorld; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -23,9 +25,6 @@ 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/mixin/event/lifecycle/neoforge/ServerWorldMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerWorldMixin.java index 3c94a5c2..06b7e47c 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerWorldMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/ServerWorldMixin.java @@ -15,16 +15,15 @@ */ package band.kessoku.lib.mixin.event.lifecycle.neoforge; -import java.util.function.BooleanSupplier; - import band.kessoku.lib.api.event.lifecycle.ServerTickEvent; +import net.minecraft.server.world.ServerWorld; 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 net.minecraft.server.world.ServerWorld; +import java.util.function.BooleanSupplier; @Mixin(ServerWorld.class) public abstract class ServerWorldMixin { diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientChunkManagerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientChunkManagerMixin.java index 57870571..290ff0b2 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientChunkManagerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientChunkManagerMixin.java @@ -15,9 +15,14 @@ */ package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; -import java.util.function.Consumer; - import band.kessoku.lib.api.event.lifecycle.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 org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -27,13 +32,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -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; @Mixin(ClientChunkManager.class) public abstract class ClientChunkManagerMixin { diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientEntityHandlerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientEntityHandlerMixin.java index d09dca24..ba989662 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientEntityHandlerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientEntityHandlerMixin.java @@ -16,6 +16,8 @@ package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; import band.kessoku.lib.api.event.lifecycle.client.ClientEntityEvent; +import net.minecraft.client.world.ClientWorld; +import net.minecraft.entity.Entity; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -23,9 +25,6 @@ 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/mixin/event/lifecycle/neoforge/client/ClientPlayNetworkHandlerMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientPlayNetworkHandlerMixin.java index 43454762..7ef309b8 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientPlayNetworkHandlerMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/ClientPlayNetworkHandlerMixin.java @@ -18,12 +18,6 @@ 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; @@ -31,6 +25,11 @@ 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/mixin/event/lifecycle/neoforge/client/MinecraftClientMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/MinecraftClientMixin.java index 357fec64..dbc13251 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/MinecraftClientMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/MinecraftClientMixin.java @@ -16,13 +16,12 @@ package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; import band.kessoku.lib.api.event.lifecycle.client.ClientLifecycleEvent; +import net.minecraft.client.MinecraftClient; 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/mixin/event/lifecycle/neoforge/client/WorldChunkMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/WorldChunkMixin.java index 8f6d4fd7..b72945ce 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/WorldChunkMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/client/WorldChunkMixin.java @@ -15,11 +15,15 @@ */ package band.kessoku.lib.mixin.event.lifecycle.neoforge.client; -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; @@ -31,12 +35,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -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 java.util.Map; @Mixin(WorldChunk.class) abstract class WorldChunkMixin { diff --git a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/server/WorldChunkMixin.java b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/server/WorldChunkMixin.java index 1a245c75..ec1b46d4 100644 --- a/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/server/WorldChunkMixin.java +++ b/lifecycle-events/neo/src/main/java/band/kessoku/lib/mixin/event/lifecycle/neoforge/server/WorldChunkMixin.java @@ -15,10 +15,13 @@ */ package band.kessoku.lib.mixin.event.lifecycle.neoforge.server; -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; @@ -30,11 +33,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; -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 java.util.Map; /** * This is a server only mixin for good reason: diff --git a/platform/common/src/main/java/band/kessoku/lib/api/platform/DependencyInfo.java b/platform/common/src/main/java/band/kessoku/lib/api/platform/DependencyInfo.java index 6ae7225e..315dec19 100644 --- a/platform/common/src/main/java/band/kessoku/lib/api/platform/DependencyInfo.java +++ b/platform/common/src/main/java/band/kessoku/lib/api/platform/DependencyInfo.java @@ -15,7 +15,6 @@ */ package band.kessoku.lib.api.platform; -import band.kessoku.lib.service.platform.LoaderService; import org.jetbrains.annotations.Nullable; public interface DependencyInfo { diff --git a/platform/common/src/main/java/band/kessoku/lib/api/platform/Loader.java b/platform/common/src/main/java/band/kessoku/lib/api/platform/Loader.java index 6b24cf51..1dcfd1dc 100644 --- a/platform/common/src/main/java/band/kessoku/lib/api/platform/Loader.java +++ b/platform/common/src/main/java/band/kessoku/lib/api/platform/Loader.java @@ -15,11 +15,11 @@ */ package band.kessoku.lib.api.platform; +import band.kessoku.lib.service.platform.LoaderService; + import java.nio.file.Path; import java.util.Collection; -import band.kessoku.lib.service.platform.LoaderService; - public final class Loader { private Loader() { } diff --git a/platform/common/src/main/java/band/kessoku/lib/service/platform/LoaderService.java b/platform/common/src/main/java/band/kessoku/lib/service/platform/LoaderService.java index 9a303615..73ae8851 100644 --- a/platform/common/src/main/java/band/kessoku/lib/service/platform/LoaderService.java +++ b/platform/common/src/main/java/band/kessoku/lib/service/platform/LoaderService.java @@ -15,13 +15,13 @@ */ package band.kessoku.lib.service.platform; -import java.nio.file.Path; -import java.util.Collection; - import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.platform.Env; import band.kessoku.lib.api.platform.Metadata; +import java.nio.file.Path; +import java.util.Collection; + public interface LoaderService { LoaderService INSTANCE = KessokuLib.loadService(LoaderService.class); diff --git a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/DependencyInfoImpl.java b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/DependencyInfoImpl.java index 763963c1..0fa2dbdd 100644 --- a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/DependencyInfoImpl.java +++ b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/DependencyInfoImpl.java @@ -16,7 +16,6 @@ package band.kessoku.lib.impl.platform.fabric; import band.kessoku.lib.api.platform.DependencyInfo; - import net.fabricmc.loader.api.metadata.ModDependency; public final class DependencyInfoImpl implements DependencyInfo { 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 2ff617f2..4c8b9339 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,6 @@ import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.platform.KessokuPlatform; - 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/LoaderImpl.java b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/LoaderImpl.java index 50393b5e..31459adb 100644 --- a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/LoaderImpl.java +++ b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/LoaderImpl.java @@ -15,21 +15,20 @@ */ 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.Metadata; import band.kessoku.lib.service.platform.LoaderService; 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(LoaderService.class) public final class LoaderImpl implements LoaderService { private final Map modMetadataMap = new ConcurrentHashMap<>(); diff --git a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/MetadataImpl.java b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/MetadataImpl.java index eded607e..2ff4166a 100644 --- a/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/MetadataImpl.java +++ b/platform/fabric/src/main/java/band/kessoku/lib/impl/platform/fabric/MetadataImpl.java @@ -15,20 +15,19 @@ */ 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.DependencyInfo; import band.kessoku.lib.api.platform.Metadata; - 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 MetadataImpl implements Metadata { private final ModContainer modContainer; private final ModMetadata modMetadata; diff --git a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/DependencyInfoImpl.java b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/DependencyInfoImpl.java index 5b112b65..50b32b1c 100644 --- a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/DependencyInfoImpl.java +++ b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/DependencyInfoImpl.java @@ -16,7 +16,6 @@ package band.kessoku.lib.impl.platform.neoforge; import band.kessoku.lib.api.platform.DependencyInfo; - import net.neoforged.neoforgespi.language.IModInfo; public final class DependencyInfoImpl implements DependencyInfo { 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 581477c8..c38678bf 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,7 +17,6 @@ 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/LoaderImpl.java b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/LoaderImpl.java index 3ec8be44..637b70fe 100644 --- a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/LoaderImpl.java +++ b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/LoaderImpl.java @@ -15,21 +15,20 @@ */ 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.Metadata; import band.kessoku.lib.service.platform.LoaderService; 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(LoaderService.class) public final class LoaderImpl implements LoaderService { private final Map modMatadataMap = new ConcurrentHashMap<>(); diff --git a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/MetadataImpl.java b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/MetadataImpl.java index e5c49689..da397b60 100644 --- a/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/MetadataImpl.java +++ b/platform/neo/src/main/java/band/kessoku/lib/impl/platform/neoforge/MetadataImpl.java @@ -15,22 +15,21 @@ */ 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.DependencyInfo; import band.kessoku.lib.api.platform.Metadata; - 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 MetadataImpl implements Metadata { private final ModContainer modContainer; private final IModInfo modInfo; 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 af9b2354..31b63d95 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,15 +15,8 @@ */ 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; @@ -36,6 +29,12 @@ 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 52545a47..63d96054 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 @@ -16,7 +16,6 @@ package band.kessoku.lib.api.registry; import band.kessoku.lib.service.registry.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/service/registry/RegistryService.java b/registry/common/src/main/java/band/kessoku/lib/service/registry/RegistryService.java index 6fe48832..7c558c3b 100644 --- a/registry/common/src/main/java/band/kessoku/lib/service/registry/RegistryService.java +++ b/registry/common/src/main/java/band/kessoku/lib/service/registry/RegistryService.java @@ -16,7 +16,6 @@ package band.kessoku.lib.service.registry; import band.kessoku.lib.api.KessokuLib; - 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 f0fbd2e8..7c3a605b 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,7 +17,6 @@ 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 dc25c516..dc84abc7 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,7 +17,6 @@ import band.kessoku.lib.service.registry.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/mixin/registry/fabric/AbstractFurnaceBlockEntityMixin.java b/registry/fabric/src/main/java/band/kessoku/lib/mixin/registry/fabric/AbstractFurnaceBlockEntityMixin.java index 65491dd5..7b367637 100644 --- a/registry/fabric/src/main/java/band/kessoku/lib/mixin/registry/fabric/AbstractFurnaceBlockEntityMixin.java +++ b/registry/fabric/src/main/java/band/kessoku/lib/mixin/registry/fabric/AbstractFurnaceBlockEntityMixin.java @@ -18,12 +18,6 @@ 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; @@ -31,6 +25,11 @@ 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/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 bd95f9b8..ce8d328e 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,22 +15,20 @@ */ package band.kessoku.lib.impl.registry.neoforge; -import java.util.Objects; - import band.kessoku.lib.api.KessokuLib; import band.kessoku.lib.api.base.neoforge.NeoEventUtils; import band.kessoku.lib.api.registry.FuelRegistry; import band.kessoku.lib.api.registry.KessokuRegistry; - import 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 3ae00930..a0c64bff 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,19 +15,17 @@ */ package band.kessoku.lib.impl.registry.neoforge; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.ConcurrentHashMap; - import band.kessoku.lib.service.registry.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; @AutoService(RegistryService.class) @SuppressWarnings({"unchecked", "rawtypes"})