Added charged/uncharged tools to creative tab

This commit is contained in:
Gig 2015-04-12 23:39:38 +01:00
parent bdc34c393d
commit 49474e741e
2 changed files with 44 additions and 3 deletions

View file

@ -1,7 +1,11 @@
package techreborn.items.tools;
import java.util.List;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
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;
@ -12,10 +16,9 @@ import cpw.mods.fml.relauncher.SideOnly;
public class ItemLithiumBatpack extends ItemArmor implements IElectricItem{
public int maxCharge = 60000000;
public int maxCharge = 40000000;
public int tier = 3;
public double transferLimit = 10000;
public int energyPerDamage = 100;
public double transferLimit = 100000;
public ItemLithiumBatpack(ArmorMaterial armorMaterial, int par3, int par4)
{
@ -39,6 +42,23 @@ public class ItemLithiumBatpack extends ItemArmor implements IElectricItem{
return "techreborn:" + "textures/models/lithiumbatpack.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)
{

View file

@ -1,8 +1,12 @@
package techreborn.items.tools;
import java.util.List;
import ic2.api.item.ElectricItem;
import ic2.api.item.IElectricItem;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
@ -37,6 +41,23 @@ public class ItemRockCutter extends ItemPickaxe implements IElectricItem{
this.itemIcon = iconRegister.registerIcon("techreborn:" + "rockcutter");
}
@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 canHarvestBlock(Block block, ItemStack stack)
{