diff --git a/src/main/java/me/geyserextensionists/geyserdisplayentity/entity/ItemDisplayEntity.java b/src/main/java/me/geyserextensionists/geyserdisplayentity/entity/ItemDisplayEntity.java index 07b177b..995db97 100644 --- a/src/main/java/me/geyserextensionists/geyserdisplayentity/entity/ItemDisplayEntity.java +++ b/src/main/java/me/geyserextensionists/geyserdisplayentity/entity/ItemDisplayEntity.java @@ -219,7 +219,7 @@ public void updateMainHand(GeyserSession session) { ItemData helmet = ItemData.AIR; // TODO ItemData chest = item; - if (custom && !config.getBoolean("hand")) { + if (custom && !(config != null && config.getBoolean("hand"))) { MobArmorEquipmentPacket armorEquipmentPacket = new MobArmorEquipmentPacket(); armorEquipmentPacket.setRuntimeEntityId(geyserId); armorEquipmentPacket.setHelmet(helmet); @@ -290,7 +290,7 @@ private static int getColor(int argb) { @Override public void moveAbsoluteRaw(Vector3f position, float yaw, float pitch, float headYaw, boolean isOnGround, boolean teleported) { - double yOffset = config.getDouble("y-offset"); + double yOffset = config != null ? config.getDouble("y-offset") : -0.5; setPosition(position); setYaw(yaw); setPitch(pitch); diff --git a/src/main/java/me/geyserextensionists/geyserdisplayentity/entity/SlotDisplayEntity.java b/src/main/java/me/geyserextensionists/geyserdisplayentity/entity/SlotDisplayEntity.java index 99670fb..e142d98 100644 --- a/src/main/java/me/geyserextensionists/geyserdisplayentity/entity/SlotDisplayEntity.java +++ b/src/main/java/me/geyserextensionists/geyserdisplayentity/entity/SlotDisplayEntity.java @@ -67,7 +67,7 @@ public void initializeMetadata() { propertyManager.addProperty(new FloatProperty(Identifier.of("geyser:s_y"), MAX_VALUE, MIN_VALUE, 0F), scale.getY()); propertyManager.addProperty(new FloatProperty(Identifier.of("geyser:s_z"), MAX_VALUE, MIN_VALUE, 0F), scale.getZ()); - if (config.getBoolean("vanilla-scale")) applyScale(); + if (config != null && config.getBoolean("vanilla-scale")) applyScale(); displayRotation = Vector3f.from(0, 0, 0); displayTranslation = Vector3f.from(0, 0, 0); @@ -127,7 +127,7 @@ protected void pushRotationProperties() { public void setScale(EntityMetadata entityMetadata) { this.scale = entityMetadata.getValue(); - if (config.getBoolean("vanilla-scale")) applyScale(); + if (config != null && config.getBoolean("vanilla-scale")) applyScale(); propertyManager.addProperty(new FloatProperty(Identifier.of("geyser:s_x"), MAX_VALUE, MIN_VALUE, 0F), scale.getX()); propertyManager.addProperty(new FloatProperty(Identifier.of("geyser:s_y"), MAX_VALUE, MIN_VALUE, 0F), scale.getY()); @@ -137,7 +137,7 @@ public void setScale(EntityMetadata entityMetadata) { protected void applyScale() { Vector3f vector3f = this.scale; float scale = (vector3f.getX() + vector3f.getY() + vector3f.getZ()) / 3; - if (config.getBoolean("vanilla-scale")) scale *= (float) config.getDouble("vanilla-scale-multiplier"); + if (config != null && config.getBoolean("vanilla-scale")) scale *= (float) config.getDouble("vanilla-scale-multiplier"); this.metadata.put(EntityDataTypes.SCALE, scale); }