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); }