aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-12 21:16:58 +0900
committersyeyoung <cyong06@naver.com>2021-02-12 21:16:58 +0900
commit77af3008dba9efab778555093191ecf8817e0ed3 (patch)
tree0440e57ff7eb6758ada65bf0fa7341d055f85ecb /src/main/java/kr/syeyoung/dungeonsguide/dungeon
parent5cac3f67b8d77bbf10b1c6cff1137f695a11f0f0 (diff)
downloadSkyblock-Dungeons-Guide-77af3008dba9efab778555093191ecf8817e0ed3.tar.gz
Skyblock-Dungeons-Guide-77af3008dba9efab778555093191ecf8817e0ed3.tar.bz2
Skyblock-Dungeons-Guide-77af3008dba9efab778555093191ecf8817e0ed3.zip
smol fix
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionInteract.java1
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java10
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java7
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java1
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java10
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java1
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java1
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java12
8 files changed, 40 insertions, 3 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionInteract.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionInteract.java
index b3be996a..96b4e874 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionInteract.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionInteract.java
@@ -40,6 +40,7 @@ public class ActionInteract extends AbstractAction {
private boolean interacted = false;
@Override
public void onLivingInteract(DungeonRoom dungeonRoom, PlayerInteractEntityEvent event) {
+ System.out.println("eve");
if (interacted) return;
Vec3 spawnLoc = EntitySpawnManager.getSpawnLocation().get(event.getEntity().getEntityId());
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java
index 39d53931..cdfc7c37 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java
@@ -102,6 +102,14 @@ public class DungeonDoor implements DungeonMechanic, RouteBlocker {
@Override
public OffsetPoint getRepresentingPoint() {
- return secretPoint.getOffsetPointList().size() == 0 ? null : secretPoint.getOffsetPointList().get(0);
+ int leastY = Integer.MAX_VALUE;
+ OffsetPoint thatPt = null;
+ for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) {
+ if (offsetPoint.getY() < leastY) {
+ thatPt = offsetPoint;
+ leastY = offsetPoint.getY();
+ }
+ }
+ return thatPt;
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java
index 41e591c1..3fe6ef46 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java
@@ -31,9 +31,14 @@ public class DungeonDummy implements DungeonMechanic {
preRequisites.add(actionMove);
preRequisites = actionMove.getPreRequisite();
} else if (state.equalsIgnoreCase("click")) {
- ActionClick actionMove = new ActionClick(secretPoint);
+ ActionClick actionClick = new ActionClick(secretPoint);
+ preRequisites.add(actionClick);
+ preRequisites = actionClick.getPreRequisite();
+
+ ActionMove actionMove = new ActionMove(secretPoint);
preRequisites.add(actionMove);
preRequisites = actionMove.getPreRequisite();
+
}
{
for (String str : preRequisite) {
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java
index 787208cc..7dd69af3 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java
@@ -20,6 +20,7 @@ public class DungeonLever implements DungeonMechanic {
@Override
public Set<Action> getAction(String state, DungeonRoom dungeonRoom) {
+ if (state.equals(getCurrentState(dungeonRoom))) return Collections.emptySet();
if (state.equalsIgnoreCase("navigate")) {
Set<Action> base;
Set<Action> preRequisites = base = new HashSet<Action>();
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java
index 2e279b64..803f7c5b 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java
@@ -104,6 +104,14 @@ public class DungeonOnewayDoor implements DungeonMechanic, RouteBlocker {
@Override
public OffsetPoint getRepresentingPoint() {
- return secretPoint.getOffsetPointList().size() == 0 ? null : secretPoint.getOffsetPointList().get(0);
+ int leastY = Integer.MAX_VALUE;
+ OffsetPoint thatPt = null;
+ for (OffsetPoint offsetPoint : secretPoint.getOffsetPointList()) {
+ if (offsetPoint.getY() < leastY) {
+ thatPt = offsetPoint;
+ leastY = offsetPoint.getY();
+ }
+ }
+ return thatPt;
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java
index 926c989d..bddfa231 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java
@@ -20,6 +20,7 @@ public class DungeonOnewayLever implements DungeonMechanic {
@Override
public Set<Action> getAction(String state, DungeonRoom dungeonRoom) {
+ if (state.equals(getCurrentState(dungeonRoom))) return Collections.emptySet();
if (state.equalsIgnoreCase("navigate")) {
Set<Action> base;
Set<Action> preRequisites = base = new HashSet<Action>();
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java
index 3574c8c9..79ef4bda 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java
@@ -20,6 +20,7 @@ public class DungeonPressurePlate implements DungeonMechanic {
@Override
public Set<Action> getAction(String state, DungeonRoom dungeonRoom) {
+ if (state.equals(getCurrentState(dungeonRoom))) return Collections.emptySet();
if (state.equalsIgnoreCase("navigate")) {
Set<Action> base;
Set<Action> preRequisites = base = new HashSet<Action>();
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java
index e014d721..128090db 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoomInfoRegistry.java
@@ -1,5 +1,6 @@
package kr.syeyoung.dungeonsguide.dungeon.roomfinder;
+import com.google.common.io.Files;
import kr.syeyoung.dungeonsguide.e;
import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo;
import net.minecraft.client.Minecraft;
@@ -10,6 +11,7 @@ import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.io.*;
import java.net.URL;
+import java.nio.charset.Charset;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
@@ -22,6 +24,7 @@ public class DungeonRoomInfoRegistry {
public static void register(DungeonRoomInfo dungeonRoomInfo) {
if (dungeonRoomInfo == null) throw new NullPointerException("what the fak parameter is noll?");
+ if (uuidMap.containsKey(dungeonRoomInfo.getUuid())) return;
dungeonRoomInfo.setRegistered(true);
registered.add(dungeonRoomInfo);
uuidMap.put(dungeonRoomInfo.getUuid(), dungeonRoomInfo);
@@ -54,6 +57,7 @@ public class DungeonRoomInfoRegistry {
dir.mkdirs();
boolean isDev = Minecraft.getMinecraft().getSession().getPlayerID().replace("-","").equals("e686fe0aab804a71ac7011dc8c2b534c");
System.out.println(isDev);
+ String nameidstring = "name,uuid,processsor,secrets";
for (DungeonRoomInfo dungeonRoomInfo : registered) {
try {
if (!dungeonRoomInfo.isUserMade() && !isDev) continue;
@@ -62,8 +66,16 @@ public class DungeonRoomInfoRegistry {
oos.writeObject(dungeonRoomInfo);
oos.flush();
oos.close();
+
+ nameidstring += "\n"+dungeonRoomInfo.getName()+","+dungeonRoomInfo.getUuid() +","+dungeonRoomInfo.getProcessorId()+","+dungeonRoomInfo.getTotalSecrets();
} catch (Exception e) {e.printStackTrace();}
}
+
+ try {
+ Files.write(nameidstring, new File(dir, "roomidmapping.csv"), Charset.defaultCharset());
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
}
public static void loadAll(File dir) throws BadPaddingException, InvalidAlgorithmParameterException, NoSuchAlgorithmException, IOException, IllegalBlockSizeException, NoSuchPaddingException, InvalidKeyException {