From 1c0ea9c60cda1deece7ed2c9d4f54a36d9217aa9 Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 18 Apr 2020 10:29:13 +0200 Subject: [PATCH 1/2] fix npe --- .../connector/entity/living/monster/ShulkerEntity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/entity/living/monster/ShulkerEntity.java b/connector/src/main/java/org/geysermc/connector/entity/living/monster/ShulkerEntity.java index a3a175b8..6ec8fdfc 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/living/monster/ShulkerEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/living/monster/ShulkerEntity.java @@ -49,7 +49,9 @@ public class ShulkerEntity extends GolemEntity { } if (entityMetadata.getId() == 16) { Position position = (Position) entityMetadata.getValue(); - metadata.put(EntityData.SHULKER_ATTACH_POS, Vector3i.from(position.getX(), position.getY(), position.getZ())); + if(position != null){ + metadata.put(EntityData.SHULKER_ATTACH_POS, Vector3i.from(position.getX(), position.getY(), position.getZ())); + } } //TODO Outdated metadata flag SHULKER_PEAK_HEIGHT // if (entityMetadata.getId() == 17) { From 685df6266f2c48d20039d3ff2cbb59e5b51828ea Mon Sep 17 00:00:00 2001 From: Marco Date: Sat, 18 Apr 2020 10:30:25 +0200 Subject: [PATCH 2/2] code formatting --- .../geysermc/connector/entity/living/monster/ShulkerEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connector/src/main/java/org/geysermc/connector/entity/living/monster/ShulkerEntity.java b/connector/src/main/java/org/geysermc/connector/entity/living/monster/ShulkerEntity.java index 6ec8fdfc..bca9e689 100644 --- a/connector/src/main/java/org/geysermc/connector/entity/living/monster/ShulkerEntity.java +++ b/connector/src/main/java/org/geysermc/connector/entity/living/monster/ShulkerEntity.java @@ -49,7 +49,7 @@ public class ShulkerEntity extends GolemEntity { } if (entityMetadata.getId() == 16) { Position position = (Position) entityMetadata.getValue(); - if(position != null){ + if (position != null) { metadata.put(EntityData.SHULKER_ATTACH_POS, Vector3i.from(position.getX(), position.getY(), position.getZ())); } }