9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-25 09:59:20 +00:00

add chunk status check

This commit is contained in:
XiaoMoMi
2025-04-02 22:07:34 +08:00
parent 13ca7d018c
commit 606dff9a43

View File

@@ -275,13 +275,17 @@ public class BukkitFurnitureManager implements FurnitureManager {
int id = entity.getEntityId();
LoadedFurniture furniture = this.furnitureByRealEntityId.remove(id);
if (furniture != null) {
furniture.destroySeats();
Location location = entity.getLocation();
boolean isPreventing = FastNMS.INSTANCE.isPreventingStatusUpdates(location.getWorld(), location.getBlockX() >> 4, location.getBlockZ() >> 4);
if (!isPreventing) {
furniture.destroySeats();
}
for (int sub : furniture.entityIds()) {
this.furnitureByEntityId.remove(sub);
}
for (CollisionEntity collision : furniture.collisionEntities()) {
this.furnitureByRealEntityId.remove(FastNMS.INSTANCE.method$Entity$getId(collision));
collision.destroy();
if (!isPreventing) collision.destroy();
}
}
}