Fabric Seasons: Extras

Fabric Seasons: Extras

7M Downloads

Crashes when iterating dye colors due to hardcoded array size

Linguardium opened this issue ยท 1 comments

commented

public static GreenhouseGlassBlock[] GREENHOUSE_GLASS_BLOCKS = new GreenhouseGlassBlock[17];

Hardcoded array size

Not hardcoded iteration limit

GREENHOUSE_GLASS_BLOCKS[value.ordinal()] = greenhouseGlass;

ordinal id used to access hardcoded array entry. Breaking when enum modification is done by any other mod

commented

Can confirm, I added the "Dye Depot" mod, which adds new dye colors, to my mod pack, and it causes to to crash on launch due to this issue.

java.lang.RuntimeException: Could not execute entrypoint stage 'main' due to errors, provided by 'seasonsextras'! at net.fabricmc.loader.impl.FabricLoaderImpl.lambda$invokeEntrypoints$2(FabricLoaderImpl.java:388) at net.fabricmc.loader.impl.util.ExceptionUtil.gatherExceptions(ExceptionUtil.java:33) at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:386) at net.fabricmc.loader.impl.game.minecraft.Hooks.startClient(Hooks.java:52) at fudge.notenoughcrashes.fabric.mixinhandlers.ModLoaders.fabricEntrypoints(ModLoaders.java:9) at net.minecraft.class_310.redirect$ldb000$notenoughcrashes$catchFabricInit(class_310.java:41032) at net.minecraft.class_310.<init>(class_310.java:458) at net.minecraft.client.main.Main.main(Main.java:211) at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 17 out of bounds for length 17 at io.github.lucaargolo.seasonsextras.FabricSeasonsExtras.onInitialize(FabricSeasonsExtras.java:105) at net.fabricmc.loader.impl.FabricLoaderImpl.invokeEntrypoints(FabricLoaderImpl.java:384) ... 8 more