Vaern 0c34901864 ZIRNOX stuff + lil bit of Igen
Added Mox ZFB rods for fast technetium breeding (50k ticks); Increased the lifetimes for almost all ZIRNOX fuels by approximately 2, along with minor changes to heat values; reduced buffs to boosted presto logs in the IGen: shouldn't be *as* broken anymore, but still nowhere near unremarkable; Added Hopper IO functionality to the ZIRNOX; Changed ZIRNOX and destroyed variant's model textures slightly
2022-06-19 22:23:18 -07:00

48 lines
1.2 KiB
Java

package com.hbm.items.machine;
import java.util.List;
import com.hbm.lib.Library;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
public class ItemFuelRod extends Item {
public int lifeTime;
public ItemFuelRod(int life) {
this.lifeTime = life;
this.canRepair = false;
}
public static void setLifeTime(ItemStack stack, int time) {
if(!stack.hasTagCompound())
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setInteger("life", time);
}
public static int getLifeTime(ItemStack stack) {
if(!stack.hasTagCompound()) {
stack.stackTagCompound = new NBTTagCompound();
return 0;
}
return stack.stackTagCompound.getInteger("life");
}
public boolean showDurabilityBar(ItemStack stack) {
return getDurabilityForDisplay(stack) > 0D;
}
public double getDurabilityForDisplay(ItemStack stack) {
return (double)getLifeTime(stack) / (double)((ItemFuelRod)stack.getItem()).lifeTime;
}
}