diff options
author | syeyoung <cyong06@naver.com> | 2021-03-31 10:40:12 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-03-31 10:40:12 +0900 |
commit | 15317450019d9fe10ab0f599f0c0fdf900fdaf0c (patch) | |
tree | 9fc25f6bfe67e1bd8ccf0536be5027eba310ac48 /src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder | |
parent | 833e0c8834b8df95b33e44f579a66d58b53679c3 (diff) | |
download | Skyblock-Dungeons-Guide-15317450019d9fe10ab0f599f0c0fdf900fdaf0c.tar.gz Skyblock-Dungeons-Guide-15317450019d9fe10ab0f599f0c0fdf900fdaf0c.tar.bz2 Skyblock-Dungeons-Guide-15317450019d9fe10ab0f599f0c0fdf900fdaf0c.zip |
bug fixes
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder')
2 files changed, 98 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombMasterDataProvider.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombMasterDataProvider.java new file mode 100755 index 00000000..f41bcf03 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombMasterDataProvider.java @@ -0,0 +1,97 @@ +package kr.syeyoung.dungeonsguide.dungeon.doorfinder; + +import com.google.common.base.Predicate; +import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.e; +import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.*; +import net.minecraft.entity.item.EntityArmorStand; +import net.minecraft.init.Blocks; +import net.minecraft.util.BlockPos; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; + +import javax.vecmath.Vector2d; +import java.util.Collection; +import java.util.Set; + +public class CatacombMasterDataProvider implements DungeonSpecificDataProvider { + + private static final Set<Vector2d> directions = Sets.newHashSet(new Vector2d(0,1), new Vector2d(0, -1), new Vector2d(1, 0), new Vector2d(-1 , 0)); + + @Override + public BlockPos findDoor(World w, String dungeonName) { + Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() { + @Override + public boolean apply(EntityArmorStand input) { + 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 pos.add(vector2d.x * (i + 2), -2, vector2d.y * (i+2)); + } + } + } + } + return null; + } + + @Override + public Vector2d findDoorOffset(World w, String dungeonName) { + Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() { + @Override + public boolean apply(EntityArmorStand input) { + 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; + } + /* + * + * */ + + @Override + public BossfightProcessor createBossfightProcessor(World w, String dungeonName) { + String floor = dungeonName.substring(14).trim(); + e.sendDebugChat(new ChatComponentText("Floor: Master mode "+floor+ " Building bossfight processor")); + return null; + } + + @Override + public boolean isTrapSpawn(String dungeonName) { + String floor = dungeonName.substring(14).trim(); + if (floor.equals("M3")) { + return true; + } else if (floor.equals("M4")) { + return true; + } else if (floor.equals("M5")) { + return true; + } else if (floor.equals("M6")) { + return true; + } else if (floor.equals("M7")) { + return true; + } + return false; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java index 41048bd2..9695c06e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java @@ -9,6 +9,7 @@ public class DungeonSpecificDataProviderRegistry { static { doorFinders.put(Pattern.compile("The Catacombs (?:F[0-9]|E)"), new CatacombDataProvider()); + doorFinders.put(Pattern.compile("The Catacombs (?:M[0-9]|E)"), new CatacombMasterDataProvider()); } public static DungeonSpecificDataProvider getDoorFinder(String dungeonName) { |