fix: empty containers are always skipped

This commit is contained in:
xtex 2023-07-30 21:15:03 +08:00
parent f3be1aae48
commit 68c90c8f8a
Signed by: xtex
GPG Key ID: B918086ED8045B91

View File

@ -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)