9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2026-01-03 22:26:16 +00:00

修复entity-renderer旋转造成的问题

This commit is contained in:
XiaoMoMi
2025-11-06 00:40:47 +08:00
parent 4240d01c1f
commit 4abb0124f7
3 changed files with 104 additions and 96 deletions

View File

@@ -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));
}

View File

@@ -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));
}