Added New tab and changed tab icons

This commit is contained in:
DarkGuardsman 2013-10-23 08:31:45 -04:00
parent baaccba6ea
commit 1b2eafe506
3 changed files with 28 additions and 6 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 457 B

View file

@ -5,6 +5,7 @@ import java.io.File;
import java.util.Arrays;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.world.WorldEvent;
@ -36,6 +37,8 @@ import dark.core.common.blocks.BlockOre.OreData;
import dark.core.common.blocks.ItemBlockColored;
import dark.core.common.blocks.ItemBlockOre;
import dark.core.common.debug.BlockDebug;
import dark.core.common.items.EnumMaterial;
import dark.core.common.items.EnumOrePart;
import dark.core.common.items.ItemBattery;
import dark.core.common.items.ItemColoredDust;
import dark.core.common.items.ItemCommonTool;
@ -142,7 +145,14 @@ public class DarkMain extends ModPrefab
{
super.postInit(event);
proxy.postInit();
if (CoreRecipeLoader.itemParts instanceof ItemParts)
{
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);
}
}
@Override

View file

@ -12,7 +12,8 @@ import dark.core.common.DarkMain;
import dark.core.prefab.ModPrefab;
import dark.core.prefab.items.ItemBasic;
/** A metadata item containing parts of various machines in Liquid Mechanics Mod.
/** A meta data item containing parts of various crafting recipes. These parts do not do anything but
* allow new crafting recipes to be created.
*
* @author DarkGuardsman */
public class ItemParts extends ItemBasic
@ -67,9 +68,12 @@ public class ItemParts extends ItemBasic
@Override
public void getSubItems(int blockID, CreativeTabs tab, List itemStackList)
{
for (int meta = 0; meta < Parts.values().length; meta++)
for (Parts part : Parts.values())
{
itemStackList.add(new ItemStack(this, 1, meta));
if (part.show)
{
itemStackList.add(new ItemStack(this, 1, part.ordinal()));
}
}
}
@ -78,14 +82,22 @@ public class ItemParts extends ItemBasic
Seal("LeatherSeal"),
SlimeSeal("SlimeSeal"),
Tank("UnfinishedTank"),
Valve("ValvePart");
Valve("ValvePart"),
MiningIcon("miningIcon", false);
public String name;
public Icon icon;
boolean show = true;
private Parts(String name)
{
this.name = name;
}
private Parts(String name, boolean show)
{
this(name);
this.show = show;
}
}
}