Created
September 19, 2017 04:29
-
-
Save Dockter/896ee9b95e9187497f53ca07e6e18ea6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public <BLOCK extends Block> BLOCK addBlock(BLOCK block, String name, Class itemClass) { | |
String qualName = assetKey + ":" + name; | |
block.setUnlocalizedName(qualName); | |
System.out.println("QualName: " + qualName); | |
// block.setBlockTextureName(qualName); | |
System.out.printf("BaseMod.addBlock: name '%s' qualName '%s' %s\n", name, qualName, block); | |
block.setRegistryName(assetKey, name); | |
ForgeRegistries.BLOCKS.register(block); | |
final Item item = new ItemBlock(block).setRegistryName(block.getRegistryName()); | |
ForgeRegistries.ITEMS.register(item); | |
if (creativeTab != null) { | |
block.setCreativeTab(creativeTab); | |
} | |
if (block instanceof BaseBlock) | |
((BaseBlock)block).mod = this; | |
registeredBlocks.add(block); | |
System.out.println("SGCraft: registering block: " + assetKey + ":" + name); | |
return block; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment