13
0
Dieser Commit ist enthalten in:
Lixfel 2020-11-06 11:17:21 +01:00
Ursprung 30d1187038
Commit 96bde868d7

Datei anzeigen

@ -101,8 +101,10 @@ public abstract class REntity {
public void sneak(boolean sneaking) {
entity.setSneaking(sneaking);
//entity.getDataWatcher().set(new DataWatcherObject<Byte>(0, DataWatcherRegistry.a), (byte)0x02);
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.getId(), entity.getDataWatcher(), false);
DataWatcher dataWatcher = new DataWatcher(entity);
dataWatcher.register(new DataWatcherObject<>(0, DataWatcherRegistry.a), sneaking ? (byte)0x02 : (byte)0x00);
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.getId(), dataWatcher, false);
for(Player player : Bukkit.getOnlinePlayers()){
((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);