Vampirism bat mode makes storage crate upgrades destroy crate contents without upgrading
Tarod7 opened this issue ยท 7 comments
version 1.10.2 minecraft with forge 12.18.3.2281
on Actually Additions r105 with Vampirism 1.1.0 beta.2
Going to post this over on the Vampirism mod issue page as well.
to get into bat mode you use the
/vampirism level Vampire 10 "playername"
command
Let me know if you anything clairified.
This doesn't make any sense at all, as I just use the normal right clicking behavior code.
Something weird must be going on with Vampirism.
Bat mode is supposed to disable most actions. I'm not sure if that has anything todo with it.
This is what he said in the other thread.
Thx for reporting. I might have found the problem already, but I don't have time to think about a solution right now.
Just writing down, what I found out:
When upgrading a chest, ActualllyAdditions copies the inventory from the old tile entity, then changes the block and writes the items to the new inventory in Item#onUse and returns EnumActionResult.SUCCESS
After the blocks have been changed, Forge posts a BlockEvent.PlaceEvent which is canceled by Vampirism.
ForgeHooks#onPlaceItemIntoWorld around line 800.
Because the event is canceled, Forge rolls back any block changes. During that rollback the chest/tile entity content is somehow lost. It seems that Forge tries to reconver the TE data, but it does not seem to work.
Will take a closer look at this soon
Looks like he may have made it so instead of disabling block placement it lets you place and immediately breaks the block and returns it to you.
Is there a specific reason you are clearing out the old chest's/TileEntity's inventory?
The problem is: The BlockPlace event is thrown after the item placed the block. If the event is canceled by any mod (e.g. Vampirism) Minecraft restores the Block and the TileEntity. But since you cleared the inventory of the old tile before it was stored (during setBockState of the new chest), it's inventory is empty and all items are lost.