Cobblemon Integrations

Cobblemon Integrations

223k Downloads

Multiple Usages of .toLowerCase() without specifying the locale

Bawnorton opened this issue ยท 2 comments

commented

Various .toLowerCase() do not specify the locale, such as:

var location = new ResourceLocation(CobblemonIntegrations.MOD_ID, type.getSimpleName().toLowerCase());

The locale used should be Locale.ENGLISH to avoid invalid identifier names.

Some locales convert "L" to "I" which is then encoded into \u0131 which is not valid when used as an identifier:

Caused by: net.minecraft.class_151: Non [a-z0-9/._-] character in path of location: cobblemonintegrations:syncevo\u0131temsmessage
	at net.minecraft.class_2960.method_45137(class_2960.java:252)
	at net.minecraft.class_2960.<init>(class_2960.java:47)
	at com.arcaryx.cobblemonintegrations.fabric.FabricNetworkHandler.registerMessageClient(FabricNetworkHandler.java:19)
commented

I currently have plans to re-write this entire mod in Kotlin, fixing a ton of things (including finally addressing localization/lang files).
Lots of parts of this mod were mostly done as proof of concept/learning the Cobblemon codebase while I was learning Kotlin on the side.

I'll take a look at fixing this on 1.0.6 for the time being (will target Cobblemon 1.5.1).

commented

This should be fixed by aac92b0 for 1.0.6