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
|
// swallow
|
||||||
}
|
}
|
||||||
|
|
||||||
NMS.setStepHeight(this, 1);// stepHeight - must not stay as the default
|
NMS.setStepHeight(this, 1); // the default (0) breaks step climbing
|
||||||
// 0 (breaks steps).
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
socket.close();
|
socket.close();
|
||||||
|
@ -15,29 +15,31 @@ public enum PlayerAnimation {
|
|||||||
ARM_SWING {
|
ARM_SWING {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 1);
|
playDefaultAnimation(player, radius, 0);
|
||||||
sendPacketNearby(packet, player, radius);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
CRIT {
|
CRIT {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 6);
|
playDefaultAnimation(player, radius, 4);
|
||||||
sendPacketNearby(packet, player, radius);
|
}
|
||||||
|
},
|
||||||
|
EAT_FOOD {
|
||||||
|
@Override
|
||||||
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
|
playDefaultAnimation(player, radius, 3);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
HURT {
|
HURT {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 2);
|
playDefaultAnimation(player, radius, 1);
|
||||||
sendPacketNearby(packet, player, radius);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
MAGIC_CRIT {
|
MAGIC_CRIT {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 7);
|
playDefaultAnimation(player, radius, 5);
|
||||||
sendPacketNearby(packet, player, radius);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
SIT {
|
SIT {
|
||||||
@ -71,8 +73,7 @@ public enum PlayerAnimation {
|
|||||||
STOP_SLEEPING {
|
STOP_SLEEPING {
|
||||||
@Override
|
@Override
|
||||||
protected void playAnimation(EntityPlayer player, int radius) {
|
protected void playAnimation(EntityPlayer player, int radius) {
|
||||||
PacketPlayOutAnimation packet = new PacketPlayOutAnimation(player, 3);
|
playDefaultAnimation(player, radius, 2);
|
||||||
sendPacketNearby(packet, player, radius);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
STOP_SNEAKING {
|
STOP_SNEAKING {
|
||||||
@ -96,6 +97,11 @@ public enum PlayerAnimation {
|
|||||||
throw new UnsupportedOperationException("unimplemented animation");
|
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) {
|
protected void sendPacketNearby(Packet packet, EntityPlayer player, int radius) {
|
||||||
NMS.sendPacketsNearby(player.getBukkitEntity().getLocation(), Arrays.asList(packet), radius);
|
NMS.sendPacketsNearby(player.getBukkitEntity().getLocation(), Arrays.asList(packet), radius);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user