From 4a36ac0df03d828a072b964fd753e4ea320bf172 Mon Sep 17 00:00:00 2001 From: NichtStudioCode <51272202+NichtStudioCode@users.noreply.github.com> Date: Sun, 17 Nov 2024 17:30:25 +0100 Subject: [PATCH] VacuumChest: Don't move items that won't fit --- .../xenondevs/nova/addon/logistics/tileentity/VacuumChest.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logistics/src/main/kotlin/xyz/xenondevs/nova/addon/logistics/tileentity/VacuumChest.kt b/logistics/src/main/kotlin/xyz/xenondevs/nova/addon/logistics/tileentity/VacuumChest.kt index 9aa895f..f474d1d 100644 --- a/logistics/src/main/kotlin/xyz/xenondevs/nova/addon/logistics/tileentity/VacuumChest.kt +++ b/logistics/src/main/kotlin/xyz/xenondevs/nova/addon/logistics/tileentity/VacuumChest.kt @@ -79,10 +79,10 @@ class VacuumChest(pos: BlockPos, state: NovaBlockState, data: Compound) : Networ items.clear() if (serverTick % 10 == 0) { - pos.world.entities.forEach { + pos.world.getNearbyEntities(region.toBoundingBox()).forEach { if (it is Item - && it.location in region && filter?.allows(it.itemStack) != false + && inventory.canHold(it.itemStack.clone().apply { amount = 1 }) && runBlocking { ProtectionManager.canInteractWithEntity(this@VacuumChest, it, null) } // TODO: non-blocking ) { items += it