Latest version of OpenComputers, Thermos server build 58.
If robot kills mob with equipped armor (dropped by player) item will be duplicated on mob death.
https://www.youtube.com/watch?v=pRQyf8bGvEw (play with 0.5 speed)
I don't know, whether there is this bug on a Vanilla server, but check it later.
UPD. All works fine with vanilla server. Internal Thermos bug with captured drop.
UPD: Robot inventory should be full
Finally, this glitch also works with Vanilla, not only Bukkit-based server.
If robot with full invenotory kills entity (also, need to check block breaking) drop from entity will be duplicated.
I don't know what you mean by "vanilla", if you have OC, you aren't running vanilla mc
Sry for my english, i'm not native speaker.
Sure, not vanilla, i mean clean mcforge server without bukkit api.
Forced item despawn work, but need testing:
li.cil.oc.server.agent.Player
private def collectDroppedItems(itemsBefore: Iterable[EntityItem]) {
val itemsAfter = adjacentItems
val itemsDropped = itemsAfter -- itemsBefore
for (drop <- itemsDropped) {
drop.delayBeforeCanPickup = 0
drop.onCollideWithPlayer(this)
drop.setDead()
}
}
@payonel still unfixed?
sorry @sirse i have no update for this
@payonel, maybe add setDead to collectDroppedItems? This is workaround, but i use since May without problems.
Thermos is unsupported and you will run into weird issues like this. For this reason, this isn't very high priority.
Wait. It's also in vanilla. Nevermind.
@Sirse I've been able to repro this. Note that it doesn't have to be player items, but any special mob equipped items that they may even have spawned with (shovels, armor, swords, etc)
I think the game is doing something extra funny with mob items, and I think ... (and this is heavy speculation), but I think the Mob Entity doesn't use the net.minecraft.entity.Entity capturedDrops for dropping items in the world, and maybe because we do use that field...maybe we are causing both copies of the drops to manifest. I've seen weirder things happen in the mc code base. I'm also definitely going to have to test for this repro on every branch.
The reason the item doesn't dup when the robot picks it up, is because we're working with the ItemStack of size 1, and because we pick up all of that stack, the forge code calls setDead on that item...and perhaps the other unknown mob drop mechanic sees that the item is dead and thus doesn't drop another? I dont know. But there are two really weird things about your fix
isDead of the capturedDrops ItemStackWhat is also good, is that I can still suck up the items the robot didn't pick up (and which are apparently dead?!)
It's a weird fix, and it does appear to work. I'm going to have to retest this on every version though
Entities with isDead set are culled by World.
Apparently they keep floating around, unphased. I can't find what this breaks.
gah! how does this even work!?