Jump to content

Recommended Posts

Posted

Hi!

is there a way to remove invalid / unused entries from blockstate?

 

Let's say I have a block with 2 properties: ASSEMBLED (true, false) and FACING (up, down, north, south, east, west) and that my game logic will only use FACING=north when ASSEMBLED is false

 

Can I make MC ignore/forget the unused combinations? Or there are no drawback with leaving there around unused?

 

Thank you!

Z

 

PS: my blockstate file include all the possibile combinations, so I have no errors

Posted

Thank you Ernio and diesieben07!

 

I'm already using the Forge blockstate so it's not a question of having to much to type while writing the json file ;)

 

I'm just wondering if the unused combinations that get generated but not used in game have some negative effect on the game performance

 

I'm building the block blockstate between all the base classes of the block so there are some unused combos

 

Posted

[*] You can tell MC to ignore whole properties.

 

[*] You can program a new property to exactly match your rendering variants.

 

[*] You can use other variables when converting to or from metadata.

I'm not sure exactly what you're trying to do, so I can't say exactly how to combine these degrees of freedom to suit your purpose.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

Posted

I'm working on a port of Big Reactors to 1.9.x and I've rewritten the classes of the blocks in the multiblock structure (reactor and turbine) and split then in multiple classes to handle specific jobs. So I have a generic base class that handle a generic multiblock-block and that add an ASSEMBLED (boolean) and FACING (EnumFacing) states to the block blockstate. Build upon that class I have other classes for the specific device (controller, power taps and so on) that add their specific states

 

So for example, the reactor controller block can be idle, off or on, part of and assembled machine or not, oriented in one of the 6 directions. But not all state combinations are actially used in game (for example, a controller can never be in the "on|unassembled|north" state) so I have a bunch of combos that MC generate but that will never see use, ence my question about the possibility/need to remove them if they are a performance problem

 

I known that I can group properties toghether but that move the stage management toward the end of the

inheritance tree and I don't like that idea too much

 

Right now I have no medata to worry about since none of that state is persisted because it depends on the state of the multiblock structure itself

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.