13
0

Reduce Code Duplication

Dieser Commit ist enthalten in:
Chaoscaot 2021-04-17 19:42:29 +02:00
Ursprung f532dce64b
Commit a2a4b96b44

Datei anzeigen

@ -82,9 +82,7 @@ public abstract class REntity {
DataWatcherObject<Byte> dataWatcherObject = new DataWatcherObject<>(0, DataWatcherRegistry.a); DataWatcherObject<Byte> dataWatcherObject = new DataWatcherObject<>(0, DataWatcherRegistry.a);
dataWatcher.register(dataWatcherObject, (byte) 1); dataWatcher.register(dataWatcherObject, (byte) 1);
dataWatcher.markDirty(dataWatcherObject); dataWatcher.markDirty(dataWatcherObject);
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.entity.getId(), dataWatcher, false); entity.sendDataWatcher(dataWatcher);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }
if(entity.entity.isSneaking()) { if(entity.entity.isSneaking()) {
DataWatcher dataWatcher = new DataWatcher(null); DataWatcher dataWatcher = new DataWatcher(null);
@ -92,10 +90,7 @@ public abstract class REntity {
DataWatcherObject<EntityPose> dataWatcherObject = new DataWatcherObject<>(6, DataWatcherRegistry.s); DataWatcherObject<EntityPose> dataWatcherObject = new DataWatcherObject<>(6, DataWatcherRegistry.s);
dataWatcher.register(dataWatcherObject, EntityPose.CROUCHING); dataWatcher.register(dataWatcherObject, EntityPose.CROUCHING);
dataWatcher.markDirty(dataWatcherObject); dataWatcher.markDirty(dataWatcherObject);
entity.sendDataWatcher(dataWatcher);
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.entity.getId(), dataWatcher, false);
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
} }
} }
} }