From 081bf824bbb448e6665573f7f8f531cbbe43dea0 Mon Sep 17 00:00:00 2001 From: syeyoung <42869671+cyoung06@users.noreply.github.com> Date: Mon, 7 Dec 2020 14:53:45 +0900 Subject: stop calling twice --- src/main/java/kr/syeyoung/dungeonsguide/EventListener.java | 3 +++ .../dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java b/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java index d1daa7d6..5f37ea82 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java @@ -126,17 +126,20 @@ public class EventListener { EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer; Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition()); + RoomProcessor roomProcessor = null; try { DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt); if (dungeonRoom != null) { if (dungeonRoom.getRoomProcessor() != null) { dungeonRoom.getRoomProcessor().chatReceived(clientChatReceivedEvent.message); + roomProcessor = dungeonRoom.getRoomProcessor(); } } } catch (Throwable t) { t.printStackTrace(); } for (RoomProcessor globalRoomProcessor : context.getGlobalRoomProcessors()) { + if (globalRoomProcessor == roomProcessor) continue;; try { globalRoomProcessor.chatReceived(clientChatReceivedEvent.message); } catch (Throwable t) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java index 7671cc80..c0cf99a5 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/icefill/RoomProcessorIcePath2.java @@ -8,6 +8,7 @@ import kr.syeyoung.dungeonsguide.utils.RenderUtils; import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; import java.awt.*; import java.util.ArrayList; @@ -80,7 +81,7 @@ public class RoomProcessorIcePath2 extends GeneralRoomProcessor { public void tick() { super.tick(); while (!messageQueue.isEmpty()){ - Minecraft.getMinecraft().thePlayer.sendChatMessage(messageQueue.poll()); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(messageQueue.poll())); } } -- cgit