diff options
author | syeyoung <cyong06@naver.com> | 2021-03-28 16:52:01 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-03-28 16:52:01 +0900 |
commit | 833e0c8834b8df95b33e44f579a66d58b53679c3 (patch) | |
tree | 3519db04820ad7fb64b38dc48eac11c2dcd41a97 /src/main | |
parent | 0980a08a0d6998afd639f3c3d908c0bc2ca74b86 (diff) | |
download | Skyblock-Dungeons-Guide-833e0c8834b8df95b33e44f579a66d58b53679c3.tar.gz Skyblock-Dungeons-Guide-833e0c8834b8df95b33e44f579a66d58b53679c3.tar.bz2 Skyblock-Dungeons-Guide-833e0c8834b8df95b33e44f579a66d58b53679c3.zip |
fix bugs
Diffstat (limited to 'src/main')
6 files changed, 29 insertions, 16 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java index 57846477..dcc9e7fa 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java @@ -206,7 +206,7 @@ public class MapProcessor { if (color == 18 && dungeonRoom.getCurrentState() != DungeonRoom.RoomState.FINISHED) { dungeonRoom.setCurrentState(DungeonRoom.RoomState.COMPLETE_WITHOUT_SECRETS); dungeonRoom.setTotalSecrets(0); - } if (color == 30) { + } else if (color == 30) { dungeonRoom.setCurrentState(DungeonRoom.RoomState.FINISHED); dungeonRoom.setTotalSecrets(0); } else if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.FINISHED){ diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java index a9d80266..fae91d26 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMove.java @@ -51,7 +51,7 @@ public class ActionMove extends AbstractAction { if (FeatureRegistry.SECRET_TOGGLE_KEY.isEnabled() && Keybinds.togglePathfindStatus) return; if (poses != null){ - RenderUtils.drawLines(poses, FeatureRegistry.SECRET_BROWSE.getColor(), partialTicks, FeatureRegistry.SECRET_BROWSE.getThickness(), true); + RenderUtils.drawLines(poses, FeatureRegistry.SECRET_BROWSE.getColor(), FeatureRegistry.SECRET_BROWSE.getThickness(), partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java index 72f39115..d9e9251d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionMoveNearestAir.java @@ -49,7 +49,7 @@ public class ActionMoveNearestAir extends AbstractAction { if (FeatureRegistry.SECRET_TOGGLE_KEY.isEnabled() && Keybinds.togglePathfindStatus) return; if (poses != null){ - RenderUtils.drawLines(poses, FeatureRegistry.SECRET_BROWSE.getColor(), partialTicks, FeatureRegistry.SECRET_BROWSE.getThickness(), true); + RenderUtils.drawLines(poses, FeatureRegistry.SECRET_BROWSE.getColor(), FeatureRegistry.SECRET_BROWSE.getThickness(), partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java index 93332f09..29060c1e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java @@ -38,6 +38,6 @@ public class FeatureBoxRealLivid extends SimpleFeature implements WorldRenderLis AColor c = this.<AColor>getParameter("color").getValue(); if (playerMP != null) - RenderUtils.highlightBox(playerMP, AxisAlignedBB.fromBounds(-0.4,-1.5,-0.4,0.4,0,0.4), c, partialTicks, true); + RenderUtils.highlightBox(playerMP, AxisAlignedBB.fromBounds(-0.4,0,-0.4,0.4,1.8,0.4), c, partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java index 7557820c..9d61c382 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonDeaths.java @@ -15,15 +15,18 @@ import kr.syeyoung.dungeonsguide.features.text.TextStyle; import kr.syeyoung.dungeonsguide.utils.TextUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.network.NetworkPlayerInfo; +import net.minecraft.scoreboard.Score; +import net.minecraft.scoreboard.ScoreObjective; +import net.minecraft.scoreboard.ScorePlayerTeam; +import net.minecraft.scoreboard.Scoreboard; import net.minecraft.util.ChatComponentText; import net.minecraftforge.client.event.ClientChatReceivedEvent; import org.lwjgl.opengl.GL11; import java.awt.*; -import java.util.ArrayList; -import java.util.Arrays; +import java.util.*; import java.util.List; -import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -76,7 +79,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener } text.add(new StyledText("Total Deaths","total")); text.add(new StyledText(": ","separator")); - text.add(new StyledText(deathsCnt+"","totalDeaths")); + text.add(new StyledText(getTotalDeaths()+"","totalDeaths")); return text; } @@ -110,6 +113,12 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener public int getTotalDeaths() { if (!skyblockStatus.isOnDungeon()) return 0; + for (NetworkPlayerInfo networkPlayerInfoIn : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) { + String name = networkPlayerInfoIn.getDisplayName() != null ? networkPlayerInfoIn.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfoIn.getPlayerTeam(), networkPlayerInfoIn.getGameProfile().getName()); + if (name.contains("Deaths")) { + return Integer.parseInt(TextUtils.keepIntegerCharactersOnly(TextUtils.keepScoreboardCharacters(TextUtils.stripColor(name)))); + } + } DungeonContext context = skyblockStatus.getContext(); if (context == null) return 0; int d = 0; @@ -133,7 +142,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener Matcher m = deathPattern.matcher(txt); if (m.matches()) { String nickname = TextUtils.stripColor(m.group(1)); - int deaths = context.getDeaths().containsKey(nickname) ? context.getDeaths().get(nickname) : 0; + int deaths = context.getDeaths().getOrDefault(nickname, 0); context.getDeaths().put(nickname, deaths + 1); context.createEvent(new DungeonDeathEvent(nickname, txt, deaths)); e.sendDebugChat(new ChatComponentText("Death verified :: "+nickname+" / "+(deaths + 1))); @@ -141,7 +150,7 @@ public class FeatureDungeonDeaths extends TextHUDFeature implements ChatListener Matcher m2 = meDeathPattern.matcher(txt); if (m2.matches()) { String nickname = "me"; - int deaths = context.getDeaths().containsKey(nickname) ? context.getDeaths().get(nickname) : 0; + int deaths = context.getDeaths().getOrDefault(nickname, 0); context.getDeaths().put(nickname, deaths + 1); context.createEvent(new DungeonDeathEvent(Minecraft.getMinecraft().thePlayer.getName(), txt, deaths)); e.sendDebugChat(new ChatComponentText("Death verified :: me / "+(deaths + 1))); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java index c3439727..6bee931d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java @@ -233,11 +233,11 @@ public class FeatureDungeonScore extends TextHUDFeature implements StompConnecte if (dungeonRoom.getColor() == 62) traproomFound = true; if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.DISCOVERED) totalCompRooms += dungeonRoom.getUnitPoints().size(); - if (dungeonRoom.getColor() == 66 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) + if (dungeonRoom.getColor() == 66 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) // INCOMPLETE PUZZLE ON MAP skill -= 10; - if (dungeonRoom.getColor() == 74 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) + if (dungeonRoom.getColor() == 74 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) // INCOMPLETE BOSSROOM YELLOW skill += 1; - if (dungeonRoom.getColor() == 62 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) + if (dungeonRoom.getColor() == 62 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) // INCOMPLETE TRAP ROOM skill += 1; skill += dungeonRoom.getCurrentState().getScoreModifier(); @@ -245,7 +245,7 @@ public class FeatureDungeonScore extends TextHUDFeature implements StompConnecte if (!bossroomFound) skill += 1; if (!traproomFound && context.isTrapRoomGen()) skill += 1; skill -= getUndiscoveredPuzzles() * 10; - skill -= (getTotalRooms() - totalCompRooms) * 4; + skill -= Math.max(0, (getTotalRooms() - totalCompRooms) * 4); skill = MathHelper.clamp_int(skill, 0, 100); } int explorer = 0; @@ -255,15 +255,19 @@ public class FeatureDungeonScore extends TextHUDFeature implements StompConnecte int secrets = 0; { int completed = 0; + double total = 0; + for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { if (dungeonRoom.getTotalSecrets() != -1) totalSecrets += dungeonRoom.getTotalSecrets(); else totalSecretsKnown = false; - if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.DISCOVERED) + if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.DISCOVERED && dungeonRoom.getCurrentState() != DungeonRoom.RoomState.FAILED) completed += dungeonRoom.getUnitPoints().size(); + total += dungeonRoom.getUnitPoints().size(); } + fullyCleared = completed >= getTotalRooms() && context.getMapProcessor().getUndiscoveredRoom() == 0; - explorer += MathHelper.clamp_int((int) Math.floor(6.0 / 10.0 * getPercentage()), 0, 60); + explorer += MathHelper.clamp_int((int) Math.floor(6.0 / 10.0 * (context.getMapProcessor().getUndiscoveredRoom() != 0 ? getPercentage() : completed / total * 100)), 0, 60); explorer += MathHelper.clamp_int((int) Math.floor(40 * ((secrets = FeatureRegistry.DUNGEON_SECRETS.getSecretsFound()) / (double)totalSecrets)),0,40); } int time = 0; |