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

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

  • Author

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

 

[*] 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.

  • Author

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

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.