diff options
author | syeyoung <cyong06@naver.com> | 2021-02-02 02:14:06 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-02 02:14:06 +0900 |
commit | 72abcd5f751f8bcb76c3bee866b0d3a7eed5f831 (patch) | |
tree | 47e3d35285f7e98634faef3f8d3b88b04d502f61 /src/main/java/kr/syeyoung/dungeonsguide | |
parent | b4635fcf7c42b21fef36dce5c7a601e4825d394b (diff) | |
download | Skyblock-Dungeons-Guide-72abcd5f751f8bcb76c3bee866b0d3a7eed5f831.tar.gz Skyblock-Dungeons-Guide-72abcd5f751f8bcb76c3bee866b0d3a7eed5f831.tar.bz2 Skyblock-Dungeons-Guide-72abcd5f751f8bcb76c3bee866b0d3a7eed5f831.zip |
puzzle solvers
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
15 files changed, 82 insertions, 66 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java index 17c1c05b..68fae79f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java @@ -77,6 +77,7 @@ public class GeneralRoomProcessor implements RoomProcessor { if (dungeonRoom.getTotalSecrets() == -1) { e.sendDebugChat(new ChatComponentText(chat.getFormattedText().replace('ยง', '&') + " - received")); } + if (!chat.getFormattedText().contains("/")) return; BlockPos pos = Minecraft.getMinecraft().thePlayer.getPosition(); DungeonContext context = e.getDungeonsGuide().getSkyblockStatus().getContext(); Point pt1 = context.getMapProcessor().worldPointToRoomPoint(pos.add(2, 0, 2)); 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 7ba75676..65dc6f28 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java @@ -156,6 +156,12 @@ public class RoomProcessorBombDefuseSolver extends GeneralRoomProcessor { public void chatReceived(IChatComponent component) { super.chatReceived(component); if (bugged) return; + for (ChamberSet ch:chambers) { + if (ch.getLeft() != null && ch.getLeft().getProcessor() != null) + ch.getLeft().getProcessor().chatReceived(component); + if (ch.getRight() != null && ch.getRight().getProcessor() != null) + ch.getRight().getProcessor().chatReceived(component); + } if (component.getFormattedText().contains("$DG-BD ")) { try { @@ -235,26 +241,28 @@ public class RoomProcessorBombDefuseSolver extends GeneralRoomProcessor { super.drawWorld(partialTicks); if (bugged) return; - BlockPos player = Minecraft.getMinecraft().thePlayer.getPosition(); - OffsetPoint offsetPoint = new OffsetPoint(getDungeonRoom(), new BlockPos(player.getX(), 68, player.getZ())); + OffsetPoint offsetPoint = new OffsetPoint(getDungeonRoom(), new BlockPos((int)Minecraft.getMinecraft().thePlayer.posX, 68, (int)Minecraft.getMinecraft().thePlayer.posZ)); + boolean found = false; for (ChamberSet ch:chambers) { if (ch.getLeft() != null && ch.getLeft().getProcessor() != null) { if (ch.getLeft().getChamberBlocks().getOffsetPointList().contains(offsetPoint)) { + found = true; ch.getLeft().getProcessor().drawWorld(partialTicks); } } if (ch.getRight() != null && ch.getRight().getProcessor() != null) { if (ch.getRight().getChamberBlocks().getOffsetPointList().contains(offsetPoint)) { + found = true; ch.getRight().getProcessor().drawWorld(partialTicks); } } } - if ((maze || impossible) && warning != null) { + if ((maze || impossible) && warning != null && !found) { if (impossible) { RenderUtils.drawTextAtWorld("Warning: This Bomb Defuse is bugged and Impossible" , warning.getX()+ 0.5f, warning.getY(), warning.getZ()+ 0.5f, 0xFF00FF00, 0.03F, false, false, partialTicks); } else { - RenderUtils.drawTextAtWorld("Warning: This Bomb Defuse contains maze which can be only done with 2 ppl" , warning.getX()+ 0.5f, warning.getY(), warning.getZ()+ 0.5f, 0xFF00FF00, 0.03F, false, false, partialTicks); + 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); } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java index 6b81cae6..f53b5aba 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowLeftProcessor.java @@ -70,14 +70,14 @@ public class ArrowLeftProcessor extends GeneralDefuseChamberProcessor { public void onSendData() { if (answer == -1) return; NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("a", "c"); + nbt.setByte("a", (byte) 3); nbt.setInteger("b", answer); getSolver().communicate(nbt); } @Override public void onDataRecieve(NBTTagCompound compound) { - if ("c".equals(compound.getString("a"))) { + if (3 == compound.getByte("a")) { answer = compound.getInteger("b"); for (int i = 8; i >= 0; i--) { answers[i] = answer % 10; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java index b597b1ae..f3def5a7 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowRightProcessor.java @@ -65,7 +65,7 @@ public class ArrowRightProcessor extends GeneralDefuseChamberProcessor { @Override public void onDataRecieve(NBTTagCompound compound) { - if ("c".equals(compound.getString("a"))) { + if (3 == compound.getByte("a")) { answer = compound.getInteger("b"); for (int i = 8; i >= 0; i--) { correctAnswers[i] = answer % 10; @@ -79,12 +79,12 @@ public class ArrowRightProcessor extends GeneralDefuseChamberProcessor { public void onInteract(PlayerInteractEntityEvent event) { if (answer == -1) return; if (event.getEntity() instanceof EntityArmorStand) { - BlockPos pos = event.getEntity().getPosition(); - for (int i = 0; i < 9; i++) { - if (currentAnswers[i] == correctAnswers[i] && pos.equals(grid[i].add(0, -1, 0))) event.setCanceled(true); - } - - System.out.println(" block ? "+event.isCanceled()); +// BlockPos pos = event.getEntity().getPosition(); +// for (int i = 0; i < 9; i++) { +// if (currentAnswers[i] == correctAnswers[i] && pos.equals(grid[i].add(0, -1, 0))) event.setCanceled(true); +// } +// +// System.out.println(" block ? "+event.isCanceled()); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java index 6f2a94c1..da1b7b22 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperLeftProcessor.java @@ -70,14 +70,14 @@ public class CreeperLeftProcessor extends GeneralDefuseChamberProcessor { public void onSendData() { if (answer == -1) return; NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("a", "b"); + nbt.setByte("a", (byte) 2); nbt.setInteger("b", answer); getSolver().communicate(nbt); } @Override public void onDataRecieve(NBTTagCompound compound) { - if ("b".equals(compound.getString("a"))) { + if (2 == compound.getByte("a")) { answer = compound.getInteger("b"); } } 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 ba5266c6..2efc2ccc 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 @@ -74,19 +74,9 @@ public class CreeperRightProcessor extends GeneralDefuseChamberProcessor { System.out.println(event.isCanceled()); } } - - @Override - public void onSendData() { - if (answer == -1) return; - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("a", "b"); - nbt.setInteger("b", answer); - getSolver().communicate(nbt); - } - @Override public void onDataRecieve(NBTTagCompound compound) { - if ("b".equals(compound.getString("a"))) { + if (2 == compound.getByte("a")) { answer = compound.getInteger("b"); } } 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 780c1c2e..07c9bd33 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 @@ -4,9 +4,12 @@ import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefus import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.utils.TextUtils; +import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; import javax.vecmath.Vector2f; import java.awt.*; @@ -25,7 +28,6 @@ public class GoldenPathLeftProcessor extends GeneralDefuseChamberProcessor { } - private long answer = -1; // 1 up 2 right 3 down 4 left private static final Point vectors[] = new Point[] { new Point(0,1), @@ -35,10 +37,11 @@ public class GoldenPathLeftProcessor extends GeneralDefuseChamberProcessor { }; private LinkedList<BlockPos> blocksolution = new LinkedList<BlockPos>(); + private String goldenPathsolution; @Override public void tick() { super.tick(); - if (answer != -1) return; + if (goldenPathsolution != null) return; List<Integer> solution = new ArrayList<Integer>(); Set<BlockPos> visited = new HashSet<BlockPos>(); @@ -62,50 +65,44 @@ public class GoldenPathLeftProcessor extends GeneralDefuseChamberProcessor { } } - answer = 0; - for (Integer inte:solution) { - answer *= 4; - answer += inte; - } + goldenPathsolution = ""; + for (Integer i:solution) + goldenPathsolution += i; } @Override public void drawScreen(float partialTicks) { - if (answer == -1) return; + if (goldenPathsolution == null) return; drawPressKey(); } @Override public void drawWorld(float partialTicks) { super.drawWorld(partialTicks); - RenderUtils.drawLines(blocksolution, Color.green, partialTicks, false); + RenderUtils.drawLines(blocksolution, Color.blue, partialTicks, false); } @Override public void onSendData() { - if (answer == -1) return; - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("a", "d"); - nbt.setLong("b", answer); - getSolver().communicate(nbt); + if (goldenPathsolution == null) return; + Minecraft.getMinecraft().thePlayer.sendChatMessage("/pc $DG-BDGP "+goldenPathsolution); } @Override - public void onDataRecieve(NBTTagCompound compound) { - if ("d".equals(compound.getString("a"))) { - answer = compound.getInteger("b"); + public void chatReceived(IChatComponent chat) { + super.chatReceived(chat); + if (chat.getFormattedText().contains("$DG-BDGP ")) { + String data = chat.getFormattedText().substring(chat.getFormattedText().indexOf("$DG-BDGP ")); + String actual = TextUtils.stripColor(data).trim().split(" ")[1].trim(); blocksolution.clear(); BlockPos lastLoc = new BlockPos(4,0,0); blocksolution.addFirst(getChamber().getBlockPos(4,1,0)); - while (answer != 0) { - int dir = (int) (answer % 4); + for (Character c:actual.toCharArray()) { + int dir = (int) (Integer.parseInt(c+"") % 4); lastLoc = lastLoc.add(vectors[dir].x, 0, vectors[dir].y); blocksolution.add(getChamber().getBlockPos(lastLoc.getX(), 1, lastLoc.getZ())); - answer /= 4; } - - answer = compound.getInteger("b"); } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java index e3a1ae04..d35a8a2d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/goldenpath/GoldenPathRightProcessor.java @@ -4,9 +4,13 @@ import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefus import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.GeneralDefuseChamberProcessor; import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import kr.syeyoung.dungeonsguide.utils.TextUtils; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; +import net.minecraft.util.IChatComponent; +import net.minecraft.world.World; +import org.lwjgl.opengl.GL11; import java.awt.*; import java.util.List; @@ -25,7 +29,6 @@ public class GoldenPathRightProcessor extends GeneralDefuseChamberProcessor { } - private long answer = -1; private BlockPos center; // 1 up 2 right 3 down 4 left private static final Point vectors[] = new Point[] { @@ -40,26 +43,39 @@ public class GoldenPathRightProcessor extends GeneralDefuseChamberProcessor { @Override public void drawWorld(float partialTicks) { super.drawWorld(partialTicks); - RenderUtils.drawTextAtWorld(answer == -1 ? "Answer not received yet. Visit left room to obtain solution" : "" , center.getX()+ 0.5f, center.getY(), center.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); - RenderUtils.drawLines(blocksolution, Color.green, partialTicks, false); + RenderUtils.drawTextAtWorld(blocksolution.size() == 0 ? "Answer not received yet. Visit left room to obtain solution" : "" , center.getX()+ 0.5f, center.getY(), center.getZ()+ 0.5f, 0xFFFFFFFF, 0.03F, false, false, partialTicks); + + RenderUtils.drawLines(blocksolution, Color.blue, partialTicks, false); + } @Override - public void onDataRecieve(NBTTagCompound compound) { - if ("d".equals(compound.getString("a"))) { - answer = compound.getInteger("b"); + public void chatReceived(IChatComponent chat) { + super.chatReceived(chat); + if (chat.getFormattedText().contains("$DG-BDGP ")) { + String data = chat.getFormattedText().substring(chat.getFormattedText().indexOf("$DG-BDGP")); + String actual = TextUtils.stripColor(data).trim().split(" ")[1].trim(); blocksolution.clear(); BlockPos lastLoc = new BlockPos(4,0,0); blocksolution.addFirst(getChamber().getBlockPos(4,1,0)); - while (answer != 0) { - int dir = (int) (answer % 4); + for (Character c:actual.toCharArray()) { + int dir = (int) (Integer.parseInt(c+"") % 4); lastLoc = lastLoc.add(vectors[dir].x, 0, vectors[dir].y); blocksolution.add(getChamber().getBlockPos(lastLoc.getX(), 1, lastLoc.getZ())); - answer /= 4; } - answer = compound.getInteger("b"); + World w = getChamber().getRoom().getContext().getWorld(); + for (int x = 0; x <9; x++) { + for (int z =0; z < 6; z++) { + BlockPos pos = getChamber().getBlockPos(x,1,z); + if (blocksolution.contains(pos)) { + w.setBlockState(pos, Blocks.light_weighted_pressure_plate.getDefaultState()); + } else { + w.setBlockState(pos, Blocks.wooden_pressure_plate.getDefaultState()); + } + } + } } } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java index 96a8ec93..2fc657d0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeLeftProcessor.java @@ -56,7 +56,7 @@ public class MazeLeftProcessor extends GeneralDefuseChamberProcessor { Block b = getChamber().getRoom().getContext().getWorld().getBlockState(block).getBlock(); NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("a", "e"); + nbt.setByte("a", (byte) 5); nbt.setInteger("b", Block.getIdFromBlock(b)); getSolver().communicate(nbt); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java index 629f7b6d..319c98af 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeProcessorMatcher.java @@ -11,7 +11,8 @@ import net.minecraft.init.Blocks; public class MazeProcessorMatcher implements BombDefuseChamberGenerator { @Override public boolean match(BDChamber left, BDChamber right) { - return left.getBlock(1,0,1).getBlock() == Blocks.iron_block; + return right.getBlock(1,0,1).getBlock() != Blocks.double_stone_slab && + left.getBlock(1,1,1).getBlock() != Blocks.barrier; } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java index bee47b05..f58b3f3a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/maze/MazeRightProcessor.java @@ -53,7 +53,7 @@ public class MazeRightProcessor extends GeneralDefuseChamberProcessor { @Override public void onDataRecieve(NBTTagCompound compound) { - if ("e".equals(compound.getString("a"))) { + if (5 == compound.getByte("a")) { int latestRequestid = compound.getInteger("b"); latestRequest = Block.getBlockById(latestRequestid); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java index b069a445..55988ec2 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberLeftProcessor.java @@ -70,14 +70,14 @@ public class NumberLeftProcessor extends GeneralDefuseChamberProcessor { public void onSendData() { if (answer == -1) return; NBTTagCompound nbt = new NBTTagCompound(); - nbt.setString("a", "a"); + nbt.setByte("a", (byte) 1); nbt.setInteger("b", answer); getSolver().communicate(nbt); } @Override public void onDataRecieve(NBTTagCompound compound) { - if ("a".equals(compound.getString("a"))) { + if (1 == compound.getByte("a")) { answer = compound.getInteger("b"); d1 = answer / 1000; d2 = (answer % 1000) / 100; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java index a61c6a6c..94b173e6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberRightProcessor.java @@ -73,7 +73,7 @@ public class NumberRightProcessor extends GeneralDefuseChamberProcessor { @Override public void onDataRecieve(NBTTagCompound compound) { - if ("a".equals(compound.getString("a"))) { + if (1 == compound.getByte("a")) { answer = compound.getInteger("b"); d1 = answer / 1000; d2 = (answer % 1000) / 100; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/MapUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/MapUtils.java index ea08c8b6..6666043f 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/MapUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/MapUtils.java @@ -62,12 +62,14 @@ public class MapUtils { } public static Point findFirstColorWithIn(byte[] colors, byte color, Rectangle dimension) { + boolean found = true; for (int y = dimension.y; y < (dimension.y + dimension.height);y++) { for (int x = dimension.x; x < (dimension.x + dimension.width); x ++) { - if (getMapColorAt(colors, x ,y) == color) { + if (getMapColorAt(colors, x ,y) == color && found) { record(colors, x, y, new Color(255, 0, 0, 40)); return new Point(x,y); } + found = getMapColorAt(colors, x,y) == 0; } } return null; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java index cb3c762f..68243d84 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/utils/RenderUtils.java @@ -200,12 +200,13 @@ public class RenderUtils { GlStateManager.disableTexture2D(); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); + GL11.glLineWidth(2); if (!depth) { GlStateManager.disableDepth(); GlStateManager.depthMask(false); } GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); - GL11.glLineWidth(2); + GlStateManager.color(colour.getRed() / 255f, colour.getGreen() / 255f, colour.getBlue()/ 255f, colour.getAlpha() / 255f); worldRenderer.begin(GL11.GL_LINE_STRIP, DefaultVertexFormats.POSITION); for (BlockPos pos:poses) { |