changed creative tab loading

This commit is contained in:
Robert 2013-12-12 22:05:55 -05:00
parent 561e52ed46
commit a27ccb3b44
13 changed files with 54 additions and 18 deletions

View file

@ -8,10 +8,10 @@ public class DMCreativeTab extends CreativeTabs
{
public ItemStack itemStack = new ItemStack(Item.ingotIron, 1, 0);
public static DMCreativeTab tabAutomation = new DMCreativeTab("Automation");
public static DMCreativeTab tabIndustrial = new DMCreativeTab("Industrial");
public static DMCreativeTab tabHydrualic = new DMCreativeTab("Hydraulic");
public static DMCreativeTab tabMining = new DMCreativeTab("Mining");
private static DMCreativeTab tabAutomation = new DMCreativeTab("Automation");
private static DMCreativeTab tabIndustrial = new DMCreativeTab("Industrial");
private static DMCreativeTab tabHydrualic = new DMCreativeTab("Hydraulic");
private static DMCreativeTab tabMining = new DMCreativeTab("Mining");
public DMCreativeTab(String label)
{
@ -29,4 +29,40 @@ public class DMCreativeTab extends CreativeTabs
this.itemStack = stack;
}
public static DMCreativeTab tabAutomation()
{
if (tabAutomation == null)
{
tabAutomation = new DMCreativeTab("Automation");
}
return tabAutomation;
}
public static DMCreativeTab tabIndustrial()
{
if (tabIndustrial == null)
{
tabIndustrial = new DMCreativeTab("Industrial");
}
return tabIndustrial;
}
public static DMCreativeTab tabHydraulic()
{
if (tabHydrualic == null)
{
tabHydrualic = new DMCreativeTab("Hydraulic");
}
return tabHydrualic;
}
public static DMCreativeTab tabMining()
{
if (tabMining == null)
{
tabMining = new DMCreativeTab("Mining");
}
return tabMining;
}
}

View file

@ -43,7 +43,7 @@ public class BlockGasOre extends Block implements IGasBlock
{
super(DarkMain.CONFIGURATION.getBlock("GasBlock", ModPrefab.getNextID()).getInt(), gas);
this.setUnlocalizedName("DMBlockGas");
this.setCreativeTab(DMCreativeTab.tabIndustrial);
this.setCreativeTab(DMCreativeTab.tabIndustrial());
this.setTickRandomly(true);
}

View file

@ -24,7 +24,7 @@ public class ItemVehicleSpawn extends Item
{
super(ModPrefab.getNextItemId());
this.setUnlocalizedName("Vehicle");
this.setCreativeTab(DMCreativeTab.tabIndustrial);
this.setCreativeTab(DMCreativeTab.tabIndustrial());
}
@Override

View file

@ -191,11 +191,11 @@ public class DarkMain extends ModPrefab
proxy.postInit();
if (CoreRecipeLoader.itemParts instanceof ItemParts)
{
DMCreativeTab.tabMining.itemStack = new ItemStack(CoreRecipeLoader.itemParts.itemID, 1, ItemParts.Parts.MiningIcon.ordinal());
DMCreativeTab.tabMining().itemStack = new ItemStack(CoreRecipeLoader.itemParts.itemID, 1, ItemParts.Parts.MiningIcon.ordinal());
}
if (CoreRecipeLoader.itemMetals instanceof ItemOreDirv)
{
DMCreativeTab.tabIndustrial.itemStack = EnumMaterial.getStack(EnumMaterial.IRON, EnumOrePart.GEARS, 1);
DMCreativeTab.tabIndustrial().itemStack = EnumMaterial.getStack(EnumMaterial.IRON, EnumOrePart.GEARS, 1);
}
MachineRecipeHandler.parseOreNames(CONFIGURATION);
CONFIGURATION.save();

View file

