Vampirism - Become a vampire!

Vampirism - Become a vampire!

16M Downloads

Vampirism bat mode makes Actually additions storage crate upgrades destroy crate contents without upgrading

Tarod7 opened this issue ยท 8 comments

commented

Versions

  • Minecraft: 1.10.2
  • Forge: 12.18.3.2281
  • Vampirism: 1.1.0 beta.2

Issue Description

Vampirism bat mode makes storage crate upgrades destroy crate contents without upgrading

Reproduce Steps

place a small storage crate and put some junk in.
change into bat form
use a small to medium upgrade on the small crate by shift clicking it on it.
crate doesn't upgrade and the contents are destroyed.

Additional Information

commented

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
https://github.com/Ellpeck/ActuallyAdditions/blob/b8667c1e1e4faffd23c24774746ecf071f1dc6bf/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemChestToCrateUpgrade.java#L43

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

commented

Sure, Is there a way to reopen the issue or do I make a new one?

commented

Usually you can reopen an issue using the button on the bottom on the issue page, but I am not sure if this is possible here since @Ellpeck and not you closed it

commented

Yeah there's no button there :/
I'll make a new one.

commented

@Tarod7 Can you reopen the issue on the ActuallyAdditions repository.
I think this has to be fixed on their side

commented

Closing this one, since ActuallyAdditions/Forge issue. Check the issue linked above for progress