aboutsummaryrefslogtreecommitdiff
path: root/mod/src/main/java/kr/syeyoung/dungeonsguide/dungeon
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2022-10-06 14:16:15 +0900
committersyeyoung <cyoung06@naver.com>2022-10-06 14:16:15 +0900
commit846a2593242e98cb82e64f00382c3b607c93b7d3 (patch)
treedddf5a74aa54a30cf901d4afdea1ff62447643a7 /mod/src/main/java/kr/syeyoung/dungeonsguide/dungeon
parentc9ef55f2df21c94a96f44497ac4986d90a52dace (diff)
parent3be8eca3689a7b431800070963171d6042658f50 (diff)
downloadSkyblock-Dungeons-Guide-846a2593242e98cb82e64f00382c3b607c93b7d3.tar.gz
Skyblock-Dungeons-Guide-846a2593242e98cb82e64f00382c3b607c93b7d3.tar.bz2
Skyblock-Dungeons-Guide-846a2593242e98cb82e64f00382c3b607c93b7d3.zip
- Merge changes from master
- (Fix player heads)
Diffstat (limited to 'mod/src/main/java/kr/syeyoung/dungeonsguide/dungeon')
-rwxr-xr-xmod/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java41
1 files changed, 26 insertions, 15 deletions
diff --git a/mod/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/mod/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
index da914ff3..ca7b2300 100755
--- a/mod/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
+++ b/mod/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
@@ -1,19 +1,19 @@
/*
- * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
- * Copyright (C) 2021 cyoung06
+ * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod
+ * Copyright (C) 2021 cyoung06
*
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
*
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
*
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package kr.syeyoung.dungeonsguide.dungeon;
@@ -21,6 +21,10 @@ package kr.syeyoung.dungeonsguide.dungeon;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
import com.google.common.collect.Sets;
+import kr.syeyoung.dungeonsguide.DungeonsGuide;
+import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProvider;
+import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProviderRegistry;
+import kr.syeyoung.dungeonsguide.dungeon.doorfinder.EDungeonDoorType;
import kr.syeyoung.dungeonsguide.dungeon.events.DungeonMapUpdateEvent;
import kr.syeyoung.dungeonsguide.dungeon.events.DungeonNodataEvent;
import kr.syeyoung.dungeonsguide.dungeon.events.DungeonRoomDiscoverEvent;
@@ -28,8 +32,6 @@ import kr.syeyoung.dungeonsguide.DungeonsGuide;
import kr.syeyoung.dungeonsguide.dungeon.doorfinder.EDungeonDoorType;
import kr.syeyoung.dungeonsguide.dungeon.events.SerializableBlockPos;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
-import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProviderRegistry;
-import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProvider;
import kr.syeyoung.dungeonsguide.events.DungeonContextInitializationEvent;
import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
import kr.syeyoung.dungeonsguide.stomp.StompPayload;
@@ -48,8 +50,9 @@ import org.json.JSONObject;
import javax.vecmath.Vector2d;
import java.awt.*;
-import java.util.*;
import java.util.List;
+import java.util.Queue;
+import java.util.*;
public class MapProcessor {
@@ -207,6 +210,14 @@ public class MapProcessor {
if (context.getDungeonMin() == null) return null;
return new Point((worldPoint.getX() - context.getDungeonMin().getX()) / 32, (worldPoint.getZ() - context.getDungeonMin().getZ()) / 32);
}
+
+ public Vector2d worldPointToMapPointFLOAT(Vec3 worldPoint) {
+ if (context.getDungeonMin() == null) return null;
+ double x = topLeftMapPoint.x + ((worldPoint.xCoord - context.getDungeonMin().getX()) / 32.0f * (unitRoomDimension.width + doorDimension.height));
+ double y = topLeftMapPoint.y + ((worldPoint.zCoord - context.getDungeonMin().getZ()) / 32.0f * (unitRoomDimension.height + doorDimension.height));
+ return new Vector2d(x, y);
+ }
+
public Point worldPointToMapPoint(Vec3 worldPoint) {
if (context.getDungeonMin() == null) return null;
return new Point(topLeftMapPoint.x + (int)((worldPoint.xCoord - context.getDungeonMin().getX()) / 32.0f * (unitRoomDimension.width + doorDimension.height)), topLeftMapPoint.y + (int)((worldPoint.zCoord - context.getDungeonMin().getZ()) / 32.0f * (unitRoomDimension.height + doorDimension.height)));