@ -37,7 +37,7 @@ public class BlockSmallSteamGen extends BlockMachine
public BlockSmallSteamGen()
{
super(new BlockBuildData(BlockSmallSteamGen.class, "StarterSteamGen", UniversalElectricity.machine).setCreativeTab(DMCreativeTab.tabIndustrial));
super(new BlockBuildData(BlockSmallSteamGen.class, "StarterSteamGen", UniversalElectricity.machine).setCreativeTab(DMCreativeTab.tabIndustrial()));
this.setStepSound(soundMetalFootstep);
}

View file

@ -32,7 +32,7 @@ public class BlockSolarPanel extends BlockMachine
{
super(new BlockBuildData(BlockSolarPanel.class, "BlockSolarPanel", UniversalElectricity.machine));
this.setBlockBounds(0, 0, 0, 1f, .6f, 1f);
this.setCreativeTab(DMCreativeTab.tabIndustrial);
this.setCreativeTab(DMCreativeTab.tabIndustrial());
}
@Override

View file

@ -16,13 +16,13 @@ public class TileEntitySolarPanel extends TileEntityGenerator
@Override
public EnumSet<ForgeDirection> getOutputDirections()
{
return EnumSet.allOf(ForgeDirection.class);
return EnumSet.of(ForgeDirection.DOWN);
}
@Override
public void consumeFuel()
{
this.burnTime = BlockSolarPanel.tickRate;
this.burnTime = BlockSolarPanel.tickRate;
if (!this.worldObj.isRemote && this.ticks % BlockSolarPanel.tickRate == 0)
{

View file

@ -22,7 +22,7 @@ public class ItemBattery extends ItemElectric implements IExtraItemInfo
{
super(DarkMain.CONFIGURATION.getItem("Battery", ModPrefab.getNextItemId()).getInt());
this.setUnlocalizedName(DarkMain.getInstance().PREFIX + "Battery");
this.setCreativeTab(DMCreativeTab.tabIndustrial);
this.setCreativeTab(DMCreativeTab.tabIndustrial());
}
@SideOnly(Side.CLIENT)

View file

@ -33,7 +33,7 @@ public class ItemFluidCan extends ItemFluidContainer
{
super(DarkMain.CONFIGURATION.getItem("FluidCan", ModPrefab.getNextItemId()).getInt());
this.setUnlocalizedName("FluidCan");
this.setCreativeTab(DMCreativeTab.tabHydrualic);
this.setCreativeTab(DMCreativeTab.tabHydraulic());
this.setMaxStackSize(1);
this.setMaxDamage(100);
this.setNoRepair();

View file

@ -28,7 +28,7 @@ public class BlockDebug extends BlockMachine
public BlockDebug()
{
super(new BlockBuildData(BlockDebug.class, "DebugBlock", Material.clay).setCreativeTab(DMCreativeTab.tabIndustrial));
super(new BlockBuildData(BlockDebug.class, "DebugBlock", Material.clay).setCreativeTab(DMCreativeTab.tabIndustrial()));
}
@Override

View file

@ -32,7 +32,7 @@ public class BlockEnergyStorage extends BlockMachine
public BlockEnergyStorage()
{
super(DarkMain.CONFIGURATION, "DMEnergyStorage", UniversalElectricity.machine);
this.setCreativeTab(DMCreativeTab.tabIndustrial);
this.setCreativeTab(DMCreativeTab.tabIndustrial());
}
@Override

View file

@ -12,6 +12,6 @@ public class BlockTransformer extends BlockMachine
public BlockTransformer(Configuration config, String blockName, Material material)
{
super(DarkMain.CONFIGURATION, "Transformer", UniversalElectricity.machine);
this.setCreativeTab(DMCreativeTab.tabIndustrial);
this.setCreativeTab(DMCreativeTab.tabIndustrial());
}
}

View file

@ -43,7 +43,7 @@ public class BlockWire extends BlockMachine
public BlockWire()
{
super(new BlockBuildData(BlockWire.class, "DMWire", Material.cloth).setCreativeTab(DMCreativeTab.tabIndustrial));
super(new BlockBuildData(BlockWire.class, "DMWire", Material.cloth).setCreativeTab(DMCreativeTab.tabIndustrial()));
this.setStepSound(soundClothFootstep);
this.setResistance(0.2F);
this.setHardness(0.1f);