aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-28 22:21:58 +0900
committersyeyoung <cyong06@naver.com>2021-02-28 22:21:58 +0900
commitd72f7f1db99b76385073995ed0b193b7ed5361c0 (patch)
tree192db2906d5743130ecfc40f8425e5dadb2299a7 /src/main/java/kr/syeyoung/dungeonsguide
parentd791b14ccc4b6e0c88b52daaf2975a4413f525df (diff)
downloadSkyblock-Dungeons-Guide-d72f7f1db99b76385073995ed0b193b7ed5361c0.tar.gz
Skyblock-Dungeons-Guide-d72f7f1db99b76385073995ed0b193b7ed5361c0.tar.bz2
Skyblock-Dungeons-Guide-d72f7f1db99b76385073995ed0b193b7ed5361c0.zip
iron bars
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java17
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java28
2 files changed, 37 insertions, 8 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java
index e329beb6..b8b15fa3 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/commands/CommandDungeonsGuide.java
@@ -4,6 +4,8 @@ import com.google.gson.JsonObject;
import kr.syeyoung.dungeonsguide.config.guiconfig.GuiConfig;
import kr.syeyoung.dungeonsguide.dungeon.DungeonContext;
import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo;
+import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic;
+import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonSecret;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoomInfoRegistry;
import kr.syeyoung.dungeonsguide.e;
@@ -34,6 +36,7 @@ import java.security.*;
import java.security.cert.CertificateException;
import java.text.SimpleDateFormat;
import java.util.Date;
+import java.util.Map;
import java.util.zip.GZIPOutputStream;
public class CommandDungeonsGuide extends CommandBase {
@@ -159,7 +162,7 @@ public class CommandDungeonsGuide extends CommandBase {
e.printStackTrace();
}
}
- } else if (args[0].equals("fixmap") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-", "").equals("e686fe0aab804a71ac7011dc8c2b534c")) {
+ } else if (args[0].equals("check") && Minecraft.getMinecraft().getSession().getPlayerID().replace("-", "").equals("e686fe0aab804a71ac7011dc8c2b534c")) {
File root = e.getDungeonsGuide().getConfigDir();
for (File f : root.listFiles()) {
if (!f.getName().endsWith(".roomdata")) continue;
@@ -169,16 +172,14 @@ public class CommandDungeonsGuide extends CommandBase {
DungeonRoomInfo dri = (DungeonRoomInfo) ois.readObject();
ois.close();
fis.close();
-
- for (int i = 0; i < dri.getBlocks().length; i++) {
- for (int i1 = 0; i1 < dri.getBlocks()[i].length; i1++) {
- if (dri.getBlocks()[i][i1] == 54 || dri.getBlocks()[i][i1] == 146) {
- dri.getBlocks()[i][i1] = -1;
- System.out.println("Fixed the thing at "+i+" - "+i1 +" on "+dri.getName());
+ for (Map.Entry<String, DungeonMechanic> stringDungeonMechanicEntry : dri.getMechanics().entrySet()) {
+ if (stringDungeonMechanicEntry.getValue() instanceof DungeonSecret) {
+ if (stringDungeonMechanicEntry.getKey().charAt(0) != Character.toLowerCase(((DungeonSecret) stringDungeonMechanicEntry.getValue()).getSecretType().name().charAt(0))) {
+ System.out.println("Mismatch found at "+dri.getName() + " - "+stringDungeonMechanicEntry.getKey() +" - "+((DungeonSecret) stringDungeonMechanicEntry.getValue()).getSecretType());
+ System.out.print(' ');
}
}
}
-
FileOutputStream fos = new FileOutputStream(f);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(dri);
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java
index 8955a765..8e937b34 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/pathfinding/NodeProcessorDungeonRoom.java
@@ -77,6 +77,34 @@ public class NodeProcessorDungeonRoom extends NodeProcessor {
}
}
}
+
+ if (dir.getY() == 0 && curr.getBlock() == Blocks.iron_bars && up.getBlock() == Blocks.air &&
+ entityIn.getEntityWorld().getBlockState(new BlockPos(currentPoint.xCoord, currentPoint.yCoord, currentPoint.zCoord)).getBlock() != Blocks.iron_bars) {
+ boolean theFlag = false;
+ if (newX == 0) {
+ if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ)
+ .add(0,0,1)).getBlock() == Blocks.air) {
+ theFlag = true;
+ } else if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ)
+ .add(0,0,-1)).getBlock() == Blocks.air) {
+ theFlag = true;
+ }
+ } else if (newZ == 0) {
+ if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ)
+ .add(-1,0,0)).getBlock() == Blocks.air) {
+ theFlag = true;
+ } else if (entityIn.getEntityWorld().getBlockState(dungeonRoom.getMin().add(newX, newY, newZ)
+ .add(1,0,0)).getBlock() == Blocks.air) {
+ theFlag = true;
+ }
+ }
+ if (theFlag) {
+ PathPoint pt = openPoint(newX, newY, newZ);
+ if (pt.visited) continue;
+ pathOptions[i++] = pt;
+ continue;
+ }
+ }
}
return i;
}