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

So I remember I read somewhere last week that we shouldn't BlockContainer when out block has a TileEntity and that we should Overrider instead this 2 methods.

 

hasTileEntity and createTileEntity

 

Which worked perfectly.

 

But today I was doing the exact same I did on the other mod I was trying it, but it didn't worked.

 

After triple checking everything I was thinking... nothing changed, so why the hell this is not working...

 

All the sudden I thought to check the Super Implementation and I saw that in one of my environments it was Deprecated.

 

Reading one of the descriptions I see:

 

Quote

Called throughout the code as a replacement for ITileEntityProvider.createNewTileEntity
     * Return the same thing you would from that function.
     * This will fall back to ITileEntityProvider.createNewTileEntity(World) if this block is a ITileEntityProvider

 

(Not 100% sure what the last line means)
But yes, then I went and implement ITileEntityProvider and added only the method createNewTileEntity

 

And everything works.

 

Now sadly I don't remember where I read about not using extends BlockContainer, but I believe they also mentioned there to not implement ITileEntityProvider but just override the 2 methods I mention above.

 

So not my question is, why it changed back to the use of ITileEntityProvider. Are we ok implementing that? Why were the other 2 methods Deprecated?

 

PS: Finally I think I need to find the way to let my software warm me somehow when I'm overriding deprecated methods :P

There are two overloads of Block#hasTileEntity: one with no parameters and one with an IBlockState parameter. Only the one with no parameters is deprecated, the one with the IBlockState parameter is the one to override. 

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • Author
22 hours ago, Choonster said:

There are two overloads of Block#hasTileEntity: one with no parameters and one with an IBlockState parameter. Only the one with no parameters is deprecated, the one with the IBlockState parameter is the one to override. 

Ohh thanks, gonna look into that. I can't believe I missed that detail after all the times I checked over and over :P

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.