mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 15:36:43 +01:00
World of Tags
- Tile Entities in ponder are now backed up as their nbt compound instead of a cloned instance
This commit is contained in:
parent
c7a75f8ffd
commit
c4eb62c862
1 changed files with 5 additions and 6 deletions
|
@ -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<BlockPos, BlockState> originalBlocks;
|
||||
protected Map<BlockPos, BlockEntity> originalTileEntities;
|
||||
protected Map<BlockPos, CompoundTag> originalTileEntities;
|
||||
protected Map<BlockPos, Integer> blockBreakingProgressions;
|
||||
protected List<Entity> originalEntities;
|
||||
private Supplier<ClientLevel> 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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue