aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-01-04 21:45:04 +0900
committersyeyoung <cyong06@naver.com>2021-01-04 21:45:04 +0900
commit04d414547e4d932f4db9a74dbc4aea8d75b96960 (patch)
treeacfccab2803dc6161e4ce099021d2fa972967ace /src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder
parentece0af65a8bba6c722ac6f0853c570d2e8cad784 (diff)
downloadSkyblock-Dungeons-Guide-04d414547e4d932f4db9a74dbc4aea8d75b96960.tar.gz
Skyblock-Dungeons-Guide-04d414547e4d932f4db9a74dbc4aea8d75b96960.tar.bz2
Skyblock-Dungeons-Guide-04d414547e4d932f4db9a74dbc4aea8d75b96960.zip
Various things
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDoorFinder.java)8
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DoorFinderRegistry.java20
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProvider.java (renamed from src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/StartDoorFinder.java)6
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java20
4 files changed, 26 insertions, 28 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDoorFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java
index b73fa2aa..7f4e9813 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDoorFinder.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombDataProvider.java
@@ -2,23 +2,21 @@ package kr.syeyoung.dungeonsguide.dungeon.doorfinder;
import com.google.common.base.Predicate;
import com.google.common.collect.Sets;
-import net.minecraft.client.Minecraft;
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 CatacombDoorFinder implements StartDoorFinder {
+public class CatacombDataProvider 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 find(World w) {
+ public BlockPos findDoor(World w, String dungeonName) {
Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() {
@Override
public boolean apply(EntityArmorStand input) {
@@ -43,7 +41,7 @@ public class CatacombDoorFinder implements StartDoorFinder {
}
@Override
- public Vector2d offset(World w) {
+ public Vector2d findDoorOffset(World w, String dungeonName) {
Collection<EntityArmorStand> armorStand = w.getEntities(EntityArmorStand.class, new Predicate<EntityArmorStand>() {
@Override
public boolean apply(EntityArmorStand input) {
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DoorFinderRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DoorFinderRegistry.java
deleted file mode 100755
index 0fb3c89a..00000000
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DoorFinderRegistry.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package kr.syeyoung.dungeonsguide.dungeon.doorfinder;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.regex.Pattern;
-
-public class DoorFinderRegistry {
- private static final Map<Pattern, StartDoorFinder> doorFinders = new HashMap<Pattern, StartDoorFinder>();
-
- static {
- doorFinders.put(Pattern.compile("The Catacombs (?:F[0-9]|E)"), new CatacombDoorFinder());
- }
-
- public static StartDoorFinder getDoorFinder(String dungeonName) {
- for (Map.Entry<Pattern, StartDoorFinder> doorFinderEntry :doorFinders.entrySet()){
- if (doorFinderEntry.getKey().matcher(dungeonName).matches()) return doorFinderEntry.getValue();
- }
- return null;
- }
-}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/StartDoorFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProvider.java
index ee1ccdaa..cc97d73a 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/StartDoorFinder.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProvider.java
@@ -5,7 +5,7 @@ import net.minecraft.world.World;
import javax.vecmath.Vector2d;
-public interface StartDoorFinder {
- BlockPos find(World w);
- Vector2d offset(World w);
+public interface DungeonSpecificDataProvider {
+ BlockPos findDoor(World w, String dungeonName);
+ Vector2d findDoorOffset(World w, String dungeonName);
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java
new file mode 100755
index 00000000..41048bd2
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java
@@ -0,0 +1,20 @@
+package kr.syeyoung.dungeonsguide.dungeon.doorfinder;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Pattern;
+
+public class DungeonSpecificDataProviderRegistry {
+ private static final Map<Pattern, DungeonSpecificDataProvider> doorFinders = new HashMap<Pattern, DungeonSpecificDataProvider>();
+
+ static {
+ doorFinders.put(Pattern.compile("The Catacombs (?:F[0-9]|E)"), new CatacombDataProvider());
+ }
+
+ public static DungeonSpecificDataProvider getDoorFinder(String dungeonName) {
+ for (Map.Entry<Pattern, DungeonSpecificDataProvider> doorFinderEntry :doorFinders.entrySet()){
+ if (doorFinderEntry.getKey().matcher(dungeonName).matches()) return doorFinderEntry.getValue();
+ }
+ return null;
+ }
+}