resonant-induction/minecraft/liquidmechanics/common/item/ItemParts.java
Rseifert 77de6e6353 Making Changes for the better
Starting down the long road of making my mod even more compatable with
other mod's liquids. This will take some time, patience, and pain
killers.

Plan of action
*Release Valve will not store any liquids but rather direction output to
pipes from other TileEntities
*Release Valve will have a gui to restrict it to outputing one or more
types of Liquids that are predefined
*Pipes will go from being fully liquid restricted to color based(0-15)
and have a universal uncolor pipe that can accept all liquids
*Once a pipe is place a tool can be used to change its color just like
in other mods.
*Some colors will be restricted to select liquids for example Blue is
water, Red is Lava, Black is oil, Yellow Fuel, White Milk,
*Steam will have its own pipe made out of bronze to fit the machines it
goes too.
*Tanks will go in the same direction
*Pumps will still be liquid restricted but come with unique textures,
models, and animation per liquid type

Current issues to resolve that are broken with push
*Release valve doesn't work at all due to changes in progress
*back compatable must be added for pipes and old release valves
2013-01-04 19:03:34 -05:00

70 lines
1.7 KiB
Java

package liquidmechanics.common.item;
import java.util.List;
import liquidmechanics.common.LiquidMechanics;
import liquidmechanics.common.TabLiquidMechanics;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
/**
* A metadata item containing parts of various machines in Liquid Mechanics Mod.
*
* @author Rs
*
*/
public class ItemParts extends Item {
public enum Parts {
Bronze("Bronze Tube", 0), Iron("Iron Tube", 1), Obby("Obby Tube", 2), Nether(
"Nether Tube", 3), Seal("Leather Seal", 16), SlimeSeal("Slime Seal", 17), Tank(
"Unfinished Tank", 18), Valve("Valve", 19);
public String name;
public int itemIndex;
private Parts(String name, int itemIndex) {
this.name = name;
this.itemIndex = itemIndex;
}
}
public ItemParts(int par1) {
super(par1);
this.setItemName("parts");
this.setHasSubtypes(true);
this.setMaxDamage(0);
this.setMaxStackSize(64);
this.setCreativeTab(TabLiquidMechanics.INSTANCE);
this.setTextureFile(LiquidMechanics.ITEM_TEXTURE_FILE);
}
@Override
public int getIconFromDamage(int par1) {
if (par1 < Parts.values().length) {
return Parts.values()[par1].itemIndex;
}
return par1;
}
@Override
public String getItemNameIS(ItemStack itemstack) {
if (itemstack.getItemDamage() < Parts.values().length) {
return Parts.values()[itemstack.getItemDamage()].name;
}
return "unkown";
}
@Override
public void getSubItems(int par1, CreativeTabs par2CreativeTabs,
List par3List) {
for (int i = 0; i < Parts.values().length; i++) {
par3List.add(new ItemStack(this, 1, i));
}
}
@Override
public String getItemName() {
return "parts";
}
}