Server crash when player has a Thruster from Futurepack in their inventory
Maxwell-lt opened this issue ยท 0 comments
Description of the Bug
Server crash when a player has a Futurepack thruster in their inventory
To Reproduce
- Use creative menu (or the crafting recipe) to add a Thruster block from Futurepack to your inventory
- Server crashes with exception
java.lang.IllegalArgumentException: Cannot set property PropertyInteger{name=metadata, clazz=class java.lang.Integer, values=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]} to 13 on block fp:triebwerk, it is not an allowed value
Expected behavior
The server does not crash.
Logs & Environment
Minimum environment to reproduce:
- Minecraft 1.12.2
- Forge 14.23.5.2854
- Railcraft 12.0.0
- Futurepack 1.12.2-26.4.89
Logs:
- Full log: https://gist.github.com/Maxwell-lt/28ae54f51a5c6697b0fa037d4a76f038#file-full-logs
- Crash report (If available): https://gist.github.com/Maxwell-lt/28ae54f51a5c6697b0fa037d4a76f038#file-crash-log
Additional context
The issue appears to be caused because Thrusters render facing upward in the inventory, but cannot by placed in that orientation as a block. Because of this, the call to getStateFromMeta(stack.getItemDamage()) fails. A fix is to catch IllegalArgumentException and return the default value of Blocks.AIR.getDefaultState() instead.