mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-09-11 07:08:17 +02:00
Fix player animations
This commit is contained in:
parent
3896c67709
commit
fe370258db
@ -196,8 +196,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder {
|
||||
// swallow
|
||||
}
|
||||
|
||||
NMS.setStepHeight(this, 1);// stepHeight - must not stay as the default
|
||||
// 0 (breaks steps).
|
||||
NMS.setStepHeight(this, 1); // the default (0) breaks step climbing
|
||||
|
||||
try {
|
||||
socket.close();
|
||||
|
@ -15,29 +15,31 @@ public enum PlayerAnimation {
|
||||
ARM_SWING {
|
||||
@Override
|
||||
protected void playAnimation(EntityPlayer player, int radius) {
|
||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 1);
|
||||
sendPacketNearby(packet, player, radius);
|
||||
playDefaultAnimation(player, radius, 0);
|
||||
}
|
||||
},
|
||||
CRIT {
|
||||
@Override
|
||||
protected void playAnimation(EntityPlayer player, int radius) {
|
||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 6);
|
||||
sendPacketNearby(packet, player, radius);
|
||||
playDefaultAnimation(player, radius, 4);
|
||||
}
|
||||
},
|
||||
EAT_FOOD {
|
||||
@Override
|
||||
protected void playAnimation(EntityPlayer player, int radius) {
|
||||
playDefaultAnimation(player, radius, 3);
|
||||
}
|
||||
},
|
||||
HURT {
|
||||
@Override
|
||||
protected void playAnimation(EntityPlayer player, int radius) {
|
||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 2);
|
||||
sendPacketNearby(packet, player, radius);
|
||||
playDefaultAnimation(player, radius, 1);
|
||||
}
|
||||
},
|
||||
MAGIC_CRIT {
|
||||
@Override
|
||||
protected void playAnimation(EntityPlayer player, int radius) {
|
||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 7);
|
||||
sendPacketNearby(packet, player, radius);
|
||||
playDefaultAnimation(player, radius, 5);
|
||||
}
|
||||
},
|
||||
SIT {
|
||||
@ -71,8 +73,7 @@ public enum PlayerAnimation {
|
||||
STOP_SLEEPING {
|
||||
@Override
|
||||
protected void playAnimation(EntityPlayer player, int radius) {
|
||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 3);
|
||||
sendPacketNearby(packet, player, radius);
|
||||
playDefaultAnimation(player, radius, 2);
|
||||
}
|
||||
},
|
||||
STOP_SNEAKING {
|
||||
@ -96,6 +97,11 @@ public enum PlayerAnimation {
|
||||
throw new UnsupportedOperationException("unimplemented animation");
|
||||
}
|
||||
|
||||
protected void playDefaultAnimation(EntityPlayer player, int radius, int code) {
|
||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, code);
|
||||
sendPacketNearby(packet, player, radius);
|
||||
}
|
||||
|
||||
protected void sendPacketNearby(Packet packet, EntityPlayer player, int radius) {
|
||||
NMS.sendPacketsNearby(player.getBukkitEntity().getLocation(), Arrays.asList(packet), radius);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user