Posted September 8, 201312 yr I don't know if ITileEntityProvider is a Forge implementation or not but just in case it is.... Suggestion: Implement createTileEntity() in ITileEntityProvider to use the metadata value as provided by the call to createTileEntity() in Block.java Details: In Block.java, under the heading "Forge Start" we find an implementation of createTileEntity: public TileEntity createTileEntity(World world, int metadata) { if (isTileProvider) { return ((ITileEntityProvider)this).createNewTileEntity(world); } return null; } which in turn calls to ITileEntityProvider, the actual implementation that gets overridden by modders. Unfortunately it neglects to pass the metadata value through to ITileEntityProvider thereby making this value unavailable. The usefulness in having it is that the value can be passed into the TileEntity through its constructor (none of the TileEntity inherited properties: worldObj, xCoord, blockMetadata, etc. are available for use in the constructor) which would in turn allow modders some flexibility to make rudamentary decisions on how the TileEntity would be initialized.
September 8, 201312 yr Why not write an init method that your constructor calls? Read the EAQ before posting! OR ELSE! This isn't building better software, its trying to grab a place in the commit list of a highly visible github project. www.forgeessentials.com Don't PM me, I don't check this account unless I have to.
September 8, 201312 yr Author ITileEntityProvider is not a forge addition (which you could have know by just looking at the package). Well to be fair the package doesn't necessarily mean it's not forge. Take a look at net.minecraft.block.block and you'll see a giant comment called "FORGE START". To make TileEntities with forge don't implement or extend anything. Just override hasTileEntity(int metadata) and createTileEntity(World world, int metadata) in your block. Thanks for this tip. I was implementing ITileEntityProvider based on some research on the wiki and other sources. I guess things are a bit outdated now.
September 9, 201312 yr They are correct, any class that we add will NOT be in net.minecraft, it'll be in net.minecraftforge. So ITileEntityProvider is NOT something we can edit as it'd break interfaces. However, as they said, you'd just override Block.hasTileEntity and Block.createTileEntity to do everything you need. Mainly because ITileEntityProvider will never be applicable to anything except blocks. It doesn't seem logicial to have it as a interface As for 'not in net.minecraftforge' we have to touch base classes, that's kinda our job. If we touch thing in a large way {like we do with Block/Item} we try to keep all of our code seperate, hence the 'Forge Start' comment. If you'd notice the bulk of our Block.java.path is adding new code in 1 big hunk Basically, to sum it up, With Forge, ITileEntityProvider is obsolete, don't use it. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
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.