JAOPCA

JAOPCA

29M Downloads

[1.21.1] ModelHandler item model gathering can cause a crash/freeze

Closed this issue ยท 1 comments

commented

the ModelHandler parse only item models here

availableLocations.stream().map(ITEM_MODEL_FORMAT::fileToId).collect(Collectors.toSet()),
, but doesn't account for other models being in the given set

that function get's all models, not just item model.
without other mods this is fine by accident, since the block prefix models/block is one character longer than models/item

when other mods have models not in block/item though this can cause a index out of bounds exception when trying to remove the prefix with fileToId

example that causes issues is a vivecraft model that is just models/bag.json, which throws this error

Range [12, 10) out of bounds for length 15

to fix this you should first filter the set you get to only contain item models, then map them.

commented

Should be fixed in 5.0.10.13