Jump to content

[1.8] proper way to set vanilla block properties


DJD

Recommended Posts

If you put a block's properties and extended properties in say a file (for reading in), such like:

 

minecraft:stone,([variant=smooth_granite])

 

and want to place it elsewhere in the world, how would one go about setting the "variant" property of that Block to "smooth_granite" and then placing it in the world ?

 

 

 

 

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

Link to comment
Share on other sites

And its the same with extended properties ?

 

Getting the extended properties seems to repeat the values of properties, except in cases like fences etc where properties appear to be always false and the extended provides the correct property values.

 

Would it be proper to skip using GetProperties and just get the GetExtendedProperties instead ? Or do should you still go through properties then extended properties ? Working with vanilla blocks only atm of course.....

 

 

 

 

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

Link to comment
Share on other sites

My bad I meant block.getExtendedState seems to repeat block.getBlockState (except in the case of fences).

 

It seems to usually repeat block.getBlockState in most cases.

 

I think if I could clarify the proper usages of block.getActualState, block.getBlockState, and block.getExtendedState it would clarify things in my muddled mind :D

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

Link to comment
Share on other sites

What would be the way to take the value "smooth_granite" to the Enum value needed for the property "Variant".

 

I can find the right property, but it seems that setting the value can get a bit... convoluted :D

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

Link to comment
Share on other sites

Thanks... so far this mod has pushed my knowledge of Java to new levels....

 

Gotta do some reading up on a Collection<? extends Comparable<?>>..... :D

 

I don't keep an open mind lest someone try to fill it with garbage - Mark Twain

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.