Skip to content

Commit

Permalink
VacuumChest: Don't move items that won't fit
Browse files Browse the repository at this point in the history
  • Loading branch information
NichtStudioCode committed Nov 17, 2024
1 parent 39ea846 commit 4a36ac0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a36ac0

Please sign in to comment.