From cb72d0f763fe0877176f58c901931079384b6f52 Mon Sep 17 00:00:00 2001 From: MrSterner <32911664+mrsterner@users.noreply.github.com> Date: Sat, 30 Dec 2023 16:31:12 +0100 Subject: [PATCH] loot container dupe fix (#668) * fixed create valuebox rendering on ships * loot container dupe fix --- .../kotlin/org/valkyrienskies/mod/util/RelocationUtil.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/src/main/kotlin/org/valkyrienskies/mod/util/RelocationUtil.kt b/common/src/main/kotlin/org/valkyrienskies/mod/util/RelocationUtil.kt index 8dfc6199c..099b846a5 100644 --- a/common/src/main/kotlin/org/valkyrienskies/mod/util/RelocationUtil.kt +++ b/common/src/main/kotlin/org/valkyrienskies/mod/util/RelocationUtil.kt @@ -6,6 +6,7 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.Blocks import net.minecraft.world.level.block.Rotation import net.minecraft.world.level.block.Rotation.NONE +import net.minecraft.world.level.block.entity.RandomizableContainerBlockEntity import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.chunk.LevelChunk import org.valkyrienskies.core.api.ships.ServerShip @@ -40,6 +41,11 @@ fun relocateBlock( it.clearContent() } + // so loot containers dont drop its content + if (it is RandomizableContainerBlockEntity) { + it.setLootTable(null, 0) + } + tag }