From 99f3a0b30957b09eca38c962e91dce239a5abef6 Mon Sep 17 00:00:00 2001 From: JoshieGemFinder <79513611+JoshieGemFinder@users.noreply.github.com> Date: Mon, 16 Jan 2023 12:48:59 +1000 Subject: [PATCH 1/2] add REAL_FACING_DIRECTION check in case it doesn't exist (e.g. summoned by commands) --- .../java/thebetweenlands/common/entity/EntityBLItemFrame.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/thebetweenlands/common/entity/EntityBLItemFrame.java b/src/main/java/thebetweenlands/common/entity/EntityBLItemFrame.java index aff5b62ed..98f70cfdd 100644 --- a/src/main/java/thebetweenlands/common/entity/EntityBLItemFrame.java +++ b/src/main/java/thebetweenlands/common/entity/EntityBLItemFrame.java @@ -172,7 +172,9 @@ public void readEntityFromNBT(NBTTagCompound compound) { dataManager.set(IS_GLOWING, compound.getBoolean("IS_GLOWING")); super.readEntityFromNBT(compound); - this.updateFacingWithBoundingBox(EnumFacing.byIndex(compound.getByte("REAL_FACING_DIRECTION"))); + if(compound.hasKey("REAL_FACING_DIRECTION")) { + this.updateFacingWithBoundingBox(EnumFacing.byIndex(compound.getByte("REAL_FACING_DIRECTION"))); + } } @Override From 79e44188ef399fcbfac9fca176a8e60445a2c33d Mon Sep 17 00:00:00 2001 From: JoshieGemFinder <79513611+JoshieGemFinder@users.noreply.github.com> Date: Mon, 16 Jan 2023 13:23:09 +1000 Subject: [PATCH 2/2] preserve old behaviour preserve old behaviour, but if "Facing" is set (the vanilla item frame tag), use the vanilla behaviour --- .../java/thebetweenlands/common/entity/EntityBLItemFrame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/thebetweenlands/common/entity/EntityBLItemFrame.java b/src/main/java/thebetweenlands/common/entity/EntityBLItemFrame.java index 98f70cfdd..3b645e3e4 100644 --- a/src/main/java/thebetweenlands/common/entity/EntityBLItemFrame.java +++ b/src/main/java/thebetweenlands/common/entity/EntityBLItemFrame.java @@ -172,7 +172,7 @@ public void readEntityFromNBT(NBTTagCompound compound) { dataManager.set(IS_GLOWING, compound.getBoolean("IS_GLOWING")); super.readEntityFromNBT(compound); - if(compound.hasKey("REAL_FACING_DIRECTION")) { + if(compound.hasKey("REAL_FACING_DIRECTION") || !compound.hasKey("Facing")) { this.updateFacingWithBoundingBox(EnumFacing.byIndex(compound.getByte("REAL_FACING_DIRECTION"))); } }