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);
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<EntityPose> 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);
}
}
}