diff --git a/build.gradle.kts b/build.gradle.kts index 86f2187..12cbc79 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { allprojects { group = "de.oliver" - version = "0.0.11" + version = "0.0.12" description = "Simple, lightweight and fast library for minecraft internals" repositories { diff --git a/factories/src/main/java/de/oliver/fancysitula/factories/EntityFactory.java b/factories/src/main/java/de/oliver/fancysitula/factories/EntityFactory.java index 4a13c69..c6f91d5 100644 --- a/factories/src/main/java/de/oliver/fancysitula/factories/EntityFactory.java +++ b/factories/src/main/java/de/oliver/fancysitula/factories/EntityFactory.java @@ -9,6 +9,10 @@ public class EntityFactory { public void spawnEntityFor(FS_RealPlayer player, FS_Entity entity) { + if (entity == null) { + return; + } + FancySitula.PACKET_FACTORY.createAddEntityPacket( entity.getId(), entity.getUuid(), @@ -29,6 +33,10 @@ public void spawnEntityFor(FS_RealPlayer player, FS_Entity entity) { } public void despawnEntityFor(FS_RealPlayer player, FS_Entity entity) { + if (entity == null) { + return; + } + FancySitula.PACKET_FACTORY.createRemoveEntitiesPacket( List.of(entity.getId()) ) @@ -36,6 +44,10 @@ public void despawnEntityFor(FS_RealPlayer player, FS_Entity entity) { } public void setEntityDataFor(FS_RealPlayer player, FS_Entity entity) { + if (entity == null) { + return; + } + if (entity.getEntityData().isEmpty()) { return; } @@ -47,6 +59,10 @@ public void setEntityDataFor(FS_RealPlayer player, FS_Entity entity) { } public void setEntityEquipmentFor(FS_RealPlayer player, FS_Player entity) { + if (entity == null) { + return; + } + FancySitula.PACKET_FACTORY.createSetEquipmentPacket( entity.getId(), entity.getEquipment()