Jump to content

[1.8] BlockState use.


Vebert

Recommended Posts

Hi, I try minecraft forge for minecraft 1.8 with the new systeme of BlockState and I used it to save an integer.

 

So It's work well exept when the Integer is bigger than 15, in thoses cases my block save well but the block can only be destroyed on client side.

 

Finally I didn't understand two thing :

    - why it save the BlockState correctly when my Integer data is bigger than 15. (if it work as metadata in the past).

    - why the block block wasn't destroyed on the server side but work on the client side.

 

Sorry for my english (I'm french :'( )

Have a nice day, thank for your help.

 

Vebert

 

Link to comment
Share on other sites

a) BlockStates are still based on 4 bits. You cannot store more than 16 distinct values.

 

Uhm... no? Example:

http://minecraft.gamepedia.com/Fence_Gate#Block_states

 

Wasn't the whole purpose of BlockStates combining Block ID and metadata to one number to prevent wasting space on blocks w/o metadata usage?

Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! |

mah twitter

This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.

Link to comment
Share on other sites

Metadata is still only 4 bits.

States can hold more information then that, but metadata can only be 16.

If you want to store more use a tile entity.

It's one of those cases where Mojang.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Yes, you can have more BlockStates than 16. But only 16 of them can be based on metadata.

If you need more (like the fence) they need to be computed on the fly (getActualState in your Block).

 

Yeah, "powered" and "in-wall" look like two states that are gotten via looking at adjacent blocks or calling ancillary functions.  They're not going to be metadata stored.

 

Though, just looking at the documentation available on the wiki, it is unclear how the flower pot works (22 different states, one of which is 'empty').

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

Ahhh.  I wondered if it had gone TE.

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.