diff options
author | syeyoung <cyong06@naver.com> | 2021-02-13 01:23:05 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-13 01:23:05 +0900 |
commit | acbdeb579e4c64d96b9274996e2a21659385fcfe (patch) | |
tree | 73c28738e63b2420d97d1fd621e8891b8014b56a /src/main/java | |
parent | 77af3008dba9efab778555093191ecf8817e0ed3 (diff) | |
download | Skyblock-Dungeons-Guide-acbdeb579e4c64d96b9274996e2a21659385fcfe.tar.gz Skyblock-Dungeons-Guide-acbdeb579e4c64d96b9274996e2a21659385fcfe.tar.bz2 Skyblock-Dungeons-Guide-acbdeb579e4c64d96b9274996e2a21659385fcfe.zip |
ok idk
Diffstat (limited to 'src/main/java')
5 files changed, 32 insertions, 10 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java index 58e256f2..17ae010d 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java @@ -7,13 +7,17 @@ import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry; import kr.syeyoung.dungeonsguide.e; +import kr.syeyoung.dungeonsguide.events.DungeonLeftEvent; import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; import kr.syeyoung.dungeonsguide.utils.AhUtils; +import kr.syeyoung.dungeonsguide.utils.MapUtils; +import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; +import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @@ -118,7 +122,7 @@ public class CommandDungeonsGuide extends CommandBase { } catch (Throwable t) { t.printStackTrace(); } - } else if (args[0].equals("process") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-","").equals("e686fe0aab804a71ac7011dc8c2b534c")) { + } else if (args[0].equals("process") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-", "").equals("e686fe0aab804a71ac7011dc8c2b534c")) { File root = e.getDungeonsGuide().getConfigDir(); File dir = new File(root, "processorinput"); File outsecret = new File(root, "processoroutpuzzle"); @@ -146,7 +150,17 @@ public class CommandDungeonsGuide extends CommandBase { oos.writeObject(dri); oos.flush(); oos.close(); - } catch (Exception e) {e.printStackTrace();} + } catch (Exception e) { + e.printStackTrace(); + } + } + } else if (args[0].equals("reloaddungeon") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-", "").equals("e686fe0aab804a71ac7011dc8c2b534c")){ + try { + MinecraftForge.EVENT_BUS.post(new DungeonLeftEvent()); + e.getDungeonsGuide().getSkyblockStatus().setContext(null); + MapUtils.clearMap(); + } catch (Throwable t) { + t.printStackTrace(); } } else { sender.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §e/dg §7-§fOpens configuration gui")); 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 3c262856..8c5376d7 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java @@ -167,6 +167,6 @@ public class DungeonRoom { return (shape >>(roomPt.y *4 +roomPt.x) & 0x1) > 0; } public boolean canAccessRelative(int x, int z) { - return (shape >>((z/32) *4 +(x/32)) & 0x1) > 0; + return x>= 0 && z >= 0 && (shape >>((z/32) *4 +(x/32)) & 0x1) > 0; } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java index 41967e6c..c4bc596c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java @@ -61,6 +61,8 @@ public class RoomMatcher { private boolean tryMatching(DungeonRoomInfo dungeonRoomInfo, int rotation) { if (dungeonRoomInfo.getColor() != dungeonRoom.getColor()) return false; + System.out.println("Matching "+dungeonRoomInfo.getName()+" At "+rotation); + int[][] res = dungeonRoomInfo.getBlocks(); for (int i = 0; i < rotation; i++) res = ArrayUtils.rotateCounterClockwise(res); @@ -72,6 +74,7 @@ public class RoomMatcher { Block b = dungeonRoom.getRelativeBlockAt(x,0,z); if (b == null || Block.getIdFromBlock(b) != data) { + System.out.println("Failed At "+x+"."+z + " "+data+" found " + Block.getIdFromBlock(b) +" found"); return false; } } @@ -93,11 +96,14 @@ public class RoomMatcher { for (int z = 0; z < data.length; z++) { for (int x = 0; x < data[0].length; x++) { - if (!(offset <= x && widthX - offset > x && offset <= z && heightZ - offset > z)) { - data[z][x] = -1; - continue; - } - if (!(dungeonRoom.canAccessRelative(x + offset - 1, z + offset - 1) && dungeonRoom.canAccessRelative(x - offset, z - offset))) { +// if (!(offset < x && widthX - offset > x && offset < z && heightZ - offset > z)) { +// data[z][x] = -1; +// continue; +// } + if (!(dungeonRoom.canAccessRelative(x + offset, z + offset) + && dungeonRoom.canAccessRelative(x - offset -1 , z - offset-1) + && dungeonRoom.canAccessRelative(x + offset , z - offset-1) + && dungeonRoom.canAccessRelative(x - offset -1 , z + offset))) { data[z][x] = -1; continue; } 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 8a1a1dcc..151092d1 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 @@ -37,6 +37,7 @@ public class FeatureBoxRealLivid extends SimpleFeature implements WorldRenderLis EntityOtherPlayerMP playerMP = ((BossfightProcessorLivid) skyblockStatus.getContext().getBossfightProcessor()).getRealLivid(); AColor c = this.<AColor>getParameter("color").getValue(); - RenderUtils.highlightBox(playerMP, AxisAlignedBB.fromBounds(-0.4,-1.5,-0.4,0.4,0,0.4), c, partialTicks, true); + if (playerMP != null) + RenderUtils.highlightBox(playerMP, AxisAlignedBB.fromBounds(-0.4,-1.5,-0.4,0.4,0,0.4), c, partialTicks, true); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java index b625e869..8fc660ce 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java @@ -54,7 +54,8 @@ public class NodeProcessorDungeonRoom extends NodeProcessor { if (newX > sub.getX()|| newZ > sub.getZ()) continue; IBlockState state = entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ)); if (state.getBlock() == Blocks.air || state.getBlock() == Blocks.water || state.getBlock() == Blocks.lava - || state.getBlock() == Blocks.flowing_water || state.getBlock() == Blocks.flowing_lava) { + || state.getBlock() == Blocks.flowing_water || state.getBlock() == Blocks.flowing_lava + || state.getBlock() == Blocks.vine) { PathPoint pt = openPoint(newX, newY, newZ); if (pt.visited) continue; pathOptions[i++] = pt; |