Chisel

Chisel

150M Downloads

Change file names to match [a-z0-9/._-], to prevent ResourceLocationExceptions

aaronhowser1 opened this issue ยท 4 comments

commented

FTB Quests gets this error, stopping me from loading a list of textures:

[03:47:42] [Render thread/ERROR] [FTB Quests/]: A mod has broken resource preventing this list from loading: net.minecraft.util.ResourceLocationException: Non [a-z0-9/._-] character in path of location: chisel:textures/block/redstoneLamp/redstone_lamp_on.png

The mod dev has said that this is more stopping Minecraft from crashing than an arbitrary limitation on the mod's end.

commented

Minecraft still picks it up and crashes internally, even with validation. The code im using is

images.addAll(Minecraft.getInstance().getResourceManager().listResources("textures", t -> t.endsWith(".png") && ResourceLocation.isValidResourceLocation(t)));

Renaming it from redstoneLamp to redstone_lamp is all that needs to be done

commented

That texture is never used, just exclude it from whatever list you're creating.

commented

But why are you doing that at all? I don't see the purpose of gathering all textures. It doesn't crash with only chisel. I'll fix the names when I implement those blocks.

commented

It's to let quest devs use images without having to type in the entire name of the resource location.

That lets us add images via KubeJS etc, and then insert them into quests with a GUI
image

This GUI usually has a list of all textures, but breaks when something doesn't follow the correct regex.
image