aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-22 23:08:32 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-22 23:08:32 +0900
commit46a86f18ebd62a3771ca4fcb7d1cf17f69b80c73 (patch)
tree7e51cbd93de3c30d95e85b4df4c9eefd4bd3c367 /src/main/java/kr/syeyoung/dungeonsguide/dungeon
parentb46d3d8ce98b112d8c4f1b3ad5eed81b234b1892 (diff)
downloadSkyblock-Dungeons-Guide-46a86f18ebd62a3771ca4fcb7d1cf17f69b80c73.tar.gz
Skyblock-Dungeons-Guide-46a86f18ebd62a3771ca4fcb7d1cf17f69b80c73.tar.bz2
Skyblock-Dungeons-Guide-46a86f18ebd62a3771ca4fcb7d1cf17f69b80c73.zip
Debug
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
index a3e0d961..7cfbdfba 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
@@ -1,6 +1,7 @@
package kr.syeyoung.dungeonsguide.dungeon;
import com.google.common.collect.Sets;
+import jdk.nashorn.internal.ir.Block;
import kr.syeyoung.dungeonsguide.DungeonsGuide;
import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoom;
import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DoorFinderRegistry;
@@ -145,6 +146,9 @@ public class MapProcessor {
public BlockPos roomPointToWorldPoint(Point roomPoint) {
return new BlockPos(context.getDungeonMin().getX() +(roomPoint.x * 32), context.getDungeonMin().getY(), context.getDungeonMin().getZ() +(roomPoint.y *32));
}
+ public Point worldPointToRoomPoint(BlockPos worldPoint) {
+ return new Point((worldPoint.getX() - context.getDungeonMin().getX()) / 32, (worldPoint.getZ() - context.getDungeonMin().getZ()) / 32);
+ }
private void processMap(byte[] mapData) {
int height = (int)((128.0 - topLeftMapPoint.y) / (unitRoomDimension.height + doorDimension.height));
@@ -160,7 +164,18 @@ public class MapProcessor {
if (color != 0 && color != 85) {
MapUtils.record(mapData, mapPoint.x, mapPoint.y, new Color(0,255,255,80));
DungeonRoom rooms = buildRoom(mapData, new Point(x,y));
- Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("New Map discovered! shape: "+rooms.getShape()+ " color: "+rooms.getColor()+" min: "+rooms.getMin()+" / "+x+","+y));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("New Map discovered! shape: "+rooms.getShape()+ " color: "+rooms.getColor()+" unitPos: "+x+","+y));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("New Map discovered! mapMin: "+rooms.getMin()));
+ StringBuilder builder = new StringBuilder();
+ for (int dy =0;dy<4;dy++) {
+ for (int dx = 0; dx < 4; dx ++) {
+ boolean isSet = ((rooms.getShape() >> (dy * 4 + dx)) & 0x1) != 0;
+ builder.append(isSet ? "O" : "X");
+ }
+ builder.append("\n");
+ }
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("Shape visual: "+builder.toString()));
+
context.getDungeonRoomList().add(rooms);
for (Point p:rooms.getUnitPoints()) {
roomsFound.add(p);