From 4abb0124f729a4b21dd366c5d040e85d6c2f78be Mon Sep 17 00:00:00 2001 From: XiaoMoMi <972454774@qq.com> Date: Thu, 6 Nov 2025 00:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dentity-renderer=E6=97=8B?= =?UTF-8?q?=E8=BD=AC=E9=80=A0=E6=88=90=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ItemDisplayBlockEntityElementConfig.java | 4 + .../TextDisplayBlockEntityElementConfig.java | 4 + .../default/configuration/templates.yml | 192 +++++++++--------- 3 files changed, 104 insertions(+), 96 deletions(-) diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/entity/renderer/element/ItemDisplayBlockEntityElementConfig.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/entity/renderer/element/ItemDisplayBlockEntityElementConfig.java index 3414f1988..ac9895063 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/entity/renderer/element/ItemDisplayBlockEntityElementConfig.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/entity/renderer/element/ItemDisplayBlockEntityElementConfig.java @@ -80,6 +80,10 @@ public class ItemDisplayBlockEntityElementConfig implements BlockEntityElementCo @Override public ItemDisplayBlockEntityElement create(World world, BlockPos pos, ItemDisplayBlockEntityElement previous) { + Quaternionf previousRotation = previous.config.rotation; + if (previousRotation.x != 0 || previousRotation.y != 0 || previousRotation.z != 0 || previousRotation.w != 1) { + return null; + } return new ItemDisplayBlockEntityElement(this, pos, previous.entityId, previous.config.yRot != this.yRot || !previous.config.position.equals(this.position)); } diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/entity/renderer/element/TextDisplayBlockEntityElementConfig.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/entity/renderer/element/TextDisplayBlockEntityElementConfig.java index 9156d7d4b..569b7583f 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/entity/renderer/element/TextDisplayBlockEntityElementConfig.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/block/entity/renderer/element/TextDisplayBlockEntityElementConfig.java @@ -68,6 +68,10 @@ public class TextDisplayBlockEntityElementConfig implements BlockEntityElementCo @Override public TextDisplayBlockEntityElement create(World world, BlockPos pos, TextDisplayBlockEntityElement previous) { + Quaternionf previousRotation = previous.config.rotation; + if (previousRotation.x != 0 || previousRotation.y != 0 || previousRotation.z != 0 || previousRotation.w != 1) { + return null; + } return new TextDisplayBlockEntityElement(this, pos, previous.entityId, previous.config.yRot != this.yRot || !previous.config.position.equals(this.position)); } diff --git a/common-files/src/main/resources/resources/default/configuration/templates.yml b/common-files/src/main/resources/resources/default/configuration/templates.yml index 82fc59d30..d22288ef0 100644 --- a/common-files/src/main/resources/resources/default/configuration/templates.yml +++ b/common-files/src/main/resources/resources/default/configuration/templates.yml @@ -2682,354 +2682,354 @@ templates#block_states: state: ${base_block}[east=false,north=false,south=false,waterlogged=false,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 east=true,north=false,south=false,waterlogged=false,west=false: state: ${base_block}[east=true,north=false,south=false,waterlogged=false,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=false,north=true,south=false,waterlogged=false,west=false: state: ${base_block}[east=false,north=true,south=false,waterlogged=false,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 180 + yaw: 180 east=false,north=false,south=true,waterlogged=false,west=false: state: ${base_block}[east=false,north=false,south=true,waterlogged=false,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 east=false,north=false,south=false,waterlogged=false,west=true: state: ${base_block}[east=false,north=false,south=false,waterlogged=false,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 east=true,north=true,south=false,waterlogged=false,west=false: state: ${base_block}[east=true,north=true,south=false,waterlogged=false,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 180 + yaw: 180 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=true,north=false,south=true,waterlogged=false,west=false: state: ${base_block}[east=true,north=false,south=true,waterlogged=false,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=true,north=false,south=false,waterlogged=false,west=true: state: ${base_block}[east=true,north=false,south=false,waterlogged=false,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=false,north=true,south=true,waterlogged=false,west=false: state: ${base_block}[east=false,north=true,south=true,waterlogged=false,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 180 + yaw: 180 east=false,north=true,south=false,waterlogged=false,west=true: state: ${base_block}[east=false,north=true,south=false,waterlogged=false,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 180 + yaw: 180 east=false,north=false,south=true,waterlogged=false,west=true: state: ${base_block}[east=false,north=false,south=true,waterlogged=false,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 east=true,north=true,south=true,waterlogged=false,west=false: state: ${base_block}[east=true,north=true,south=true,waterlogged=false,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 180 + yaw: 180 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=true,north=true,south=false,waterlogged=false,west=true: state: ${base_block}[east=true,north=true,south=false,waterlogged=false,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 180 + yaw: 180 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=true,north=false,south=true,waterlogged=false,west=true: state: ${base_block}[east=true,north=false,south=true,waterlogged=false,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=false,north=true,south=true,waterlogged=false,west=true: state: ${base_block}[east=false,north=true,south=true,waterlogged=false,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 180 + yaw: 180 east=true,north=true,south=true,waterlogged=false,west=true: state: ${base_block}[east=true,north=true,south=true,waterlogged=false,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 180 + yaw: 180 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=false,north=false,south=false,waterlogged=true,west=false: state: ${base_block}[east=false,north=false,south=false,waterlogged=true,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 east=true,north=false,south=false,waterlogged=true,west=false: state: ${base_block}[east=true,north=false,south=false,waterlogged=true,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=false,north=true,south=false,waterlogged=true,west=false: state: ${base_block}[east=false,north=true,south=false,waterlogged=true,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 180 + yaw: 180 east=false,north=false,south=true,waterlogged=true,west=false: state: ${base_block}[east=false,north=false,south=true,waterlogged=true,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 east=false,north=false,south=false,waterlogged=true,west=true: state: ${base_block}[east=false,north=false,south=false,waterlogged=true,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 east=true,north=true,south=false,waterlogged=true,west=false: state: ${base_block}[east=true,north=true,south=false,waterlogged=true,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 180 + yaw: 180 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=true,north=false,south=true,waterlogged=true,west=false: state: ${base_block}[east=true,north=false,south=true,waterlogged=true,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=true,north=false,south=false,waterlogged=true,west=true: state: ${base_block}[east=true,north=false,south=false,waterlogged=true,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=false,north=true,south=true,waterlogged=true,west=false: state: ${base_block}[east=false,north=true,south=true,waterlogged=true,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 180 + yaw: 180 east=false,north=true,south=false,waterlogged=true,west=true: state: ${base_block}[east=false,north=true,south=false,waterlogged=true,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 180 + yaw: 180 east=false,north=false,south=true,waterlogged=true,west=true: state: ${base_block}[east=false,north=false,south=true,waterlogged=true,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 east=true,north=true,south=true,waterlogged=true,west=false: state: ${base_block}[east=true,north=true,south=true,waterlogged=true,west=false] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 180 + yaw: 180 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=true,north=true,south=false,waterlogged=true,west=true: state: ${base_block}[east=true,north=true,south=false,waterlogged=true,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 180 + yaw: 180 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=true,north=false,south=true,waterlogged=true,west=true: state: ${base_block}[east=true,north=false,south=true,waterlogged=true,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 270 + yaw: 270 east=false,north=true,south=true,waterlogged=true,west=true: state: ${base_block}[east=false,north=true,south=true,waterlogged=true,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 180 + yaw: 180 east=true,north=true,south=true,waterlogged=true,west=true: state: ${base_block}[east=true,north=true,south=true,waterlogged=true,west=true] entity-renderer: - item: ${fence_post_item} - rotation: 180 + yaw: 180 scale: 1.0003 translation: 0,0.0001,0 - item: ${fence_side_item} - rotation: 0 + yaw: 0 - item: ${fence_side_item} - rotation: 90 + yaw: 90 - item: ${fence_side_item} - rotation: 180 + yaw: 180 - item: ${fence_side_item} - rotation: 270 + yaw: 270 variants: waterlogged=true: settings: