2013-08-23 16:59:50 +02:00
|
|
|
package com.pahimar.ee3.item;
|
|
|
|
|
2015-11-25 22:00:25 +01:00
|
|
|
import com.pahimar.ee3.api.exchange.EnergyValue;
|
|
|
|
import com.pahimar.ee3.api.exchange.IEnergyValueProvider;
|
2014-04-01 22:11:52 +02:00
|
|
|
import com.pahimar.ee3.reference.Names;
|
2015-11-25 22:00:25 +01:00
|
|
|
import net.minecraft.item.ItemStack;
|
2014-04-01 22:11:52 +02:00
|
|
|
|
2023-01-03 17:47:36 +01:00
|
|
|
public class ItemMiniumShard extends ItemEE implements IEnergyValueProvider {
|
|
|
|
public ItemMiniumShard() {
|
2014-04-01 22:11:52 +02:00
|
|
|
super();
|
|
|
|
this.setMaxStackSize(64);
|
|
|
|
this.setUnlocalizedName(Names.Items.MINIUM_SHARD);
|
|
|
|
}
|
2015-11-25 22:00:25 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public EnergyValue getEnergyValue(ItemStack itemStack) {
|
2023-01-03 17:47:36 +01:00
|
|
|
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)
|
|
|
|
);
|
2015-11-28 05:07:45 +01:00
|
|
|
}
|
2015-11-25 22:00:25 +01:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2013-08-23 16:59:50 +02:00
|
|
|
}
|