aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java4
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java2
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/CatacombMasterDataProvider.java97
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/doorfinder/DungeonSpecificDataProviderRegistry.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java1
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java9
9 files changed, 116 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java
index 2966f67b..32bda60a 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/DungeonContext.java
@@ -90,7 +90,9 @@ public class DungeonContext {
createEvent(new DungeonNodataEvent("DUNGEON_CONTEXT_CREATION"));
mapProcessor = new MapProcessor(this);
DungeonSpecificDataProvider doorFinder = DungeonSpecificDataProviderRegistry.getDoorFinder(((SkyblockStatus) e.getDungeonsGuide().getSkyblockStatus()).getDungeonName());
- trapRoomGen = doorFinder.isTrapSpawn(e.getDungeonsGuide().getSkyblockStatus().getDungeonName());
+ if (doorFinder != null)
+ trapRoomGen = doorFinder.isTrapSpawn(e.getDungeonsGuide().getSkyblockStatus().getDungeonName());
+ else mapProcessor.setBugged(true);
init = System.currentTimeMillis();
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
index dcc9e7fa..e3ec00c6 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
@@ -15,6 +15,7 @@ import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonSpecificDataProvider;
import kr.syeyoung.dungeonsguide.events.DungeonContextInitializationEvent;
import kr.syeyoung.dungeonsguide.utils.MapUtils;
import lombok.Getter;
+import lombok.Setter;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemMap;
@@ -50,6 +51,7 @@ public class MapProcessor {
@Getter
private Point topLeftMapPoint;
+ @Setter
private boolean bugged = false;
private List<Point> roomsFound = new ArrayList<Point>();
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) {
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java
index 29060c1e..1464d397 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBoxRealLivid.java
@@ -32,6 +32,7 @@ public class FeatureBoxRealLivid extends SimpleFeature implements WorldRenderLis
public void drawWorld(float partialTicks) {
if (!isEnabled()) return;
if (!skyblockStatus.isOnDungeon()) return;
+ if (skyblockStatus.getContext() == null) return;
if (skyblockStatus.getContext().getBossfightProcessor() == null) return;
if (!(skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorLivid)) return;
EntityOtherPlayerMP playerMP = ((BossfightProcessorLivid) skyblockStatus.getContext().getBossfightProcessor()).getRealLivid();
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java
index 743b9f35..dfce6493 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureHideAnimals.java
@@ -34,6 +34,7 @@ public class FeatureHideAnimals extends SimpleFeature implements EntityLivingRen
public void onEntityRenderPre(RenderLivingEvent.Pre renderPlayerEvent) {
if (!isEnabled()) return;
if (!skyblockStatus.isOnDungeon()) return;
+ if (skyblockStatus.getContext() == null) return;
if (skyblockStatus.getContext().getBossfightProcessor() == null) return;
if (!(skyblockStatus.getContext().getBossfightProcessor() instanceof BossfightProcessorThorn)) return;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java
index a14b9c99..e7e899d3 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonMap.java
@@ -104,7 +104,7 @@ public class FeatureDungeonMap extends GuiFeature implements DungeonEndListener,
@Override
public void drawHUD(float partialTicks) {
if (!skyblockStatus.isOnDungeon()) return;
- if (skyblockStatus.getContext() == null | !skyblockStatus.getContext().getMapProcessor().isInitialized()) return;
+ if (skyblockStatus.getContext() == null || !skyblockStatus.getContext().getMapProcessor().isInitialized()) return;
if (!on) return;;
DungeonContext context = skyblockStatus.getContext();
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java
index 42df10ad..b6c4bde7 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java
@@ -74,6 +74,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature {
public String getTotalSecrets() {
DungeonContext context = skyblockStatus.getContext();
+ if (context == null) return "?";
int totalSecrets = 0;
boolean allknown = true;
for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) {
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java
index bd80f0f1..54353e34 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java
@@ -34,6 +34,7 @@ import java.awt.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
+import java.util.UUID;
public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderListener, GuiClickListener, WorldRenderListener {
@@ -51,6 +52,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis
}
SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus();
+ private UUID lastRoomUID = null;
@Override
public void drawHUD(float partialTicks) {
if (Minecraft.getMinecraft().currentScreen != null && !(Minecraft.getMinecraft().currentScreen instanceof GuiGuiLocationConfig
@@ -69,6 +71,13 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderLis
Point roomPt = context.getMapProcessor().worldPointToRoomPoint(thePlayer.getPosition());
DungeonRoom dungeonRoom = context.getRoomMapper().get(roomPt);
if (dungeonRoom == null) return;
+ if (!dungeonRoom.getDungeonRoomInfo().getUuid().equals(lastRoomUID)) {
+ selected = -1;
+ selectedState = -1;
+ dy = 0;
+ }
+ lastRoomUID = dungeonRoom.getDungeonRoomInfo().getUuid();
+
if (!(dungeonRoom.getRoomProcessor() instanceof GeneralRoomProcessor)) return;
GeneralRoomProcessor grp = (GeneralRoomProcessor) dungeonRoom.getRoomProcessor();