Jump to content

Recommended Posts

Posted

As the topic states, what is the proper way for the subblocks? I have a block which changes facing and I'm trying to create subblocks of it for each vanilla wood type. So, 4 directions and 6 wood types result in 24 different metadata. But as far as I know, metadata only support up to 16.

I can think of two ways to solve it:

1 - I can separate them like logs, which results in 2 different blocks, first for oak, spruce, birch, jungle and second for acacia and dark oak.
2 - I can create a unique block for each wood variant and save the metadata for only facing.

I'm interested in brief explanations of why one would be better than the other.

Also, if you have a more proper than both of the ways, I would like to hear it. Thanks in advance.

Posted

Separating them into 2 blocks creates a lot of confusion since your will have 2 meaningless blocks (BlockThingOne and BlockThingTwo). That said this way is pretty good if you want to save on block ids.

Creating a unique block for each variant is a more intuitiva approach. This is also how variants function in 1.13. So this approach will allow you to update your mod to 1.13 easier and is more intuitive but it's less conservative on block ids.

Alternatively you can store all your variants in a single block by using a TileEntity. Since TEs can be non-tickable now this approach is also viable.

  • Like 1
Posted (edited)

Actually, since you're starting this now and 1.13 is getting close I would suggest taking the same approach and making it fully "flat" -- separate block for every variant. The way 1.13 seems to be going is that properties like facing orientation will still be applied to blocks but all the different types of wood will be their own block. I am not sure the entire motivation but I'd bet it is because the combination of variants with other states simply runs out of room with the 4-bit per block position "metadata". So instead of doing a half-assed approach like having two log blocks each with multiple variants just go all the way and make every variant its own thing.

 

For more on the 1.13 approach see: https://minecraft.gamepedia.com/1.13/Flattening

 

It will make your transition to 1.13 a LOT easier if you go ahead and flatten now.

Edited by jabelar
  • Like 1

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.