Merge pull request 'Sneaking in SpectateSystem' (#19) from sneaking_like_a_god into master
Reviewed-on: #19 Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Commit
db6fd39788
@ -48,6 +48,7 @@ public abstract class REntity {
|
||||
for(Player player : Bukkit.getOnlinePlayers()){
|
||||
sendToPlayer(player);
|
||||
}
|
||||
sneak(false);
|
||||
}
|
||||
|
||||
public static void playerJoins(Player player){
|
||||
@ -104,16 +105,17 @@ public abstract class REntity {
|
||||
}
|
||||
|
||||
public void sneak(boolean sneaking) {
|
||||
entity.setSneaking(sneaking);
|
||||
DataWatcher dataWatcher = new DataWatcher(null);
|
||||
|
||||
DataWatcherObject<EntityPose> dataWatcherObject = new DataWatcherObject<>(6, DataWatcherRegistry.s);
|
||||
dataWatcher.register(dataWatcherObject, sneaking?EntityPose.CROUCHING:EntityPose.STANDING);
|
||||
dataWatcher.markDirty(dataWatcherObject);
|
||||
|
||||
/*DataWatcher dataWatcher = new DataWatcher(entity);
|
||||
System.out.println("Let " + entity.getName() + " sneak " + sneaking);
|
||||
dataWatcher.register(new DataWatcherObject<>(0, DataWatcherRegistry.a), sneaking ? (byte)0x02 : (byte)0x40);
|
||||
PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.getId(), dataWatcher, false);
|
||||
|
||||
for(Player player : Bukkit.getOnlinePlayers()){
|
||||
((CraftPlayer)player).getHandle().playerConnection.sendPacket(packet);
|
||||
}*/
|
||||
((CraftPlayer) player).getHandle().playerConnection.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
public void animation(byte animation) {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren