fix: empty containers are always skipped

This commit is contained in:
xtex committed 2023-07-30 21:15:03 +08:00
1 parent f3be1aae48
commit 68c90c8f8a
1 file changed
+1 -1
@@ -43,7 +43,7 @@ class ExchangeItem<E> : Behavior<E>(
if (chest is ChestBlockEntity) {
ChestBlockEntity.playSound(level, target!!, level.getBlockState(target!!), SoundEvents.CHEST_OPEN)
}
if (chest.isEmpty) {
if (chest.isEmpty && level.random.nextBoolean()) {
closeAt = l + 7
} else {
closeAt = l + 10 + level.random.nextInt(100)