aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-28 00:24:22 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-28 00:24:22 +0900
commit832eb22f6320540c8f9c2c12dec5e8466bbe87f1 (patch)
tree2122c930db0e21b2d0aa6957ce5be980fb2726b0 /src
parent2a4d8f550661a510ec4abbeabdc7b6fcb03322a5 (diff)
downloadSkyblock-Dungeons-Guide-832eb22f6320540c8f9c2c12dec5e8466bbe87f1.tar.gz
Skyblock-Dungeons-Guide-832eb22f6320540c8f9c2c12dec5e8466bbe87f1.tar.bz2
Skyblock-Dungeons-Guide-832eb22f6320540c8f9c2c12dec5e8466bbe87f1.zip
DEBUG Command, chat msg to thing stuff
Diffstat (limited to 'src')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/EventListener.java23
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java3
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java3
4 files changed, 29 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java
index 459c963a..d15b1583 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java
@@ -6,6 +6,7 @@ import kr.syeyoung.dungeonsguide.commands.CommandSaveData;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry;
import lombok.Getter;
import net.minecraft.client.Minecraft;
+import net.minecraft.command.CommandDebug;
import net.minecraft.init.Blocks;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.client.ClientCommandHandler;
@@ -45,6 +46,7 @@ public class DungeonsGuide
MinecraftForge.EVENT_BUS.register(cc);
ClientCommandHandler.instance.registerCommand(new CommandLoadData());
ClientCommandHandler.instance.registerCommand(new CommandSaveData());
+ ClientCommandHandler.instance.registerCommand(new CommandDebug());
//noinspection ResultOfMethodCallIgnored
configDir.mkdirs();
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java b/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
index 9ded79ef..39abefee 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/EventListener.java
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ResourceLocation;
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
@@ -103,6 +104,28 @@ public class EventListener {
}
@SubscribeEvent
+ public void onChatReceived(ClientChatReceivedEvent clientChatReceivedEvent) {
+ SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus();
+ if (!skyblockStatus.isOnDungeon()) return;
+
+ DungeonContext context = skyblockStatus.getContext();
+
+ if (skyblockStatus.getContext() != null) {
+ EntityPlayerSP thePlayer = Minecraft.getMinecraft().thePlayer;
+ Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition());
+
+ DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt);
+ FontRenderer fontRenderer = Minecraft.getMinecraft().fontRendererObj;
+ if (dungeonRoom != null) {
+ if (dungeonRoom.getRoomProcessor() != null)
+ dungeonRoom.getRoomProcessor().chatReceived(clientChatReceivedEvent.message);
+ }
+
+ }
+ }
+
+
+ @SubscribeEvent
public void onWorldRender(RenderWorldLastEvent renderWorldLastEvent) {
SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus();
if (!skyblockStatus.isOnDungeon()) return;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
index 71664aa4..ce4f6b16 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
@@ -4,6 +4,7 @@ import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.RoomProcessorWaterPuzzle;
import lombok.Getter;
import lombok.Setter;
+import net.minecraft.util.IChatComponent;
public class GeneralRoomProcessor implements RoomProcessor {
@@ -30,7 +31,7 @@ public class GeneralRoomProcessor implements RoomProcessor {
}
@Override
- public void chatReceived(String chat) {
+ public void chatReceived(IChatComponent chat) {
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
index cf7e9ff0..78b5c8c8 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
@@ -1,10 +1,11 @@
package kr.syeyoung.dungeonsguide.roomprocessor;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
+import net.minecraft.util.IChatComponent;
public interface RoomProcessor {
void tick();
void drawScreen(float partialTicks);
void drawWorld(float partialTicks);
- void chatReceived(String chat);
+ void chatReceived(IChatComponent chat);
} \ No newline at end of file