Merge pull request #2016 from WushiThe/contributing

1 single parenthesis
This commit is contained in:
HbmMods 2025-03-27 08:28:33 +01:00 committed by GitHub
commit 2d48960e2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,7 +20,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
public class ItemRBMKRod extends Item { public class ItemRBMKRod extends Item {
public ItemRBMKPellet pellet; public ItemRBMKPellet pellet;
public String fullName = ""; //full name of the fuel rod public String fullName = ""; //full name of the fuel rod
public double reactivity; //endpoint of the function public double reactivity; //endpoint of the function
@ -35,7 +35,7 @@ public class ItemRBMKRod extends Item {
public double diffusion = 0.02D; //the speed at which the core heats the hull public double diffusion = 0.02D; //the speed at which the core heats the hull
public NType nType = NType.SLOW; //neutronType, the most efficient neutron type for fission public NType nType = NType.SLOW; //neutronType, the most efficient neutron type for fission
public NType rType = NType.FAST; //releaseType, the type of neutrons released by this fuel public NType rType = NType.FAST; //releaseType, the type of neutrons released by this fuel
/* _____ /* _____
* ,I I I I, * ,I I I I,
* |'-----'| * |'-----'|
@ -52,7 +52,7 @@ public class ItemRBMKRod extends Item {
* | | * | |
* '-----' * '-----'
* I I I I * I I I I
* *
* i drew a fuel rod yay * i drew a fuel rod yay
*/ */
@ -63,7 +63,7 @@ public class ItemRBMKRod extends Item {
public ItemRBMKRod(String fullName) { public ItemRBMKRod(String fullName) {
this.fullName = fullName; this.fullName = fullName;
this.setContainerItem(ModItems.rbmk_fuel_empty); this.setContainerItem(ModItems.rbmk_fuel_empty);
this.setMaxStackSize(1); this.setMaxStackSize(1);
this.setCreativeTab(MainRegistry.controlTab); this.setCreativeTab(MainRegistry.controlTab);
@ -93,7 +93,7 @@ public class ItemRBMKRod extends Item {
this.depFunc = func; this.depFunc = func;
return this; return this;
} }
public ItemRBMKRod setXenon(double gen, double burn) { public ItemRBMKRod setXenon(double gen, double burn) {
this.xGen = gen; this.xGen = gen;
this.xBurn = burn; this.xBurn = burn;
@ -120,7 +120,7 @@ public class ItemRBMKRod extends Item {
this.rType = rType; this.rType = rType;
return this; return this;
} }
/** /**
* Adjusts the input flux using the poison level * Adjusts the input flux using the poison level
* Generates, then burns poison * Generates, then burns poison
@ -131,82 +131,82 @@ public class ItemRBMKRod extends Item {
* @return outFlux * @return outFlux
*/ */
public double burn(World world, ItemStack stack, double inFlux) { public double burn(World world, ItemStack stack, double inFlux) {
inFlux += selfRate; inFlux += selfRate;
//if xenon poison is enabled //if xenon poison is enabled
if(RBMKDials.getXenon(world)) { if(RBMKDials.getXenon(world)) {
double xenon = getPoison(stack); double xenon = getPoison(stack);
xenon -= xenonBurnFunc(inFlux); xenon -= xenonBurnFunc(inFlux);
inFlux *= (1D - getPoisonLevel(stack)); inFlux *= (1D - getPoisonLevel(stack));
xenon += xenonGenFunc(inFlux); xenon += xenonGenFunc(inFlux);
if(xenon < 0D) xenon = 0D; if(xenon < 0D) xenon = 0D;
if(xenon > 100D) xenon = 100D; if(xenon > 100D) xenon = 100D;
setPoison(stack, xenon); setPoison(stack, xenon);
} }
double outFlux = reactivityFunc(inFlux, getEnrichment(stack)) * RBMKDials.getReactivityMod(world); double outFlux = reactivityFunc(inFlux, getEnrichment(stack)) * RBMKDials.getReactivityMod(world);
//if depletion is enabled //if depletion is enabled
if(RBMKDials.getDepletion(world)) { if(RBMKDials.getDepletion(world)) {
double y = getYield(stack); double y = getYield(stack);
y -= inFlux; y -= inFlux;
if(y < 0D) y = 0D; if(y < 0D) y = 0D;
setYield(stack, y); setYield(stack, y);
} }
double coreHeat = this.getCoreHeat(stack); double coreHeat = this.getCoreHeat(stack);
coreHeat += outFlux * heat; coreHeat += outFlux * heat;
this.setCoreHeat(stack, rectify(coreHeat)); this.setCoreHeat(stack, rectify(coreHeat));
return outFlux; return outFlux;
} }
private double rectify(double num) { private double rectify(double num) {
if(num > 1_000_000D) num = 1_000_000D; if(num > 1_000_000D) num = 1_000_000D;
if(num < 20D || Double.isNaN(num)) num = 20D; if(num < 20D || Double.isNaN(num)) num = 20D;
return num; return num;
} }
/** /**
* Heat up the core based on the outFlux, then move some heat to the hull * Heat up the core based on the outFlux, then move some heat to the hull
* @param stack * @param stack
*/ */
public void updateHeat(World world, ItemStack stack, double mod) { public void updateHeat(World world, ItemStack stack, double mod) {
double coreHeat = this.getCoreHeat(stack); double coreHeat = this.getCoreHeat(stack);
double hullHeat = this.getHullHeat(stack); double hullHeat = this.getHullHeat(stack);
if(coreHeat > hullHeat) { if(coreHeat > hullHeat) {
double mid = (coreHeat - hullHeat) / 2D; double mid = (coreHeat - hullHeat) / 2D;
coreHeat -= mid * this.diffusion * RBMKDials.getFuelDiffusionMod(world) * mod; coreHeat -= mid * this.diffusion * RBMKDials.getFuelDiffusionMod(world) * mod;
hullHeat += mid * this.diffusion * RBMKDials.getFuelDiffusionMod(world) * mod; hullHeat += mid * this.diffusion * RBMKDials.getFuelDiffusionMod(world) * mod;
this.setCoreHeat(stack, rectify(coreHeat)); this.setCoreHeat(stack, rectify(coreHeat));
this.setHullHeat(stack, rectify(hullHeat)); this.setHullHeat(stack, rectify(hullHeat));
} }
} }
/** /**
* return one tick's worth of heat and cool the hull of the fuel rod, this heat goes into the fuel rod assembly block * return one tick's worth of heat and cool the hull of the fuel rod, this heat goes into the fuel rod assembly block
* @param stack * @param stack
* @return * @return
*/ */
public double provideHeat(World world, ItemStack stack, double heat, double mod) { public double provideHeat(World world, ItemStack stack, double heat, double mod) {
double hullHeat = this.getHullHeat(stack); double hullHeat = this.getHullHeat(stack);
//metldown! the hull melts so the entire structure stops making sense //metldown! the hull melts so the entire structure stops making sense
//hull and core heats are instantly equalized into 33% of their sum each, //hull and core heats are instantly equalized into 33% of their sum each,
//the rest is sent to the component which is always fatal //the rest is sent to the component which is always fatal
@ -217,20 +217,20 @@ public class ItemRBMKRod extends Item {
this.setHullHeat(stack, avg); this.setHullHeat(stack, avg);
return avg - heat; return avg - heat;
} }
if(hullHeat <= heat) if(hullHeat <= heat)
return 0; return 0;
double ret = (hullHeat - heat) / 2; double ret = (hullHeat - heat) / 2;
ret *= RBMKDials.getFuelHeatProvision(world) * mod; ret *= RBMKDials.getFuelHeatProvision(world) * mod;
hullHeat -= ret; hullHeat -= ret;
this.setHullHeat(stack, hullHeat); this.setHullHeat(stack, hullHeat);
return ret; return ret;
} }
public static enum EnumBurnFunc { public static enum EnumBurnFunc {
PASSIVE(EnumChatFormatting.DARK_GREEN + "SAFE / PASSIVE"), //const, no reactivity PASSIVE(EnumChatFormatting.DARK_GREEN + "SAFE / PASSIVE"), //const, no reactivity
LOG_TEN(EnumChatFormatting.YELLOW + "MEDIUM / LOGARITHMIC"), //log10(x + 1) * reactivity * 50 LOG_TEN(EnumChatFormatting.YELLOW + "MEDIUM / LOGARITHMIC"), //log10(x + 1) * reactivity * 50
@ -241,22 +241,22 @@ public class ItemRBMKRod extends Item {
LINEAR(EnumChatFormatting.RED + "DANGEROUS / LINEAR"), //x * reactivity LINEAR(EnumChatFormatting.RED + "DANGEROUS / LINEAR"), //x * reactivity
QUADRATIC(EnumChatFormatting.RED + "DANGEROUS / QUADRATIC"), //x^2 / 100 * reactivity QUADRATIC(EnumChatFormatting.RED + "DANGEROUS / QUADRATIC"), //x^2 / 100 * reactivity
EXPERIMENTAL(EnumChatFormatting.RED + "EXPERIMENTAL / SINE SLOPE"); //x * (sin(x) + 1) EXPERIMENTAL(EnumChatFormatting.RED + "EXPERIMENTAL / SINE SLOPE"); //x * (sin(x) + 1)
public String title = ""; public String title = "";
private EnumBurnFunc(String title) { private EnumBurnFunc(String title) {
this.title = title; this.title = title;
} }
} }
/** /**
* @param enrichment [0;100] ...or at least those are sane levels * @param enrichment [0;100] ...or at least those are sane levels
* @return the amount of reactivity yielded, unmodified by xenon * @return the amount of reactivity yielded, unmodified by xenon
*/ */
public double reactivityFunc(double in, double enrichment) { public double reactivityFunc(double in, double enrichment) {
double flux = in * reactivityModByEnrichment(enrichment); double flux = in * reactivityModByEnrichment(enrichment);
switch(this.function) { switch(this.function) {
case PASSIVE: return selfRate * enrichment; case PASSIVE: return selfRate * enrichment;
case LOG_TEN: return Math.log10(flux + 1) * 0.5D * reactivity; case LOG_TEN: return Math.log10(flux + 1) * 0.5D * reactivity;
@ -268,20 +268,20 @@ public class ItemRBMKRod extends Item {
case QUADRATIC: return flux * flux / 10000D * reactivity; case QUADRATIC: return flux * flux / 10000D * reactivity;
case EXPERIMENTAL: return flux * (Math.sin(flux) + 1) * reactivity; case EXPERIMENTAL: return flux * (Math.sin(flux) + 1) * reactivity;
} }
return 0; return 0;
} }
public String getFuncDescription(ItemStack stack) { public String getFuncDescription(ItemStack stack) {
String function; String function;
switch(this.function) { switch(this.function) {
case PASSIVE: function = EnumChatFormatting.RED + "" + selfRate; case PASSIVE: function = EnumChatFormatting.RED + "" + selfRate;
break; break;
case LOG_TEN: function = "log10(%1$s + 1) * 0.5 * %2$s"; case LOG_TEN: function = "log10(%1$s + 1) * 0.5 * %2$s";
break; break;
case PLATEU: function = "(1 - e^-%1$s / 25)) * %2$s"; case PLATEU: function = "(1 - e^(-%1$s / 25)) * %2$s";
break; break;
case ARCH: function = "(%1$s - %1$s² / 10000) / 100 * %2$s [0;∞]"; case ARCH: function = "(%1$s - %1$s² / 10000) / 100 * %2$s [0;∞]";
break; break;
@ -297,20 +297,20 @@ public class ItemRBMKRod extends Item {
break; break;
default: function = "ERROR"; default: function = "ERROR";
} }
double enrichment = getEnrichment(stack); double enrichment = getEnrichment(stack);
if(enrichment < 1) { if(enrichment < 1) {
enrichment = reactivityModByEnrichment(enrichment); enrichment = reactivityModByEnrichment(enrichment);
String reactivity = EnumChatFormatting.YELLOW + "" + ((int)(this.reactivity * enrichment * 1000D) / 1000D) + EnumChatFormatting.WHITE; String reactivity = EnumChatFormatting.YELLOW + "" + ((int)(this.reactivity * enrichment * 1000D) / 1000D) + EnumChatFormatting.WHITE;
String enrichmentPer = EnumChatFormatting.GOLD + " (" + ((int)(enrichment * 1000D) / 10D) + "%)"; String enrichmentPer = EnumChatFormatting.GOLD + " (" + ((int)(enrichment * 1000D) / 10D) + "%)";
return String.format(Locale.US, function, selfRate > 0 ? "(x" + EnumChatFormatting.RED + " + " + selfRate + "" + EnumChatFormatting.WHITE + ")" : "x", reactivity).concat(enrichmentPer); return String.format(Locale.US, function, selfRate > 0 ? "(x" + EnumChatFormatting.RED + " + " + selfRate + "" + EnumChatFormatting.WHITE + ")" : "x", reactivity).concat(enrichmentPer);
} }
return String.format(Locale.US, function, selfRate > 0 ? "(x" + EnumChatFormatting.RED + " + " + selfRate + "" + EnumChatFormatting.WHITE + ")" : "x", reactivity); return String.format(Locale.US, function, selfRate > 0 ? "(x" + EnumChatFormatting.RED + " + " + selfRate + "" + EnumChatFormatting.WHITE + ")" : "x", reactivity);
} }
public static enum EnumDepleteFunc { public static enum EnumDepleteFunc {
LINEAR, //old function LINEAR, //old function
RAISING_SLOPE, //for breeding fuels such as MEU, maximum of 110% at 28% depletion RAISING_SLOPE, //for breeding fuels such as MEU, maximum of 110% at 28% depletion
@ -318,9 +318,9 @@ public class ItemRBMKRod extends Item {
GENTLE_SLOPE, //recommended for most fuels, maximum barely over the start, near the beginning GENTLE_SLOPE, //recommended for most fuels, maximum barely over the start, near the beginning
STATIC; //for arcade-style neutron sources STATIC; //for arcade-style neutron sources
} }
public double reactivityModByEnrichment(double enrichment) { public double reactivityModByEnrichment(double enrichment) {
switch(this.depFunc) { switch(this.depFunc) {
default: default:
case LINEAR: return enrichment; case LINEAR: return enrichment;
@ -330,7 +330,7 @@ public class ItemRBMKRod extends Item {
case GENTLE_SLOPE: return enrichment + (Math.sin(enrichment * Math.PI) / 3D); //x + (sin(x * pi) / 3) also works case GENTLE_SLOPE: return enrichment + (Math.sin(enrichment * Math.PI) / 3D); //x + (sin(x * pi) / 3) also works
} }
} }
/** /**
* Xenon generated per tick, linear function * Xenon generated per tick, linear function
* @param flux * @param flux
@ -339,7 +339,7 @@ public class ItemRBMKRod extends Item {
public double xenonGenFunc(double flux) { public double xenonGenFunc(double flux) {
return flux * xGen; return flux * xGen;
} }
/** /**
* Xenon burned away per tick, quadratic function * Xenon burned away per tick, quadratic function
* @param flux * @param flux
@ -348,7 +348,7 @@ public class ItemRBMKRod extends Item {
public double xenonBurnFunc(double flux) { public double xenonBurnFunc(double flux) {
return (flux * flux) / xBurn; return (flux * flux) / xBurn;
} }
/** /**
* @param stack * @param stack
* @return enrichment [0;1] * @return enrichment [0;1]
@ -356,7 +356,7 @@ public class ItemRBMKRod extends Item {
public static double getEnrichment(ItemStack stack) { public static double getEnrichment(ItemStack stack) {
return getYield(stack) / ((ItemRBMKRod) stack.getItem()).yield; return getYield(stack) / ((ItemRBMKRod) stack.getItem()).yield;
} }
/** /**
* @param stack * @param stack
* @return poison [0;1] * @return poison [0;1]
@ -415,15 +415,15 @@ public class ItemRBMKRod extends Item {
@Override @Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add(EnumChatFormatting.ITALIC + this.fullName); list.add(EnumChatFormatting.ITALIC + this.fullName);
if(this == ModItems.rbmk_fuel_drx) { if(this == ModItems.rbmk_fuel_drx) {
if(selfRate > 0 || this.function == EnumBurnFunc.SIGMOID) { if(selfRate > 0 || this.function == EnumBurnFunc.SIGMOID) {
list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmx.source")); list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmx.source"));
} }
list.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey("trait.rbmx.depletion", ((int)(((yield - getYield(stack)) / yield) * 100000)) / 1000D + "%")); list.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey("trait.rbmx.depletion", ((int)(((yield - getYield(stack)) / yield) * 100000)) / 1000D + "%"));
list.add(EnumChatFormatting.DARK_PURPLE + I18nUtil.resolveKey("trait.rbmx.xenon", ((int)(getPoison(stack) * 1000D) / 1000D) + "%")); list.add(EnumChatFormatting.DARK_PURPLE + I18nUtil.resolveKey("trait.rbmx.xenon", ((int)(getPoison(stack) * 1000D) / 1000D) + "%"));
list.add(EnumChatFormatting.BLUE + I18nUtil.resolveKey("trait.rbmx.splitsWith", I18nUtil.resolveKey(nType.unlocalized + ".x"))); list.add(EnumChatFormatting.BLUE + I18nUtil.resolveKey("trait.rbmx.splitsWith", I18nUtil.resolveKey(nType.unlocalized + ".x")));
@ -437,13 +437,13 @@ public class ItemRBMKRod extends Item {
list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmx.skinTemp", ((int)(getHullHeat(stack) * 10D) / 10D) + "m")); list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmx.skinTemp", ((int)(getHullHeat(stack) * 10D) / 10D) + "m"));
list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmx.coreTemp", ((int)(getCoreHeat(stack) * 10D) / 10D) + "m")); list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmx.coreTemp", ((int)(getCoreHeat(stack) * 10D) / 10D) + "m"));
list.add(EnumChatFormatting.DARK_RED + I18nUtil.resolveKey("trait.rbmx.melt", meltingPoint + "m")); list.add(EnumChatFormatting.DARK_RED + I18nUtil.resolveKey("trait.rbmx.melt", meltingPoint + "m"));
} else { } else {
if(selfRate > 0 || this.function == EnumBurnFunc.SIGMOID) { if(selfRate > 0 || this.function == EnumBurnFunc.SIGMOID) {
list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmk.source")); list.add(EnumChatFormatting.RED + I18nUtil.resolveKey("trait.rbmk.source"));
} }
list.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey("trait.rbmk.depletion", ((int)(((yield - getYield(stack)) / yield) * 100000D)) / 1000D + "%")); list.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey("trait.rbmk.depletion", ((int)(((yield - getYield(stack)) / yield) * 100000D)) / 1000D + "%"));
list.add(EnumChatFormatting.DARK_PURPLE + I18nUtil.resolveKey("trait.rbmk.xenon", ((int)(getPoison(stack) * 1000D) / 1000D) + "%")); list.add(EnumChatFormatting.DARK_PURPLE + I18nUtil.resolveKey("trait.rbmk.xenon", ((int)(getPoison(stack) * 1000D) / 1000D) + "%"));
list.add(EnumChatFormatting.BLUE + I18nUtil.resolveKey("trait.rbmk.splitsWith", I18nUtil.resolveKey(nType.unlocalized))); list.add(EnumChatFormatting.BLUE + I18nUtil.resolveKey("trait.rbmk.splitsWith", I18nUtil.resolveKey(nType.unlocalized)));
@ -471,10 +471,10 @@ public class ItemRBMKRod extends Item {
list.add(EnumChatFormatting.RED + "Skin temp: " + ((int)(getHullHeat(stack) * 10D) / 10D) + "°C"); list.add(EnumChatFormatting.RED + "Skin temp: " + ((int)(getHullHeat(stack) * 10D) / 10D) + "°C");
list.add(EnumChatFormatting.RED + "Core temp: " + ((int)(getCoreHeat(stack) * 10D) / 10D) + "°C"); list.add(EnumChatFormatting.RED + "Core temp: " + ((int)(getCoreHeat(stack) * 10D) / 10D) + "°C");
list.add(EnumChatFormatting.DARK_RED + "Melting point: " + meltingPoint + "°C");*/ list.add(EnumChatFormatting.DARK_RED + "Melting point: " + meltingPoint + "°C");*/
super.addInformation(stack, player, list, bool); super.addInformation(stack, player, list, bool);
} }
/* __ __ ____ ________ /* __ __ ____ ________
* | \ | | | __ \ |__ __| * | \ | | | __ \ |__ __|
* | \ | | | |__| | | | * | \ | | | |__| | | |
@ -482,40 +482,40 @@ public class ItemRBMKRod extends Item {
* | | \ | | |__| | | | * | | \ | | |__| | | |
* |__| \__| |_____/ |__| * |__| \__| |_____/ |__|
*/ */
public static void setYield(ItemStack stack, double yield) { public static void setYield(ItemStack stack, double yield) {
setDouble(stack, "yield", yield); setDouble(stack, "yield", yield);
} }
public static double getYield(ItemStack stack) { public static double getYield(ItemStack stack) {
if(stack.getItem() instanceof ItemRBMKRod) { if(stack.getItem() instanceof ItemRBMKRod) {
return getDouble(stack, "yield"); return getDouble(stack, "yield");
} }
return 0; return 0;
} }
public static void setPoison(ItemStack stack, double xenon) { public static void setPoison(ItemStack stack, double xenon) {
setDouble(stack, "xenon", xenon); setDouble(stack, "xenon", xenon);
} }
public static double getPoison(ItemStack stack) { public static double getPoison(ItemStack stack) {
return getDouble(stack, "xenon"); return getDouble(stack, "xenon");
} }
public static void setCoreHeat(ItemStack stack, double heat) { public static void setCoreHeat(ItemStack stack, double heat) {
setDouble(stack, "core", heat); setDouble(stack, "core", heat);
} }
public static double getCoreHeat(ItemStack stack) { public static double getCoreHeat(ItemStack stack) {
return getDouble(stack, "core"); return getDouble(stack, "core");
} }
public static void setHullHeat(ItemStack stack, double heat) { public static void setHullHeat(ItemStack stack, double heat) {
setDouble(stack, "hull", heat); setDouble(stack, "hull", heat);
} }
public static double getHullHeat(ItemStack stack) { public static double getHullHeat(ItemStack stack) {
return getDouble(stack, "hull"); return getDouble(stack, "hull");
} }
@ -529,23 +529,23 @@ public class ItemRBMKRod extends Item {
public double getDurabilityForDisplay(ItemStack stack) { public double getDurabilityForDisplay(ItemStack stack) {
return 1D - getEnrichment(stack); return 1D - getEnrichment(stack);
} }
public static void setDouble(ItemStack stack, String key, double yield) { public static void setDouble(ItemStack stack, String key, double yield) {
if(!stack.hasTagCompound()) if(!stack.hasTagCompound())
setNBTDefaults(stack); setNBTDefaults(stack);
stack.stackTagCompound.setDouble(key, yield); stack.stackTagCompound.setDouble(key, yield);
} }
public static double getDouble(ItemStack stack, String key) { public static double getDouble(ItemStack stack, String key) {
if(!stack.hasTagCompound()) if(!stack.hasTagCompound())
setNBTDefaults(stack); setNBTDefaults(stack);
return stack.stackTagCompound.getDouble(key); return stack.stackTagCompound.getDouble(key);
} }
/** /**
* Sets up the default values for all NBT data because doing it one-by-one will only correctly set the first called value and the rest stays 0 which is very not good * Sets up the default values for all NBT data because doing it one-by-one will only correctly set the first called value and the rest stays 0 which is very not good
* @param stack * @param stack
@ -557,7 +557,7 @@ public class ItemRBMKRod extends Item {
setCoreHeat(stack, 20.0D); setCoreHeat(stack, 20.0D);
setHullHeat(stack, 20.0D); setHullHeat(stack, 20.0D);
} }
@Override @Override
public void onCreated(ItemStack stack, World world, EntityPlayer player) { public void onCreated(ItemStack stack, World world, EntityPlayer player) {
setNBTDefaults(stack); //minimize the window where NBT screwups can happen setNBTDefaults(stack); //minimize the window where NBT screwups can happen