From e58296d7089f094d359b8e1b3290dbf0338b214a Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sat, 10 Feb 2024 17:42:52 +0100 Subject: [PATCH 01/12] Use Java logger if FabricLoader logger is not available --- .../impl/command/CommandManagerImpl.java | 4 +- .../impl/command/CommandManagerImpl.java | 4 +- .../impl/command/CommandManagerImpl.java | 4 +- .../fabric/test/entity/EntityEventsTest.java | 4 +- .../fabric/test/entity/EntityEventsTest.java | 4 +- .../fabric/test/entity/EntityEventsTest.java | 4 +- .../client/ClientLifecycleEventsTest.java | 4 +- .../client/ClientLifecycleEventsTest.java | 4 +- .../client/ClientLifecycleEventsTest.java | 4 +- .../lifecycle/ServerLifecycleEventsTest.java | 4 +- .../ClientLifecycleEventsCommonTest.java | 4 +- .../fabric/api/logger/v1/Logger.java | 4 +- .../fabric/impl/logger/JavaLoggerImpl.java | 95 +++++++++++++++++++ .../fabric/impl/logger/LoggerHelper.java | 13 +++ ...{LoggerImpl.java => NativeLoggerImpl.java} | 4 +- .../test/network/ServerNetworkingTest.java | 4 +- .../network/client/ClientNetworkingTest.java | 4 +- .../test/network/ServerNetworkingTest.java | 4 +- .../network/client/ClientNetworkingTest.java | 4 +- .../test/network/ServerNetworkingTest.java | 4 +- .../network/client/ClientNetworkingTest.java | 4 +- .../impl/networking/AbstractNetworkAddon.java | 4 +- .../impl/networking/NetworkingImpl.java | 4 +- .../permission/v1/PermissionsApiHolder.java | 4 +- .../sync/remappers/RegistryRemapper.java | 4 +- .../registry/sync/WorldSaveHandlerMixin.java | 4 +- .../client/rendering/RenderingEventsTest.java | 4 +- .../client/rendering/RenderingEventsTest.java | 4 +- .../loader/client/ResourceReloadTest.java | 4 +- .../loader/client/ResourceReloadTest.java | 4 +- .../loader/client/ResourceReloadTest.java | 4 +- .../loader/client/ResourceReloadTest.java | 4 +- .../loader/client/ResourceReloadTest.java | 4 +- .../resource/loader/ModNioResourcePack.java | 4 +- .../loader/ResourceManagerHelperImpl.java | 4 +- 35 files changed, 174 insertions(+), 66 deletions(-) create mode 100644 legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java create mode 100644 legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java rename legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/{LoggerImpl.java => NativeLoggerImpl.java} (96%) diff --git a/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index 154b79db9..cd5cb5823 100644 --- a/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -48,10 +48,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class CommandManagerImpl implements CommandManager { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Command Manager"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Command Manager"); private final Object lock = new Object(); private final SimpleDispatcher dispatcher; private final List mappings = Lists.newArrayList(); diff --git a/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index 5722211b5..29faeb5d6 100644 --- a/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -49,10 +49,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class CommandManagerImpl implements CommandManager { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Command Manager"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Command Manager"); private final Object lock = new Object(); private final SimpleDispatcher dispatcher; private final List mappings = Lists.newArrayList(); diff --git a/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index 154b79db9..cd5cb5823 100644 --- a/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -48,10 +48,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class CommandManagerImpl implements CommandManager { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Command Manager"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Command Manager"); private final Object lock = new Object(); private final SimpleDispatcher dispatcher; private final List mappings = Lists.newArrayList(); diff --git a/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index 6b1102113..93fa9b303 100644 --- a/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -25,10 +25,10 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class EntityEventsTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "EntityEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "EntityEvents"); @Override public void onInitialize() { diff --git a/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index 6fdba38b8..adf00ce03 100644 --- a/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -25,10 +25,10 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class EntityEventsTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "EntityEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "EntityEvents"); @Override public void onInitialize() { diff --git a/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index 6b1102113..93fa9b303 100644 --- a/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -25,10 +25,10 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class EntityEventsTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "EntityEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "EntityEvents"); @Override public void onInitialize() { diff --git a/legacy-fabric-lifecycle-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java index be435af19..80f922d8a 100644 --- a/legacy-fabric-lifecycle-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java @@ -21,10 +21,10 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ClientLifecycleEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ClientLifecycleEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientLifecycleEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-lifecycle-events-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java index be435af19..80f922d8a 100644 --- a/legacy-fabric-lifecycle-events-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java @@ -21,10 +21,10 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ClientLifecycleEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ClientLifecycleEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientLifecycleEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-lifecycle-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java index be435af19..80f922d8a 100644 --- a/legacy-fabric-lifecycle-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java @@ -21,10 +21,10 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ClientLifecycleEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ClientLifecycleEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientLifecycleEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java index eefb41a6d..3a01023d8 100644 --- a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java @@ -25,10 +25,10 @@ import net.legacyfabric.fabric.api.event.lifecycle.v1.ServerEntityEvents; import net.legacyfabric.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ServerLifecycleEventsTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ServerLifecycleEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ServerLifecycleEvents"); @Override public void onInitialize() { diff --git a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java index 1b869c3ee..e44f096fe 100644 --- a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java +++ b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientChunkEvents; import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientEntityEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ClientLifecycleEventsCommonTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ClientLifecycleEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientLifecycleEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/api/logger/v1/Logger.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/api/logger/v1/Logger.java index 0949dc306..508f7850f 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/api/logger/v1/Logger.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/api/logger/v1/Logger.java @@ -17,7 +17,7 @@ package net.legacyfabric.fabric.api.logger.v1; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public interface Logger { /** @@ -32,7 +32,7 @@ public interface Logger { * @return a Logger implementation */ static Logger get(String context, String... subs) { - return new LoggerImpl(context, subs); + return LoggerHelper.getLogger(context, subs); } void info(String format); diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java new file mode 100644 index 000000000..82d90c6e1 --- /dev/null +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java @@ -0,0 +1,95 @@ +package net.legacyfabric.fabric.impl.logger; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.stream.Collectors; + +public class JavaLoggerImpl implements net.legacyfabric.fabric.api.logger.v1.Logger { + private final Logger instance; + + protected JavaLoggerImpl(String context, String... subs) { + List parts = new ArrayList<>(); + parts.add(context); + parts.addAll(Arrays.asList(subs)); + + instance = Logger.getLogger(parts.stream().collect(Collectors.joining("/"))); + } + + @Override + public void info(String format) { + instance.log(Level.INFO, format); + } + + @Override + public void info(String format, Object... args) { + instance.log(Level.INFO, format, args); + } + + @Override + public void info(String format, Throwable exc) { + instance.log(Level.INFO, format, exc); + } + + @Override + public void error(String format) { + instance.log(Level.SEVERE, format); + } + + @Override + public void error(String format, Object... args) { + instance.log(Level.SEVERE, format, args); + } + + @Override + public void error(String format, Throwable exc) { + instance.log(Level.SEVERE, format, exc); + } + + @Override + public void warn(String format) { + instance.log(Level.WARNING, format); + } + + @Override + public void warn(String format, Object... args) { + instance.log(Level.WARNING, format, args); + } + + @Override + public void warn(String format, Throwable exc) { + instance.log(Level.WARNING, format, exc); + } + + @Override + public void debug(String format) { + instance.log(Level.FINE, format); + } + + @Override + public void debug(String format, Object... args) { + instance.log(Level.FINE, format, args); + } + + @Override + public void debug(String format, Throwable exc) { + instance.log(Level.FINE, format, exc); + } + + @Override + public void trace(String format) { + instance.log(Level.FINEST, format); + } + + @Override + public void trace(String format, Object... args) { + instance.log(Level.FINEST, format, args); + } + + @Override + public void trace(String format, Throwable exc) { + instance.log(Level.FINEST, format, exc); + } +} diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java new file mode 100644 index 000000000..144c9198c --- /dev/null +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java @@ -0,0 +1,13 @@ +package net.legacyfabric.fabric.impl.logger; + +import net.legacyfabric.fabric.api.logger.v1.Logger; + +public class LoggerHelper { + public static Logger getLogger(String context, String... subs) { + try { + return new NativeLoggerImpl(context, subs); + } catch (NoClassDefFoundError e) { + return new JavaLoggerImpl(context, subs); + } + } +} diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerImpl.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java similarity index 96% rename from legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerImpl.java rename to legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java index ad74d1e49..3a4fe8ce2 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerImpl.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java @@ -27,11 +27,11 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; -public class LoggerImpl implements Logger { +public class NativeLoggerImpl implements Logger { public static final String API = "LegacyFabricAPI"; private LogCategory category; - public LoggerImpl(String context, String... subs) { + public NativeLoggerImpl(String context, String... subs) { try { // Loader 0.14.3+ tryCreatingLogger(context, subs); } catch (NoSuchMethodError e) { // Loader 0.13+ diff --git a/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java b/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java index c11da710e..cc5a1bb9d 100644 --- a/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.networking.v1.S2CPlayChannelEvents; import net.legacyfabric.fabric.api.networking.v1.ServerPlayConnectionEvents; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ServerNetworkingTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ServerNetworking"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ServerNetworking"); @Override public void onInitialize() { diff --git a/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java b/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java index cff6567df..91690cbde 100644 --- a/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.client.networking.v1.C2SPlayChannelEvents; import net.legacyfabric.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ClientNetworkingTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ClientNetworking"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientNetworking"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java b/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java index c11da710e..cc5a1bb9d 100644 --- a/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.networking.v1.S2CPlayChannelEvents; import net.legacyfabric.fabric.api.networking.v1.ServerPlayConnectionEvents; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ServerNetworkingTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ServerNetworking"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ServerNetworking"); @Override public void onInitialize() { diff --git a/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java b/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java index cff6567df..91690cbde 100644 --- a/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.client.networking.v1.C2SPlayChannelEvents; import net.legacyfabric.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ClientNetworkingTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ClientNetworking"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientNetworking"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java b/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java index c11da710e..cc5a1bb9d 100644 --- a/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.networking.v1.S2CPlayChannelEvents; import net.legacyfabric.fabric.api.networking.v1.ServerPlayConnectionEvents; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ServerNetworkingTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ServerNetworking"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ServerNetworking"); @Override public void onInitialize() { diff --git a/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java b/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java index cff6567df..91690cbde 100644 --- a/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.client.networking.v1.C2SPlayChannelEvents; import net.legacyfabric.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ClientNetworkingTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ClientNetworking"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientNetworking"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/AbstractNetworkAddon.java b/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/AbstractNetworkAddon.java index 5ce704fb5..ae519b1ee 100644 --- a/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/AbstractNetworkAddon.java +++ b/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/AbstractNetworkAddon.java @@ -27,7 +27,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; /** * A network addon is a simple abstraction to hold information about a player's registered channels. @@ -45,7 +45,7 @@ public abstract class AbstractNetworkAddon { protected AbstractNetworkAddon(GlobalReceiverRegistry receiver, String description) { this.receiver = receiver; - this.logger = Logger.get(LoggerImpl.API, description); + this.logger = Logger.get(NativeLoggerImpl.API, description); } public H getHandler(String channel) { diff --git a/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/NetworkingImpl.java b/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/NetworkingImpl.java index e6c1e2d11..5dc329e08 100644 --- a/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/NetworkingImpl.java +++ b/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/NetworkingImpl.java @@ -18,11 +18,11 @@ package net.legacyfabric.fabric.impl.networking; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public final class NetworkingImpl { public static final String MOD_ID = "fabric-networking-api-v1"; - public static final Logger LOGGER = Logger.get(LoggerImpl.API, MOD_ID); + public static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, MOD_ID); /** * Id of packet used to register supported channels. */ diff --git a/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java b/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java index b4d98a589..92e4ff402 100644 --- a/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java +++ b/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java @@ -27,7 +27,7 @@ import net.fabricmc.loader.api.FabricLoader; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; /** * @deprecated Unstable API, may change in the future. @@ -35,7 +35,7 @@ @Deprecated @ApiStatus.Experimental public class PermissionsApiHolder { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "PermissionApiHolder"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "PermissionApiHolder"); private static PlayerPermissionsApi PLAYER_PERMISSIONS_API = null; public static boolean setPlayerPermissionsApi(PlayerPermissionsApi api) { diff --git a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java index 3caa6a74a..cdca78cf6 100644 --- a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java +++ b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java @@ -29,7 +29,7 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.registry.v1.RegistryHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; import net.legacyfabric.fabric.impl.registry.RegistryHelperImpl; import net.legacyfabric.fabric.impl.registry.sync.compat.IdListCompat; import net.legacyfabric.fabric.impl.registry.sync.compat.SimpleRegistryCompat; @@ -37,7 +37,7 @@ import net.legacyfabric.fabric.impl.registry.util.RegistryEventsHolder; public class RegistryRemapper { - protected static final Logger LOGGER = Logger.get(LoggerImpl.API, "RegistryRemapper"); + protected static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "RegistryRemapper"); protected final SimpleRegistryCompat registry; protected BiMap entryDump; protected BiMap missingMap = HashBiMap.create(); diff --git a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java index 091b387b6..6ae482469 100644 --- a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java +++ b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java @@ -38,7 +38,7 @@ import net.minecraft.world.level.LevelProperties; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; import net.legacyfabric.fabric.impl.registry.sync.ServerRegistryRemapper; @Mixin(WorldSaveHandler.class) @@ -48,7 +48,7 @@ public class WorldSaveHandlerMixin { @Unique private static final int FABRIC_ID_REGISTRY_BACKUPS = 3; @Unique - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "WorldSaveHandler"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "WorldSaveHandler"); @Final @Shadow private File worldDir; diff --git a/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java b/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java index aedeec647..b53989ef3 100644 --- a/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java +++ b/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java @@ -26,10 +26,10 @@ import net.legacyfabric.fabric.api.client.rendering.v1.HudRenderCallback; import net.legacyfabric.fabric.api.client.rendering.v1.InvalidateRenderStateCallback; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class RenderingEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "RenderingEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "RenderingEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java b/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java index aedeec647..b53989ef3 100644 --- a/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java +++ b/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java @@ -26,10 +26,10 @@ import net.legacyfabric.fabric.api.client.rendering.v1.HudRenderCallback; import net.legacyfabric.fabric.api.client.rendering.v1.InvalidateRenderStateCallback; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class RenderingEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "RenderingEvents"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "RenderingEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index 3d6c0bda5..feeb0fbc5 100644 --- a/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -27,10 +27,10 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index 3d6c0bda5..feeb0fbc5 100644 --- a/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -27,10 +27,10 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index 3d6c0bda5..feeb0fbc5 100644 --- a/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -27,10 +27,10 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index 3d6c0bda5..feeb0fbc5 100644 --- a/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -27,10 +27,10 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index 3d6c0bda5..feeb0fbc5 100644 --- a/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -27,10 +27,10 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java index 106e35bd5..d57d6c40a 100644 --- a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java +++ b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java @@ -36,10 +36,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.resource.ModResourcePack; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ModNioResourcePack extends AbstractFileResourcePack implements ModResourcePack, Closeable { - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "ModNioResourcePack"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "ModNioResourcePack"); private static final Pattern RESOURCE_PACK_PATH = Pattern.compile("[a-z0-9-_]+"); private final ModContainer container; private final Path basePath; diff --git a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java index 81e6609d5..ed68d38c0 100644 --- a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java +++ b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java @@ -31,11 +31,11 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.LoggerImpl; +import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceManagerHelperImpl implements ResourceManagerHelper { private static final ResourceManagerHelperImpl INSTANCE = new ResourceManagerHelperImpl(); - private static final Logger LOGGER = Logger.get(LoggerImpl.API, "ResourceManagerHelperImpl"); + private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "ResourceManagerHelperImpl"); private final Set addedListenerIds = new HashSet<>(); private final Set addedListeners = new LinkedHashSet<>(); From 3d30f62c29b2f49f8763814ba7c185baba37d8f2 Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sat, 10 Feb 2024 17:44:01 +0100 Subject: [PATCH 02/12] Drop native logger support for loader 0.13 --- .../fabric/impl/logger/NativeLoggerImpl.java | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java index 3a4fe8ce2..09290b1a5 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java @@ -32,22 +32,6 @@ public class NativeLoggerImpl implements Logger { private LogCategory category; public NativeLoggerImpl(String context, String... subs) { - try { // Loader 0.14.3+ - tryCreatingLogger(context, subs); - } catch (NoSuchMethodError e) { // Loader 0.13+ - List parts = new ArrayList<>(); - parts.add(context); - Collections.addAll(parts, subs); - - try { - this.category = LogCategory.class.getDeclaredConstructor(String[].class).newInstance(parts.toArray(new String[0])); - } catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException ex) { - throw new RuntimeException(ex); - } - } - } - - private void tryCreatingLogger(String context, String... subs) throws NoSuchMethodError { this.category = LogCategory.createCustom(context, subs); } From 42a5f0806d4a527a6e2aebac9d86cb16f09a8ec0 Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sat, 10 Feb 2024 17:46:36 +0100 Subject: [PATCH 03/12] Bump logger-api-v1 version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 12fd4705f..576720760 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,7 +14,7 @@ legacy-fabric-gamerule-api-v1.version = 1.0.0 legacy-fabric-item-groups-v1.version = 2.0.0 legacy-fabric-keybindings-api-v1.version = 1.0.0 legacy-fabric-lifecycle-events-v1.version = 1.0.1 -legacy-fabric-logger-api-v1.version = 1.0.4 +legacy-fabric-logger-api-v1.version = 1.1.0 legacy-fabric-networking-api-v1.version = 2.0.0 legacy-fabric-permissions-api-v1.version = 1.0.0 legacy-fabric-registry-sync-api-v1.version = 2.1.0 From 1fc85002dbad81a1ff61dc40a8b40a5d4206fd0c Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sat, 10 Feb 2024 17:55:29 +0100 Subject: [PATCH 04/12] Apply spotless --- .../fabric/impl/logger/JavaLoggerImpl.java | 17 +++++++++++++++++ .../fabric/impl/logger/LoggerHelper.java | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java index 82d90c6e1..ab2513590 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2020 - 2022 Legacy Fabric + * Copyright (c) 2016 - 2022 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package net.legacyfabric.fabric.impl.logger; import java.util.ArrayList; diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java index 144c9198c..b76067a6a 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java @@ -1,3 +1,20 @@ +/* + * Copyright (c) 2020 - 2022 Legacy Fabric + * Copyright (c) 2016 - 2022 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package net.legacyfabric.fabric.impl.logger; import net.legacyfabric.fabric.api.logger.v1.Logger; From f3573bf6590a86cebfbbff6ee39c37351f833ea1 Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sat, 10 Feb 2024 17:57:11 +0100 Subject: [PATCH 05/12] Fix style --- .../legacyfabric/fabric/impl/logger/NativeLoggerImpl.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java index 09290b1a5..f6966c882 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java @@ -17,11 +17,6 @@ package net.legacyfabric.fabric.impl.logger; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - import net.fabricmc.loader.impl.util.log.Log; import net.fabricmc.loader.impl.util.log.LogCategory; From 5f31ec6c3a62efde254b2bb3ee585c36c89dff1b Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sun, 11 Feb 2024 12:24:15 +0100 Subject: [PATCH 06/12] Move default Logger name to LoggerHelper --- .../legacyfabric/fabric/impl/command/CommandManagerImpl.java | 4 ++-- .../legacyfabric/fabric/impl/command/CommandManagerImpl.java | 4 ++-- .../legacyfabric/fabric/impl/command/CommandManagerImpl.java | 4 ++-- .../net/legacyfabric/fabric/test/entity/EntityEventsTest.java | 4 ++-- .../net/legacyfabric/fabric/test/entity/EntityEventsTest.java | 4 ++-- .../net/legacyfabric/fabric/test/entity/EntityEventsTest.java | 4 ++-- .../test/lifecycle/client/ClientLifecycleEventsTest.java | 4 ++-- .../test/lifecycle/client/ClientLifecycleEventsTest.java | 4 ++-- .../test/lifecycle/client/ClientLifecycleEventsTest.java | 4 ++-- .../fabric/test/lifecycle/ServerLifecycleEventsTest.java | 4 ++-- .../lifecycle/client/ClientLifecycleEventsCommonTest.java | 4 ++-- .../net/legacyfabric/fabric/impl/logger/LoggerHelper.java | 4 +++- .../net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java | 1 - .../fabric/test/network/ServerNetworkingTest.java | 4 ++-- .../fabric/test/network/client/ClientNetworkingTest.java | 4 ++-- .../fabric/test/network/ServerNetworkingTest.java | 4 ++-- .../fabric/test/network/client/ClientNetworkingTest.java | 4 ++-- .../fabric/test/network/ServerNetworkingTest.java | 4 ++-- .../fabric/test/network/client/ClientNetworkingTest.java | 4 ++-- .../fabric/impl/networking/AbstractNetworkAddon.java | 4 ++-- .../legacyfabric/fabric/impl/networking/NetworkingImpl.java | 4 ++-- .../fabric/api/permission/v1/PermissionsApiHolder.java | 4 ++-- .../fabric/impl/registry/sync/remappers/RegistryRemapper.java | 4 ++-- .../fabric/mixin/registry/sync/WorldSaveHandlerMixin.java | 4 ++-- .../fabric/test/client/rendering/RenderingEventsTest.java | 4 ++-- .../fabric/test/client/rendering/RenderingEventsTest.java | 4 ++-- .../test/resource/loader/client/ResourceReloadTest.java | 4 ++-- .../test/resource/loader/client/ResourceReloadTest.java | 4 ++-- .../test/resource/loader/client/ResourceReloadTest.java | 4 ++-- .../test/resource/loader/client/ResourceReloadTest.java | 4 ++-- .../test/resource/loader/client/ResourceReloadTest.java | 4 ++-- .../fabric/impl/resource/loader/ModNioResourcePack.java | 4 ++-- .../impl/resource/loader/ResourceManagerHelperImpl.java | 4 ++-- 33 files changed, 65 insertions(+), 64 deletions(-) diff --git a/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index cd5cb5823..f9c082e5a 100644 --- a/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -27,6 +27,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.jetbrains.annotations.Nullable; import net.minecraft.text.HoverEvent; @@ -48,10 +49,9 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class CommandManagerImpl implements CommandManager { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Command Manager"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Command Manager"); private final Object lock = new Object(); private final SimpleDispatcher dispatcher; private final List mappings = Lists.newArrayList(); diff --git a/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index 29faeb5d6..2237e7064 100644 --- a/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -27,6 +27,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.jetbrains.annotations.Nullable; import net.minecraft.text.HoverEvent; @@ -49,10 +50,9 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class CommandManagerImpl implements CommandManager { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Command Manager"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Command Manager"); private final Object lock = new Object(); private final SimpleDispatcher dispatcher; private final List mappings = Lists.newArrayList(); diff --git a/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index cd5cb5823..f9c082e5a 100644 --- a/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -27,6 +27,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.jetbrains.annotations.Nullable; import net.minecraft.text.HoverEvent; @@ -48,10 +49,9 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class CommandManagerImpl implements CommandManager { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Command Manager"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Command Manager"); private final Object lock = new Object(); private final SimpleDispatcher dispatcher; private final List mappings = Lists.newArrayList(); diff --git a/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index 93fa9b303..ed02007c4 100644 --- a/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -17,6 +17,7 @@ package net.legacyfabric.fabric.test.entity; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ModInitializer; @@ -25,10 +26,9 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class EntityEventsTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "EntityEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "EntityEvents"); @Override public void onInitialize() { diff --git a/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index adf00ce03..3b4f20e3b 100644 --- a/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -17,6 +17,7 @@ package net.legacyfabric.fabric.test.entity; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ModInitializer; @@ -25,10 +26,9 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class EntityEventsTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "EntityEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "EntityEvents"); @Override public void onInitialize() { diff --git a/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index 93fa9b303..ed02007c4 100644 --- a/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -17,6 +17,7 @@ package net.legacyfabric.fabric.test.entity; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ModInitializer; @@ -25,10 +26,9 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class EntityEventsTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "EntityEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "EntityEvents"); @Override public void onInitialize() { diff --git a/legacy-fabric-lifecycle-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java index 80f922d8a..9fc33f14a 100644 --- a/legacy-fabric-lifecycle-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java @@ -21,10 +21,10 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ClientLifecycleEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientLifecycleEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ClientLifecycleEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-lifecycle-events-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java index 80f922d8a..9fc33f14a 100644 --- a/legacy-fabric-lifecycle-events-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java @@ -21,10 +21,10 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ClientLifecycleEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientLifecycleEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ClientLifecycleEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-lifecycle-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java index 80f922d8a..9fc33f14a 100644 --- a/legacy-fabric-lifecycle-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsTest.java @@ -21,10 +21,10 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ClientLifecycleEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientLifecycleEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ClientLifecycleEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java index 3a01023d8..c21a7336b 100644 --- a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java @@ -17,6 +17,7 @@ package net.legacyfabric.fabric.test.lifecycle; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ModInitializer; @@ -25,10 +26,9 @@ import net.legacyfabric.fabric.api.event.lifecycle.v1.ServerEntityEvents; import net.legacyfabric.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ServerLifecycleEventsTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ServerLifecycleEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ServerLifecycleEvents"); @Override public void onInitialize() { diff --git a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java index e44f096fe..5fa18bf9e 100644 --- a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java +++ b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java @@ -17,6 +17,7 @@ package net.legacyfabric.fabric.test.lifecycle.client; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ClientModInitializer; @@ -24,10 +25,9 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientChunkEvents; import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientEntityEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ClientLifecycleEventsCommonTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientLifecycleEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ClientLifecycleEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java index b76067a6a..a55d4dce6 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java @@ -20,7 +20,9 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; public class LoggerHelper { - public static Logger getLogger(String context, String... subs) { + public static final String API = "LegacyFabricAPI"; + + public static Logger getLogger(String context, String... subs) { try { return new NativeLoggerImpl(context, subs); } catch (NoClassDefFoundError e) { diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java index f6966c882..e7d2ae6a0 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java @@ -23,7 +23,6 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; public class NativeLoggerImpl implements Logger { - public static final String API = "LegacyFabricAPI"; private LogCategory category; public NativeLoggerImpl(String context, String... subs) { diff --git a/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java b/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java index cc5a1bb9d..8718d81c4 100644 --- a/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.networking.v1.S2CPlayChannelEvents; import net.legacyfabric.fabric.api.networking.v1.ServerPlayConnectionEvents; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ServerNetworkingTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ServerNetworking"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ServerNetworking"); @Override public void onInitialize() { diff --git a/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java b/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java index 91690cbde..446cccf1e 100644 --- a/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.client.networking.v1.C2SPlayChannelEvents; import net.legacyfabric.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ClientNetworkingTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientNetworking"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ClientNetworking"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java b/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java index cc5a1bb9d..8718d81c4 100644 --- a/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.networking.v1.S2CPlayChannelEvents; import net.legacyfabric.fabric.api.networking.v1.ServerPlayConnectionEvents; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ServerNetworkingTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ServerNetworking"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ServerNetworking"); @Override public void onInitialize() { diff --git a/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java b/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java index 91690cbde..446cccf1e 100644 --- a/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.client.networking.v1.C2SPlayChannelEvents; import net.legacyfabric.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ClientNetworkingTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientNetworking"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ClientNetworking"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java b/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java index cc5a1bb9d..8718d81c4 100644 --- a/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/ServerNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.networking.v1.S2CPlayChannelEvents; import net.legacyfabric.fabric.api.networking.v1.ServerPlayConnectionEvents; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ServerNetworkingTest implements ModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ServerNetworking"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ServerNetworking"); @Override public void onInitialize() { diff --git a/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java b/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java index 91690cbde..446cccf1e 100644 --- a/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java +++ b/legacy-fabric-networking-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/network/client/ClientNetworkingTest.java @@ -24,10 +24,10 @@ import net.legacyfabric.fabric.api.client.networking.v1.C2SPlayChannelEvents; import net.legacyfabric.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ClientNetworkingTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ClientNetworking"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ClientNetworking"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/AbstractNetworkAddon.java b/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/AbstractNetworkAddon.java index ae519b1ee..8a8c4bda9 100644 --- a/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/AbstractNetworkAddon.java +++ b/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/AbstractNetworkAddon.java @@ -27,7 +27,7 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; /** * A network addon is a simple abstraction to hold information about a player's registered channels. @@ -45,7 +45,7 @@ public abstract class AbstractNetworkAddon { protected AbstractNetworkAddon(GlobalReceiverRegistry receiver, String description) { this.receiver = receiver; - this.logger = Logger.get(NativeLoggerImpl.API, description); + this.logger = Logger.get(LoggerHelper.API, description); } public H getHandler(String channel) { diff --git a/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/NetworkingImpl.java b/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/NetworkingImpl.java index 5dc329e08..e001b851c 100644 --- a/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/NetworkingImpl.java +++ b/legacy-fabric-networking-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/networking/NetworkingImpl.java @@ -18,11 +18,11 @@ package net.legacyfabric.fabric.impl.networking; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public final class NetworkingImpl { public static final String MOD_ID = "fabric-networking-api-v1"; - public static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, MOD_ID); + public static final Logger LOGGER = Logger.get(LoggerHelper.API, MOD_ID); /** * Id of packet used to register supported channels. */ diff --git a/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java b/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java index 92e4ff402..6131bfc4c 100644 --- a/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java +++ b/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java @@ -17,6 +17,7 @@ package net.legacyfabric.fabric.api.permission.v1; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.jetbrains.annotations.ApiStatus; import net.minecraft.client.MinecraftClient; @@ -27,7 +28,6 @@ import net.fabricmc.loader.api.FabricLoader; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; /** * @deprecated Unstable API, may change in the future. @@ -35,7 +35,7 @@ @Deprecated @ApiStatus.Experimental public class PermissionsApiHolder { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "PermissionApiHolder"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "PermissionApiHolder"); private static PlayerPermissionsApi PLAYER_PERMISSIONS_API = null; public static boolean setPlayerPermissionsApi(PlayerPermissionsApi api) { diff --git a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java index cdca78cf6..aeafaf6de 100644 --- a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java +++ b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java @@ -24,12 +24,12 @@ import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.nbt.NbtCompound; import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.registry.v1.RegistryHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; import net.legacyfabric.fabric.impl.registry.RegistryHelperImpl; import net.legacyfabric.fabric.impl.registry.sync.compat.IdListCompat; import net.legacyfabric.fabric.impl.registry.sync.compat.SimpleRegistryCompat; @@ -37,7 +37,7 @@ import net.legacyfabric.fabric.impl.registry.util.RegistryEventsHolder; public class RegistryRemapper { - protected static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "RegistryRemapper"); + protected static final Logger LOGGER = Logger.get(LoggerHelper.API, "RegistryRemapper"); protected final SimpleRegistryCompat registry; protected BiMap entryDump; protected BiMap missingMap = HashBiMap.create(); diff --git a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java index 6ae482469..0ffa97f70 100644 --- a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java +++ b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java @@ -23,6 +23,7 @@ import java.io.FileOutputStream; import java.io.IOException; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -38,7 +39,6 @@ import net.minecraft.world.level.LevelProperties; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; import net.legacyfabric.fabric.impl.registry.sync.ServerRegistryRemapper; @Mixin(WorldSaveHandler.class) @@ -48,7 +48,7 @@ public class WorldSaveHandlerMixin { @Unique private static final int FABRIC_ID_REGISTRY_BACKUPS = 3; @Unique - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "WorldSaveHandler"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "WorldSaveHandler"); @Final @Shadow private File worldDir; diff --git a/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java b/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java index b53989ef3..a14d707bb 100644 --- a/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java +++ b/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java @@ -19,6 +19,7 @@ import java.awt.Color; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.client.resource.language.I18n; import net.fabricmc.api.ClientModInitializer; @@ -26,10 +27,9 @@ import net.legacyfabric.fabric.api.client.rendering.v1.HudRenderCallback; import net.legacyfabric.fabric.api.client.rendering.v1.InvalidateRenderStateCallback; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class RenderingEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "RenderingEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "RenderingEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java b/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java index b53989ef3..a14d707bb 100644 --- a/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java +++ b/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java @@ -19,6 +19,7 @@ import java.awt.Color; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.client.resource.language.I18n; import net.fabricmc.api.ClientModInitializer; @@ -26,10 +27,9 @@ import net.legacyfabric.fabric.api.client.rendering.v1.HudRenderCallback; import net.legacyfabric.fabric.api.client.rendering.v1.InvalidateRenderStateCallback; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class RenderingEventsTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "RenderingEvents"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "RenderingEvents"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index feeb0fbc5..dfe57c259 100644 --- a/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -27,10 +28,9 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index feeb0fbc5..dfe57c259 100644 --- a/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -27,10 +28,9 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index feeb0fbc5..dfe57c259 100644 --- a/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -27,10 +28,9 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index feeb0fbc5..dfe57c259 100644 --- a/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -27,10 +28,9 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index feeb0fbc5..dfe57c259 100644 --- a/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,6 +19,7 @@ import java.util.Arrays; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -27,10 +28,9 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceReloadTest implements ClientModInitializer { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "Test", "ResourceReload"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); @Override public void onInitializeClient() { diff --git a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java index d57d6c40a..0e2ceec5a 100644 --- a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java +++ b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java @@ -29,6 +29,7 @@ import java.util.Set; import java.util.regex.Pattern; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.AbstractFileResourcePack; import net.fabricmc.loader.api.ModContainer; @@ -36,10 +37,9 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.resource.ModResourcePack; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ModNioResourcePack extends AbstractFileResourcePack implements ModResourcePack, Closeable { - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "ModNioResourcePack"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "ModNioResourcePack"); private static final Pattern RESOURCE_PACK_PATH = Pattern.compile("[a-z0-9-_]+"); private final ModContainer container; private final Path basePath; diff --git a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java index ed68d38c0..65dcc0903 100644 --- a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java +++ b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java @@ -25,17 +25,17 @@ import com.google.common.collect.Lists; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceReloadListener; import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; -import net.legacyfabric.fabric.impl.logger.NativeLoggerImpl; public class ResourceManagerHelperImpl implements ResourceManagerHelper { private static final ResourceManagerHelperImpl INSTANCE = new ResourceManagerHelperImpl(); - private static final Logger LOGGER = Logger.get(NativeLoggerImpl.API, "ResourceManagerHelperImpl"); + private static final Logger LOGGER = Logger.get(LoggerHelper.API, "ResourceManagerHelperImpl"); private final Set addedListenerIds = new HashSet<>(); private final Set addedListeners = new LinkedHashSet<>(); From 38548d88c2430b85b81ba71aa4df3e105f5f0ddb Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sun, 11 Feb 2024 12:47:52 +0100 Subject: [PATCH 07/12] Fix style --- .../legacyfabric/fabric/impl/command/CommandManagerImpl.java | 2 +- .../legacyfabric/fabric/impl/command/CommandManagerImpl.java | 2 +- .../legacyfabric/fabric/impl/command/CommandManagerImpl.java | 2 +- .../net/legacyfabric/fabric/impl/logger/LoggerHelper.java | 4 ++-- .../fabric/api/permission/v1/PermissionsApiHolder.java | 2 +- .../fabric/impl/registry/sync/remappers/RegistryRemapper.java | 2 +- .../fabric/mixin/registry/sync/WorldSaveHandlerMixin.java | 2 +- .../fabric/impl/resource/loader/ModNioResourcePack.java | 2 +- .../impl/resource/loader/ResourceManagerHelperImpl.java | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index f9c082e5a..26a8d0982 100644 --- a/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.12.2/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -27,7 +27,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.jetbrains.annotations.Nullable; import net.minecraft.text.HoverEvent; @@ -49,6 +48,7 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class CommandManagerImpl implements CommandManager { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Command Manager"); diff --git a/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index 2237e7064..462975f15 100644 --- a/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.7.10/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -27,7 +27,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.jetbrains.annotations.Nullable; import net.minecraft.text.HoverEvent; @@ -50,6 +49,7 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class CommandManagerImpl implements CommandManager { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Command Manager"); diff --git a/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java b/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java index f9c082e5a..26a8d0982 100644 --- a/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java +++ b/legacy-fabric-command-api-v2/1.8.9/src/main/java/net/legacyfabric/fabric/impl/command/CommandManagerImpl.java @@ -27,7 +27,6 @@ import com.google.common.collect.Lists; import com.google.common.collect.Multimap; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.jetbrains.annotations.Nullable; import net.minecraft.text.HoverEvent; @@ -49,6 +48,7 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.permission.v1.PermissibleCommandSource; import net.legacyfabric.fabric.api.util.Location; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class CommandManagerImpl implements CommandManager { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Command Manager"); diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java index a55d4dce6..87fc1d2d5 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java @@ -20,9 +20,9 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; public class LoggerHelper { - public static final String API = "LegacyFabricAPI"; + public static final String API = "LegacyFabricAPI"; - public static Logger getLogger(String context, String... subs) { + public static Logger getLogger(String context, String... subs) { try { return new NativeLoggerImpl(context, subs); } catch (NoClassDefFoundError e) { diff --git a/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java b/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java index 6131bfc4c..0d93553a4 100644 --- a/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java +++ b/legacy-fabric-permissions-api-v1/common/src/main/java/net/legacyfabric/fabric/api/permission/v1/PermissionsApiHolder.java @@ -17,7 +17,6 @@ package net.legacyfabric.fabric.api.permission.v1; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.jetbrains.annotations.ApiStatus; import net.minecraft.client.MinecraftClient; @@ -28,6 +27,7 @@ import net.fabricmc.loader.api.FabricLoader; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; /** * @deprecated Unstable API, may change in the future. diff --git a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java index aeafaf6de..36a5d30f7 100644 --- a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java +++ b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/registry/sync/remappers/RegistryRemapper.java @@ -24,12 +24,12 @@ import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.nbt.NbtCompound; import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.registry.v1.RegistryHelper; import net.legacyfabric.fabric.api.util.Identifier; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.legacyfabric.fabric.impl.registry.RegistryHelperImpl; import net.legacyfabric.fabric.impl.registry.sync.compat.IdListCompat; import net.legacyfabric.fabric.impl.registry.sync.compat.SimpleRegistryCompat; diff --git a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java index 0ffa97f70..e1e9e554f 100644 --- a/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java +++ b/legacy-fabric-registry-sync-api-v1/common/src/main/java/net/legacyfabric/fabric/mixin/registry/sync/WorldSaveHandlerMixin.java @@ -23,7 +23,6 @@ import java.io.FileOutputStream; import java.io.IOException; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; @@ -39,6 +38,7 @@ import net.minecraft.world.level.LevelProperties; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.legacyfabric.fabric.impl.registry.sync.ServerRegistryRemapper; @Mixin(WorldSaveHandler.class) diff --git a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java index 0e2ceec5a..e4c1f8227 100644 --- a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java +++ b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ModNioResourcePack.java @@ -29,7 +29,6 @@ import java.util.Set; import java.util.regex.Pattern; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.AbstractFileResourcePack; import net.fabricmc.loader.api.ModContainer; @@ -37,6 +36,7 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.resource.ModResourcePack; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ModNioResourcePack extends AbstractFileResourcePack implements ModResourcePack, Closeable { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "ModNioResourcePack"); diff --git a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java index 65dcc0903..cde29ee19 100644 --- a/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java +++ b/legacy-fabric-resource-loader-v1/common/src/main/java/net/legacyfabric/fabric/impl/resource/loader/ResourceManagerHelperImpl.java @@ -25,13 +25,13 @@ import com.google.common.collect.Lists; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceReloadListener; import net.legacyfabric.fabric.api.logger.v1.Logger; import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ResourceManagerHelperImpl implements ResourceManagerHelper { private static final ResourceManagerHelperImpl INSTANCE = new ResourceManagerHelperImpl(); From 94ceaf753a26a627a7f140ad277b0a1ff1e6515b Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sun, 11 Feb 2024 16:44:54 +0100 Subject: [PATCH 08/12] Make logger-api depend on api-base-common --- legacy-fabric-api-base/common/gradle.properties | 3 +-- legacy-fabric-logger-api-v1/common.gradle | 4 +++- .../common/src/main/resources/fabric.mod.json | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/legacy-fabric-api-base/common/gradle.properties b/legacy-fabric-api-base/common/gradle.properties index 13b94f3a1..8b1378917 100644 --- a/legacy-fabric-api-base/common/gradle.properties +++ b/legacy-fabric-api-base/common/gradle.properties @@ -1,2 +1 @@ -minVersionIncluded=1.3 -maxVersionIncluded=1.13.2 + diff --git a/legacy-fabric-logger-api-v1/common.gradle b/legacy-fabric-logger-api-v1/common.gradle index f616d72cb..f7bb5a4dd 100644 --- a/legacy-fabric-logger-api-v1/common.gradle +++ b/legacy-fabric-logger-api-v1/common.gradle @@ -1 +1,3 @@ -moduleDependencies(project, []) +moduleDependencies(project, [ + "legacy-fabric-api-base" +]) diff --git a/legacy-fabric-logger-api-v1/common/src/main/resources/fabric.mod.json b/legacy-fabric-logger-api-v1/common/src/main/resources/fabric.mod.json index b9acf50a3..a11df2944 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/resources/fabric.mod.json +++ b/legacy-fabric-logger-api-v1/common/src/main/resources/fabric.mod.json @@ -16,7 +16,8 @@ "FabricMC" ], "depends": { - "fabricloader": ">0.13" + "fabricloader": ">=0.14", + "legacy-fabric-api-base-common": "*" }, "description": "Friendly logger api built on top of fabric loader internal's", "custom": { From dd5f6de4989c783d58bf5253103073a3d3fa5620 Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sun, 11 Feb 2024 16:45:25 +0100 Subject: [PATCH 09/12] Only test if loader logging classes are present once --- .../fabric/impl/logger/LoggerHelper.java | 21 +++++++++++++++---- .../fabric/impl/logger/NativeLoggerImpl.java | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java index 87fc1d2d5..66d9856b8 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java @@ -17,16 +17,29 @@ package net.legacyfabric.fabric.impl.logger; +import java.util.function.BiFunction; + import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.api.util.TriState; public class LoggerHelper { public static final String API = "LegacyFabricAPI"; + private static TriState exists = TriState.DEFAULT; + private static final BiFunction javaLogger = JavaLoggerImpl::new; + private static final BiFunction nativeLogger = NativeLoggerImpl::new; + public static Logger getLogger(String context, String... subs) { - try { - return new NativeLoggerImpl(context, subs); - } catch (NoClassDefFoundError e) { - return new JavaLoggerImpl(context, subs); + if (exists == TriState.DEFAULT) { + try { + Class.forName("net.fabricmc.loader.impl.util.log.LogCategory"); + Class.forName("net.fabricmc.loader.impl.util.log.Log"); + exists = TriState.TRUE; + } catch (ClassNotFoundException ignored) { + exists = TriState.FALSE; + } } + + return exists.get() ? nativeLogger.apply(context, subs) : javaLogger.apply(context, subs); } } diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java index e7d2ae6a0..78f49a190 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/NativeLoggerImpl.java @@ -23,7 +23,7 @@ import net.legacyfabric.fabric.api.logger.v1.Logger; public class NativeLoggerImpl implements Logger { - private LogCategory category; + private final LogCategory category; public NativeLoggerImpl(String context, String... subs) { this.category = LogCategory.createCustom(context, subs); From b2b11e1c9bae54bc29bcd06add81b508ee1e1ce2 Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sun, 11 Feb 2024 16:51:02 +0100 Subject: [PATCH 10/12] Fix circular dependencies --- .../common/gradle.properties | 3 +- legacy-fabric-logger-api-v1/common.gradle | 4 +- .../fabric/impl/logger/LoggerHelper.java | 2 +- .../impl/logger/utils/BooleanFunction.java | 34 +++++ .../fabric/impl/logger/utils/TriState.java | 140 ++++++++++++++++++ .../common/src/main/resources/fabric.mod.json | 3 +- 6 files changed, 179 insertions(+), 7 deletions(-) create mode 100644 legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/BooleanFunction.java create mode 100644 legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java diff --git a/legacy-fabric-api-base/common/gradle.properties b/legacy-fabric-api-base/common/gradle.properties index 8b1378917..13b94f3a1 100644 --- a/legacy-fabric-api-base/common/gradle.properties +++ b/legacy-fabric-api-base/common/gradle.properties @@ -1 +1,2 @@ - +minVersionIncluded=1.3 +maxVersionIncluded=1.13.2 diff --git a/legacy-fabric-logger-api-v1/common.gradle b/legacy-fabric-logger-api-v1/common.gradle index f7bb5a4dd..f616d72cb 100644 --- a/legacy-fabric-logger-api-v1/common.gradle +++ b/legacy-fabric-logger-api-v1/common.gradle @@ -1,3 +1 @@ -moduleDependencies(project, [ - "legacy-fabric-api-base" -]) +moduleDependencies(project, []) diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java index 66d9856b8..e08a146ae 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java @@ -20,7 +20,7 @@ import java.util.function.BiFunction; import net.legacyfabric.fabric.api.logger.v1.Logger; -import net.legacyfabric.fabric.api.util.TriState; +import net.legacyfabric.fabric.impl.logger.utils.TriState; public class LoggerHelper { public static final String API = "LegacyFabricAPI"; diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/BooleanFunction.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/BooleanFunction.java new file mode 100644 index 000000000..9bf96823a --- /dev/null +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/BooleanFunction.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2020 - 2022 Legacy Fabric + * Copyright (c) 2016 - 2022 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.legacyfabric.fabric.impl.logger.utils; + +/** + * Represents a function that accepts an boolean-valued argument and produces a result. + * + *

This is the {@code boolean}-consuming primitive specialization for {@link java.util.function.Function}. + */ +@FunctionalInterface +public interface BooleanFunction { + /** + * Applies this function to the given argument. + * + * @param value the function argument + * @return the function result + */ + R apply(boolean value); +} diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java new file mode 100644 index 000000000..731a6bac4 --- /dev/null +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2020 - 2022 Legacy Fabric + * Copyright (c) 2016 - 2022 FabricMC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package net.legacyfabric.fabric.impl.logger.utils; + +import org.jetbrains.annotations.Nullable; + +import java.util.Objects; +import java.util.Optional; +import java.util.function.BooleanSupplier; +import java.util.function.Supplier; + +/** + * Represents a boolean value which can be true, false or refer to a default value. + */ +public enum TriState { + /** + * Represents the boolean value of {@code false}. + */ + FALSE, + /** + * Represents a value that refers to a "default" value, often as a fallback. + */ + DEFAULT, + /** + * Represents the boolean value of {@code true}. + */ + TRUE; + + /** + * Gets the corresponding tri-state from a boolean value. + * + * @param bool the boolean value + * @return {@link TriState#TRUE} or {@link TriState#FALSE} depending on the value of the boolean. + */ + public static TriState of(boolean bool) { + return bool ? TRUE : FALSE; + } + + /** + * Gets a tri-state from a nullable boxed boolean. + * + * @param bool the boolean value + * @return {@link TriState#DEFAULT} if {@code null}. + * Otherwise {@link TriState#TRUE} or {@link TriState#FALSE} depending on the value of the boolean. + */ + public static TriState of(@Nullable Boolean bool) { + return bool == null ? DEFAULT : of(bool.booleanValue()); + } + + /** + * Gets the value of the tri-state. + * + * @return true if the tri-state is {@link TriState#TRUE}. + * Otherwise false. + */ + public boolean get() { + return this == TRUE; + } + + /** + * Gets the value of the tri-state as a boxed, nullable boolean. + * + * @return {@code null} if {@link TriState#DEFAULT}. + * Otherwise {@code true} if {@link TriState#TRUE} or {@code false} if {@link TriState#FALSE}. + */ + @Nullable + public Boolean getBoxed() { + return this == DEFAULT ? null : this.get(); + } + + /** + * Gets the value of this tri-state. + * If the value is {@link TriState#DEFAULT} then use the supplied value. + * + * @param value the value to fallback to + * @return the value of the tri-state or the supplied value if {@link TriState#DEFAULT}. + */ + public boolean orElse(boolean value) { + return this == DEFAULT ? value : this.get(); + } + + /** + * Gets the value of this tri-state. + * If the value is {@link TriState#DEFAULT} then use the supplied value. + * + * @param supplier the supplier used to get the value to fallback to + * @return the value of the tri-state or the value of the supplier if the tri-state is {@link TriState#DEFAULT}. + */ + public boolean orElseGet(BooleanSupplier supplier) { + return this == DEFAULT ? supplier.getAsBoolean() : this.get(); + } + + /** + * Maps the boolean value of this tri-state if it is {@link TriState#TRUE} or {@link TriState#FALSE}. + * + * @param mapper the mapper to use + * @param the type of object being supplier by the mapper + * @return an optional containing the mapped value; {@link Optional#empty()} if the tri-state is {@link TriState#DEFAULT} or the value provided by the mapper is {@code null}. + */ + public Optional map(BooleanFunction<@Nullable ? extends T> mapper) { + Objects.requireNonNull(mapper, "Mapper function cannot be null"); + + if (this == DEFAULT) { + return Optional.empty(); + } + + return Optional.ofNullable(mapper.apply(this.get())); + } + + /** + * Gets the value of this tri-state, or throws an exception if this tri-state's value is {@link TriState#DEFAULT}. + * + * @param exceptionSupplier the supplying function that produces an exception to be thrown + * @param Type of the exception to be thrown + * @return the value + * @throws X if the value is {@link TriState#DEFAULT} + */ + public boolean orElseThrow(Supplier exceptionSupplier) throws X { + if (this != DEFAULT) { + return this.get(); + } + + throw exceptionSupplier.get(); + } +} diff --git a/legacy-fabric-logger-api-v1/common/src/main/resources/fabric.mod.json b/legacy-fabric-logger-api-v1/common/src/main/resources/fabric.mod.json index a11df2944..14f24b681 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/resources/fabric.mod.json +++ b/legacy-fabric-logger-api-v1/common/src/main/resources/fabric.mod.json @@ -16,8 +16,7 @@ "FabricMC" ], "depends": { - "fabricloader": ">=0.14", - "legacy-fabric-api-base-common": "*" + "fabricloader": ">=0.14" }, "description": "Friendly logger api built on top of fabric loader internal's", "custom": { From b86267ad49841aaca654101c9b8c8e1f4221bf16 Mon Sep 17 00:00:00 2001 From: Cat Core Date: Sun, 11 Feb 2024 17:12:56 +0100 Subject: [PATCH 11/12] Fix style again --- .../net/legacyfabric/fabric/test/entity/EntityEventsTest.java | 2 +- .../net/legacyfabric/fabric/test/entity/EntityEventsTest.java | 2 +- .../net/legacyfabric/fabric/test/entity/EntityEventsTest.java | 2 +- .../fabric/test/lifecycle/ServerLifecycleEventsTest.java | 2 +- .../lifecycle/client/ClientLifecycleEventsCommonTest.java | 2 +- .../net/legacyfabric/fabric/impl/logger/utils/TriState.java | 4 ++-- .../fabric/test/client/rendering/RenderingEventsTest.java | 2 +- .../fabric/test/client/rendering/RenderingEventsTest.java | 2 +- .../test/resource/loader/client/ResourceReloadTest.java | 2 +- .../test/resource/loader/client/ResourceReloadTest.java | 2 +- .../test/resource/loader/client/ResourceReloadTest.java | 2 +- .../test/resource/loader/client/ResourceReloadTest.java | 2 +- .../test/resource/loader/client/ResourceReloadTest.java | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index ed02007c4..3dd394ed8 100644 --- a/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -17,7 +17,6 @@ package net.legacyfabric.fabric.test.entity; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ModInitializer; @@ -26,6 +25,7 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class EntityEventsTest implements ModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "EntityEvents"); diff --git a/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index 3b4f20e3b..5aa946e3c 100644 --- a/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -17,7 +17,6 @@ package net.legacyfabric.fabric.test.entity; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ModInitializer; @@ -26,6 +25,7 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class EntityEventsTest implements ModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "EntityEvents"); diff --git a/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java b/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java index ed02007c4..3dd394ed8 100644 --- a/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java +++ b/legacy-fabric-entity-events-v1/1.9.4/src/testmod/java/net/legacyfabric/fabric/test/entity/EntityEventsTest.java @@ -17,7 +17,6 @@ package net.legacyfabric.fabric.test.entity; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ModInitializer; @@ -26,6 +25,7 @@ import net.legacyfabric.fabric.api.entity.event.v1.ServerEntityWorldChangeEvents; import net.legacyfabric.fabric.api.entity.event.v1.ServerPlayerEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class EntityEventsTest implements ModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "EntityEvents"); diff --git a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java index c21a7336b..0d87d7385 100644 --- a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java +++ b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/ServerLifecycleEventsTest.java @@ -17,7 +17,6 @@ package net.legacyfabric.fabric.test.lifecycle; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ModInitializer; @@ -26,6 +25,7 @@ import net.legacyfabric.fabric.api.event.lifecycle.v1.ServerEntityEvents; import net.legacyfabric.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ServerLifecycleEventsTest implements ModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ServerLifecycleEvents"); diff --git a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java index 5fa18bf9e..8b39deb2e 100644 --- a/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java +++ b/legacy-fabric-lifecycle-events-v1/common/src/testmod/java/net/legacyfabric/fabric/test/lifecycle/client/ClientLifecycleEventsCommonTest.java @@ -17,7 +17,6 @@ package net.legacyfabric.fabric.test.lifecycle.client; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.entity.EntityType; import net.fabricmc.api.ClientModInitializer; @@ -25,6 +24,7 @@ import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientChunkEvents; import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientEntityEvents; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ClientLifecycleEventsCommonTest implements ClientModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ClientLifecycleEvents"); diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java index 731a6bac4..bac68de8d 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java @@ -17,13 +17,13 @@ package net.legacyfabric.fabric.impl.logger.utils; -import org.jetbrains.annotations.Nullable; - import java.util.Objects; import java.util.Optional; import java.util.function.BooleanSupplier; import java.util.function.Supplier; +import org.jetbrains.annotations.Nullable; + /** * Represents a boolean value which can be true, false or refer to a default value. */ diff --git a/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java b/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java index a14d707bb..5c4787fb4 100644 --- a/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java +++ b/legacy-fabric-rendering-api-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java @@ -19,7 +19,6 @@ import java.awt.Color; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.client.resource.language.I18n; import net.fabricmc.api.ClientModInitializer; @@ -27,6 +26,7 @@ import net.legacyfabric.fabric.api.client.rendering.v1.HudRenderCallback; import net.legacyfabric.fabric.api.client.rendering.v1.InvalidateRenderStateCallback; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class RenderingEventsTest implements ClientModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "RenderingEvents"); diff --git a/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java b/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java index a14d707bb..5c4787fb4 100644 --- a/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java +++ b/legacy-fabric-rendering-api-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/client/rendering/RenderingEventsTest.java @@ -19,7 +19,6 @@ import java.awt.Color; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.client.resource.language.I18n; import net.fabricmc.api.ClientModInitializer; @@ -27,6 +26,7 @@ import net.legacyfabric.fabric.api.client.rendering.v1.HudRenderCallback; import net.legacyfabric.fabric.api.client.rendering.v1.InvalidateRenderStateCallback; import net.legacyfabric.fabric.api.logger.v1.Logger; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class RenderingEventsTest implements ClientModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "RenderingEvents"); diff --git a/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index dfe57c259..5ce1d9cb4 100644 --- a/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.10.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,7 +19,6 @@ import java.util.Arrays; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -28,6 +27,7 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ResourceReloadTest implements ClientModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); diff --git a/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index dfe57c259..5ce1d9cb4 100644 --- a/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.12.2/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,7 +19,6 @@ import java.util.Arrays; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -28,6 +27,7 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ResourceReloadTest implements ClientModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); diff --git a/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index dfe57c259..5ce1d9cb4 100644 --- a/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.7.10/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,7 +19,6 @@ import java.util.Arrays; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -28,6 +27,7 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ResourceReloadTest implements ClientModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); diff --git a/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index dfe57c259..5ce1d9cb4 100644 --- a/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.8.9/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,7 +19,6 @@ import java.util.Arrays; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -28,6 +27,7 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ResourceReloadTest implements ClientModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); diff --git a/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java b/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java index dfe57c259..5ce1d9cb4 100644 --- a/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java +++ b/legacy-fabric-resource-loader-v1/1.8/src/testmod/java/net/legacyfabric/fabric/test/resource/loader/client/ResourceReloadTest.java @@ -19,7 +19,6 @@ import java.util.Arrays; -import net.legacyfabric.fabric.impl.logger.LoggerHelper; import net.minecraft.resource.ResourceManager; import net.fabricmc.api.ClientModInitializer; @@ -28,6 +27,7 @@ import net.legacyfabric.fabric.api.resource.IdentifiableResourceReloadListener; import net.legacyfabric.fabric.api.resource.ResourceManagerHelper; import net.legacyfabric.fabric.api.util.Identifier; +import net.legacyfabric.fabric.impl.logger.LoggerHelper; public class ResourceReloadTest implements ClientModInitializer { private static final Logger LOGGER = Logger.get(LoggerHelper.API, "Test", "ResourceReload"); From a9a9b89ee8bf4972a182ae3cf4a75a1c2fa7f14e Mon Sep 17 00:00:00 2001 From: Cat Core Date: Fri, 23 Feb 2024 12:32:41 +0100 Subject: [PATCH 12/12] Apply spotless --- .../net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java | 2 +- .../java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java | 2 +- .../legacyfabric/fabric/impl/logger/utils/BooleanFunction.java | 2 +- .../net/legacyfabric/fabric/impl/logger/utils/TriState.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java index ab2513590..51ecd9a37 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/JavaLoggerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 - 2022 Legacy Fabric + * Copyright (c) 2020 - 2024 Legacy Fabric * Copyright (c) 2016 - 2022 FabricMC * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java index e08a146ae..56ec7d3ac 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/LoggerHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 - 2022 Legacy Fabric + * Copyright (c) 2020 - 2024 Legacy Fabric * Copyright (c) 2016 - 2022 FabricMC * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/BooleanFunction.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/BooleanFunction.java index 9bf96823a..2f5b5e8df 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/BooleanFunction.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/BooleanFunction.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 - 2022 Legacy Fabric + * Copyright (c) 2020 - 2024 Legacy Fabric * Copyright (c) 2016 - 2022 FabricMC * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java index bac68de8d..cb9237faf 100644 --- a/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java +++ b/legacy-fabric-logger-api-v1/common/src/main/java/net/legacyfabric/fabric/impl/logger/utils/TriState.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2020 - 2022 Legacy Fabric + * Copyright (c) 2020 - 2024 Legacy Fabric * Copyright (c) 2016 - 2022 FabricMC * * Licensed under the Apache License, Version 2.0 (the "License");