Jump to content

[1.11] AttachCapabilitiesEvent#addCapability forced lowercase issues


Aeronica

Recommended Posts

I understand Mojang changed ResourceLocation to force lowercase. That has been a minor irritation. The AttachCapabilitiesEvent#addCapability uses a ResourceLocation too. As a result this new behavior has broke loading a 1.10.x. and earlier world data IF you used a mixed or uppercase resource name. Fortunately you only lose data since the saved capability is simply recreated with defaults again using the lowercased identifier. I was curious if there is a way I can dynamically fix world data.

 

event.addCapability(new ResourceLocation(MXTuneMain.MODID, "IPlayerMusicOptions"), new ICapabilitySerializable<NBTTagCompound>()

 

The result for pre 1.11 is what I would expect.

sKj32.png

 

The result for 1.11 was not surprising once I looked at my code and saw the ResourceLocation parameter.

sKjeO.png

 

I've seen examples to fix your registry renames using the FMLMissingMappingsEvent. But that's for Items and Blocks.

 

At this point I need to do more research. Does anyone have any ideas or suggestions?

Link to comment
Share on other sites

After reviewing some NBT specs I'd would say it would be better to allow mixed case in the resource path portion of a ResourceLocation. NBT is case sensitive. Should capabilities respect the case of the name you choose? In my opinion it should. A CapResourcePath could be created that extends ResourcePath.

 

 

Link to comment
Share on other sites

it would be better to allow mixed case in the resource path portion of a ResourceLocation

 

Not going to happen.  Mojang already made the change.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

True, they do.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.