Skip to content
Permalink
Browse files

[Fabric] Fix tile entities expecting proper pos data

  • Loading branch information
octylFractal committed Feb 3, 2020
1 parent 48cc31c commit 93762093f7e33f9720d22ce2e5b4c4e941de5ad1
Showing with 6 additions and 1 deletion.
  1. +6 −1 worldedit-fabric/src/main/java/com/sk89q/worldedit/fabric/FabricWorld.java
@@ -193,11 +193,16 @@ public Path getStoragePath() {
if (block instanceof BaseBlock) {
CompoundTag tag = ((BaseBlock) block).getNbtData();
if (tag != null) {
tag = tag.createBuilder()
.putInt("x", x)
.putInt("y", y)
.putInt("z", z)
.build();
net.minecraft.nbt.CompoundTag nativeTag = NBTConverter.toNative(tag);
BlockEntity tileEntity = getWorld().getWorldChunk(pos).getBlockEntity(pos);
if (tileEntity != null) {
tileEntity.fromTag(nativeTag);
tileEntity.setLocation(world, pos);
tileEntity.fromTag(nativeTag);
successful = true; // update if TE changed as well
}
}

0 comments on commit 9376209

Please sign in to comment.
You can’t perform that action at this time.