Ender IO Zoo

Ender IO Zoo

962k Downloads

Entity duplication with soul vial

Twisted-Code opened this issue ยท 3 comments

commented

Issue Description:

I am developing a custom mod pack to go with a server I operate. When playing around with your mod in particular -and and admittedly old version of it at that so this may have already been fixed-, I noticed something peculiar. If I use a soul vial on an entity multiple times while the server is nonresponsive (this being one of the issues I have to iron out when I rebuild the pack: frequent server and client lag spikes), I end up using two vials and end up with duplicates of the entity. At first I suspected it was a client-sided issue... Until I tried using the filled soul vials and found all to be completely intact server-side

What happens:

entity duplication with the soul vials, sometimes even to the degree that the filled vials stack

What you expected to happen:

no duplication or at worst a temporary client-only duplicate that gets corrected properly by the server

Steps to reproduce:

  1. set up a planned server-side lag spike somehow, ideally two seconds or more
  2. when it spikes, use multiple soul vials on an entity like a villager or zombie. I recommend the former, as it will be easier to identify an exact copy, as the profession and all trades will be the same
  3. when the lag clears, if you were successful (and I kind of hope you aren't and that it's just something Herobrine snuck into the server's punch), you'll have multiple soul vials filled with identical (or very nearly) copies of whatever type of entity you tried to collect.
    ...

Affected Versions (Do not use "latest"):

  • EnderIO: 3.1.156
  • EnderCore: 0.4.1.64-beta
  • Minecraft: 1.10.2
  • Forge: build 2281 for 1.10.2 (if I need to be more specific, I can, but I think that build number should be enough, right?)

Your most recent log file where the issue was present:

[pastebin/gist/etc link here]
err, give me bit. I forgot to save a copy of such a log before I stopped using that server instance. I'll try to reproduce one eventually, but I at least want to get this issue report opened so you're aware of it

commented

Just to clarify: It is only the entity that is duped, not the item?

commented

Root cause analysis: Vanilla bug. The game handles removing entities by setting the flag "isDead" on them and then batch-removing all dead entities at the end of the tick. However, for the remainder of the tick those entities still exist and can be interacted with. Most vanilla code does not check that flag when acting on an entity, or only checks it after an interaction (e.g. a Wither projectile applies damage and if the entity is alive after that it applies the wither effect).

commented

@HenryLoenwind yes, only the entity is duplicated. It looks like you found the problem? If the commit above addresses duplicating entities by right clicking them multiple times on a tick with soul vials, then I don't think there's any more to do here.