Skip to content

[RC] OOB when setting value for Gravel Gun Gating Material #3450

@MalTeeez

Description

@MalTeeez

When setting the RC "Gravel Gun Gating Material" setting to an entry that resolves to an ore dictionary item (as provided in https://github.com/ReikaKalseki/RotaryCraft/blob/master/Auxiliary/BlastGate.java) the game crashes with an ArrayOutOfBounds (see below for log).

java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
	at Launch//Reika.DragonAPI.Libraries.Registry.ReikaItemHelper.lookupItem(ReikaItemHelper.java:773)
	at Launch//Reika.DragonAPI.Libraries.Registry.ReikaItemHelper.parseItem(ReikaItemHelper.java:854)
	at Launch//Reika.RotaryCraft.RotaryConfig.getGatedMaterial(RotaryConfig.java:94)
	at Launch//Reika.RotaryCraft.RotaryConfig.getGravelGunGatingMaterial(RotaryConfig.java:78)
	at Launch//Reika.RotaryCraft.RotaryRecipes.addToolItems(RotaryRecipes.java:1183)
	at Launch//Reika.RotaryCraft.RotaryRecipes.addRecipes(RotaryRecipes.java:138)
	at Launch//Reika.RotaryCraft.RotaryCraft.load(RotaryCraft.java:369)

This probably happens due to ReikaItemHelper.java#L854 forwarding the ore dict String to lookupItem, which tries to split the String on a ":" at ReikaItemHelper.java#L763, of which there are none. Later on, the function tries to return the second result from the split, while there is only one ReikaItemHelper.java#L773 to the crash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions