mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-19 19:59:36 +00:00
Move block registration out of constructors
This commit is contained in:
17 files changed
+127
-96
No files matched your search
@@ -25,13 +25,13 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public class BlockMod extends Block implements IModelRegister {
|
||||
public class BlockMod extends Block implements IModelRegister, IRegisterCallback {
|
||||
|
||||
public BlockMod(Material par2Material, String name) {
|
||||
super(par2Material);
|
||||
setUnlocalizedName(name);
|
||||
GameRegistry.register(this, new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
registerItemForm();
|
||||
ModBlocks.ALL_BLOCKS.add(this);
|
||||
setRegistryName(new ResourceLocation(LibMisc.MOD_ID, name));
|
||||
if(registerInCreative())
|
||||
setCreativeTab(BotaniaCreativeTab.INSTANCE);
|
||||
}
|
||||
@@ -49,4 +49,10 @@ public class BlockMod extends Block implements IModelRegister {
|
||||
public void registerModels() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register() {
|
||||
GameRegistry.register(this);
|
||||
registerItemForm();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user