diff options
author | syeyoung <cyong06@naver.com> | 2021-01-04 21:45:04 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-01-04 21:45:04 +0900 |
commit | 04d414547e4d932f4db9a74dbc4aea8d75b96960 (patch) | |
tree | acfccab2803dc6161e4ce099021d2fa972967ace /src/main/java/kr/syeyoung/dungeonsguide/roomprocessor | |
parent | ece0af65a8bba6c722ac6f0853c570d2e8cad784 (diff) | |
download | Skyblock-Dungeons-Guide-04d414547e4d932f4db9a74dbc4aea8d75b96960.tar.gz Skyblock-Dungeons-Guide-04d414547e4d932f4db9a74dbc4aea8d75b96960.tar.bz2 Skyblock-Dungeons-Guide-04d414547e4d932f4db9a74dbc4aea8d75b96960.zip |
Various things
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomprocessor')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java | 33 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java index 541d5ccc..a46ea8cb 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java @@ -1,13 +1,17 @@ package kr.syeyoung.dungeonsguide.roomprocessor; import kr.syeyoung.dungeonsguide.config.Config; +import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.roomedit.EditingContext; import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; import lombok.Getter; import lombok.Setter; +import net.minecraft.client.Minecraft; +import net.minecraft.util.BlockPos; import net.minecraft.util.IChatComponent; import java.awt.*; @@ -48,6 +52,35 @@ public class GeneralRoomProcessor implements RoomProcessor { } @Override + public void actionbarReceived(IChatComponent chat) { + if (dungeonRoom.getTotalSecrets() != -1) return; + BlockPos pos = Minecraft.getMinecraft().thePlayer.getPosition(); + DungeonContext context = e.getDungeonsGuide().getSkyblockStatus().getContext(); + Point pt1 = context.getMapProcessor().worldPointToRoomPoint(pos.add(2,0,2)); + Point pt2 = context.getMapProcessor().worldPointToRoomPoint(pos.add(-2,0,-2)); + if (!pt1.equals(pt2)) { + return; + } + + + String text = chat.getFormattedText(); + int secretsIndex = text.indexOf("Secrets"); + if (secretsIndex == -1) { + dungeonRoom.setTotalSecrets(0); + return; + } + int theindex = 0; + for (int i = secretsIndex; i > 0; i--) { + if (text.startsWith("ยง7", i)) { + theindex = i; + } + } + String it = text.substring(theindex + 2, secretsIndex- 1); + int maxSecret = Integer.parseInt(it.split("/")[1]); + dungeonRoom.setTotalSecrets(maxSecret); + } + + @Override public boolean readGlobalChat() { return false; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java index f768ac40..e922cfd1 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java @@ -8,6 +8,7 @@ public interface RoomProcessor { void drawScreen(float partialTicks); void drawWorld(float partialTicks); void chatReceived(IChatComponent chat); + void actionbarReceived(IChatComponent chat); boolean readGlobalChat(); }
\ No newline at end of file |