Work on the LapotronPack - Hitt forge bug.
This commit is contained in:
parent
7249130c0c
commit
a8ee636846
3 changed files with 28 additions and 4 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue