American2050 Posted December 21, 2017 Posted December 21, 2017 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 Quote
Choonster Posted December 21, 2017 Posted December 21, 2017 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. 2 Quote 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.
American2050 Posted December 22, 2017 Author Posted December 22, 2017 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 Quote
Recommended Posts
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.