diff options
Diffstat (limited to 'src/main/java/Ic2ExpReactorPlanner/components')
8 files changed, 95 insertions, 169 deletions
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java b/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java index e4b73aa838..2ae559d9c6 100644 --- a/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java +++ b/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java @@ -1,7 +1,6 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * To change this license header, choose License Headers in Project Properties. To change this template file, choose + * Tools | Templates and open the template in the editor. */ package Ic2ExpReactorPlanner.components; @@ -9,17 +8,13 @@ import gregtech.api.objects.GT_ItemStack; /** * Represents a condensator in a reactor, either RSH or LZH. + * * @author Brian McCloud */ public class Condensator extends ReactorItem { - public Condensator( - final int id, - final String baseName, - GT_ItemStack aItem, - final double maxDamage, - final double maxHeat, - final String sourceMod) { + public Condensator(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, + final double maxHeat, final String sourceMod) { super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); } diff --git a/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java b/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java index a9a90ceb6b..ab7b2e5867 100644 --- a/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java +++ b/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java @@ -1,7 +1,6 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * To change this license header, choose License Headers in Project Properties. To change this template file, choose + * Tools | Templates and open the template in the editor. */ package Ic2ExpReactorPlanner.components; @@ -9,17 +8,13 @@ import gregtech.api.objects.GT_ItemStack; /** * Represents a coolant cell in a reactor. + * * @author Brian McCloud */ public class CoolantCell extends ReactorItem { - public CoolantCell( - final int id, - final String baseName, - GT_ItemStack aItem, - final double maxDamage, - final double maxHeat, - final String sourceMod) { + public CoolantCell(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, + final double maxHeat, final String sourceMod) { super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); } diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java b/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java index 9c2f470eba..9a168bfa06 100644 --- a/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java +++ b/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java @@ -1,16 +1,17 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * To change this license header, choose License Headers in Project Properties. To change this template file, choose + * Tools | Templates and open the template in the editor. */ package Ic2ExpReactorPlanner.components; -import gregtech.api.objects.GT_ItemStack; import java.util.ArrayList; import java.util.List; +import gregtech.api.objects.GT_ItemStack; + /** * Represents a heat exchanger of some sort in a reactor. + * * @author Brian McCloud */ public class Exchanger extends ReactorItem { @@ -18,15 +19,8 @@ public class Exchanger extends ReactorItem { private final int switchSide; private final int switchReactor; - public Exchanger( - final int id, - final String baseName, - GT_ItemStack aItem, - final double maxDamage, - final double maxHeat, - final String sourceMod, - final int switchSide, - final int switchReactor) { + public Exchanger(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, + final double maxHeat, final String sourceMod, final int switchSide, final int switchReactor) { super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); this.switchSide = switchSide; this.switchReactor = switchReactor; diff --git a/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java b/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java index abeea45a37..2beac5c226 100644 --- a/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java +++ b/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java @@ -1,16 +1,17 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * To change this license header, choose License Headers in Project Properties. To change this template file, choose + * Tools | Templates and open the template in the editor. */ package Ic2ExpReactorPlanner.components; -import gregtech.api.objects.GT_ItemStack; import java.util.ArrayList; import java.util.List; +import gregtech.api.objects.GT_ItemStack; + /** * Represents some form of fuel rod (may be single, dual, or quad). + * * @author Brian McCloud */ public class FuelRod extends ReactorItem { @@ -31,17 +32,9 @@ public class FuelRod extends ReactorItem { GTNHbehavior = value; } - public FuelRod( - final int id, - final String baseName, - GT_ItemStack aItem, - final double maxDamage, - final double maxHeat, - final String sourceMod, - final int energyMult, - final double heatMult, - final int rodCount, - final boolean moxStyle) { + public FuelRod(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, + final double maxHeat, final String sourceMod, final int energyMult, final double heatMult, + final int rodCount, final boolean moxStyle) { super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); this.energyMult = energyMult; this.heatMult = heatMult; diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Plating.java b/src/main/java/Ic2ExpReactorPlanner/components/Plating.java index de49dfa13c..8a1edf8d8f 100644 --- a/src/main/java/Ic2ExpReactorPlanner/components/Plating.java +++ b/src/main/java/Ic2ExpReactorPlanner/components/Plating.java @@ -1,7 +1,6 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * To change this license header, choose License Headers in Project Properties. To change this template file, choose + * Tools | Templates and open the template in the editor. */ package Ic2ExpReactorPlanner.components; @@ -9,23 +8,17 @@ import Ic2ExpReactorPlanner.Reactor; import gregtech.api.objects.GT_ItemStack; /** - * Represents some form of plating, which changes how much heat the reactor can - * hold before causing external effects (up to and including explosion), as well - * as somewhat reducing explosion power. + * Represents some form of plating, which changes how much heat the reactor can hold before causing external effects (up + * to and including explosion), as well as somewhat reducing explosion power. + * * @author Brian McCloud */ public class Plating extends ReactorItem { private final int heatAdjustment; - public Plating( - final int id, - final String baseName, - GT_ItemStack aItem, - final double maxDamage, - final double maxHeat, - final String sourceMod, - final int heatAdjustment, + public Plating(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, + final double maxHeat, final String sourceMod, final int heatAdjustment, final double explosionPowerMultiplier) { super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); this.heatAdjustment = heatAdjustment; diff --git a/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java b/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java index aee7f1c441..8319f6931b 100644 --- a/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java +++ b/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java @@ -1,17 +1,16 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * To change this license header, choose License Headers in Project Properties. To change this template file, choose + * Tools | Templates and open the template in the editor. */ package Ic2ExpReactorPlanner.components; +import java.util.HashMap; + import Ic2ExpReactorPlanner.Reactor; import gregtech.api.objects.GT_ItemStack; -import java.util.HashMap; /** - * Represents an item (component) in an IndustrialCraft2 Experimental Nuclear - * Reactor. + * Represents an item (component) in an IndustrialCraft2 Experimental Nuclear Reactor. * * @author Brian McCloud */ @@ -206,13 +205,8 @@ public class ReactorItem { protected double explosionPowerMultiplier = 1; - protected ReactorItem( - final int id, - final String baseName, - GT_ItemStack aItem, - final double maxDamage, - final double maxHeat, - String sourceMod) { + protected ReactorItem(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, + final double maxHeat, String sourceMod) { this.id = id; this.baseName = baseName; this.name = aItem.mItem.getItemStackDisplayName(aItem.toStack()); @@ -262,8 +256,7 @@ public class ReactorItem { } /** - * Checks if this component can accept heat. (e.g. from adjacent fuel rods, - * or from an exchanger) + * Checks if this component can accept heat. (e.g. from adjacent fuel rods, or from an exchanger) * * @return true if this component can accept heat, false otherwise. */ @@ -274,8 +267,7 @@ public class ReactorItem { } /** - * Determines if this component can be cooled down, such as by a component - * heat vent. + * Determines if this component can be cooled down, such as by a component heat vent. * * @return true if this component can be cooled down, false otherwise. */ @@ -284,9 +276,8 @@ public class ReactorItem { } /** - * Checks if this component acts as a neutron reflector, and boosts - * performance of adjacent fuel rods, either by being a "neutron reflector" - * item or by being a fuel rod. + * Checks if this component acts as a neutron reflector, and boosts performance of adjacent fuel rods, either by + * being a "neutron reflector" item or by being a fuel rod. * * @return true if this component reflects neutrons, false otherwise. */ @@ -309,8 +300,7 @@ public class ReactorItem { } /** - * Generate heat if appropriate for component type, and spread to reactor or - * adjacent cells. + * Generate heat if appropriate for component type, and spread to reactor or adjacent cells. * * @return the amount of heat generated by this component. */ @@ -321,8 +311,7 @@ public class ReactorItem { /** * Generate energy if appropriate for component type. * - * @return the number of EU generated by this component during the current - * reactor tick. + * @return the number of EU generated by this component during the current reactor tick. */ public double generateEnergy() { return 0.0; @@ -331,31 +320,26 @@ public class ReactorItem { /** * Dissipate (aka vent) heat if appropriate for component type. * - * @return the amount of heat successfully vented during the current reactor - * tick. + * @return the amount of heat successfully vented during the current reactor tick. */ public double dissipate() { return 0.0; } /** - * Transfer heat between component, neighbors, and/or reactor, if - * appropriate for component type. + * Transfer heat between component, neighbors, and/or reactor, if appropriate for component type. */ public void transfer() { // do nothing by default. } /** - * Adds this component to a new reactor, and applies changes to the reactor - * when adding this component if appropriate, such as for reactor plating. + * Adds this component to a new reactor, and applies changes to the reactor when adding this component if + * appropriate, such as for reactor plating. * - * @param parent - * the reactor to add this component to. - * @param row - * the row this component will be in. - * @param col - * the column this component will be in. + * @param parent the reactor to add this component to. + * @param row the row this component will be in. + * @param col the column this component will be in. */ public void addToReactor(final Reactor parent, final int row, final int col) { // call removeFromReactor first, in case it had previously been added to @@ -367,9 +351,8 @@ public class ReactorItem { } /** - * Removes this component from its reactor (if any), and applies changes to - * the reactor when removing this component if appropriate, such as for - * reactor plating. + * Removes this component from its reactor (if any), and applies changes to the reactor when removing this component + * if appropriate, such as for reactor plating. */ public void removeFromReactor() { parent = null; @@ -395,12 +378,9 @@ public class ReactorItem { /** * Adjusts the component heat up or down * - * @param heat - * the amount of heat to adjust by (positive to add heat, - * negative to remove heat). - * @return the amount of heat adjustment refused. (e.g. due to going below - * minimum heat, breaking due to excessive heat, or attempting to - * remove heat from a condensator) + * @param heat the amount of heat to adjust by (positive to add heat, negative to remove heat). + * @return the amount of heat adjustment refused. (e.g. due to going below minimum heat, breaking due to excessive + * heat, or attempting to remove heat from a condensator) */ public double adjustCurrentHeat(final double heat) { if (isHeatAcceptor()) { @@ -422,20 +402,18 @@ public class ReactorItem { } /** - * Clears the damage back to 0 (used when resetting simulation, or replacing - * the component in an automation simulation). + * Clears the damage back to 0 (used when resetting simulation, or replacing the component in an automation + * simulation). */ public final void clearDamage() { currentDamage = 0.0; } /** - * Applies damage to the component, as opposed to heat. Mainly used for fuel - * rods and neutron reflectors that lose durability as the reactor runs, but - * can't recover it via cooling. + * Applies damage to the component, as opposed to heat. Mainly used for fuel rods and neutron reflectors that lose + * durability as the reactor runs, but can't recover it via cooling. * - * @param damage - * the damage to apply (only used if positive). + * @param damage the damage to apply (only used if positive). */ public final void applyDamage(final double damage) { // maxDamage of 1 is treated as meaning the component doesn't accept @@ -448,23 +426,19 @@ public class ReactorItem { } /** - * Determines if this component is broken in the current tick of the - * simulation + * Determines if this component is broken in the current tick of the simulation * - * @return true if the component has broken either from damage (e.g. neutron - * reflectors, fuel rods) or from heat (e.g. heat vents, coolant - * cells), false otherwise. + * @return true if the component has broken either from damage (e.g. neutron reflectors, fuel rods) or from heat + * (e.g. heat vents, coolant cells), false otherwise. */ public boolean isBroken() { return currentHeat >= getMaxHeat() || currentDamage >= getMaxDamage(); } /** - * The number of fuel rods in this component (0 for non-fuel-rod - * components). + * The number of fuel rods in this component (0 for non-fuel-rod components). * - * @return The number of fuel rods in this component, or 0 if this component - * has no fuel rods. + * @return The number of fuel rods in this component, or 0 if this component has no fuel rods. */ public int getRodCount() { return 0; @@ -473,9 +447,8 @@ public class ReactorItem { /** * Gets a value added in the formula for calculating explosion power. * - * @return the additive value for explosion power caused by this component, - * or 0 if this component doesn't affect the addition part of the - * explosion calculation. + * @return the additive value for explosion power caused by this component, or 0 if this component doesn't affect + * the addition part of the explosion calculation. */ public double getExplosionPowerOffset() { if (!isBroken()) { @@ -493,18 +466,16 @@ public class ReactorItem { /** * Gets a value multiplied in the formula for calculating explosion power. * - * @return the multiplier value for explosion power caused by this - * component, or 1 if this component doesn't affect the - * multiplication part of the explosion calculation. + * @return the multiplier value for explosion power caused by this component, or 1 if this component doesn't affect + * the multiplication part of the explosion calculation. */ public double getExplosionPowerMultiplier() { return explosionPowerMultiplier; } /** - * Finds the theoretical maximum venting of this component, regardless of - * whether this venting is from itself, directly from the reactor, or from - * adjacent components. + * Finds the theoretical maximum venting of this component, regardless of whether this venting is from itself, + * directly from the reactor, or from adjacent components. * * @return the capacity of this component to vent heat. */ @@ -515,17 +486,15 @@ public class ReactorItem { /** * Finds the theoretical maximum hull cooling of this component. * - * @return the capacity of this component to remove heat from the reactor - * hull. + * @return the capacity of this component to remove heat from the reactor hull. */ public double getHullCoolingCapacity() { return 0; } /** - * Gets the current "output" of this component, presumably for writing to - * CSV data. What this "output" means may vary by component type or reactor - * type. + * Gets the current "output" of this component, presumably for writing to CSV data. What this "output" means may + * vary by component type or reactor type. * * @return the output of this component for the current reactor tick. */ @@ -534,22 +503,21 @@ public class ReactorItem { } /** - * Determines whether this component expects to produces some sort of output - * each reactor tick, e.g. for purposes of tracking in a CSV file. + * Determines whether this component expects to produces some sort of output each reactor tick, e.g. for purposes of + * tracking in a CSV file. * - * @return true if this component produces output (such as EU or vented - * heat), false otherwise. + * @return true if this component produces output (such as EU or vented heat), false otherwise. */ public boolean producesOutput() { return getVentCoolingCapacity() > 0 || getRodCount() > 0; } /** - * Determines if this component needs input from a Reactor Coolant Injector. - * Simply returns false for non-condensator items. + * Determines if this component needs input from a Reactor Coolant Injector. Simply returns false for + * non-condensator items. * - * @return true if this is a condensator that has absorbed enough heat to - * require the appropriate item added to repair it, false otherwise. + * @return true if this is a condensator that has absorbed enough heat to require the appropriate item added to + * repair it, false otherwise. */ public boolean needsCoolantInjected() { return false; diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java b/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java index bca0e9f43a..f0b16f3d14 100644 --- a/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java +++ b/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java @@ -1,7 +1,6 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * To change this license header, choose License Headers in Project Properties. To change this template file, choose + * Tools | Templates and open the template in the editor. */ package Ic2ExpReactorPlanner.components; @@ -9,19 +8,15 @@ import gregtech.api.objects.GT_ItemStack; /** * Represents a neutron reflector in a reactor. + * * @author Brian McCloud */ public class Reflector extends ReactorItem { private static String mcVersion = "1.12.2"; - public Reflector( - final int id, - final String baseName, - final GT_ItemStack aStack, - final double maxDamage, - final double maxHeat, - final String sourceMod) { + public Reflector(final int id, final String baseName, final GT_ItemStack aStack, final double maxDamage, + final double maxHeat, final String sourceMod) { super(id, baseName, aStack, maxDamage, maxHeat, sourceMod); } diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Vent.java b/src/main/java/Ic2ExpReactorPlanner/components/Vent.java index 9eb9f3aa66..e0f26416ac 100644 --- a/src/main/java/Ic2ExpReactorPlanner/components/Vent.java +++ b/src/main/java/Ic2ExpReactorPlanner/components/Vent.java @@ -1,16 +1,17 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * To change this license header, choose License Headers in Project Properties. To change this template file, choose + * Tools | Templates and open the template in the editor. */ package Ic2ExpReactorPlanner.components; -import gregtech.api.objects.GT_ItemStack; import java.util.ArrayList; import java.util.List; +import gregtech.api.objects.GT_ItemStack; + /** * Represents some kind of vent in a reactor. + * * @author Brian McCloud */ public class Vent extends ReactorItem { @@ -19,16 +20,8 @@ public class Vent extends ReactorItem { private final int hullDraw; private final int sideVent; - public Vent( - final int id, - final String baseName, - GT_ItemStack aItem, - final double maxDamage, - final double maxHeat, - final String sourceMod, - final int selfVent, - final int hullDraw, - final int sideVent) { + public Vent(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, + final String sourceMod, final int selfVent, final int hullDraw, final int sideVent) { super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); this.selfVent = selfVent; this.hullDraw = hullDraw; |