Wanted to add onto this for anyone else who finds it. GameRegistry.addSubstitutionAlias works, but if you are replacing a block, you need to replace both the block and the block item. // removed everything but the relevant code
public static Block newBlock= new FallingBlockDirt(); // needs to extend Dirt Block...
@EventHandler
public void preInit(FMLPreInitializationEvent event ) {
GameRegistry.addSubstitutionAlias( "block.id.to.replace", GameRegistry.Type.BLOCK, newBlock);
GameRegistry.addSubstitutionAlias( "block.id.to.replace", GameRegistry.Type.ITEM, new ItemBlock(newBlock));
}In the case of the op, I think he was missing this second substitute alias. As the error he mentioned is similar to what I saw in that scenario. He would need to make a class that extends Block Dirt ( what he's replacing ), but overwrite some methods with those of BlockFalling ( what gravel uses ). If he tried to use the BlockFalling class, or a new class that extends that... that would also fail as it doesn't match 1-1 what the BlockDirt was expecting. In my case, I was using 1.7.10, so there may be slight differences that I haven't noticed. Edit: Forgot to mention. Don't register the new block. The addSubsitutionAlias is splicing the new one in for the old one, so it shouldn't have a new registry.
By
rockGiant · 7 hours ago 7 hr
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.