diff options
author | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-22 20:05:51 +0900 |
---|---|---|
committer | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-22 20:05:51 +0900 |
commit | 70a753c2a0aac9bd7e7e21ca081c4ee994bc4891 (patch) | |
tree | de7bef79f537650c7c1d557fcf86dd1bce7d64f0 /src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder | |
parent | 527732c2242d1dc0556c6a6cd49f4847b1f9c716 (diff) | |
download | Skyblock-Dungeons-Guide-70a753c2a0aac9bd7e7e21ca081c4ee994bc4891.tar.gz Skyblock-Dungeons-Guide-70a753c2a0aac9bd7e7e21ca081c4ee994bc4891.tar.bz2 Skyblock-Dungeons-Guide-70a753c2a0aac9bd7e7e21ca081c4ee994bc4891.zip |
room building
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDoorFinder.java | 26 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/StartDoorFinder.java | 3 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDoorFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDoorFinder.java index c3b67d9e..bb0a52a0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDoorFinder.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDoorFinder.java @@ -42,4 +42,30 @@ public class CatacombDoorFinder implements StartDoorFinder { } return null; } + + @Override + public Vector2d offset(World w) { + Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() { + @Override + public boolean apply(EntityArmorStand input) { + System.out.println(input.getName()); + return input.getName().equals("§bMort"); + } + }); + + if (armorStand.size() != 0) { + EntityArmorStand mort = armorStand.iterator().next(); + BlockPos pos = mort.getPosition(); + pos = pos.add(0, 3, 0); + for (int i = 0; i < 5; i++) { + for (Vector2d vector2d:directions) { + BlockPos test = pos.add(vector2d.x * i, 0, vector2d.y * i); + if (w.getChunkFromBlockCoords(test).getBlock(test) == Blocks.iron_bars) { + return vector2d; + } + } + } + } + return null; + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/StartDoorFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/StartDoorFinder.java index 5096fe7b..ee1ccdaa 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/StartDoorFinder.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/StartDoorFinder.java @@ -3,6 +3,9 @@ package kr.syeyoung.dungeonsguide.dungeon.doorfinder; import net.minecraft.util.BlockPos; import net.minecraft.world.World; +import javax.vecmath.Vector2d; + public interface StartDoorFinder { BlockPos find(World w); + Vector2d offset(World w); } |