Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 ?

 

  • Author

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.

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.