equivalent-exchange-3/src/main/java/com/pahimar/ee3/item/ItemMiniumShard.java

29 lines
920 B
Java
Raw Normal View History

2013-08-23 16:59:50 +02:00
package com.pahimar.ee3.item;
import com.pahimar.ee3.api.exchange.EnergyValue;
import com.pahimar.ee3.api.exchange.IEnergyValueProvider;
import com.pahimar.ee3.reference.Names;
import net.minecraft.item.ItemStack;
public class ItemMiniumShard extends ItemEE implements IEnergyValueProvider
{
public ItemMiniumShard()
{
super();
this.setMaxStackSize(64);
this.setUnlocalizedName(Names.Items.MINIUM_SHARD);
}
@Override
public EnergyValue getEnergyValue(ItemStack itemStack) {
if (itemStack != null && itemStack.hasTagCompound() && itemStack.getTagCompound().hasKey(Names.NBT.ENERGY_VALUE))
{
if (Float.compare(itemStack.getTagCompound().getFloat(Names.NBT.ENERGY_VALUE), 0) > 0)
{
return new EnergyValue(itemStack.getTagCompound().getFloat(Names.NBT.ENERGY_VALUE));
}
}
return null;
}
2013-08-23 16:59:50 +02:00
}