aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-25 15:37:57 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-25 15:37:57 +0900
commit81a315f025f361d1155305e55dfee29308a74ed3 (patch)
tree9be59a599ef9821ca9e66005207cee32022e5a4f /src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder
parenta49e2c1970f6f77079a860dd5e92741251f41c9c (diff)
downloadSkyblock-Dungeons-Guide-81a315f025f361d1155305e55dfee29308a74ed3.tar.gz
Skyblock-Dungeons-Guide-81a315f025f361d1155305e55dfee29308a74ed3.tar.bz2
Skyblock-Dungeons-Guide-81a315f025f361d1155305e55dfee29308a74ed3.zip
room processor stuff
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonDoor.java37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonDoor.java
index 30908ef8..f13ab33f 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonDoor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonDoor.java
@@ -18,20 +18,55 @@ public class DungeonDoor {
private static final Set<Block> legalBlocks = Sets.newHashSet(Blocks.coal_block, Blocks.barrier, Blocks.monster_egg, Blocks.air, Blocks.stained_hardened_clay);
+ private boolean requiresKey = false;
+ private boolean opened = false;
public DungeonDoor(World world, BlockPos pos) {
this.w = world;
this.position = pos;
+ Block itshouldbeall = world.getChunkFromBlockCoords(pos).getBlock(pos);
+ if (!legalBlocks.contains(itshouldbeall)) {
+ exist = false;
+ return;
+ }
for (int x = -1; x<=1; x++)
for (int y = -1; y<=1; y++)
for (int z = -1; z<=1; z++) {
BlockPos pos2 = pos.add(x,y,z);
Block block = world.getChunkFromBlockCoords(pos2).getBlock(pos2);
- if (!legalBlocks.contains(block)) exist = false;
+ if (itshouldbeall != block) exist = false;
}
if (exist) {
BlockPos ZCheck = pos.add(0,0,2);
isZDir = world.getChunkFromBlockCoords(ZCheck).getBlock(ZCheck) == Blocks.air;
+
+ if (isZDir) {
+ for (int x = -1; x<=1; x++)
+ for (int y = -1; y<=1; y++)
+ for (int z = -2; z<=2; z+=4) {
+ BlockPos pos2 = pos.add(x,y,z);
+ Block block = world.getChunkFromBlockCoords(pos2).getBlock(pos2);
+ if (block != Blocks.air) exist = false;
+ }
+ } else {
+ for (int x = -2; x<=2; x+=4)
+ for (int y = -1; y<=1; y++)
+ for (int z = -1; z<=1; z++) {
+ BlockPos pos2 = pos.add(x,y,z);
+ Block block = world.getChunkFromBlockCoords(pos2).getBlock(pos2);
+ if (block != Blocks.air) exist = false;
+ }
+ }
+ }
+ if (!exist) {
+ isZDir = false;
+ return;
+ }
+
+ if (itshouldbeall == Blocks.stained_hardened_clay || itshouldbeall == Blocks.coal_block) {
+ requiresKey = true;
+ } else if (itshouldbeall == Blocks.barrier) {
+ opened = true;
}
}
}