Botania

Botania

133M Downloads

Crash when changing worlds

the-vindex opened this issue ยท 8 comments

commented
  1. In one world give yourself mana blaster and potency lens. Craft them together. Hold in the hand and Save and close.
  2. Start loading another world.
  3. Crash: https://gist.github.com/the-vindex/35479362a34dee3bb4f7.
commented

Lines of interest:

[FML/]: Fixed item id mismatch Botania:signalFlare: 4260 (init) -> 4258 (map).

[FML/]: Fixed item id mismatch Botania:lens: 4258 (init) -> 4255 (map).

java.lang.ClassCastException: vazkii.botania.common.item.ItemSignalFlare cannot be cast to vazkii.botania.api.mana.ILens
at vazkii.botania.common.item.ItemManaGun.getBurst(ItemManaGun.java:200)
at vazkii.botania.common.item.ItemManaGun.func_82790_a(ItemManaGun.java:163)

In ItemManaGun line 200:
((ILens) lens.getItem()).apply(lens, props);
lens is:
ItemStack lens = getLens(stack);
In getLens(stack):
ItemStack lens = ItemStack.loadItemStackFromNBT(cmp);

commented

Used the same world 1 and world 2 and the crash line is this:
java.lang.ClassCastException: vazkii.botania.common.item.ItemSignalFlare cannot be cast to vazkii.botania.api.mana.ILens

commented

mystery solved! I have no idea how to fix this. might be a forge issue

The problem:

  • Save item id in nbt
  • forge finds conflicting ids, so solves them like normal
  • nbt is not updated
  • Wrong id in the wrong place at the wrong time
  • all sorts of issues should be expected
commented

And when loading world 3 and then world 2, I get
java.lang.ClassCastException: vazkii.botania.common.item.material.ItemRune cannot be cast to vazkii.botania.api.mana.ILens

I think it's trying to render original stuff from original world into the new world.
I'll try updating forge, but last time I did it, it broke my pack...

commented

Probably the change to ItemRune is just because that is the item that happened to have that item id in world 2's build

commented

Tried updating forge to 1558 (latest recommended) and still the same.

commented

Perhaps this could be fixed by not storing the ItemStack directly, but storing the lens's item id (string) and using that.

commented

This is broken because forge found the need to remap something. Not a botania issue :v