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

I have a block type with several instances that have different properties which I set in the constructor. I want the IPropertys that go into the BlockStateContainer to be dependent on the constructor parameters (nothing else needs to be overriden so I don't have subclasses), but createBlockState is called in the Block super constructor so that doesn't work. Is there any other way I can achieve this without having to manually override createBlockState for every instance of my block?

  • Author

I have a sort of workaround. I'm constructing my own BlockStateContainer in my constructor (using my parameters), and then overriding getBlockState to return mine instead of Block#blockState. Although I also have to check if mine is null (meaning the method is being called from the super constructor) and return the default version if that's the case (which will then be ignored, but otherwise the super constructor throws an NPE). It's messy but, still less messy than making 10+ subclasses to override one method.

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.