diff --git a/src/de/steamwar/spectatesystem/elements/REntity.java b/src/de/steamwar/spectatesystem/elements/REntity.java index a7dc873..ccc5171 100644 --- a/src/de/steamwar/spectatesystem/elements/REntity.java +++ b/src/de/steamwar/spectatesystem/elements/REntity.java @@ -82,9 +82,7 @@ public abstract class REntity { DataWatcherObject dataWatcherObject = new DataWatcherObject<>(0, DataWatcherRegistry.a); dataWatcher.register(dataWatcherObject, (byte) 1); dataWatcher.markDirty(dataWatcherObject); - PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.entity.getId(), dataWatcher, false); - - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + entity.sendDataWatcher(dataWatcher); } if(entity.entity.isSneaking()) { DataWatcher dataWatcher = new DataWatcher(null); @@ -92,10 +90,7 @@ public abstract class REntity { DataWatcherObject dataWatcherObject = new DataWatcherObject<>(6, DataWatcherRegistry.s); dataWatcher.register(dataWatcherObject, EntityPose.CROUCHING); dataWatcher.markDirty(dataWatcherObject); - - PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.entity.getId(), dataWatcher, false); - - ((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet); + entity.sendDataWatcher(dataWatcher); } } }