9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-06 15:52:03 +00:00

fix(bukkit): 优化实体移除逻辑

This commit is contained in:
jhqwqmc
2025-04-08 15:31:33 +08:00
parent 7cea94971b
commit 48ae6d1c8d

View File

@@ -1100,11 +1100,12 @@ public class PacketConsumers {
try { try {
IntList intList = FastNMS.INSTANCE.field$ClientboundRemoveEntitiesPacket$entityIds(packet); IntList intList = FastNMS.INSTANCE.field$ClientboundRemoveEntitiesPacket$entityIds(packet);
for (int i = 0, size = intList.size(); i < size; i++) { for (int i = 0, size = intList.size(); i < size; i++) {
user.entityView().remove(intList.getInt(i)); int entityId = intList.getInt(i);
List<Integer> entities = user.furnitureView().remove(intList.getInt(i)); user.entityView().remove(entityId);
List<Integer> entities = user.furnitureView().remove(entityId);
if (entities == null) continue; if (entities == null) continue;
for (int entityId : entities) { for (int entityId1 : entities) {
intList.add(entityId); intList.add(entityId1);
} }
} }
} catch (Exception e) { } catch (Exception e) {