From 740c141be9abb13b7b54389a408b082570945153 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Sat, 27 Feb 2021 00:55:04 +0900 Subject: massive refactor --- .../dungeon/actions/ActionChangeState.java | 4 +- .../dungeon/actions/tree/ActionRoute.java | 2 +- .../dungeon/mechanics/DungeonBreakableWall.java | 5 +- .../dungeon/mechanics/DungeonDoor.java | 5 +- .../dungeon/mechanics/DungeonDummy.java | 3 +- .../dungeon/mechanics/DungeonFairySoul.java | 8 +-- .../dungeon/mechanics/DungeonJournal.java | 4 +- .../dungeon/mechanics/DungeonLever.java | 6 +- .../dungeon/mechanics/DungeonMechanic.java | 2 +- .../dungeon/mechanics/DungeonNPC.java | 2 +- .../dungeon/mechanics/DungeonOnewayDoor.java | 6 +- .../dungeon/mechanics/DungeonOnewayLever.java | 6 +- .../dungeon/mechanics/DungeonPressurePlate.java | 6 +- .../dungeon/mechanics/DungeonRoomDoor.java | 63 +++++++++++++++++++ .../dungeon/mechanics/DungeonSecret.java | 7 +-- .../dungeon/mechanics/DungeonTomb.java | 5 +- .../dungeon/roomfinder/DungeonRoom.java | 14 +++++ .../eventlistener/FeatureListener.java | 30 ++++++++++ .../dungeonsguide/features/FeatureRegistry.java | 5 +- .../features/impl/dungeon/FeaturePlayerESP.java | 64 ++++++++++++++++++++ .../impl/dungeon/FeatureWatcherWarning.java | 70 ++++++++++++++++++++++ .../impl/secret/FeatureMechanicBrowse.java | 35 +++++++---- .../impl/secret/FeatureSoulRoomWarning.java | 2 +- .../features/listener/PlayerRenderListener.java | 8 +++ .../roomprocessor/GeneralRoomProcessor.java | 10 ++-- 25 files changed, 307 insertions(+), 65 deletions(-) create mode 100644 src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java create mode 100644 src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java create mode 100644 src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWatcherWarning.java create mode 100644 src/main/java/kr/syeyoung/dungeonsguide/features/listener/PlayerRenderListener.java (limited to 'src/main/java/kr') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java index 82e87425..9a883cb8 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java @@ -28,7 +28,7 @@ public class ActionChangeState extends AbstractAction{ public Set getPreRequisites(DungeonRoom dungeonRoom) { Set set = new HashSet(); set.addAll(preRequisite2); - DungeonMechanic mechanic = dungeonRoom.getDungeonRoomInfo().getMechanics().get(mechanicName); + DungeonMechanic mechanic = dungeonRoom.getMechanics().get(mechanicName); if (mechanic!= null) set.addAll(mechanic.getAction(state, dungeonRoom)); return set; @@ -40,7 +40,7 @@ public class ActionChangeState extends AbstractAction{ @Override public boolean isComplete(DungeonRoom dungeonRoom) { - DungeonMechanic mechanic = dungeonRoom.getDungeonRoomInfo().getMechanics().get(mechanicName); + DungeonMechanic mechanic = dungeonRoom.getMechanics().get(mechanicName); if (state.equalsIgnoreCase("navigate")) return true; if (mechanic== null) diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java index 49026db9..d5c99c8a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java @@ -71,7 +71,7 @@ public class ActionRoute { current.onTick(dungeonRoom); - if (dungeonRoom.getDungeonRoomInfo().getMechanics().get(mechanic).getCurrentState(dungeonRoom).equals(state)) { + if (dungeonRoom.getMechanics().get(mechanic).getCurrentState(dungeonRoom).equals(state)) { this.current = actions.size() - 1; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java index 5fa994e0..1587393c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java @@ -4,7 +4,6 @@ import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateSuperBoom; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.Data; @@ -55,7 +54,7 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { Set preRequisites = base = new HashSet(); { ActionBreakWithSuperBoom actionClick; - preRequisites.add(actionClick = new ActionBreakWithSuperBoom(getRepresentingPoint())); + preRequisites.add(actionClick = new ActionBreakWithSuperBoom(getRepresentingPoint(dungeonRoom))); preRequisites = actionClick.getPreRequisite(); } { @@ -130,7 +129,7 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint.getOffsetPointList().size() == 0 ? null : secretPoint.getOffsetPointList().get(secretPoint.getOffsetPointList().size() / 2); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java index 443e8bbd..9c16a481 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java @@ -5,9 +5,6 @@ import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionClickSet; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMoveNearestAir; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateSuperBoom; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.Data; @@ -99,7 +96,7 @@ public class DungeonDoor implements DungeonMechanic, RouteBlocker { } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { int leastY = Integer.MAX_VALUE; OffsetPoint thatPt = null; for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java index 3fe6ef46..139e32a2 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java @@ -3,7 +3,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateArmorStand; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.Data; @@ -81,7 +80,7 @@ public class DungeonDummy implements DungeonMechanic { return Sets.newHashSet("no-state","navigate,click"); } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java index 5f619089..3b8e6a5c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonFairySoul.java @@ -4,15 +4,9 @@ import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateArmorStand; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateBat; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.utils.RenderUtils; -import lombok.AllArgsConstructor; import lombok.Data; -import lombok.Getter; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.BlockPos; import java.awt.*; @@ -83,7 +77,7 @@ public class DungeonFairySoul implements DungeonMechanic { return Sets.newHashSet("no-state","navigate"); } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java index 3993d0d7..5d5a5776 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonJournal.java @@ -3,10 +3,8 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionInteract; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMove; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateArmorStand; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.Data; @@ -75,7 +73,7 @@ public class DungeonJournal implements DungeonMechanic { return Sets.newHashSet("no-state","navigate"); } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java index 7dd69af3..86ae7a6a 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java @@ -24,7 +24,7 @@ public class DungeonLever implements DungeonMechanic { if (state.equalsIgnoreCase("navigate")) { Set base; Set preRequisites = base = new HashSet(); - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); for (String str : preRequisite) { @@ -78,7 +78,7 @@ public class DungeonLever implements DungeonMechanic { @Override public String getCurrentState(DungeonRoom dungeonRoom) { if (triggering == null) triggering = "null"; - DungeonMechanic mechanic = dungeonRoom.getDungeonRoomInfo().getMechanics().get(triggering); + DungeonMechanic mechanic = dungeonRoom.getMechanics().get(triggering); if (mechanic == null) { return "undeterminable"; @@ -106,7 +106,7 @@ public class DungeonLever implements DungeonMechanic { return Sets.newHashSet("triggered", "untriggered"); } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return leverPoint; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java index 7dd91ae6..ab790e9b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java @@ -18,5 +18,5 @@ public interface DungeonMechanic extends Serializable { Set getPossibleStates(DungeonRoom dungeonRoom); Set getTotalPossibleStates(DungeonRoom dungeonRoom); - OffsetPoint getRepresentingPoint(); + OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java index 086f3d11..ea1f7aa5 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonNPC.java @@ -82,7 +82,7 @@ public class DungeonNPC implements DungeonMechanic { return Sets.newHashSet("no-state","navigate"); } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java index 803f7c5b..80a9beed 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java @@ -5,9 +5,7 @@ import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionClickSet; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMoveNearestAir; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateSuperBoom; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.Data; @@ -29,7 +27,7 @@ public class DungeonOnewayDoor implements DungeonMechanic, RouteBlocker { if (state.equalsIgnoreCase("navigate")) { Set base; Set preRequisites = base = new HashSet(); - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); for (String str : preRequisite) { @@ -103,7 +101,7 @@ public class DungeonOnewayDoor implements DungeonMechanic, RouteBlocker { @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { int leastY = Integer.MAX_VALUE; OffsetPoint thatPt = null; for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java index bddfa231..bac4d7e3 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java @@ -24,7 +24,7 @@ public class DungeonOnewayLever implements DungeonMechanic { if (state.equalsIgnoreCase("navigate")) { Set base; Set preRequisites = base = new HashSet(); - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); for (String str : preRequisite) { @@ -77,7 +77,7 @@ public class DungeonOnewayLever implements DungeonMechanic { @Override public String getCurrentState(DungeonRoom dungeonRoom) { if (triggering == null) triggering = "null"; - DungeonMechanic mechanic = dungeonRoom.getDungeonRoomInfo().getMechanics().get(triggering); + DungeonMechanic mechanic = dungeonRoom.getMechanics().get(triggering); if (mechanic == null) { return "undeterminable"; @@ -104,7 +104,7 @@ public class DungeonOnewayLever implements DungeonMechanic { } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return leverPoint; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java index 79ef4bda..75231eff 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java @@ -24,7 +24,7 @@ public class DungeonPressurePlate implements DungeonMechanic { if (state.equalsIgnoreCase("navigate")) { Set base; Set preRequisites = base = new HashSet(); - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); for (String str : preRequisite) { @@ -79,7 +79,7 @@ public class DungeonPressurePlate implements DungeonMechanic { @Override public String getCurrentState(DungeonRoom dungeonRoom) { if (triggering == null) triggering = "null"; - DungeonMechanic mechanic = dungeonRoom.getDungeonRoomInfo().getMechanics().get(triggering); + DungeonMechanic mechanic = dungeonRoom.getMechanics().get(triggering); if (mechanic == null) { return "undeterminable"; @@ -107,7 +107,7 @@ public class DungeonPressurePlate implements DungeonMechanic { return Sets.newHashSet("triggered", "untriggered"); } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return platePoint; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java new file mode 100644 index 00000000..83b5388a --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonRoomDoor.java @@ -0,0 +1,63 @@ +package kr.syeyoung.dungeonsguide.dungeon.mechanics; + +import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.dungeon.actions.Action; +import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMove; +import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; +import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; +import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import net.minecraft.util.BlockPos; + +import java.awt.*; +import java.util.HashSet; +import java.util.Set; + +public class DungeonRoomDoor implements DungeonMechanic { + private DungeonDoor doorfinder; + + public DungeonRoomDoor(DungeonDoor doorfinder) { + this.doorfinder = doorfinder; + } + + @Override + public Set getAction(String state, DungeonRoom dungeonRoom) { + if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); + Set base; + Set preRequisites = base = new HashSet(); + { + ActionMove actionMove = new ActionMove(new OffsetPoint(dungeonRoom, doorfinder.getPosition())); + preRequisites.add(actionMove); + preRequisites = actionMove.getPreRequisite(); + } + return base; + } + + @Override + public void highlight(Color color, String name, DungeonRoom dungeonRoom, float partialTicks) { + BlockPos pos = doorfinder.getPosition(); + RenderUtils.highlightBlock(pos, color,partialTicks); + RenderUtils.drawTextAtWorld(name, pos.getX() +0.5f, pos.getY()+0.75f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() +0.5f, pos.getY()+0.25f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + } + + @Override + public String getCurrentState(DungeonRoom dungeonRoom) { + return doorfinder.isRequiresKey() ? doorfinder.isOpened() ? "key-open" : "key-closed" : "normal"; + } + + @Override + public Set getPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("navigate"); + } + + @Override + public Set getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("key-open", "key-closed", "normal"); + } + + @Override + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { + return new OffsetPoint(dungeonRoom, doorfinder.getPosition()); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java index 05a2a7c1..f2c93624 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java @@ -7,7 +7,6 @@ import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateBat; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.pathfinding.NodeProcessorDungeonRoom; -import kr.syeyoung.dungeonsguide.roomedit.panes.SecretEditPane; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.AllArgsConstructor; import lombok.Data; @@ -18,8 +17,6 @@ import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; -import net.minecraft.util.Vec3i; -import net.minecraft.util.Vector3d; import java.awt.*; import java.util.*; @@ -92,7 +89,7 @@ public class DungeonSecret implements DungeonMechanic { if (state.equalsIgnoreCase("navigate")) { Set base; Set preRequisites = base = new HashSet(); - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); for (String str : preRequisite) { @@ -177,7 +174,7 @@ public class DungeonSecret implements DungeonMechanic { return Sets.newHashSet("found"/*, "definitely_not", "not_sure", "created", "error"*/); } @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java index 0f84d164..2a17bbc8 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java @@ -4,7 +4,6 @@ import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; -import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateSuperBoom; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.Data; @@ -27,7 +26,7 @@ public class DungeonTomb implements DungeonMechanic, RouteBlocker { if (state.equalsIgnoreCase("navigate")) { Set base; Set preRequisites = base = new HashSet(); - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint(dungeonRoom)); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); for (String str : preRequisite) { @@ -110,7 +109,7 @@ public class DungeonTomb implements DungeonMechanic, RouteBlocker { @Override - public OffsetPoint getRepresentingPoint() { + public OffsetPoint getRepresentingPoint(DungeonRoom dungeonRoom) { return secretPoint.getOffsetPointList().size() == 0 ? null : secretPoint.getOffsetPointList().get(0); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java index 05eb09e9..def02c91 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java @@ -6,6 +6,8 @@ import kr.syeyoung.dungeonsguide.dungeon.MapProcessor; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; import kr.syeyoung.dungeonsguide.dungeon.events.DungeonStateChangeEvent; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonRoomDoor; import kr.syeyoung.dungeonsguide.pathfinding.NodeProcessorDungeonRoom; import kr.syeyoung.dungeonsguide.roomprocessor.ProcessorFactory; import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; @@ -45,6 +47,18 @@ public class DungeonRoom { private int totalSecrets = -1; private RoomState currentState = RoomState.DISCOVERED; + private Map cached = null; + public Map getMechanics() { + if (cached == null) { + cached = new HashMap(dungeonRoomInfo.getMechanics()); + int index = 0; + for (DungeonDoor door : doors) { + if (door.isExist()) cached.put((door.isRequiresKey() ? "withergate" : "gate")+"-"+(++index), new DungeonRoomDoor(door)); + } + } + return cached; + } + public void setCurrentState(RoomState currentState) { context.createEvent(new DungeonStateChangeEvent(unitPoints.get(0), dungeonRoomInfo.getName(), this.currentState, currentState)); this.currentState = currentState; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java index cb45b416..e1cd7d74 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/eventlistener/FeatureListener.java @@ -34,6 +34,36 @@ public class FeatureListener { t.printStackTrace(); } } + @SubscribeEvent + public void onRender(RenderPlayerEvent.Pre preRender) { + try { + SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + if (!skyblockStatus.isOnSkyblock()) return; + + for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { + if (abstractFeature instanceof PlayerRenderListener) { + ((PlayerRenderListener) abstractFeature).onEntityRenderPre(preRender); + } + } + } catch (Throwable t) { + t.printStackTrace(); + } + } + @SubscribeEvent + public void onRender(RenderPlayerEvent.Post preRender) { + try { + SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + if (!skyblockStatus.isOnSkyblock()) return; + + for (AbstractFeature abstractFeature : FeatureRegistry.getFeatureList()) { + if (abstractFeature instanceof PlayerRenderListener) { + ((PlayerRenderListener) abstractFeature).onEntityRenderPost(preRender); + } + } + } catch (Throwable t) { + t.printStackTrace(); + } + } @SubscribeEvent diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java index e3de783e..4a01c5c7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java @@ -81,6 +81,7 @@ public class FeatureRegistry { public static final FeatureInstaCloseChest DUNGEON_INSTACLOSE = register(new FeatureInstaCloseChest()); + public static final FeatureDungeonMap DUNGEON_MAP = register(new FeatureDungeonMap()); public static final FeatureBoxSkelemaster DUNGEON_BOXSKELEMASTER = register(new FeatureBoxSkelemaster()); public static final FeatureBoxBats DUNGEON_BOXBAT = register(new FeatureBoxBats()); public static final FeatureBoxStarMobs DUNGEON_BOXSTARMOBS = register(new FeatureBoxStarMobs()); @@ -94,7 +95,9 @@ public class FeatureRegistry { public static final FeatureDungeonScore DUNGEON_SCORE = register(new FeatureDungeonScore()); public static final FeatureWarnLowHealth DUNGEON_LOWHEALTH_WARN = register(new FeatureWarnLowHealth()); public static final SimpleFeature DUNGEON_INTERMODCOMM = register(new SimpleFeature("Dungeon", "Communicate With Other's Dungeons Guide", "Sends total secret in the room to others\nSo that they can use the data to calculate total secret in dungeon run\n\nThis automates player chatting action, (chatting data) Thus it might be against hypixel's rules.\nBut mods like auto-gg which also automate player action and is kinda allowed mod exist so I'm leaving this feature.\nThis option is use-at-your-risk and you'll be responsible for ban if you somehow get banned because of this feature\n(Although it is not likely to happen)\nDefaults to off", "dungeon.intermodcomm", false)); - public static final FeatureDungeonMap DUNGEON_MAP = register(new FeatureDungeonMap()); + public static final FeaturePlayerESP DUNGEON_PLEYARESP = register(new FeaturePlayerESP()); + public static final FeatureWatcherWarning DUNGEON_WATCHERWARNING = register(new FeatureWatcherWarning()); + public static final FeatureMechanicBrowse SECRET_BROWSE = register(new FeatureMechanicBrowse()); public static final FeatureActions SECRET_ACTIONS = register(new FeatureActions()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java new file mode 100644 index 00000000..14d62437 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeaturePlayerESP.java @@ -0,0 +1,64 @@ +package kr.syeyoung.dungeonsguide.features.impl.dungeon; + +import com.google.common.base.Predicate; +import kr.syeyoung.dungeonsguide.SkyblockStatus; +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.e; +import kr.syeyoung.dungeonsguide.features.FeatureParameter; +import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.features.listener.PlayerRenderListener; +import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; +import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.AbstractClientPlayer; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.entity.Entity; +import net.minecraft.entity.passive.EntityBat; +import net.minecraft.util.BlockPos; +import net.minecraftforge.client.event.RenderPlayerEvent; +import org.jetbrains.annotations.Nullable; +import org.lwjgl.opengl.GL11; + +import java.util.List; + + +public class FeaturePlayerESP extends SimpleFeature implements PlayerRenderListener { + public FeaturePlayerESP() { + super("Dungeon", "See players through walls", "See players through walls", "dungeon.playeresp", false); + setEnabled(false); + } + + + private SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + + private boolean preCalled = false; + @Override + public void onEntityRenderPre(RenderPlayerEvent.Pre renderPlayerEvent) { + if (preCalled) return; + if (!isEnabled()) return; + + DungeonContext dungeonContext = skyblockStatus.getContext(); + if (dungeonContext == null) return; + if (!dungeonContext.getPlayers().contains(renderPlayerEvent.entityPlayer.getName())) { + return; + } + + + + preCalled = true; + GlStateManager.depthFunc(GL11.GL_GEQUAL); + Entity entity = renderPlayerEvent.entityPlayer; + float f = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * renderPlayerEvent.partialRenderTick; + try { + renderPlayerEvent.renderer.doRender((AbstractClientPlayer) renderPlayerEvent.entityPlayer, renderPlayerEvent.x, renderPlayerEvent.y, renderPlayerEvent.z, f, renderPlayerEvent.partialRenderTick); + } catch (Throwable t) {} + preCalled = false; + GlStateManager.depthFunc(GL11.GL_LEQUAL); + } + + @Override + public void onEntityRenderPost(RenderPlayerEvent.Post renderPlayerEvent) { + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWatcherWarning.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWatcherWarning.java new file mode 100644 index 00000000..a2ca6dab --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureWatcherWarning.java @@ -0,0 +1,70 @@ +package kr.syeyoung.dungeonsguide.features.impl.dungeon; + +import kr.syeyoung.dungeonsguide.SkyblockStatus; +import kr.syeyoung.dungeonsguide.config.types.AColor; +import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonFairySoul; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; +import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.e; +import kr.syeyoung.dungeonsguide.features.listener.ChatListener; +import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; +import kr.syeyoung.dungeonsguide.features.listener.TickListener; +import kr.syeyoung.dungeonsguide.features.text.StyledText; +import kr.syeyoung.dungeonsguide.features.text.TextHUDFeature; +import kr.syeyoung.dungeonsguide.features.text.TextStyle; +import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraftforge.client.event.ClientChatReceivedEvent; + +import java.awt.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.UUID; + +public class FeatureWatcherWarning extends TextHUDFeature implements ChatListener, DungeonEndListener { + + public FeatureWatcherWarning() { + super("Dungeon","Watcher Spawn Alert", "Alert when watcher says 'That will be enough for now'", "dungen.watcherwarn", true, getFontRenderer().getStringWidth("Watcher finished spawning all mobs!"), getFontRenderer().FONT_HEIGHT); + getStyles().add(new TextStyle("warning", new AColor(0xFF, 0x69,0x17,255), new AColor(0, 0,0,0), false)); + setEnabled(false); + } + + SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus(); + @Override + public boolean isHUDViewable() { + return warning > System.currentTimeMillis(); + } + + @Override + public List getUsedTextStyle() { + return Collections.singletonList("warning"); + } + + private UUID lastRoomUID = UUID.randomUUID(); + private long warning = 0; + + private static final List text = new ArrayList(); + static { + text.add(new StyledText("Watcher finished spawning all mobs!", "warning")); + } + + @Override + public List getText() { + return text; + } + + @Override + public void onChat(ClientChatReceivedEvent clientChatReceivedEvent) { + if (clientChatReceivedEvent.message.getFormattedText().equals("§r§c[BOSS] The Watcher§r§f: That will be enough for now.§r")) { + warning = System.currentTimeMillis() + 2500; + } + } + + @Override + public void onDungeonEnd() { + warning = 0; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java index 34fd50c3..0727c36c 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java @@ -12,7 +12,6 @@ import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.features.GuiFeature; import kr.syeyoung.dungeonsguide.features.listener.GuiClickListener; -import kr.syeyoung.dungeonsguide.features.listener.GuiPostRenderListener; import kr.syeyoung.dungeonsguide.features.listener.GuiPreRenderListener; import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener; import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonAddSet; @@ -20,7 +19,6 @@ import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonParameterEdit; import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonValueEdit; import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; -import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.FontRenderer; @@ -38,7 +36,6 @@ import java.awt.*; import java.util.List; import java.util.ArrayList; import java.util.Map; -import java.util.Set; public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderListener, GuiClickListener, WorldRenderListener { @@ -164,8 +161,8 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis String name = sortedMechanicsName.get(i); fr.drawString(name, 3, i * fr.FONT_HEIGHT, 0xFFFFFF00); fr.drawString(" ("+ ((DungeonMechanic) obj).getCurrentState(dungeonRoom) +", "+ - (((DungeonMechanic) obj).getRepresentingPoint() != null ? - String.format("%.1f", MathHelper.sqrt_double(((DungeonMechanic) obj).getRepresentingPoint().getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()))) : "") + (((DungeonMechanic) obj).getRepresentingPoint(dungeonRoom) != null ? + String.format("%.1f", MathHelper.sqrt_double(((DungeonMechanic) obj).getRepresentingPoint(dungeonRoom).getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()))) : "") +"m)",fr.getStringWidth(name) + 3, i * fr.FONT_HEIGHT, 0xFFAAAAAA); } else if ("$SPECIAL-CANCEL".equals(obj)) { fr.drawString("Cancel Current", 3, i * fr.FONT_HEIGHT, 0xFF00FFFF); @@ -225,7 +222,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis sortedMechanicsName.add(""); boolean found = false; - for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getDungeonRoomInfo().getMechanics().entrySet()) { + for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getMechanics().entrySet()) { if (value.getValue() instanceof DungeonFairySoul) { if (!found) { sortedMechanics.add("Fairy Souls"); @@ -237,7 +234,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis } } found = false; - for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getDungeonRoomInfo().getMechanics().entrySet()) { + for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getMechanics().entrySet()) { if (value.getValue() instanceof DungeonSecret) { if (!found) { sortedMechanics.add("Secrets"); @@ -249,7 +246,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis } } found = false; - for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getDungeonRoomInfo().getMechanics().entrySet()) { + for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getMechanics().entrySet()) { if (value.getValue() instanceof DungeonTomb) { if (!found) { sortedMechanics.add("Crypts"); @@ -261,7 +258,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis } } found = false; - for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getDungeonRoomInfo().getMechanics().entrySet()) { + for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getMechanics().entrySet()) { if (value.getValue() instanceof DungeonNPC) { if (!found) { sortedMechanics.add("NPC"); @@ -273,7 +270,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis } } found = false; - for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getDungeonRoomInfo().getMechanics().entrySet()) { + for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getMechanics().entrySet()) { if (value.getValue() instanceof DungeonJournal) { if (!found) { sortedMechanics.add("Journals"); @@ -285,7 +282,19 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis } } found = false; - for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getDungeonRoomInfo().getMechanics().entrySet()) { + for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getMechanics().entrySet()) { + if (value.getValue() instanceof DungeonRoomDoor){ + if (!found) { + sortedMechanics.add("Gates"); + sortedMechanicsName.add(""); + found = true; + } + sortedMechanics.add(value.getValue()); + sortedMechanicsName.add(value.getKey()); + } + } + found = false; + for (Map.Entry value : ((GeneralRoomProcessor) dungeonRoom.getRoomProcessor()).getDungeonRoom().getMechanics().entrySet()) { if (value.getValue() instanceof DungeonDoor || value.getValue() instanceof DungeonBreakableWall || value.getValue() instanceof DungeonLever || value.getValue() instanceof DungeonOnewayDoor || value.getValue() instanceof DungeonOnewayLever || value.getValue() instanceof DungeonPressurePlate) { if (!found) { @@ -404,8 +413,8 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis if (selected != -1) { if (sortedMechanics.size() <= selected) return;; ((DungeonMechanic)sortedMechanics.get(selected)).highlight(new Color(0,255,255,50), sortedMechanicsName.get(selected) +" ("+(((DungeonMechanic) - sortedMechanics.get(selected)).getRepresentingPoint() != null ? - String.format("%.1f", MathHelper.sqrt_double(((DungeonMechanic) sortedMechanics.get(selected)).getRepresentingPoint().getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()))) : "") + sortedMechanics.get(selected)).getRepresentingPoint(dungeonRoom) != null ? + String.format("%.1f", MathHelper.sqrt_double(((DungeonMechanic) sortedMechanics.get(selected)).getRepresentingPoint(dungeonRoom).getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()))) : "") +"m)", dungeonRoom, partialTicks); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java index 785ba617..6f3a3ea7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureSoulRoomWarning.java @@ -86,7 +86,7 @@ public class FeatureSoulRoomWarning extends TextHUDFeature implements TickListen if (!(dungeonRoom.getRoomProcessor() instanceof GeneralRoomProcessor)) return; if (!dungeonRoom.getDungeonRoomInfo().getUuid().equals(lastRoomUID)) { - for (DungeonMechanic value : dungeonRoom.getDungeonRoomInfo().getMechanics().values()) { + for (DungeonMechanic value : dungeonRoom.getMechanics().values()) { if (value instanceof DungeonFairySoul) warning = System.currentTimeMillis() + 2500; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/listener/PlayerRenderListener.java b/src/main/java/kr/syeyoung/dungeonsguide/features/listener/PlayerRenderListener.java new file mode 100644 index 00000000..2cc1e7a0 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/listener/PlayerRenderListener.java @@ -0,0 +1,8 @@ +package kr.syeyoung.dungeonsguide.features.listener; + +import net.minecraftforge.client.event.RenderPlayerEvent; + +public interface PlayerRenderListener { + void onEntityRenderPre(RenderPlayerEvent.Pre renderPlayerEvent ); + void onEntityRenderPost(RenderPlayerEvent.Post renderPlayerEvent ); +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java index b0b98310..ed5dfc87 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java @@ -57,7 +57,7 @@ public class GeneralRoomProcessor implements RoomProcessor { path.onTick(); if (FeatureRegistry.SECRET_AUTO_BROWSE_NEXT.isEnabled() && path.getCurrentAction() instanceof ActionComplete) { if (!path.getState().equals("found")) return; - if (!(dungeonRoom.getDungeonRoomInfo().getMechanics().get(path.getMechanic()) instanceof DungeonSecret)) return; + if (!(dungeonRoom.getMechanics().get(path.getMechanic()) instanceof DungeonSecret)) return; searchForNextTarget(); } } @@ -69,7 +69,7 @@ public class GeneralRoomProcessor implements RoomProcessor { double lowestCost = 99999999999999.0; Map.Entry lowestWeightMechanic = null; - for (Map.Entry mech: dungeonRoom.getDungeonRoomInfo().getMechanics().entrySet()) { + for (Map.Entry mech: dungeonRoom.getMechanics().entrySet()) { if (!(mech.getValue() instanceof DungeonSecret)) continue; if (visited.contains(mech.getKey())) continue; if (((DungeonSecret) mech.getValue()).getSecretStatus(getDungeonRoom()) != DungeonSecret.SecretStatus.FOUND) { @@ -78,8 +78,8 @@ public class GeneralRoomProcessor implements RoomProcessor { ((DungeonSecret) mech.getValue()).getPreRequisite().size() == 0) { cost += -100000000; } - if (mech.getValue().getRepresentingPoint() == null) continue; - BlockPos blockpos = mech.getValue().getRepresentingPoint().getBlockPos(getDungeonRoom()); + if (mech.getValue().getRepresentingPoint(getDungeonRoom()) == null) continue; + BlockPos blockpos = mech.getValue().getRepresentingPoint(getDungeonRoom()).getBlockPos(getDungeonRoom()); cost += blockpos.distanceSq(pos); cost += ((DungeonSecret) mech.getValue()).getPreRequisite().size() * 100; @@ -118,7 +118,7 @@ public class GeneralRoomProcessor implements RoomProcessor { @Override public void drawWorld(float partialTicks) { if (FeatureRegistry.DEBUG.isEnabled() && (EditingContext.getEditingContext() != null && EditingContext.getEditingContext().getCurrent() instanceof GuiDungeonRoomEdit)) { - for (Map.Entry value : dungeonRoom.getDungeonRoomInfo().getMechanics().entrySet()) { + for (Map.Entry value : dungeonRoom.getMechanics().entrySet()) { if (value.getValue() == null) continue;; value.getValue().highlight(new Color(0,255,255,50), value.getKey(), dungeonRoom, partialTicks); } -- cgit