diff options
author | syeyoung <cyong06@naver.com> | 2021-02-03 00:29:46 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-03 00:29:46 +0900 |
commit | 1004561ee2311c56ad3d24cbb8d601f79e92fe8c (patch) | |
tree | 583c0073c08efbb6261c47a1dfdfe250fb543d49 /src/main/java | |
parent | b05398ec3858a09ff1bdb5f6db3c9bb770fac51a (diff) | |
download | Skyblock-Dungeons-Guide-1004561ee2311c56ad3d24cbb8d601f79e92fe8c.tar.gz Skyblock-Dungeons-Guide-1004561ee2311c56ad3d24cbb8d601f79e92fe8c.tar.bz2 Skyblock-Dungeons-Guide-1004561ee2311c56ad3d24cbb8d601f79e92fe8c.zip |
bomb defuse solver complete
Diffstat (limited to 'src/main/java')
5 files changed, 30 insertions, 26 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java index 414f61ca..1bb30757 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java @@ -266,7 +266,7 @@ public class RoomProcessorBombDefuseSolver extends GeneralRoomProcessor { RenderUtils.drawTextAtWorld("Warning: This Bomb Defuse must be done with 2 people (maze)" , warning.getX()+ 0.5f, warning.getY(), warning.getZ()+ 0.5f, 0xFF00FF00, 0.03F, false, false, partialTicks); } } - if (warning != null) { + if (warning != null && !found) { for (int i = 0; i < 4; i++) { BombDefuseChamberGenerator bdcg = chambers.get(i).getChamberGen(); RenderUtils.drawTextAtWorld((i + 1) + ". " + (bdcg == null ? "null" : bdcg.getName()), warning.getX() + 0.5f, warning.getY() - ((i + 1) * 0.3f), warning.getZ() + 0.5f, 0xFF00FF00, 0.03F, false, false, partialTicks); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java index 24d18a88..af87ae7b 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorLeftProcessor.java @@ -3,6 +3,7 @@ package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.color; import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; import kr.syeyoung.dungeonsguide.Keybinds; +import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; @@ -22,7 +23,7 @@ import java.util.Map; public class ColorLeftProcessor extends GeneralDefuseChamberProcessor { public ColorLeftProcessor(RoomProcessorBombDefuseSolver solver, BDChamber chamber) { super(solver, chamber); - center = chamber.getBlockPos(4,4,4); + center = chamber.getBlockPos(4,6,4); b1p = chamber.getBlockPos(1,1,4); b2p = chamber.getBlockPos(4,1,4); b3p = chamber.getBlockPos(7,1,4); @@ -98,18 +99,21 @@ public class ColorLeftProcessor extends GeneralDefuseChamberProcessor { RenderUtils.drawTextAtWorld(c2 == null ? "null" : c2.getLocalizedName(), b2p.getX()+ 0.5f, b2p.getY() + 0.6f, b2p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); RenderUtils.drawTextAtWorld(c3 == null ? "null" : c3.getLocalizedName(), b3p.getX()+ 0.5f, b3p.getY() + 0.6f, b3p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld(s1 + "", b1p.getX()+ 0.5f, b1p.getY() + 2.6f, b1p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld(s2 + "", b2p.getX()+ 0.5f, b2p.getY() + 3.6f, b2p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld(s3 + "", b3p.getX()+ 0.5f, b3p.getY() + 2.6f, b3p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); + if (FeatureRegistry.DEBUG.isEnabled()) { + RenderUtils.drawTextAtWorld(s1 + "", b1p.getX() + 0.5f, b1p.getY() + 2.6f, b1p.getZ() + 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld(s2 + "", b2p.getX() + 0.5f, b2p.getY() + 3.6f, b2p.getZ() + 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld(s3 + "", b3p.getX() + 0.5f, b3p.getY() + 2.6f, b3p.getZ() + 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); + } RenderUtils.drawTextAtWorld(colors.get(s1), b1p.getX()+ 0.5f, b1p.getY() + 2.2f, b1p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); RenderUtils.drawTextAtWorld(colors.get(s2), b2p.getX()+ 0.5f, b2p.getY() + 3.2f, b2p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); RenderUtils.drawTextAtWorld(colors.get(s3), b3p.getX()+ 0.5f, b3p.getY() + 2.2f, b3p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld(s1t+"", b1p.getX()+ 0.5f, b1p.getY() + 1.5f, b1p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld(s2t+"", b2p.getX()+ 0.5f, b2p.getY() + 2f, b2p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld(s3t+"", b3p.getX()+ 0.5f, b3p.getY() + 1.5f, b3p.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - + if (FeatureRegistry.DEBUG.isEnabled()) { + RenderUtils.drawTextAtWorld(s1t + "", b1p.getX() + 0.5f, b1p.getY() + 1.5f, b1p.getZ() + 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld(s2t + "", b2p.getX() + 0.5f, b2p.getY() + 2f, b2p.getZ() + 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld(s3t + "", b3p.getX() + 0.5f, b3p.getY() + 1.5f, b3p.getZ() + 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); + } } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java index f6e1313c..490ba593 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorRightProcessor.java @@ -47,22 +47,22 @@ public class ColorRightProcessor extends GeneralDefuseChamberProcessor { @Override public void tick() { super.tick(); - c1b = match(getChamber().getEntityAt(EntityArmorStand.class,b1.add(0, -1, 0))); + c3b = match(getChamber().getEntityAt(EntityArmorStand.class,b1.add(0, -1, 0))); c2b = match(getChamber().getEntityAt(EntityArmorStand.class,b2.add(0, -1, 0))); - c3b = match(getChamber().getEntityAt(EntityArmorStand.class,b3.add(0, -1, 0))); + c1b = match(getChamber().getEntityAt(EntityArmorStand.class,b3.add(0, -1, 0))); } @Override public void drawWorld(float partialTicks) { super.drawWorld(partialTicks); RenderUtils.drawTextAtWorld(answer == -1 ? "Press "+ Keyboard.getKeyName(Keybinds.sendBombdefuse.getKeyCode())+" to request solution" : "" , center.getX()+ 0.5f, center.getY(), center.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld( colors.get(c1b), b1.getX()+ 0.5f, b1.getY()+0.6f, b1.getZ()+ 0.5f,c1b == b1b ? 0xFF00FF00 : 0xFFFF0000, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld( colors.get(c2b), b2.getX()+ 0.5f, b2.getY()+0.6f, b2.getZ()+ 0.5f,c2b == b2b ? 0xFF00FF00 : 0xFFFF0000, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld( colors.get(c3b), b3.getX()+ 0.5f, b3.getY()+0.6f, b3.getZ()+ 0.5f,c3b == b3b ? 0xFF00FF00 : 0xFFFF0000, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld( colors.get((int) c1b), b1.getX()+ 0.5f, b1.getY()+0.6f, b1.getZ()+ 0.5f,c1b == b1b ? 0xFF00FF00 : 0xFFFF0000, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld( colors.get((int) c2b), b2.getX()+ 0.5f, b2.getY()+0.6f, b2.getZ()+ 0.5f,c2b == b2b ? 0xFF00FF00 : 0xFFFF0000, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld( colors.get((int) c3b), b3.getX()+ 0.5f, b3.getY()+0.6f, b3.getZ()+ 0.5f,c3b == b3b ? 0xFF00FF00 : 0xFFFF0000, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld( colors.get(b1b), b1.getX()+ 0.5f, b1.getY()+0.2f, b1.getZ()+ 0.5f,0xFFFFFF00, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld( colors.get(b2b), b2.getX()+ 0.5f, b2.getY()+0.2f, b2.getZ()+ 0.5f,0xFFFFFF00, 0.03F, false, false, partialTicks); - RenderUtils.drawTextAtWorld( colors.get(b3b), b3.getX()+ 0.5f, b3.getY()+0.2f, b3.getZ()+ 0.5f,0xFFFFFF00, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld( colors.get((int) b1b), b1.getX()+ 0.5f, b1.getY()+0.2f, b1.getZ()+ 0.5f,0xFFFFFF00, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld( colors.get((int) b2b), b2.getX()+ 0.5f, b2.getY()+0.2f, b2.getZ()+ 0.5f,0xFFFFFF00, 0.03F, false, false, partialTicks); + RenderUtils.drawTextAtWorld( colors.get((int) b3b), b3.getX()+ 0.5f, b3.getY()+0.2f, b3.getZ()+ 0.5f,0xFFFFFF00, 0.03F, false, false, partialTicks); } @Override @@ -79,10 +79,11 @@ public class ColorRightProcessor extends GeneralDefuseChamberProcessor { @Override public void onDataRecieve(NBTTagCompound compound) { if (7 == compound.getByte("a")) { - int answer = compound.getInteger("b"); + answer = compound.getInteger("b"); b1b = (byte) (answer / 10000); b2b = (byte) ((answer % 10000) / 100); b3b = (byte) (answer % 100); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java index 2efc2ccc..e7d964aa 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperRightProcessor.java @@ -35,14 +35,6 @@ public class CreeperRightProcessor extends GeneralDefuseChamberProcessor { @Override public void tick() { super.tick(); - if (answer != -1) return; - answer = 0; - for (int i = 0; i < poses.length; i++) { - BlockPos pos = poses[i]; - if (getChamber().getRoom().getContext().getWorld().getBlockState(pos).getBlock() == Blocks.air) { - answer |= (1 << i); - } - } } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java index 07c9bd33..8621af57 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathLeftProcessor.java @@ -46,9 +46,11 @@ public class GoldenPathLeftProcessor extends GeneralDefuseChamberProcessor { List<Integer> solution = new ArrayList<Integer>(); Set<BlockPos> visited = new HashSet<BlockPos>(); BlockPos lastLoc = new BlockPos(4,0,0); + visited.add(lastLoc); blocksolution.add(getChamber().getBlockPos(4,1,0)); BlockPos target = new BlockPos(4,0,5); while (!lastLoc.equals(target)) { + boolean solution2 = false; for (int i =0; i<vectors.length; i++) { BlockPos target2 = lastLoc.add(vectors[i].x, 0, vectors[i].y); if (visited.contains(target2)) continue; @@ -58,11 +60,16 @@ public class GoldenPathLeftProcessor extends GeneralDefuseChamberProcessor { if (getChamber().getBlock(target2.getX(), 0, target2.getZ()).getBlock() == Blocks.hardened_clay || getChamber().getBlock(target2.getX(), 0, target2.getZ()).getBlock() == Blocks.stained_hardened_clay) { lastLoc = target2; + blocksolution.add(getChamber().getBlockPos(lastLoc.getX(), 1, lastLoc.getZ())); solution.add(i); + solution2 = true; break; } } + if (!solution2){ + return; + } } goldenPathsolution = ""; |