aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2021-10-02 23:37:44 +0900
committersyeyoung <cyoung06@naver.com>2021-10-02 23:37:44 +0900
commit2a60380de52cce7a895e8200751e8e854178796a (patch)
tree5d20bfc36735a577a1df16fd01fabdfaf8dde480 /src/main/java/kr/syeyoung/dungeonsguide/roomprocessor
parent5469f3041832885ccf33b5b1d9959d610e1bd6c2 (diff)
downloadSkyblock-Dungeons-Guide-2a60380de52cce7a895e8200751e8e854178796a.tar.gz
Skyblock-Dungeons-Guide-2a60380de52cce7a895e8200751e8e854178796a.tar.bz2
Skyblock-Dungeons-Guide-2a60380de52cce7a895e8200751e8e854178796a.zip
- Block Changed Event
- Optimization on JPS Pathfinder
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomprocessor')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java10
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java3
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/GeneralDefuseChamberProcessor.java5
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java5
4 files changed, 23 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
index c0696a9e..0b002161 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java
@@ -30,8 +30,10 @@ import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint;
import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic;
import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonSecret;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
+import kr.syeyoung.dungeonsguide.events.BlockUpdateEvent;
import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent;
import kr.syeyoung.dungeonsguide.features.FeatureRegistry;
+import kr.syeyoung.dungeonsguide.pathfinding.NodeProcessorDungeonRoom;
import kr.syeyoung.dungeonsguide.roomedit.EditingContext;
import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonAddSet;
import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit;
@@ -72,6 +74,7 @@ public class GeneralRoomProcessor implements RoomProcessor {
}
private boolean ticked = false;
+
@Override
public void tick() {
if (!ticked && FeatureRegistry.SECRET_AUTO_START.isEnabled())
@@ -412,6 +415,13 @@ public class GeneralRoomProcessor implements RoomProcessor {
}
}
}
+ @Override
+ public void onBlockUpdate(BlockUpdateEvent blockUpdateEvent) {
+ for (Tuple<BlockPos, IBlockState> updatedBlock : blockUpdateEvent.getUpdatedBlocks()) {
+ if (updatedBlock.getSecond().equals(NodeProcessorDungeonRoom.preBuilt)) continue;
+ dungeonRoom.resetBlock(updatedBlock.getFirst());
+ }
+ }
public static class Generator implements RoomProcessorGenerator<GeneralRoomProcessor> {
@Override
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
index 0f4cce7c..848bd71a 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/RoomProcessor.java
@@ -19,6 +19,7 @@
package kr.syeyoung.dungeonsguide.roomprocessor;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
+import kr.syeyoung.dungeonsguide.events.BlockUpdateEvent;
import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent;
import net.minecraft.util.IChatComponent;
import net.minecraftforge.client.event.GuiScreenEvent;
@@ -46,4 +47,6 @@ public interface RoomProcessor {
void onInteract(PlayerInteractEntityEvent event);
void onInteractBlock(PlayerInteractEvent event);
+
+ void onBlockUpdate(BlockUpdateEvent blockUpdateEvent);
} \ No newline at end of file
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 6ea0fd95..823e322b 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
@@ -19,6 +19,7 @@
package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers;
import kr.syeyoung.dungeonsguide.Keybinds;
+import kr.syeyoung.dungeonsguide.events.BlockUpdateEvent;
import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent;
import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver;
import lombok.Getter;
@@ -84,6 +85,10 @@ public abstract class GeneralDefuseChamberProcessor implements ChamberProcessor
public void actionbarReceived(IChatComponent chat) {
}
+ @Override
+ public void onBlockUpdate(BlockUpdateEvent blockUpdateEvent) {
+
+ }
@Override
public boolean readGlobalChat() {
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java
index 8ea4b5a6..1d297a0d 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java
@@ -18,6 +18,7 @@
package kr.syeyoung.dungeonsguide.roomprocessor.bossfight;
+import kr.syeyoung.dungeonsguide.events.BlockUpdateEvent;
import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent;
import lombok.*;
import net.minecraft.entity.boss.BossStatus;
@@ -127,6 +128,10 @@ public abstract class GeneralBossfightProcessor implements BossfightProcessor {
public void onEntityDeath(LivingDeathEvent deathEvent) {
}
+ @Override
+ public void onBlockUpdate(BlockUpdateEvent blockUpdateEvent) {
+
+ }
public void onPhaseChange() {}