diff options
author | syeyoung <cyong06@naver.com> | 2021-01-06 11:31:07 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-01-06 11:31:07 +0900 |
commit | ba793c28fa627ae2ea437b261be56b4cf19fcd8f (patch) | |
tree | 466c6d541f125f462c2c5415158f29c662b5828d /src/main/java/kr/syeyoung/dungeonsguide/dungeon | |
parent | 04d414547e4d932f4db9a74dbc4aea8d75b96960 (diff) | |
download | Skyblock-Dungeons-Guide-ba793c28fa627ae2ea437b261be56b4cf19fcd8f.tar.gz Skyblock-Dungeons-Guide-ba793c28fa627ae2ea437b261be56b4cf19fcd8f.tar.bz2 Skyblock-Dungeons-Guide-ba793c28fa627ae2ea437b261be56b4cf19fcd8f.zip |
fix xray inter mod comm
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java index 7a6d704f..32f251de 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java @@ -1,12 +1,17 @@ package kr.syeyoung.dungeonsguide.dungeon; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; +import kr.syeyoung.dungeonsguide.utils.TextUtils; import lombok.Getter; import lombok.Setter; import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.IChatComponent; import net.minecraft.util.IntegerCache; import net.minecraft.world.World; +import net.minecraftforge.client.event.ClientChatReceivedEvent; import java.awt.*; import java.util.*; @@ -49,4 +54,23 @@ public class DungeonContext { mapProcessor.tick(); } + public void onChat(ClientChatReceivedEvent event) { + IChatComponent component = event.message; + if (component.getFormattedText().contains("$DG-Comm")) { + event.setCanceled(true); + String data = component.getFormattedText().substring(component.getFormattedText().indexOf("$DG-Comm")); + String actual = TextUtils.stripColor(data); + String coords = actual.split(" ")[1]; + String secrets = actual.split(" ")[2]; + int x = Integer.parseInt(coords.split("/")[0]); + int z = Integer.parseInt(coords.split("/")[1]); + int secrets2 = Integer.parseInt(secrets); + Point roomPt = mapProcessor.worldPointToRoomPoint(new BlockPos(x,70,z)); + e.sendDebugChat(new ChatComponentText("Message from Other dungeons guide :: "+roomPt.x+" / " + roomPt.y + " total secrets "+secrets2)); + DungeonRoom dr = roomMapper.get(roomPt); + if (dr != null) { + dr.setTotalSecrets(secrets2); + } + } + } } |