Changed Creative Tab Handling a bit

This commit is contained in:
Ellpeck 2015-10-25 14:30:59 +01:00
parent 4131198835
commit 713e9b6e1a
4 changed files with 11 additions and 23 deletions

View file

@ -188,19 +188,19 @@ public class InitBlocks{
BlockUtil.register(blockFermentingBarrel);
blockRice = new BlockPlant("blockRice", 6, 1, 2);
BlockUtil.register(blockRice, false);
BlockUtil.register(blockRice);
CompatUtil.registerMFRPlant(blockRice);
blockCanola = new BlockPlant("blockCanola", 4, 3, 3);
BlockUtil.register(blockCanola, false);
BlockUtil.register(blockCanola);
CompatUtil.registerMFRPlant(blockCanola);
blockFlax = new BlockPlant("blockFlax", 6, 2, 4);
BlockUtil.register(blockFlax, false);
BlockUtil.register(blockFlax);
CompatUtil.registerMFRPlant(blockFlax);
blockCoffee = new BlockPlant("blockCoffee", 6, 2, 2);
BlockUtil.register(blockCoffee, false);
BlockUtil.register(blockCoffee);
CompatUtil.registerMFRPlant(blockCoffee);
blockCompost = new BlockCompost();
@ -267,7 +267,7 @@ public class InitBlocks{
BlockUtil.register(blockPhantomBooster);
blockWildPlant = new BlockWildPlant();
BlockUtil.register(blockWildPlant, BlockWildPlant.TheItemBlock.class, false);
BlockUtil.register(blockWildPlant, BlockWildPlant.TheItemBlock.class);
registerFluids();
}
@ -287,7 +287,7 @@ public class InitBlocks{
//Canola Block
if(fluidCanolaOil.getBlock() == null || ConfigBoolValues.PREVENT_CANOLA_BLOCK_OVERRIDE.isEnabled()){
blockCanolaOil = new BlockFluidFlowing(fluidCanolaOil, Material.water, "blockCanolaOil");
BlockUtil.register(blockCanolaOil, false);
BlockUtil.register(blockCanolaOil);
}
else{
errorAlreadyRegistered("Canola Oil Block");
@ -308,7 +308,7 @@ public class InitBlocks{
//Oil Block
if(fluidOil.getBlock() == null || ConfigBoolValues.PREVENT_OIL_BLOCK_OVERRIDE.isEnabled()){
blockOil = new BlockFluidFlowing(fluidOil, Material.water, "blockOil");
BlockUtil.register(blockOil, false);
BlockUtil.register(blockOil);
}
else{
errorAlreadyRegistered("Oil Block");

View file

@ -39,7 +39,7 @@ public class CreativeTab extends CreativeTabs{
@Override
public Item getTabIconItem(){
return Item.getItemFromBlock(InitBlocks.blockPhantomLiquiface);
return InitItems.itemLexicon;
}
@Override

View file

@ -19,11 +19,7 @@ import net.minecraft.item.ItemBlock;
public class BlockUtil{
public static void register(Block block, Class<? extends ItemBlock> itemBlock){
register(block, itemBlock, true);
}
public static void register(Block block, Class<? extends ItemBlock> itemBlock, boolean addTab){
block.setCreativeTab(addTab ? CreativeTab.instance : null);
block.setCreativeTab(CreativeTab.instance);
block.setBlockName(createUnlocalizedName(block));
GameRegistry.registerBlock(block, itemBlock, ((IActAddItemOrBlock)block).getName());
}
@ -33,10 +29,6 @@ public class BlockUtil{
}
public static void register(Block block){
register(block, ItemBlockBase.class, true);
}
public static void register(Block block, boolean addTab){
register(block, ItemBlockBase.class, addTab);
register(block, ItemBlockBase.class);
}
}

View file

@ -36,11 +36,7 @@ public class ItemUtil{
}
public static void register(Item item){
register(item, true);
}
public static void register(Item item, boolean addTab){
item.setCreativeTab(addTab ? CreativeTab.instance : null);
item.setCreativeTab(CreativeTab.instance);
item.setUnlocalizedName(createUnlocalizedName(item));
GameRegistry.registerItem(item, ((IActAddItemOrBlock)item).getName());
}