narrowtux / DropChest

Sucks dropped loot into Chests. Useful for automatic farming or gathering loot from mob traps.
http://forums.bukkit.org/threads/3835/
GNU Lesser General Public License v3.0
15 stars 10 forks source link

Overlapping chest areas with distinct filters doesn't work; items are not picked up #6

Open lassevk opened 12 years ago

lassevk commented 12 years ago

It seems the logic for finding out which chest that can pick up an item looks like this:

  1. For each loose item in the world
  2. Find the chest with the lowest ID, that is in range, and that has room
  3. If the filter for the chest allows it, put the item into the chest

Notice here that the question is; what if the filter doesn't allow that chest to pick up the item? It seems the logic does not move on to the next possible chest within range to see if that can do it, and so on.

To reproduce the problem:

  1. Place a chest, add it to dropchest with a range of 64, and set a filter on it to only pick up cobblestone
  2. Go about 10 blocks away, place a chest, add it to dropchest with a range of 5, and set a filter on it to only pick up something other than cobblestone (that you have, so you can test)
  3. Now, within the range of the last chest, drop an item of what that chest is configured to pick up
  4. Notice that the item is not picked up and is left floating in the world
  5. Now remove the first chest, by id, and notice that the floating item is immediately picked up, and is now in the second chest

This is latest (as of posting this issue) version of dropchest, with craftbukkit 1611, minecraft server 1.0.1.

lassevk commented 12 years ago

Actually, I was wrong on point 2 in that logic, it stops at the first chest within range, even if that chest is full.

I tried this:

  1. Place a chest, add it to dropchest with range 20
  2. Place a chest next to it, as a separate chest, so at least 1 block free between them, add this as well to dropchest with a range of 20
  3. Drop enough distinct items within range of the first chest to fill it
  4. Drop more distinct items, notice that they will be left floating in the world, instead of being picked up by the second chest

Now, I don't know if this is a bug or by design, but it would still be nice if I could add more chests to handle areas or things where a lot will drop, and as described in the main issue description, this is problematic when it comes to filtering, where I would expect two chests within range both working if they have non-overlapping filters.