From c4eb62c862349be5c10e5c84b360d7ec1b0e9e40 Mon Sep 17 00:00:00 2001 From: simibubi <31564874+simibubi@users.noreply.github.com> Date: Fri, 7 Oct 2022 18:43:39 +0200 Subject: [PATCH] World of Tags - Tile Entities in ponder are now backed up as their nbt compound instead of a cloned instance --- .../create/foundation/ponder/PonderWorld.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java b/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java index 5193df037..cf6955e22 100644 --- a/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java +++ b/src/main/java/com/simibubi/create/foundation/ponder/PonderWorld.java @@ -34,6 +34,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.core.particles.BlockParticleOption; import net.minecraft.core.particles.ParticleOptions; import net.minecraft.core.particles.ParticleTypes; +import net.minecraft.nbt.CompoundTag; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; import net.minecraft.world.entity.Entity; @@ -54,7 +55,7 @@ public class PonderWorld extends SchematicWorld { public PonderScene scene; protected Map originalBlocks; - protected Map originalTileEntities; + protected Map originalTileEntities; protected Map blockBreakingProgressions; protected List originalEntities; private Supplier asClientWorld = Suppliers.memoize(() -> WrappedClientWorld.of(this)); @@ -79,8 +80,7 @@ public class PonderWorld extends SchematicWorld { originalBlocks.clear(); originalTileEntities.clear(); blocks.forEach((k, v) -> originalBlocks.put(k, v)); - tileEntities.forEach( - (k, v) -> originalTileEntities.put(k, BlockEntity.loadStatic(k, blocks.get(k), v.saveWithFullMetadata()))); + tileEntities.forEach((k, v) -> originalTileEntities.put(k, v.saveWithFullMetadata())); entities.forEach(e -> EntityType.create(e.serializeNBT(), this) .ifPresent(originalEntities::add)); } @@ -93,7 +93,7 @@ public class PonderWorld extends SchematicWorld { renderedTileEntities.clear(); originalBlocks.forEach((k, v) -> blocks.put(k, v)); originalTileEntities.forEach((k, v) -> { - BlockEntity te = BlockEntity.loadStatic(k, originalBlocks.get(k), v.saveWithFullMetadata()); + BlockEntity te = BlockEntity.loadStatic(k, originalBlocks.get(k), v); onTEadded(te, te.getBlockPos()); tileEntities.put(k, te); renderedTileEntities.add(te); @@ -109,8 +109,7 @@ public class PonderWorld extends SchematicWorld { if (originalBlocks.containsKey(p)) blocks.put(p, originalBlocks.get(p)); if (originalTileEntities.containsKey(p)) { - BlockEntity te = BlockEntity.loadStatic(p, originalBlocks.get(p), originalTileEntities.get(p) - .saveWithFullMetadata()); + BlockEntity te = BlockEntity.loadStatic(p, originalBlocks.get(p), originalTileEntities.get(p)); onTEadded(te, te.getBlockPos()); tileEntities.put(p, te); }