From 284bd590df9fee1daa097d92b227ce9d057b86f6 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Tue, 24 Jan 2023 21:00:47 +0900 Subject: - fix it eating up chat message when stomp error Signed-off-by: syeyoung --- .../syeyoung/dungeonsguide/mod/chat/ChatProcessor.java | 16 ++++++++++------ .../dungeonsguide/mod/commands/CommandDgDebug.java | 4 ++++ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'mod/src/main/java/kr/syeyoung/dungeonsguide') diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessor.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessor.java index 003b5a44..206aed96 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessor.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/chat/ChatProcessor.java @@ -100,12 +100,16 @@ public class ChatProcessor { ChatSubscriber chatSubscribed = it.next(); context.put("removed", processed); context.put("onceListenered", listened); - ChatProcessResult chatProcessResult = chatSubscribed.process(txt, context); - if (chatProcessResult.isRemoveChat()) processed++; - if (chatProcessResult.isRemoveListener()) listened++; - - if (chatProcessResult.isRemoveChat()) chatReceivedEvent.setResult(Event.Result.DENY); - if (chatProcessResult.isRemoveListener()) it.remove(); + try { + ChatProcessResult chatProcessResult = chatSubscribed.process(txt, context); + if (chatProcessResult.isRemoveChat()) processed++; + if (chatProcessResult.isRemoveListener()) listened++; + + if (chatProcessResult.isRemoveChat()) chatReceivedEvent.setResult(Event.Result.DENY); + if (chatProcessResult.isRemoveListener()) it.remove(); + } catch (Exception e) { + e.printStackTrace(); + } } } diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java index a75b11fb..95d7367c 100644 --- a/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java +++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/mod/commands/CommandDgDebug.java @@ -48,6 +48,7 @@ import kr.syeyoung.dungeonsguide.mod.utils.MapUtils; import kr.syeyoung.dungeonsguide.mod.wsresource.StaticResourceCache; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.settings.GameSettings; import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -186,6 +187,9 @@ public class CommandDgDebug extends CommandBase { case "clearprofile": clearProfileCommand(); break; + case "gimmebright": + Minecraft.getMinecraft().gameSettings.setOptionFloatValue(GameSettings.Options.GAMMA, 1000); + break; default: ChatTransmitter.addToQueue(new ChatComponentText("ain't gonna find much anything here")); ChatTransmitter.addToQueue(new ChatComponentText("§eDungeons Guide §7:: §e/dg loadrooms §7-§f Reloads dungeon roomdata.")); -- cgit