mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 10:36:10 +01:00
Avoid errors with missing metadata
This commit is contained in:
parent
8c0fa7cd17
commit
688ba3af8e
@ -62,7 +62,7 @@ public class PlayerAnimationImpl {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.dead || !player.valid
|
||||
if (player.dead || !player.valid || !player.getBukkitEntity().hasMetadata("citizens.sitting")
|
||||
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||
cancel();
|
||||
return;
|
||||
|
@ -62,7 +62,7 @@ public class PlayerAnimationImpl {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.dead || !player.valid
|
||||
if (player.dead || !player.valid || !player.getBukkitEntity().hasMetadata("citizens.sitting")
|
||||
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||
cancel();
|
||||
return;
|
||||
|
@ -61,7 +61,7 @@ public class PlayerAnimationImpl {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.dead || !player.valid
|
||||
if (player.dead || !player.valid || !player.getBukkitEntity().hasMetadata("citizens.sitting")
|
||||
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||
cancel();
|
||||
return;
|
||||
|
@ -61,7 +61,7 @@ public class PlayerAnimationImpl {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.dead || !player.valid
|
||||
if (player.dead || !player.valid || !player.getBukkitEntity().hasMetadata("citizens.sitting")
|
||||
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||
cancel();
|
||||
return;
|
||||
|
@ -61,7 +61,7 @@ public class PlayerAnimationImpl {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.dead || !player.valid
|
||||
if (player.dead || !player.valid || !player.getBukkitEntity().hasMetadata("citizens.sitting")
|
||||
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||
cancel();
|
||||
return;
|
||||
@ -137,9 +137,9 @@ public class PlayerAnimationImpl {
|
||||
NMSImpl.sendPacketNearby(player.getBukkitEntity(), player.getBukkitEntity().getLocation(), packet, radius);
|
||||
}
|
||||
|
||||
private static EnumMap<PlayerAnimation, Integer> DEFAULTS = Maps.newEnumMap(PlayerAnimation.class);
|
||||
private static final MethodHandle ENTITY_SETPOSE_METHOD = NMS.getMethodHandle(Entity.class, "setPose", true,
|
||||
EntityPose.class);
|
||||
private static EnumMap<PlayerAnimation, Integer> DEFAULTS = Maps.newEnumMap(PlayerAnimation.class);
|
||||
static {
|
||||
DEFAULTS.put(PlayerAnimation.ARM_SWING, 0);
|
||||
DEFAULTS.put(PlayerAnimation.HURT, 1);
|
||||
|
@ -61,7 +61,7 @@ public class PlayerAnimationImpl {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.dead || !player.valid
|
||||
if (player.dead || !player.valid || !player.getBukkitEntity().hasMetadata("citizens.sitting")
|
||||
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||
cancel();
|
||||
return;
|
||||
|
@ -61,7 +61,7 @@ public class PlayerAnimationImpl {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.dead || !player.valid
|
||||
if (player.dead || !player.valid || !player.getBukkitEntity().hasMetadata("citizens.sitting")
|
||||
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||
cancel();
|
||||
return;
|
||||
|
@ -60,7 +60,7 @@ public class PlayerAnimationImpl {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (player.dead || !player.valid
|
||||
if (player.dead || !player.valid || !player.getBukkitEntity().hasMetadata("citizens.sitting")
|
||||
|| !player.getBukkitEntity().getMetadata("citizens.sitting").get(0).asBoolean()) {
|
||||
cancel();
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user