diff options
author | syeyoung <cyong06@naver.com> | 2021-02-14 19:31:46 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-14 19:31:46 +0900 |
commit | befa8982a0a8d929e65a23b66040671a45181ef4 (patch) | |
tree | 9c32ac7e538d9ec0c970b2bd128c6c2d953e07c6 /src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics | |
parent | 3bbe67ecd993bac9e32e7f303ce84b2fa5c7cda4 (diff) | |
download | Skyblock-Dungeons-Guide-befa8982a0a8d929e65a23b66040671a45181ef4.tar.gz Skyblock-Dungeons-Guide-befa8982a0a8d929e65a23b66040671a45181ef4.tar.bz2 Skyblock-Dungeons-Guide-befa8982a0a8d929e65a23b66040671a45181ef4.zip |
new thins
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java | 22 | ||||
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java | 20 |
2 files changed, 40 insertions, 2 deletions
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 5ba3f21c..5fa994e0 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java @@ -27,7 +27,16 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { if (state.equalsIgnoreCase("navigate")) { Set<Action> base; Set<Action> preRequisites = base = new HashSet<Action>(); - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + + int leastY = Integer.MAX_VALUE; + OffsetPoint thatPt = null; + for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) { + if (offsetPoint.getY() < leastY) { + thatPt = offsetPoint; + leastY = offsetPoint.getY(); + } + } + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(thatPt); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); for (String str : preRequisite) { @@ -50,7 +59,16 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { preRequisites = actionClick.getPreRequisite(); } { - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); + + int leastY = Integer.MAX_VALUE; + OffsetPoint thatPt = null; + for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) { + if (offsetPoint.getY() < leastY) { + thatPt = offsetPoint; + leastY = offsetPoint.getY(); + } + } + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(thatPt); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); } 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 182e0201..abedc705 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java @@ -1,10 +1,12 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.dungeon.DungeonActionManager; import kr.syeyoung.dungeonsguide.dungeon.actions.*; 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.roomedit.panes.SecretEditPane; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import lombok.AllArgsConstructor; import lombok.Data; @@ -13,6 +15,7 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntityChest; import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; import java.awt.*; import java.util.*; @@ -40,6 +43,23 @@ public class DungeonSecret implements DungeonMechanic { return SecretStatus.CREATED; } } + } else if (secretType == SecretType.ESSENCE) { + BlockPos pos = secretPoint.getBlockPos(dungeonRoom); + IBlockState blockState = dungeonRoom.getContext().getWorld().getBlockState(pos); + if (blockState.getBlock() == Blocks.skull) { + return SecretStatus.DEFINITELY_NOT; + } else { + return SecretStatus.NOT_SURE; + } + } else if (secretType == SecretType.BAT) { + Vec3 spawn = new Vec3(secretPoint.getBlockPos(dungeonRoom)); + for (Integer killed : DungeonActionManager.getKilleds()) { + if (DungeonActionManager.getSpawnLocation().get(killed) == null) continue; + if (DungeonActionManager.getSpawnLocation().get(killed).squareDistanceTo(spawn) < 100) { + return SecretStatus.FOUND; + } + } + return SecretStatus.NOT_SURE; } else { return SecretStatus.NOT_SURE; } |