This commit is contained in:
gigabit101 2016-03-28 21:52:57 +01:00
commit 8280703eb4
3 changed files with 28 additions and 4 deletions

View file

@ -1,7 +1,5 @@
package techreborn.items.armor;
import java.util.List;
import me.modmuss50.jsonDestroyer.api.ITexturedItem;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
@ -11,6 +9,7 @@ import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.RebornCore;
@ -20,6 +19,8 @@ import techreborn.client.TechRebornCreativeTab;
import techreborn.config.ConfigTechReborn;
import techreborn.lib.ModInfo;
import java.util.List;
public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo, ITexturedItem
{
@ -93,6 +94,29 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo, ITex
}
@Override public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected)
{System.out.print("Hey!");
}
@Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack)
{
System.out.print("Hey!");
for(int i = 0; i < player.inventory.getSizeInventory(); i++){
if(player.inventory.getStackInSlot(i) != null){
ItemStack item = player.inventory.getStackInSlot(i);
if(item.getItem() instanceof IEnergyItemInfo){
IEnergyItemInfo energyItemInfo = (IEnergyItemInfo) item.getItem();
if(energyItemInfo.canAcceptEnergy(item)){
if(PoweredItem.canUseEnergy(energyItemInfo.getMaxPower(item), itemStack)){
PoweredItem.useEnergy(energyItemInfo.getMaxPower(item), itemStack);
PoweredItem.addEnergy(energyItemInfo.getMaxPower(item), item);
}
}
}
}
}
}
@Override
public boolean showDurabilityBar(ItemStack stack)
{

View file

@ -10,7 +10,7 @@ public class ItemDiamondDrill extends ItemDrill
public ItemDiamondDrill()
{
super(ToolMaterial.DIAMOND, "techreborn.diamondDrill", ConfigTechReborn.DiamondDrillCharge,
ConfigTechReborn.DiamondDrillTier, 2.5F, 15F);
ConfigTechReborn.DiamondDrillTier, 0.5F, 15F);
this.cost = 250;
}

View file

@ -10,7 +10,7 @@ public class ItemIronDrill extends ItemDrill
public ItemIronDrill()
{
super(ToolMaterial.IRON, "techreborn.ironDrill", ConfigTechReborn.IronDrillCharge,
ConfigTechReborn.IronDrillTier, 2.0F, 10F);
ConfigTechReborn.IronDrillTier, 0.5F, 10F);
this.cost = 50;
}