From 506566601db6e4f16cb863ce05940bb126dfd45c Mon Sep 17 00:00:00 2001 From: 1e99 Date: Sun, 15 Dec 2024 21:53:29 +0100 Subject: [PATCH] add logger on server --- mod-fabric/resources/pixelchat.mixins.json | 7 ++----- mod-fabric/src/eu/e99/pixelchat/fabric/PixelChat.java | 1 - .../e99/pixelchat/fabric/mixin/MessageHandlerMixin.java | 8 -------- server/build.gradle | 1 + server/src/eu/e99/pixelchat/server/ImageHandler.java | 2 ++ .../eu/e99/pixelchat/server/storage/MemoryStorage.java | 2 +- 6 files changed, 6 insertions(+), 15 deletions(-) delete mode 100644 mod-fabric/src/eu/e99/pixelchat/fabric/mixin/MessageHandlerMixin.java diff --git a/mod-fabric/resources/pixelchat.mixins.json b/mod-fabric/resources/pixelchat.mixins.json index e0fda93..003321a 100644 --- a/mod-fabric/resources/pixelchat.mixins.json +++ b/mod-fabric/resources/pixelchat.mixins.json @@ -2,14 +2,11 @@ "required": true, "package": "eu.e99.pixelchat.fabric.mixin", "compatibilityLevel": "JAVA_21", - "mixins": [ - "ChatScreenMixin" - ], "injectors": { "defaultRequire": 1 }, "client": [ - "BossBarHudMixin", - "MessageHandlerMixin" + "ChatScreenMixin", + "BossBarHudMixin" ] } \ No newline at end of file diff --git a/mod-fabric/src/eu/e99/pixelchat/fabric/PixelChat.java b/mod-fabric/src/eu/e99/pixelchat/fabric/PixelChat.java index d2bc5ea..3b3eda1 100644 --- a/mod-fabric/src/eu/e99/pixelchat/fabric/PixelChat.java +++ b/mod-fabric/src/eu/e99/pixelchat/fabric/PixelChat.java @@ -3,7 +3,6 @@ package eu.e99.pixelchat.fabric; import eu.e99.pixelchat.fabric.image.ImageUploader; import net.fabricmc.api.ClientModInitializer; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.gui.hud.BossBarHud; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/mod-fabric/src/eu/e99/pixelchat/fabric/mixin/MessageHandlerMixin.java b/mod-fabric/src/eu/e99/pixelchat/fabric/mixin/MessageHandlerMixin.java deleted file mode 100644 index ade0259..0000000 --- a/mod-fabric/src/eu/e99/pixelchat/fabric/mixin/MessageHandlerMixin.java +++ /dev/null @@ -1,8 +0,0 @@ -package eu.e99.pixelchat.fabric.mixin; - -import net.minecraft.client.network.message.MessageHandler; -import org.spongepowered.asm.mixin.Mixin; - -@Mixin(MessageHandler.class) -public class MessageHandlerMixin { -} diff --git a/server/build.gradle b/server/build.gradle index 5675fc1..ec97e00 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -11,6 +11,7 @@ repositories { dependencies { implementation 'io.javalin:javalin:6.3.0' + implementation 'org.slf4j:slf4j-simple:2.0.16' implementation 'org.apache.commons:commons-imaging:1.0.0-alpha5' } diff --git a/server/src/eu/e99/pixelchat/server/ImageHandler.java b/server/src/eu/e99/pixelchat/server/ImageHandler.java index 6e688dd..aa1be08 100644 --- a/server/src/eu/e99/pixelchat/server/ImageHandler.java +++ b/server/src/eu/e99/pixelchat/server/ImageHandler.java @@ -8,6 +8,8 @@ import org.apache.commons.imaging.ImageFormat; import org.apache.commons.imaging.ImageFormats; import org.apache.commons.imaging.Imaging; import org.apache.commons.imaging.internal.ImageParserFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.awt.image.BufferedImage; import java.io.IOException; diff --git a/server/src/eu/e99/pixelchat/server/storage/MemoryStorage.java b/server/src/eu/e99/pixelchat/server/storage/MemoryStorage.java index 9859002..3925bba 100644 --- a/server/src/eu/e99/pixelchat/server/storage/MemoryStorage.java +++ b/server/src/eu/e99/pixelchat/server/storage/MemoryStorage.java @@ -6,7 +6,7 @@ import java.util.Map; public class MemoryStorage implements Storage { private final Map storage; - private int counter = 0; + private int counter; public MemoryStorage() { this.storage = new HashMap<>();