Create

Create

86M Downloads

Crash on Curios Head Slot set to Zero

Talan67 opened this issue ยท 2 comments

commented

Describe the Bug

Hovering over any Create item with Curios Head Slot set to 0 Crashes the game.

Reproduction Steps

  1. Make sure Create and Curios are installed
  2. Create a New World
  3. Locate the worlds serverconfig
  4. In the curios-server.toml put the following:

[[curiosSettings]]
identifier = "head"
size = 0
override = true

  1. Then load back into world and hover over any Create item
  2. Crash

Expected Result

The game would not crash and would play normally.

Screenshots and Videos

No response

Crash Report or Log

https://paste.ee/p/X3QNG

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

commented

This is due to this code:

if (stacksHandler != null) {
return AllItems.GOGGLES.isIn(stacksHandler.getStacks().getStackInSlot(0));
}

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.

commented

Fixed in patch H.