rwtema / Extra-Utilities-2-Source

Sourcecode for Extra Utilities
Other
108 stars 75 forks source link

[1.10.2] Magical Snow Globe crashing MC when eating any food or using a shield #153

Closed Robijnvogel closed 6 years ago

Robijnvogel commented 6 years ago

Minecraft version: 1.10.2 Forge version: 12.18.3.2221 ExUtils version: 1.10.2 - 1.8.2 (latest)

What happens: When eating food or using a shield (possibly in other cases as well), Minecraft crashes, producing this crash report.

How to reproduce: Eat any food or try to block with the shield in either hand, while the other hand is empty.

Suspected cause: In MC 1.10.2, an ItemStack could still be null, while in MC 1.11+, ItemStacks.EMPTY is enforced instead. As such, event.getItemStack().getItem() throws an NPE on MC 1.10.2 if a hand is empty, as I suggested in #150 before I tested it.