aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-10 19:50:58 +0900
committersyeyoung <cyong06@naver.com>2021-02-10 19:50:58 +0900
commit8d81f25a74af028357f33c4a44f73fc929ad5338 (patch)
treee34cb9006b5bb1fcbda209d17e966f040e705ac0 /src/main/java/kr/syeyoung/dungeonsguide/roomprocessor
parentb6a7d4231a245a4d0ba772761319bd180c44944d (diff)
downloadSkyblock-Dungeons-Guide-8d81f25a74af028357f33c4a44f73fc929ad5338.tar.gz
Skyblock-Dungeons-Guide-8d81f25a74af028357f33c4a44f73fc929ad5338.tar.bz2
Skyblock-Dungeons-Guide-8d81f25a74af028357f33c4a44f73fc929ad5338.zip
AY PATHFINDER GO BRRRRR
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomprocessor')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java27
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java6
2 files changed, 29 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
index 9b86c36f..dc09f46d 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
@@ -3,6 +3,7 @@ package kr.syeyoung.dungeonsguide.roomprocessor;
import kr.syeyoung.dungeonsguide.SkyblockStatus;
import kr.syeyoung.dungeonsguide.config.Config;
import kr.syeyoung.dungeonsguide.dungeon.DungeonContext;
+import kr.syeyoung.dungeonsguide.dungeon.actions.tree.ActionRoute;
import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.e;
@@ -40,21 +41,32 @@ public class GeneralRoomProcessor implements RoomProcessor {
@Override
public void tick() {
-
+ if (path != null) path.onTick();
}
@Override
public void drawScreen(float partialTicks) {
+ if (path != null) path.onRenderScreen(partialTicks);
+
+ FontRenderer fr = Minecraft.getMinecraft().fontRendererObj;
+ if (path != null) {
+ fr.drawString("Pathfinding " + path.getMechanic() + ":" + path.getState(), 5, 5, 0xffffffff);
+ for (int i = 0; i < path.getActions().size(); i++) {
+ fr.drawString((i == path.getCurrent() ? ">" : " ") + " " + i + ". " + path.getActions().get(i),
+ 5, i * 8 + 13, 0xFF00FF00);
+ }
+ }
}
@Override
public void drawWorld(float partialTicks) {
- if (FeatureRegistry.DEBUG.isEnabled() && (EditingContext.getEditingContext() == null || EditingContext.getEditingContext().getCurrent() instanceof GuiDungeonRoomEdit)) {
+ if (FeatureRegistry.DEBUG.isEnabled() && (EditingContext.getEditingContext() != null && EditingContext.getEditingContext().getCurrent() instanceof GuiDungeonRoomEdit)) {
for (Map.Entry<String, DungeonMechanic> value : dungeonRoom.getDungeonRoomInfo().getMechanics().entrySet()) {
if (value.getValue() == null) continue;;
value.getValue().highlight(new Color(0,255,255,50), value.getKey(), dungeonRoom, partialTicks);
}
}
+ if (path != null) path.onRenderWorld(partialTicks);
}
@Override
@@ -115,8 +127,15 @@ public class GeneralRoomProcessor implements RoomProcessor {
return false;
}
+ private ActionRoute path;
+
+ public void pathfind(String mechanic, String state) {
+ path = new ActionRoute(getDungeonRoom(), mechanic, state);
+ }
+
@Override
public void onPostGuiRender(GuiScreenEvent.DrawScreenEvent.Post event) {
+
}
@Override
@@ -134,12 +153,12 @@ public class GeneralRoomProcessor implements RoomProcessor {
@Override
public void onInteractBlock(PlayerInteractEvent event) {
-
+ if (path != null) path.onPlayerInteract(event);
}
@Override
public void onEntityDeath(LivingDeathEvent deathEvent) {
-
+ if (path != null) path.onLivingDeath(deathEvent);
}
public static class Generator implements RoomProcessorGenerator<GeneralRoomProcessor> {
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java
index 41dde1fe..b64d11de 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java
@@ -11,6 +11,7 @@ import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.client.event.GuiScreenEvent;
+import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.living.LivingEvent;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
@@ -54,6 +55,11 @@ public abstract class GeneralDefuseChamberProcessor implements ChamberProcessor
}
@Override
+ public void onEntityDeath(LivingDeathEvent deathEvent) {
+
+ }
+
+ @Override
public void actionbarReceived(IChatComponent chat) {
}