Skip to content

Commit

Permalink
loot container dupe fix on ship assembly (#667)
Browse files Browse the repository at this point in the history
* fixed create valuebox rendering, on 1.18

* loot container dupe fix

* loot container dupe fix
  • Loading branch information
mrsterner authored Dec 30, 2023
1 parent b1ee932 commit a2caf4d
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@ package org.valkyrienskies.mod.util

import net.minecraft.core.BlockPos
import net.minecraft.world.Clearable
import net.minecraft.world.Container
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.ChestBlockEntity
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
Expand Down Expand Up @@ -40,6 +43,11 @@ fun relocateBlock(
it.clearContent()
}

// so loot containers dont drop its content
if (it is RandomizableContainerBlockEntity) {
it.setLootTable(null, 0)
}

tag
}

Expand Down

0 comments on commit a2caf4d

Please sign in to comment.