
Crash on Curios Head Slot set to Zero
Talan67 opened this issue ยท 2 comments
Describe the Bug
Hovering over any Create item with Curios Head Slot set to 0 Crashes the game.
Reproduction Steps
- Make sure Create and Curios are installed
- Create a New World
- Locate the worlds serverconfig
- In the curios-server.toml put the following:
[[curiosSettings]]
identifier = "head"
size = 0
override = true
- Then load back into world and hover over any Create item
- Crash
Expected Result
The game would not crash and would play normally.
Screenshots and Videos
No response
Crash Report or Log
Operating System
Windows 10
Mod Version
0.5.0g
Minecraft Version
1.19.2
Forge Version
43,2,0
Other Mods
Curios-forge-1.19.2-5.1.1.0
Additional Context
No response
This is due to this code:
Create/src/main/java/com/simibubi/create/compat/curios/Curios.java
Lines 24 to 26 in 324729a
While the code does check to see if the "Head" slot type exists, it does not check to see how many slots there are currently. It is valid for there to be 0 slots on a player, either removed or to be added later, so checks must be made to validate the index before accessing it.