Added LapotronPack

This commit is contained in:
Gig 2015-04-12 23:38:30 +01:00
parent a46645ff42
commit bdc34c393d
5 changed files with 105 additions and 0 deletions

View file

@ -11,6 +11,7 @@ import techreborn.items.ItemDusts;
import techreborn.items.ItemGems;
import techreborn.items.ItemIngots;
import techreborn.items.ItemParts;
import techreborn.items.tools.ItemLapotronPack;
import techreborn.items.tools.ItemLithiumBatpack;
import techreborn.items.tools.ItemRockCutter;
import techreborn.util.LogHelper;
@ -24,6 +25,7 @@ public class ModItems {
public static Item parts;
public static Item rockCutter;
public static Item lithiumBatpack;
public static Item lapotronpack;
public static void init()
{
@ -39,6 +41,9 @@ public class ModItems {
GameRegistry.registerItem(rockCutter, "rockCutter");
lithiumBatpack = new ItemLithiumBatpack(ArmorMaterial.DIAMOND, 7, 1);
GameRegistry.registerItem(lithiumBatpack, "lithiumBatpack");
lapotronpack = new ItemLapotronPack(ArmorMaterial.DIAMOND, 7, 1);
GameRegistry.registerItem(lapotronpack, "lapotronPack");
LogHelper.info("TechReborns Items Loaded");
registerOreDict();

View file

@ -0,0 +1,98 @@
package techreborn.items.tools;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import techreborn.client.TechRebornCreativeTab;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ItemLapotronPack extends ItemArmor implements IElectricItem{
public int maxCharge = 100000000;
public int tier = 3;
public double transferLimit = 100000;
public ItemLapotronPack(ArmorMaterial armormaterial, int par2, int par3)
{
super(armormaterial, par2, par3);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.lapotronpack");
setMaxStackSize(1);
}
@SideOnly(Side.CLIENT)
@Override
public void registerIcons(IIconRegister iconRegister)
{
this.itemIcon = iconRegister.registerIcon("techreborn:" + "lapotronpack");
}
@Override
@SideOnly(Side.CLIENT)
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
{
return "techreborn:" + "textures/models/lapotronpack.png";
}
@SuppressWarnings({"rawtypes", "unchecked"})
@SideOnly(Side.CLIENT)
public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList)
{
ItemStack itemStack = new ItemStack(this, 1);
if (getChargedItem(itemStack) == this)
{
ItemStack charged = new ItemStack(this, 1);
ElectricItem.manager.charge(charged, 2147483647, 2147483647, true, false);
itemList.add(charged);
}
if (getEmptyItem(itemStack) == this)
{
itemList.add(new ItemStack(this, 1, getMaxDamage()));
}
}
@Override
public boolean canProvideEnergy(ItemStack itemStack)
{
return true;
}
@Override
public Item getChargedItem(ItemStack itemStack)
{
return this;
}
@Override
public Item getEmptyItem(ItemStack itemStack)
{
return this;
}
@Override
public double getMaxCharge(ItemStack itemStack)
{
return maxCharge;
}
@Override
public int getTier(ItemStack itemStack)
{
return tier;
}
@Override
public double getTransferLimit(ItemStack itemStack)
{
return transferLimit;
}
}

View file

@ -148,5 +148,7 @@ item.techreborn.part.BrassMachineHull.name=Brass Machine Hull
#Tools
item.techreborn.rockcutter.name=Rockcutter
item.techreborn.lithiumbatpack.name=lithium Batpack
item.techreborn.lapotronpack.name=Lapotron Pack

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB