diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-01-13 00:28:02 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-01-13 00:28:02 +0000 |
commit | 3e519e890249825dc8face0087cc631684d36e8c (patch) | |
tree | 33f667dc118da284af154ffbfe9f926ff55928a8 /src/main/java/Ic2ExpReactorPlanner/components/Reflector.java | |
parent | b72a9b138fafceab899c1bd86fee64decb9fb98a (diff) | |
download | GT5-Unofficial-3e519e890249825dc8face0087cc631684d36e8c.tar.gz GT5-Unofficial-3e519e890249825dc8face0087cc631684d36e8c.tar.bz2 GT5-Unofficial-3e519e890249825dc8face0087cc631684d36e8c.zip |
Basically finished work on Reactor Simulator.
Diffstat (limited to 'src/main/java/Ic2ExpReactorPlanner/components/Reflector.java')
-rw-r--r-- | src/main/java/Ic2ExpReactorPlanner/components/Reflector.java | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java b/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java new file mode 100644 index 0000000000..465641972a --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java @@ -0,0 +1,66 @@ +/* + * 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 Ic2ExpReactorPlanner.MaterialsList; +import gregtech.api.objects.GT_ItemStack; + +import java.awt.Image; + +/** + * 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) { + super(id, baseName, aStack, maxDamage, maxHeat, sourceMod); + } + + public Reflector(final Reflector other) { + super(other); + } + + @Override + public boolean isNeutronReflector() { + return !isBroken(); + } + + @Override + public double generateHeat() { + ReactorItem component = parent.getComponentAt(row - 1, col); + if (component != null) { + applyDamage(component.getRodCount()); + } + component = parent.getComponentAt(row, col + 1); + if (component != null) { + applyDamage(component.getRodCount()); + } + component = parent.getComponentAt(row + 1, col); + if (component != null) { + applyDamage(component.getRodCount()); + } + component = parent.getComponentAt(row, col - 1); + if (component != null) { + applyDamage(component.getRodCount()); + } + return 0; + } + + @Override + public double getMaxDamage() { + if (maxDamage > 1 && "1.7.10".equals(mcVersion)) { + return maxDamage / 3; + } + return maxDamage; + } + + public static void setMcVersion(String newVersion) { + mcVersion = newVersion; + } +} |