diff --git a/common/src/main/java/dev/ryanhcode/sable/api/SubLevelAssemblyHelper.java b/common/src/main/java/dev/ryanhcode/sable/api/SubLevelAssemblyHelper.java index c95b7400..3c3a60c6 100644 --- a/common/src/main/java/dev/ryanhcode/sable/api/SubLevelAssemblyHelper.java +++ b/common/src/main/java/dev/ryanhcode/sable/api/SubLevelAssemblyHelper.java @@ -27,8 +27,6 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.FullChunkStatus; import net.minecraft.server.level.ServerLevel; -import net.minecraft.world.Clearable; -import net.minecraft.world.RandomizableContainer; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.decoration.HangingEntity; import net.minecraft.world.level.ChunkPos; @@ -346,13 +344,8 @@ public static void moveBlocks(final ServerLevel level, final AssemblyTransform t tag.putInt("x", newPos.getX()); tag.putInt("y", newPos.getY()); tag.putInt("z", newPos.getZ()); - } - if (blockEntity instanceof final RandomizableContainer container) { - container.setLootTable(null); - } - if (blockEntity instanceof final Clearable clearable) { - clearable.clearContent(); + level.removeBlockEntity(block); } final LevelChunk chunk = resultingAccelerator.getChunk(SectionPos.blockToSectionCoord(newPos.getX()), SectionPos.blockToSectionCoord(newPos.getZ())); @@ -396,10 +389,8 @@ public static void moveBlocks(final ServerLevel level, final AssemblyTransform t final BlockState subLevelState = Blocks.AIR.defaultBlockState(); try { - final LevelChunk chunk = accelerator.getChunk(SectionPos.blockToSectionCoord(block.getX()), - SectionPos.blockToSectionCoord(block.getZ())); - - chunk.setBlockState(block, subLevelState, true); + level.setBlock(block, subLevelState, + Block.UPDATE_MOVE_BY_PISTON | Block.UPDATE_SUPPRESS_DROPS | Block.UPDATE_CLIENTS); } catch (final Exception e) { Sable.LOGGER.error("Failed to destroy old block during assembly {}", block, e); }