Koward Posted September 21, 2016 Posted September 21, 2016 Hello. I have multiple blocks that currently use Mojang's BlockPlanks.EnumType. If Mojang ever add a new type of wood, new matching blocks will be created. So far so good. I may also like to add new wood types myself, and would want the same behavior. I can add new stacks to getSubBlocks() and change other methods that handles states and meta. It works, but is it safe for worlds in the future ? I'm not so sure. Current metadata values (with 6 Mojang types and 3 mod types) : 012345 678 If Mojang adds a new wood type : 0123456 789 <= Shifted, wood types of blocks in the world will change at login with new version ! Is there an elegant solution to solve this or do we have to manually add all woods to our own custom enum ? Quote
Animefan8888 Posted September 21, 2016 Posted September 21, 2016 I would say put your "Enums" first then Minecrafts, and hopefully MInecraft won't change the order. Quote 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.
Koward Posted September 21, 2016 Author Posted September 21, 2016 I would say put your "Enums" first then Minecrafts, and hopefully MInecraft won't change the order. The problem will then happen when I add new wood types, the very same way. Quote
jabelar Posted September 22, 2016 Posted September 22, 2016 Another approach for any case where you're worried about world saves staying up to date is to do an explicit conversion -- basically check versions and if you detect an upgrade that you know requires conversion process the world save data (or replace directly in the world as it is loaded) accordingly. This can even be done for major Minecraft upgrades and such. it's a bit of work but is a fully managed way to accommodate upgrades while retaining your favorite world saves. If you're really ambitious you can also handle downgrades as well. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
Recommended Posts
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.