From 10ce4c138db8573caaebe24d95cac6be8e95decb Mon Sep 17 00:00:00 2001 From: NightFish <101402767+dmzz-yyhyy@users.noreply.github.com> Date: Mon, 8 Jul 2024 14:35:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=94=99=E6=8B=BCunload?= =?UTF-8?q?=E4=B8=BAload?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anvilcraft/api/chargecollector/ChargeCollectorManager.java | 3 +-- .../dubhe/anvilcraft/event/ServerBlockEntityEventListener.java | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/dev/dubhe/anvilcraft/api/chargecollector/ChargeCollectorManager.java b/common/src/main/java/dev/dubhe/anvilcraft/api/chargecollector/ChargeCollectorManager.java index cf9bdf079..ef2a60c27 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/api/chargecollector/ChargeCollectorManager.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/api/chargecollector/ChargeCollectorManager.java @@ -16,8 +16,8 @@ import org.joml.Vector3f; public class ChargeCollectorManager { - private final Map chargeCollectors = new HashMap<>(); private static final Map INSTANCES = new HashMap<>(); + private final Map chargeCollectors = new HashMap<>(); @Getter private final Level level; @@ -89,6 +89,5 @@ public Entry(Double distance, ChargeCollectorBlockEntity blockEntity) { this.distance = distance; this.blockEntity = blockEntity; } - } } diff --git a/common/src/main/java/dev/dubhe/anvilcraft/event/ServerBlockEntityEventListener.java b/common/src/main/java/dev/dubhe/anvilcraft/event/ServerBlockEntityEventListener.java index 40efacc1a..ffdaaeccc 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/event/ServerBlockEntityEventListener.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/event/ServerBlockEntityEventListener.java @@ -4,6 +4,7 @@ import dev.dubhe.anvilcraft.api.chargecollector.ChargeCollectorManager; import dev.dubhe.anvilcraft.api.chargecollector.HeatedBlockRecorder; import dev.dubhe.anvilcraft.api.event.server.block.ServerBlockEntityLoadEvent; +import dev.dubhe.anvilcraft.api.event.server.block.ServerBlockEntityUnloadEvent; import dev.dubhe.anvilcraft.api.power.IPowerComponent; import dev.dubhe.anvilcraft.api.power.PowerGrid; import dev.dubhe.anvilcraft.api.world.load.LevelLoadManager; @@ -32,7 +33,7 @@ public void onLoad(ServerBlockEntityLoadEvent event) { */ @SuppressWarnings("unused") @SubscribeEvent - public void onUnload(ServerBlockEntityLoadEvent event) { + public void onUnload(ServerBlockEntityUnloadEvent event) { if (event.getBlockEntity() instanceof IPowerComponent component) { PowerGrid.removeComponent(component); }