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