Jump to content

Is it possible to rename items without breaking people's saves?


Recommended Posts

Posted

I'd like to slightly change the (game id) names of items in my mod for the next release. It there a way to add an alias or something so that doing this doesn't break people's old save files when they update?

Posted
1 minute ago, skeddles said:

I'd like to slightly change the (game id) names of items in my mod for the next release. It there a way to add an alias or something so that doing this doesn't break people's old save files when they update?

Why do you want to change the game ids?

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted (edited)
1 minute ago, Animefan8888 said:

Why do you want to change the game ids?

I just formatted them poorly like camelCaseStyleName instead of underscore_style_name like people would expect

Edited by skeddles
Posted
Just now, skeddles said:

I just formatted them poorly like camelCaseStyleName instead of underscore_style_name like people would expect

They are/should automatically be set to lower case.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted

And yes, there's a Forge Missing Mapping event you can subscribe to to update things.

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.

Posted

Basically this process is called "data fixing". So as Draco18s mentions you can intercept an event that makes sense -- like loading problem or possibly even earlier and "fix" the data by converting it. You'll notice that vanilla has to do that when they update save formats and such and you'll seed data fixer methods and classes occasionally in the code.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • 2 weeks later...
Posted

How can I look at what events there are? I found this thread which explains it but I can't figure how to do it with my IDE or what exactly to click. I used IntelliJ. Usually I right click > go to > declaration.

 

//loot tables
@SubscribeEvent
public static void lootLoad(LootTableLoadEvent evt) {
    //code
}
Posted
18 minutes ago, skeddles said:

How can I look at what events there are? I found this thread which explains it but I can't figure how to do it with my IDE or what exactly to click. I used IntelliJ. Usually I right click > go to > declaration.

Typically I just check the file locations, net.minecraftforge.client.event, net.minecraftforge.event, net.minecraftforge.fml.client.event, net.minecraftforge.fml.common.event, or net.minecraftforge.fml.common.gameevent. Note fml.common.event are the mod life-cycle events.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Posted
On 9/29/2018 at 2:07 PM, skeddles said:

How can I look at what events there are? I found this thread which explains it but I can't figure how to do it with my IDE or what exactly to click. I used IntelliJ. Usually I right click > go to > declaration.

 


//loot tables
@SubscribeEvent
public static void lootLoad(LootTableLoadEvent evt) {
    //code
}

 

One of many ways: In Eclipse you can find the Event class (in net.minecraftforge.event) and look at the Type Hierarchy (you can get there by highlighting the class name and right-clicking and choosing Type Hierarchy). That should open a pane in the window that contains all classes that extend Event.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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.