diff options
39 files changed, 17 insertions, 5542 deletions
diff --git a/build.gradle b/build.gradle index 78ed8d44f0..3fa171e0dd 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1683563728 +//version: 1683705740 /* DO NOT CHANGE THIS FILE! Also, you may replace this file at any time if there is an update available. @@ -69,7 +69,7 @@ plugins { id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version id 'com.modrinth.minotaur' version '2.+' apply false id 'com.matthewprenger.cursegradle' version '1.4.0' apply false - id 'com.gtnewhorizons.retrofuturagradle' version '1.3.7' + id 'com.gtnewhorizons.retrofuturagradle' version '1.3.11' } print("You might want to check out './gradlew :faq' if your build fails.\n") @@ -569,9 +569,10 @@ repositories { def mixinProviderGroup = "io.github.legacymoddingmc" def mixinProviderModule = "unimixins" -def mixinProviderVersion = "0.1.6" +def mixinProviderVersion = "0.1.7.1" def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" +ext.mixinProviderSpec = mixinProviderSpec dependencies { if (usesMixins.toBoolean()) { @@ -822,6 +823,18 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask { } this.classpath(project.java17DependenciesCfg) } + + public void setup(Project project) { + super.setup(project) + if (project.usesMixins.toBoolean()) { + this.extraJvmArgs.addAll(project.provider(() -> { + def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec)) + mixinCfg.canBeConsumed = false + mixinCfg.transitive = false + enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : [] + })) + } + } } def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient") diff --git a/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java b/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java deleted file mode 100644 index 45c1f5bdf5..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java +++ /dev/null @@ -1,690 +0,0 @@ -package Ic2ExpReactorPlanner; - -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.List; - -import Ic2ExpReactorPlanner.components.ReactorItem; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube; - -/** - * - * @author Brian McCloud - */ -public class AutomationSimulator { - - private final Reactor reactor; - - private final ArrayList<String> output; - - private final GT_TileEntity_ComputerCube mReactor; - - private final boolean[][] needsCooldown = new boolean[6][9]; - - private final int initialHeat; - - private double minEUoutput = Double.MAX_VALUE; - private double maxEUoutput = 0.0; - private double minHeatOutput = Double.MAX_VALUE; - private double maxHeatOutput = 0.0; - - private final int onPulseDuration; - private final int offPulseDuration; - private final int clockPeriod; - private final int suspendTemp; - private final int resumeTemp; - private final int maxSimulationTicks; - - private boolean reachedBelow50; - private boolean reachedBurn; - private boolean reachedEvaporate; - private boolean reachedHurt; - private boolean reachedLava; - private boolean reachedExplode; - - private boolean allFuelRodsDepleted = false; - private boolean componentsIntact = true; - private boolean anyRodsDepleted = false; - - private int activeTime = 0; - private int inactiveTime = 0; - private int currentActiveTime = 0; - private int minActiveTime = Integer.MAX_VALUE; - private int maxActiveTime = 0; - private int currentInactiveTime = 0; - private int minInactiveTime = Integer.MAX_VALUE; - private int maxInactiveTime = 0; - - private double totalHullHeating = 0; - private double totalComponentHeating = 0; - private double totalHullCooling = 0; - private double totalVentCooling = 0; - - private boolean showHeatingCoolingCalled = false; - - private boolean active = true; - - private int pauseTimer = 0; - - private int redstoneUsed = 0; - - private int lapisUsed = 0; - - private boolean completed = false; - - private boolean mRunning = false; - private static final DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#,##0.##"); - - private final SimulationData data = new SimulationData(); - - public SimulationData getData() { - if (completed) { - return data; - } - return null; - } - - public AutomationSimulator(final Reactor reactor, final ArrayList<String> output2, - final GT_TileEntity_ComputerCube aTile) { - this.reactor = reactor; - this.output = output2; - this.mReactor = aTile; - this.initialHeat = (int) reactor.getCurrentHeat(); - this.onPulseDuration = reactor.getOnPulse(); - this.offPulseDuration = reactor.getOffPulse(); - this.clockPeriod = onPulseDuration + offPulseDuration; - this.suspendTemp = reactor.getSuspendTemp(); - this.resumeTemp = reactor.getResumeTemp(); - this.maxSimulationTicks = reactor.getMaxSimulationTicks(); - } - - public void process() { - - mRunning = true; - completed = false; - long startTime = System.nanoTime(); - int reactorTicks = 0; - int cooldownTicks = 0; - int totalRodCount = 0; - - publish(""); // NOI18N - publish("Simulation.Started"); - reactor.setCurrentHeat(initialHeat); - reactor.clearVentedHeat(); - double minReactorHeat = initialHeat; - double maxReactorHeat = initialHeat; - reachedBelow50 = false; - reachedBurn = initialHeat >= 0.4 * reactor.getMaxHeat(); - reachedEvaporate = initialHeat >= 0.5 * reactor.getMaxHeat(); - reachedHurt = initialHeat >= 0.7 * reactor.getMaxHeat(); - reachedLava = initialHeat >= 0.85 * reactor.getMaxHeat(); - reachedExplode = false; - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null) { - component.clearCurrentHeat(); - component.clearDamage(); - totalRodCount += component.getRodCount(); - } - publish(String.format("R%dC%d:0xC0C0C0", row, col)); // NOI18N - } - } - data.totalRodCount = totalRodCount; - double lastEUoutput = 0.0; - double totalEUoutput = 0.0; - double lastHeatOutput = 0.0; - double totalHeatOutput = 0.0; - double maxGeneratedHeat = 0.0; - double explosionPower = 10.0; - allFuelRodsDepleted = false; - componentsIntact = true; - anyRodsDepleted = false; - Logger.INFO("Reactor Current Heat: " + reactor.getCurrentHeat()); - Logger.INFO("Reactor Max Heat: " + reactor.getMaxHeat()); - Logger.INFO("Least EU Output: " + lastEUoutput); - Logger.INFO("Least Heat Output: " + lastHeatOutput); - Logger.INFO("Reactor Max Ticks: " + maxSimulationTicks); - Logger.INFO("All Fuel Depleted: " + allFuelRodsDepleted); - Logger.INFO("Running: " + isRunning()); - Logger.INFO("Stopped: " + hasStopped()); - while (reactor.getCurrentHeat() < reactor.getMaxHeat() - && (!allFuelRodsDepleted || lastEUoutput > 0 || lastHeatOutput > 0) - && reactorTicks < maxSimulationTicks - && isRunning()) { - // Logger.INFO("Reactor Tick: "+reactorTicks); - reactorTicks++; - reactor.clearEUOutput(); - reactor.clearVentedHeat(); - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null) { - component.preReactorTick(); - } - } - } - if (active) { - allFuelRodsDepleted = true; // assume rods depleted until one is - // found that isn't. - } - double generatedHeat = 0.0; - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null && !component.isBroken()) { - if (allFuelRodsDepleted && component.getRodCount() > 0) { - allFuelRodsDepleted = false; - } - if (active) { - generatedHeat += component.generateHeat(); - } - component.dissipate(); - component.transfer(); - } - } - } - maxReactorHeat = Math.max(reactor.getCurrentHeat(), maxReactorHeat); - minReactorHeat = Math.min(reactor.getCurrentHeat(), minReactorHeat); - checkReactorTemperature(reactorTicks); - maxGeneratedHeat = Math.max(generatedHeat, maxGeneratedHeat); - if (active) { - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null && !component.isBroken()) { - component.generateEnergy(); - } - } - } - } - lastEUoutput = reactor.getCurrentEUoutput(); - totalEUoutput += lastEUoutput; - lastHeatOutput = reactor.getVentedHeat(); - totalHeatOutput += lastHeatOutput; - if (reactor.getCurrentHeat() <= reactor.getMaxHeat()) { - if (reactor.isPulsed() || reactor.isAutomated()) { - if (active) { - activeTime++; - currentActiveTime++; - if (reactor.isPulsed() && (reactor.getCurrentHeat() >= suspendTemp - || (reactorTicks % clockPeriod) >= onPulseDuration)) { - active = false; - minActiveTime = Math.min(currentActiveTime, minActiveTime); - maxActiveTime = Math.max(currentActiveTime, maxActiveTime); - currentActiveTime = 0; - } - } else { - inactiveTime++; - currentInactiveTime++; - if (reactor.isAutomated() && pauseTimer > 0) { - pauseTimer--; - } else if ((reactor.isPulsed() && reactor.getCurrentHeat() <= resumeTemp - && (reactorTicks % clockPeriod) < onPulseDuration)) { - active = true; - minInactiveTime = Math.min(currentInactiveTime, minInactiveTime); - maxInactiveTime = Math.max(currentInactiveTime, maxInactiveTime); - currentInactiveTime = 0; - } - } - } - minEUoutput = Math.min(lastEUoutput, minEUoutput); - maxEUoutput = Math.max(lastEUoutput, maxEUoutput); - minHeatOutput = Math.min(lastHeatOutput, minHeatOutput); - maxHeatOutput = Math.max(lastHeatOutput, maxHeatOutput); - } - calculateHeatingCooling(reactorTicks); - handleAutomation(reactorTicks); - } - - if (hasStopped()) { - publish("Simulation.CancelledAtTick", reactorTicks); - } - data.minTemp = (int) minReactorHeat; - data.maxTemp = (int) maxReactorHeat; - publish("Simulation.ReactorMinTemp", minReactorHeat); - publish("Simulation.ReactorMaxTemp", maxReactorHeat); - if (reactor.getCurrentHeat() < reactor.getMaxHeat()) { - publish("Simulation.TimeWithoutExploding", reactorTicks); - if (reactor.isPulsed()) { - String rangeString = ""; - if (maxActiveTime > minActiveTime) { - rangeString = rangeString("Simulation.ActiveTimeRange", minActiveTime, maxActiveTime); - } else if (minActiveTime < activeTime) { - rangeString = "Simulation.ActiveTimeSingle " + minActiveTime; - } - publish("Simulation.ActiveTime", activeTime, rangeString); - rangeString = ""; - if (maxInactiveTime > minInactiveTime) { - rangeString = rangeString("Simulation.InactiveTimeRange", minInactiveTime, maxInactiveTime); - } else if (minInactiveTime < inactiveTime) { - rangeString = "Simulation.InactiveTimeSingle " + minInactiveTime; - } - publish("Simulation.InactiveTime", inactiveTime, rangeString); - } - - if (reactorTicks > 0) { - data.totalReactorTicks = reactorTicks; - if (reactor.isFluid()) { - data.totalHUoutput = (int) (40 * totalHeatOutput); - data.avgHUoutput = (int) (2 * totalHeatOutput / reactorTicks); - data.minHUoutput = 2 * minHeatOutput; - data.maxHUoutput = (int) (2 * maxHeatOutput); - if (totalHeatOutput > 0) { - publish( - "Simulation.HeatOutputs", - DECIMAL_FORMAT.format(40 * totalHeatOutput), - DECIMAL_FORMAT.format(2 * totalHeatOutput / reactorTicks), - DECIMAL_FORMAT.format(2 * minHeatOutput), - DECIMAL_FORMAT.format(2 * maxHeatOutput)); - if (totalRodCount > 0) { - publish( - "Simulation.Efficiency", - totalHeatOutput / reactorTicks / 4 / totalRodCount, - minHeatOutput / 4 / totalRodCount, - maxHeatOutput / 4 / totalRodCount); - } - } - } else { - data.totalEUoutput = (int) totalEUoutput; - data.avgEUoutput = MathUtils.roundToClosestInt(Math.ceil(totalEUoutput / (reactorTicks * 20))); - data.minEUoutput = minEUoutput / 20.0; - data.maxEUoutput = (int) (maxEUoutput / 20.0); - if (totalEUoutput > 0) { - publish( - "Simulation.EUOutputs", - DECIMAL_FORMAT.format(totalEUoutput), - DECIMAL_FORMAT.format(totalEUoutput / (reactorTicks * 20)), - DECIMAL_FORMAT.format(minEUoutput / 20.0), - DECIMAL_FORMAT.format(maxEUoutput / 20.0)); - if (totalRodCount > 0) { - publish( - "Simulation.Efficiency", - totalEUoutput / reactorTicks / 100 / totalRodCount, - minEUoutput / 100 / totalRodCount, - maxEUoutput / 100 / totalRodCount); - } - } - } - } - - if (reactor.getCurrentHeat() > 0.0) { - publish("Simulation.ReactorRemainingHeat", reactor.getCurrentHeat()); - } - double prevReactorHeat = reactor.getCurrentHeat(); - double prevTotalComponentHeat = 0.0; - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null && !component.isBroken()) { - if (component.getCurrentHeat() > 0.0) { - prevTotalComponentHeat += component.getCurrentHeat(); - publish(String.format("R%dC%d:0xFFA500", row, col)); // NOI18N - component.info.append("ComponentInfo.RemainingHeat " + component.getCurrentHeat()); - } - } - } - } - if (prevReactorHeat == 0.0 && prevTotalComponentHeat == 0.0) { - publish("Simulation.NoCooldown"); - } else if (reactor.getCurrentHeat() < reactor.getMaxHeat()) { - double currentTotalComponentHeat = prevTotalComponentHeat; - int reactorCooldownTime = 0; - do { - reactor.clearVentedHeat(); - prevReactorHeat = reactor.getCurrentHeat(); - if (prevReactorHeat == 0.0) { - reactorCooldownTime = cooldownTicks; - } - prevTotalComponentHeat = currentTotalComponentHeat; - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null && !component.isBroken()) { - component.dissipate(); - component.transfer(); - } - } - } - lastHeatOutput = reactor.getVentedHeat(); - totalHeatOutput += lastHeatOutput; - minEUoutput = Math.min(lastEUoutput, minEUoutput); - maxEUoutput = Math.max(lastEUoutput, maxEUoutput); - minHeatOutput = Math.min(lastHeatOutput, minHeatOutput); - maxHeatOutput = Math.max(lastHeatOutput, maxHeatOutput); - cooldownTicks++; - currentTotalComponentHeat = 0.0; - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null && !component.isBroken()) { - currentTotalComponentHeat += component.getCurrentHeat(); - if (component.getCurrentHeat() == 0.0 && needsCooldown[row][col]) { - component.info.append("ComponentInfo.CooldownTime " + cooldownTicks); - needsCooldown[row][col] = false; - } - } - } - } - } while (lastHeatOutput > 0 && cooldownTicks < 50000); - if (reactor.getCurrentHeat() < reactor.getMaxHeat()) { - if (reactor.getCurrentHeat() == 0.0) { - publish("Simulation.ReactorCooldownTime", reactorCooldownTime); - } else if (reactorCooldownTime > 0) { - publish("Simulation.ReactorResidualHeat", reactor.getCurrentHeat(), reactorCooldownTime); - } - publish("Simulation.TotalCooldownTime", cooldownTicks); - } - } - } else { - publish("Simulation.ReactorOverheatedTime", reactorTicks); - explosionPower = 10.0; - double explosionPowerMult = 1.0; - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null) { - explosionPower += component.getExplosionPowerOffset(); - explosionPowerMult *= component.getExplosionPowerMultiplier(); - } - } - } - explosionPower *= explosionPowerMult; - publish("Simulation.ExplosionPower", explosionPower); - } - double totalEffectiveVentCooling = 0.0; - double totalVentCoolingCapacity = 0.0; - double totalCellCooling = 0.0; - double totalCondensatorCooling = 0.0; - - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null) { - if (component.getVentCoolingCapacity() > 0) { - component.info.append( - "ComponentInfo.UsedCooling " + component.getBestVentCooling() - + " | " - + component.getVentCoolingCapacity()); - totalEffectiveVentCooling += component.getBestVentCooling(); - totalVentCoolingCapacity += component.getVentCoolingCapacity(); - } else if (component.getBestCellCooling() > 0) { - component.info.append("ComponentInfo.ReceivedHeat " + component.getBestCellCooling()); - totalCellCooling += component.getBestCellCooling(); - } else if (component.getBestCondensatorCooling() > 0) { - component.info.append("ComponentInfo.ReceivedHeat " + component.getBestCondensatorCooling()); - totalCondensatorCooling += component.getBestCondensatorCooling(); - } else if (component.getMaxHeatGenerated() > 0) { - if (!reactor.isFluid() && component.getMaxEUGenerated() > 0) { - component.info.append( - "ComponentInfo.GeneratedEU " + component.getMinEUGenerated() - + " | " - + component.getMaxEUGenerated()); - } - component.info.append( - "ComponentInfo.GeneratedHeat " + component.getMinHeatGenerated() - + " | " - + component.getMaxHeatGenerated()); - } - if (component.getMaxReachedHeat() > 0) { - component.info.append( - "ComponentInfo.ReachedHeat " + component.getMaxReachedHeat() - + " | " - + component.getMaxHeat()); - } - } - } - } - - // if (totalVentCoolingCapacity > 0) { - // publish("Simulation.TotalVentCooling", - // totalEffectiveVentCooling, totalVentCoolingCapacity); - // } - showHeatingCooling(reactorTicks); // Call to show this info in case it - // hasn't already been shown, such - // as for an automated reactor. - if (totalCellCooling > 0) { - publish("Simulation.TotalCellCooling", totalCellCooling); - } - if (totalCondensatorCooling > 0) { - publish("Simulation.TotalCondensatorCooling", totalCondensatorCooling); - } - if (maxGeneratedHeat > 0) { - publish("Simulation.MaxHeatGenerated", maxGeneratedHeat); - } - if (redstoneUsed > 0) { - publish("Simulation.RedstoneUsed", redstoneUsed); - } - if (lapisUsed > 0) { - publish("Simulation.LapisUsed", lapisUsed); - } - // double totalCooling = totalEffectiveVentCooling + totalCellCooling + - // totalCondensatorCooling; - // if (totalCooling >= maxGeneratedHeat) { - // publish("Simulation.ExcessCooling", totalCooling - - // maxGeneratedHeat); - // } else { - // publish("Simulation.ExcessHeating", maxGeneratedHeat - - // totalCooling); - // } - // return null; - - /* - * catch (Throwable e) { if (cooldownTicks == 0) { publish("Simulation.ErrorReactor", reactorTicks); } else { - * publish("Simulation.ErrorCooldown", cooldownTicks); } publish(e.toString(), " ", - * Arrays.toString(e.getStackTrace()); // NO18N } - */ - data.explosionPower = (int) explosionPower; - data.totalReactorTicks = reactorTicks; - long endTime = System.nanoTime(); - publish("Simulation.ElapsedTime", (endTime - startTime) / 1e9); - mRunning = false; - completed = true; - } - - public boolean hasStopped() { - return !mRunning; - } - - public boolean isRunning() { - return mRunning; - } - - private void handleAutomation(final int reactorTicks) { - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null && reactor.isAutomated()) { - if (component.getMaxHeat() > 1) { - if (component.getAutomationThreshold() > component.getInitialHeat() - && component.getCurrentHeat() >= component.getAutomationThreshold()) { - component.clearCurrentHeat(); - component.info.append("ComponentInfo.ReplacedTime | " + reactorTicks); - if (component.getReactorPause() > 0) { - active = false; - pauseTimer = Math.max(pauseTimer, component.getReactorPause()); - minActiveTime = Math.min(currentActiveTime, minActiveTime); - maxActiveTime = Math.max(currentActiveTime, maxActiveTime); - currentActiveTime = 0; - } - } else if (component.getAutomationThreshold() < component.getInitialHeat() - && component.getCurrentHeat() <= component.getAutomationThreshold()) { - component.clearCurrentHeat(); - component.info.append("ComponentInfo.ReplacedTime | " + reactorTicks); - if (component.getReactorPause() > 0) { - active = false; - pauseTimer = Math.max(pauseTimer, component.getReactorPause()); - minActiveTime = Math.min(currentActiveTime, minActiveTime); - maxActiveTime = Math.max(currentActiveTime, maxActiveTime); - currentActiveTime = 0; - } - } - } else if (component.isBroken() || (component.getMaxDamage() > 1 - && component.getCurrentDamage() >= component.getAutomationThreshold())) { - component.clearDamage(); - component.info.append("ComponentInfo.ReplacedTime | " + reactorTicks); - if (component.getReactorPause() > 0) { - active = false; - pauseTimer = Math.max(pauseTimer, component.getReactorPause()); - minActiveTime = Math.min(currentActiveTime, minActiveTime); - maxActiveTime = Math.max(currentActiveTime, maxActiveTime); - currentActiveTime = 0; - } - } - } - if (reactor.isUsingReactorCoolantInjectors() && component != null && component.needsCoolantInjected()) { - component.injectCoolant(); - if ("rshCondensator".equals(component.baseName)) { - redstoneUsed++; - } else if ("lzhCondensator".equals(component.baseName)) { - lapisUsed++; - } - } - } - } - } - - private void checkReactorTemperature(final int reactorTicks) { - if (reactor.getCurrentHeat() < 0.5 * reactor.getMaxHeat() && !reachedBelow50 && reachedEvaporate) { - publish("Simulation.TimeToBelow50", reactorTicks); - reachedBelow50 = true; - data.timeToBelow50 = reactorTicks; - } - if (reactor.getCurrentHeat() >= 0.4 * reactor.getMaxHeat() && !reachedBurn) { - publish("Simulation.TimeToBurn", reactorTicks); - reachedBurn = true; - data.timeToBurn = reactorTicks; - } - if (reactor.getCurrentHeat() >= 0.5 * reactor.getMaxHeat() && !reachedEvaporate) { - publish("Simulation.TimeToEvaporate", reactorTicks); - reachedEvaporate = true; - data.timeToEvaporate = reactorTicks; - } - if (reactor.getCurrentHeat() >= 0.7 * reactor.getMaxHeat() && !reachedHurt) { - publish("Simulation.TimeToHurt", reactorTicks); - reachedHurt = true; - data.timeToHurt = reactorTicks; - } - if (reactor.getCurrentHeat() >= 0.85 * reactor.getMaxHeat() && !reachedLava) { - publish("Simulation.TimeToLava", reactorTicks); - reachedLava = true; - data.timeToLava = reactorTicks; - } - if (reactor.getCurrentHeat() >= reactor.getMaxHeat() && !reachedExplode) { - publish("Simulation.TimeToXplode", reactorTicks); - reachedExplode = true; - data.timeToXplode = reactorTicks; - } - } - - private void calculateHeatingCooling(final int reactorTicks) { - if (reactorTicks > 20) { - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null) { - totalHullHeating += component.getCurrentHullHeating(); - totalComponentHeating += component.getCurrentComponentHeating(); - totalHullCooling += component.getCurrentHullCooling(); - totalVentCooling += component.getCurrentVentCooling(); - } - } - } - } - } - - private void showHeatingCooling(final int reactorTicks) { - if (!showHeatingCoolingCalled) { - showHeatingCoolingCalled = true; - if (reactorTicks >= 40) { - double totalHullCoolingCapacity = 0; - double totalVentCoolingCapacity = 0; - for (int row = 0; row < 6; row++) { - for (int col = 0; col < 9; col++) { - ReactorItem component = reactor.getComponentAt(row, col); - if (component != null) { - totalHullCoolingCapacity += component.getHullCoolingCapacity(); - totalVentCoolingCapacity += component.getVentCoolingCapacity(); - } - } - } - data.hullHeating = totalHullHeating / (reactorTicks - 20); - data.componentHeating = totalComponentHeating / (reactorTicks - 20); - data.hullCooling = totalHullCooling / (reactorTicks - 20); - data.hullCoolingCapacity = totalHullCoolingCapacity; - data.ventCooling = totalVentCooling / (reactorTicks - 20); - data.ventCoolingCapacity = totalVentCoolingCapacity; - if (totalHullHeating > 0) { - publish("Simulation.HullHeating", totalHullHeating / (reactorTicks - 20)); - } - if (totalComponentHeating > 0) { - publish("Simulation.ComponentHeating", totalComponentHeating / (reactorTicks - 20)); - } - if (totalHullCoolingCapacity > 0) { - publish( - "Simulation.HullCooling | " + totalHullCooling / (reactorTicks - 20), - totalHullCoolingCapacity); - } - if (totalVentCoolingCapacity > 0) { - publish( - "Simulation.VentCooling | " + totalVentCooling / (reactorTicks - 20), - totalVentCoolingCapacity); - } - } - } - } - - private void publish(String string, double currentHeat, int reactorCooldownTime) { - publish(string + " | " + currentHeat + " | " + reactorCooldownTime); - } - - private void publish(String string, double d, double e, double f) { - publish(string + " | " + d + " | " + e + " | " + f); - } - - private void publish(String string, String format, String format2, String format3, String format4) { - publish(string + " | " + format + " | " + format2 + " | " + format3 + " | " + format4); - } - - private void publish(String string, int activeTime2, String rangeString) { - publish(string + " | " + activeTime2 + " | " + rangeString); - } - - private void publish(String aString, double aData) { - publish(aString + ":" + aData); - } - - private void publish(String aString, long aData) { - publish(aString + ":" + aData); - } - - private void publish(String aString) { - output.add(aString); - } - - private String rangeString(String string, int aMin, int aMax) { - return string + " (" + aMin + "-" + aMax + ")"; - } - - protected void process(List<String> chunks) { - /* - * for (String chunk : chunks) { if (chunk.isEmpty()) { output.add(""); // NO18N } else { if - * (chunk.matches("R\\dC\\d:.*")) { // NO18N String temp = chunk.substring(5); int row = chunk.charAt(1) - '0'; - * int col = chunk.charAt(3) - '0'; if (temp.startsWith("0x")) { // NO18N - * mReactorComponents[row][col].setBackground(Color.decode(temp)); if ("0xC0C0C0".equals(temp)) { - * mReactorComponents[row][col].setToolTipText(null); } else if ("0xFF0000".equals(temp)) { - * mReactorComponents[row][col].setToolTipText(getI18n("ComponentTooltip.Broken")); } else if - * ("0xFFA500".equals(temp)) { - * mReactorComponents[row][col].setToolTipText(getI18n("ComponentTooltip.ResidualHeat")); } } } else { - * output.add(chunk); } } } - */ - } - - public void cancel() { - Logger.INFO("Stopping Simulation."); - mRunning = false; - completed = true; - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java b/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java deleted file mode 100644 index 9a43ca0056..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java +++ /dev/null @@ -1,836 +0,0 @@ -/* - * 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; - -import static gregtech.api.enums.Mods.BartWorks; -import static gregtech.api.enums.Mods.GoodGenerator; - -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -import com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems; - -import Ic2ExpReactorPlanner.components.Condensator; -import Ic2ExpReactorPlanner.components.CoolantCell; -import Ic2ExpReactorPlanner.components.Exchanger; -import Ic2ExpReactorPlanner.components.FuelRod; -import Ic2ExpReactorPlanner.components.Plating; -import Ic2ExpReactorPlanner.components.ReactorItem; -import Ic2ExpReactorPlanner.components.Reflector; -import Ic2ExpReactorPlanner.components.Vent; -import gregtech.api.enums.ItemList; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_ModHandler; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.xmod.goodgenerator.GG_Utils; -import gtPlusPlus.xmod.goodgenerator.GG_Utils.GG_Fuel_Rod; - -/** - * Factory class to handle creating components by id or name. - * - * @author Brian McCloud - */ -public class ComponentFactory { - - public static int MAX_COMPONENT_ID = 64; - - static ItemList[] aGtItems = new ItemList[] { ItemList.Neutron_Reflector, ItemList.Moxcell_1, ItemList.Moxcell_2, - ItemList.Moxcell_4 }; - - private ComponentFactory() { - // do nothing, this class should not be instantiated. - } - - private static LinkedHashMap<Integer, ReactorItem> ITEM_LIST = new LinkedHashMap<Integer, ReactorItem>(); - - static { - int aID = 0; - ITEM_LIST.put(aID++, null); - ITEM_LIST.put( - aID++, - new FuelRod( - 1, - "fuelRodUranium", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumSimple", 1).copy()), - 20e3, - 1, - null, - 100, - 2, - 1, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 2, - "dualFuelRodUranium", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumDual", 1).copy()), - 20e3, - 1, - null, - 200, - 4, - 2, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 3, - "quadFuelRodUranium", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorUraniumQuad", 1).copy()), - 20e3, - 1, - null, - 400, - 8, - 4, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 4, - "fuelRodMox", - new GT_ItemStack(aGtItems[1].get(1).copy()), - 10e3, - 1, - null, - 100, - 2, - 1, - true)); - ITEM_LIST.put( - aID++, - new FuelRod( - 5, - "dualFuelRodMox", - new GT_ItemStack(aGtItems[2].get(1).copy()), - 10e3, - 1, - null, - 200, - 4, - 2, - true)); - ITEM_LIST.put( - aID++, - new FuelRod( - 6, - "quadFuelRodMox", - new GT_ItemStack(aGtItems[3].get(1).copy()), - 10e3, - 1, - null, - 400, - 8, - 4, - true)); - ITEM_LIST.put( - aID++, - new Reflector( - 7, - "neutronReflector", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorReflector", 1).copy()), - 30e3, - 1, - null)); - ITEM_LIST.put( - aID++, - new Reflector( - 8, - "thickNeutronReflector", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorReflectorThick", 1).copy()), - 120e3, - 1, - null)); - ITEM_LIST.put( - aID++, - new Vent( - 9, - "heatVent", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVent", 1).copy()), - 1, - 1000, - null, - 6, - 0, - 0)); - ITEM_LIST.put( - aID++, - new Vent( - 10, - "advancedHeatVent", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentDiamond", 1).copy()), - 1, - 1000, - null, - 12, - 0, - 0)); - ITEM_LIST.put( - aID++, - new Vent( - 11, - "reactorHeatVent", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentCore", 1).copy()), - 1, - 1000, - null, - 5, - 5, - 0)); - ITEM_LIST.put( - aID++, - new Vent( - 12, - "componentHeatVent", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentSpread", 1).copy()), - 1, - 1, - null, - 0, - 0, - 4)); - ITEM_LIST.put( - aID++, - new Vent( - 13, - "overclockedHeatVent", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorVentGold", 1).copy()), - 1, - 1000, - null, - 20, - 36, - 0)); - ITEM_LIST.put( - aID++, - new CoolantCell( - 14, - "coolantCell10k", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCoolantSimple", 1).copy()), - 1, - 10e3, - null)); - ITEM_LIST.put( - aID++, - new CoolantCell( - 15, - "coolantCell30k", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCoolantTriple", 1).copy()), - 1, - 30e3, - null)); - ITEM_LIST.put( - aID++, - new CoolantCell( - 16, - "coolantCell60k", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCoolantSix", 1).copy()), - 1, - 60e3, - null)); - ITEM_LIST.put( - aID++, - new Exchanger( - 17, - "heatExchanger", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitch", 1).copy()), - 1, - 2500, - null, - 12, - 4)); - ITEM_LIST.put( - aID++, - new Exchanger( - 18, - "advancedHeatExchanger", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchDiamond", 1).copy()), - 1, - 10e3, - null, - 24, - 8)); - ITEM_LIST.put( - aID++, - new Exchanger( - 19, - "coreHeatExchanger", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchCore", 1).copy()), - 1, - 5000, - null, - 0, - 72)); - ITEM_LIST.put( - aID++, - new Exchanger( - 20, - "componentHeatExchanger", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorHeatSwitchSpread", 1).copy()), - 1, - 5000, - null, - 36, - 0)); - ITEM_LIST.put( - aID++, - new Plating( - 21, - "reactorPlating", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorPlating", 1).copy()), - 1, - 1, - null, - 1000, - 0.9025)); - ITEM_LIST.put( - aID++, - new Plating( - 22, - "heatCapacityReactorPlating", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorPlatingHeat", 1).copy()), - 1, - 1, - null, - 1700, - 0.9801)); - ITEM_LIST.put( - aID++, - new Plating( - 23, - "containmentReactorPlating", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorPlatingExplosive", 1).copy()), - 1, - 1, - null, - 500, - 0.81)); - ITEM_LIST.put( - aID++, - new Condensator( - 24, - "rshCondensator", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCondensator", 1).copy()), - 1, - 20e3, - null)); - ITEM_LIST.put( - aID++, - new Condensator( - 25, - "lzhCondensator", - new GT_ItemStack(GT_ModHandler.getIC2Item("reactorCondensatorLap", 1).copy()), - 1, - 100e3, - null)); - ITEM_LIST.put( - aID++, - new FuelRod( - 26, - "fuelRodThorium", - new GT_ItemStack(ItemList.ThoriumCell_1.get(1).copy()), - 50e3, - 1, - "GregTech", - 20, - 0.5, - 1, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 27, - "dualFuelRodThorium", - new GT_ItemStack(ItemList.ThoriumCell_2.get(1).copy()), - 50e3, - 1, - "GregTech", - 40, - 1, - 2, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 28, - "quadFuelRodThorium", - new GT_ItemStack(ItemList.ThoriumCell_4.get(1).copy()), - 50e3, - 1, - "GregTech", - 80, - 2, - 4, - false)); - ITEM_LIST.put( - aID++, - new CoolantCell( - 29, - "coolantCellHelium60k", - new GT_ItemStack(ItemList.Reactor_Coolant_He_1.get(1).copy()), - 1, - 60e3, - "GregTech")); - ITEM_LIST.put( - aID++, - new CoolantCell( - 30, - "coolantCellHelium180k", - new GT_ItemStack(ItemList.Reactor_Coolant_He_3.get(1).copy()), - 1, - 180e3, - "GregTech")); - ITEM_LIST.put( - aID++, - new CoolantCell( - 31, - "coolantCellHelium360k", - new GT_ItemStack(ItemList.Reactor_Coolant_He_6.get(1).copy()), - 1, - 360e3, - "GregTech")); - ITEM_LIST.put( - aID++, - new CoolantCell( - 32, - "coolantCellNak60k", - new GT_ItemStack(ItemList.Reactor_Coolant_NaK_1.get(1).copy()), - 1, - 60e3, - "GregTech")); - ITEM_LIST.put( - aID++, - new CoolantCell( - 33, - "coolantCellNak180k", - new GT_ItemStack(ItemList.Reactor_Coolant_NaK_3.get(1).copy()), - 1, - 180e3, - "GregTech")); - ITEM_LIST.put( - aID++, - new CoolantCell( - 34, - "coolantCellNak360k", - new GT_ItemStack(ItemList.Reactor_Coolant_NaK_3.get(1).copy()), - 1, - 360e3, - "GregTech")); - ITEM_LIST.put( - aID++, - new Reflector( - 35, - "iridiumNeutronReflector", - new GT_ItemStack(ItemList.Neutron_Reflector.get(1).copy()), - 1, - 1, - null)); - ITEM_LIST.put( - aID++, - new FuelRod( - 36, - "fuelRodNaquadah", - new GT_ItemStack(ItemList.NaquadahCell_1.get(1).copy()), - 100e3, - 1, - "GregTech", - 100, - 2, - 1, - true)); - ITEM_LIST.put( - aID++, - new FuelRod( - 37, - "dualFuelRodNaquadah", - new GT_ItemStack(ItemList.NaquadahCell_2.get(1).copy()), - 100e3, - 1, - "GregTech", - 200, - 4, - 2, - true)); - ITEM_LIST.put( - aID++, - new FuelRod( - 38, - "quadFuelRodNaquadah", - new GT_ItemStack(ItemList.NaquadahCell_4.get(1).copy()), - 100e3, - 1, - "GregTech", - 400, - 8, - 4, - true)); - - // aID = 39; - // ITEM_LIST.put(aID++, new FuelRod(39, "fuelRodCoaxium", null, 20e3, 1, "Coaxium", 100, 0, 1, false)); - // ITEM_LIST.put(aID++, new FuelRod(40, "dualFuelRodCoaxium", null, 20e3, 1, "Coaxium", 200, 0, 2, false)); - // ITEM_LIST.put(aID++, new FuelRod(41, "quadFuelRodCoaxium", null, 20e3, 1, "Coaxium", 400, 0, 4, false)); - // ITEM_LIST.put(aID++, new FuelRod(42, "fuelRodCesium", null, 10861, 1, "Coaxium", 200, 1, 1, false)); - // ITEM_LIST.put(aID++, new FuelRod(43, "dualFuelRodCesium", null, 10861, 1, "Coaxium", 400, 6, 2, false)); - // ITEM_LIST.put(aID++, new FuelRod(44, "quadFuelRodCesium", null, 10861, 1, "Coaxium", 800, 24, 4, false)); - - aID = 45; - ITEM_LIST.put( - aID++, - new FuelRod( - 45, - "fuelRodNaquadahGTNH", - new GT_ItemStack(ItemList.NaquadahCell_1.get(1).copy()), - 100e3, - 1, - "GTNH", - 100, - 2, - 1, - false)); // Naq rods are not MOX-like in GTNH, - ITEM_LIST.put( - aID++, - new FuelRod( - 46, - "dualFuelRodNaquadahGTNH", - new GT_ItemStack(ItemList.NaquadahCell_2.get(1).copy()), - 100e3, - 1, - "GTNH", - 200, - 4, - 2, - false)); // we have naquadria for that - ITEM_LIST.put( - aID++, - new FuelRod( - 47, - "quadFuelRodNaquadahGTNH", - new GT_ItemStack(ItemList.NaquadahCell_4.get(1).copy()), - 100e3, - 1, - "GTNH", - 400, - 8, - 4, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 48, - "fuelRodNaquadria", - new GT_ItemStack(ItemList.MNqCell_1.get(1).copy()), - 100e3, - 1, - "GTNH", - 100, - 2, - 1, - true)); - ITEM_LIST.put( - aID++, - new FuelRod( - 49, - "dualFuelRodNaquadria", - new GT_ItemStack(ItemList.MNqCell_2.get(1).copy()), - 100e3, - 1, - "GTNH", - 200, - 4, - 2, - true)); - ITEM_LIST.put( - aID++, - new FuelRod( - 50, - "quadFuelRodNaquadria", - new GT_ItemStack(ItemList.MNqCell_4.get(1).copy()), - 100e3, - 1, - "GTNH", - 400, - 8, - 4, - true)); - - aID = 51; - if (BartWorks.isModLoaded()) { - ITEM_LIST.put( - aID++, - new FuelRod( - 51, - "fuelRodTiberium", - new GT_ItemStack(BW_NonMeta_MaterialItems.TiberiumCell_1.get(1)), - 50e3, - 1, - BartWorks.ID, - 100, - 1, - 1, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 52, - "dualFuelRodTiberium", - new GT_ItemStack(BW_NonMeta_MaterialItems.TiberiumCell_2.get(1)), - 50e3, - 1, - BartWorks.ID, - 200, - 2, - 2, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 53, - "quadFuelRodTiberium", - new GT_ItemStack(BW_NonMeta_MaterialItems.TiberiumCell_4.get(1)), - 50e3, - 1, - BartWorks.ID, - 400, - 4, - 4, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 54, - "fuelRodTheCore", - new GT_ItemStack(BW_NonMeta_MaterialItems.TheCoreCell.get(1)), - 100e3, - 1, - BartWorks.ID, - 72534, - 816, - 32, - false)); - } - - aID = 55; - ITEM_LIST.put( - aID++, - new CoolantCell( - 55, - "coolantCellSpace180k", - new GT_ItemStack(ItemList.Reactor_Coolant_Sp_1.get(1).copy()), - 1, - 180e3, - "GTNH")); - ITEM_LIST.put( - aID++, - new CoolantCell( - 56, - "coolantCellSpace360k", - new GT_ItemStack(ItemList.Reactor_Coolant_Sp_2.get(1).copy()), - 1, - 360e3, - "GTNH")); - ITEM_LIST.put( - aID++, - new CoolantCell( - 57, - "coolantCellSpace540k", - new GT_ItemStack(ItemList.Reactor_Coolant_Sp_3.get(1).copy()), - 1, - 540e3, - "GTNH")); - ITEM_LIST.put( - aID++, - new CoolantCell( - 58, - "coolantCellSpace1080k", - new GT_ItemStack(ItemList.Reactor_Coolant_Sp_6.get(1).copy()), - 1, - 1080e3, - "GTNH")); - - aID = 59; - if (GoodGenerator.isModLoaded()) { - ITEM_LIST.put( - aID++, - new FuelRod( - 59, - "fuelRodCompressedUranium", - new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium, 1)), - 50e3, - 1, - GoodGenerator.ID, - 100, - 1, - 1, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 60, - "fuelRodDoubleCompressedUranium", - new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_2, 1)), - 50e3, - 1, - GoodGenerator.ID, - 100, - 1, - 2, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 61, - "fuelRodQuadCompressedUranium", - new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_4, 1)), - 50e3, - 1, - GoodGenerator.ID, - 100, - 1, - 4, - false)); - ITEM_LIST.put( - aID++, - new FuelRod( - 62, - "fuelRodCompressedPlutonium", - new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium, 1)), - 50e3, - 1, - GoodGenerator.ID, - 50, - 1, - 1, - true)); - ITEM_LIST.put( - aID++, - new FuelRod( - 63, - "fuelRodDoubleCompressedPlutonium", - new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_2, 1)), - 50e3, - 1, - GoodGenerator.ID, - 50, - 1, - 2, - true)); - ITEM_LIST.put( - aID++, - new FuelRod( - 64, - "fuelRodQuadCompressedPlutonium", - new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_4, 1)), - 50e3, - 1, - GoodGenerator.ID, - 50, - 1, - 4, - true)); - } - } - - private static final Map<String, ReactorItem> ITEM_MAP = makeItemMap(); - - private static Map<String, ReactorItem> makeItemMap() { - Map<String, ReactorItem> result = new HashMap<>((int) (ITEM_LIST.size() * 1.5)); - for (ReactorItem reactorItem : ITEM_LIST.values()) { - if (reactorItem != null) { - result.put(reactorItem.baseName, reactorItem); - } - } - return Collections.unmodifiableMap(result); - } - - private static ReactorItem copy(ReactorItem source) { - if (source != null) { - Class<? extends ReactorItem> aClass = source.getClass(); - if (aClass == Condensator.class) { - return new Condensator((Condensator) source); - } else if (aClass == CoolantCell.class) { - return new CoolantCell((CoolantCell) source); - } else if (aClass == Exchanger.class) { - return new Exchanger((Exchanger) source); - } else if (aClass == FuelRod.class) { - return new FuelRod((FuelRod) source); - } else if (aClass == Plating.class) { - return new Plating((Plating) source); - } else if (aClass == Reflector.class) { - return new Reflector((Reflector) source); - } else if (aClass == Vent.class) { - return new Vent((Vent) source); - } - } - return null; - } - - /** - * Gets a default instances of the specified component (such as for drawing button images) - * - * @param id the id of the component. - * @return the component with the specified id, or null if the id is out of range. - */ - public static ReactorItem getDefaultComponent(int id) { - ReactorItem aItem = ITEM_LIST.get(id); - if (aItem != null) { - return aItem; - } - Logger.INFO("Tried to get default component with ID " + id + ". This is invalid."); - return null; - } - - /** - * Gets a default instances of the specified component (such as for drawing button images) - * - * @param name the name of the component. - * @return the component with the specified name, or null if the name is not found. - */ - public static ReactorItem getDefaultComponent(String name) { - if (name != null) { - return ITEM_MAP.get(name); - } - return null; - } - - /** - * Creates a new instance of the specified component. - * - * @param id the id of the component to create. - * @return a new instance of the specified component, or null if the id is out of range. - */ - public static ReactorItem createComponent(int id) { - ReactorItem aItem = ITEM_LIST.get(id); - if (aItem != null) { - return copy(aItem); - } - Logger.INFO("Tried to create component with ID " + id + ". This is invalid."); - return null; - } - - /** - * Creates a new instance of the specified component. - * - * @param name the name of the component to create. - * @return a new instance of the specified component, or null if the name is not found. - */ - public static ReactorItem createComponent(String name) { - if (name != null) { - return copy(ITEM_MAP.get(name)); - } - return null; - } - - /** - * Get the number of defined components. - * - * @return the number of defined components. - */ - public static int getComponentCount() { - return ITEM_LIST.size(); - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/Reactor.java b/src/main/java/Ic2ExpReactorPlanner/Reactor.java deleted file mode 100644 index 08de840b8c..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/Reactor.java +++ /dev/null @@ -1,776 +0,0 @@ -/* - * 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; - -import java.awt.*; -import java.util.ArrayList; - -import Ic2ExpReactorPlanner.components.ReactorItem; - -/** - * Represents an IndustrialCraft2 Nuclear Reactor. - * - * @author Brian McCloud - */ -public class Reactor { - - private final ReactorItem[][] grid = new ReactorItem[6][9]; - - private double currentEUoutput = 0.0; - - private double currentHeat = 0.0; - - private double maxHeat = 10000.0; - - private double ventedHeat = 0.0; - - private boolean fluid = false; - - private boolean pulsed = false; - - private boolean automated = false; - - private boolean usingReactorCoolantInjectors = false; - - private static final int DEFAULT_ON_PULSE = (int) 5e6; - - private int onPulse = DEFAULT_ON_PULSE; - - private static final int DEFAULT_OFF_PULSE = 0; - - private int offPulse = DEFAULT_OFF_PULSE; - - private static final int DEFAULT_SUSPEND_TEMP = (int) 120e3; - - private int suspendTemp = DEFAULT_SUSPEND_TEMP; - - private static final int DEFAULT_RESUME_TEMP = (int) 120e3; - - private int resumeTemp = DEFAULT_RESUME_TEMP; - - private int maxSimulationTicks = (int) 5e6; - - // maximum paramatter types for a reactor component (current initial heat, automation threshold, reactor pause - private static final int MAX_PARAM_TYPES = 3; - - public static final int MAX_COMPONENT_HEAT = 1_080_000; - - public ReactorItem getComponentAt(final int row, final int column) { - if (row >= 0 && row < grid.length && column >= 0 && column < grid[row].length) { - return grid[row][column]; - } - return null; - } - - public void setComponentAt(final int row, final int column, final ReactorItem component) { - if (row >= 0 && row < grid.length && column >= 0 && column < grid[row].length) { - if (grid[row][column] != null) { - grid[row][column].removeFromReactor(); - } - grid[row][column] = component; - if (component != null) { - component.addToReactor(this, row, column); - } - } - } - - public void clearGrid() { - for (int row = 0; row < grid.length; row++) { - for (int col = 0; col < grid[row].length; col++) { - setComponentAt(row, col, null); - } - } - } - - /** - * @return the amount of EU output in the reactor tick just simulated. - */ - public double getCurrentEUoutput() { - return currentEUoutput; - } - - /** - * @return the current heat level of the reactor. - */ - public double getCurrentHeat() { - return currentHeat; - } - - /** - * @return the maximum heat of the reactor. - */ - public double getMaxHeat() { - return maxHeat; - } - - /** - * Adjust the maximum heat - * - * @param adjustment the adjustment amount (negative values decrease the max heat). - */ - public void adjustMaxHeat(final double adjustment) { - maxHeat += adjustment; - } - - /** - * Set the current heat of the reactor. Mainly to be used for simulating a pre-heated reactor, or for resetting to 0 - * for a new simulation. - * - * @param currentHeat the heat to set - */ - public void setCurrentHeat(final double currentHeat) { - this.currentHeat = currentHeat; - } - - /** - * Adjusts the reactor's current heat by a specified amount - * - * @param adjustment the adjustment amount. - */ - public void adjustCurrentHeat(final double adjustment) { - currentHeat += adjustment; - if (currentHeat < 0.0) { - currentHeat = 0.0; - } - } - - /** - * add some EU output. - * - * @param amount the amount of EU to output over 1 reactor tick (20 game ticks). - */ - public void addEUOutput(final double amount) { - currentEUoutput += amount; - } - - /** - * clears the EU output (presumably to start simulating a new reactor tick). - */ - public void clearEUOutput() { - currentEUoutput = 0.0; - } - - /** - * Gets a list of the materials needed to build the components. - * - * @return a list of the materials needed to build the components. - */ - public ArrayList getMaterials() { - return new ArrayList(); - } - - public ArrayList<ReactorItem> getComponentList() { - ArrayList<ReactorItem> result = new ArrayList<ReactorItem>(); - for (int col = 0; col < grid[0].length; col++) { - for (int row = 0; row < grid.length; row++) { - if (getComponentAt(row, col) != null) { - result.add(getComponentAt(row, col)); - } - } - } - return result; - } - - /** - * @return the amount of heat vented this reactor tick. - */ - public double getVentedHeat() { - return ventedHeat; - } - - /** - * Adds to the amount of heat vented this reactor tick, in case it is a new-style reactor with a pressure vessel and - * outputting heat to fluid instead of EU. - * - * @param amount the amount to add. - */ - public void ventHeat(final double amount) { - ventedHeat += amount; - } - - /** - * Clears the amount of vented heat, in case a new reactor tick is starting. - */ - public void clearVentedHeat() { - ventedHeat = 0; - } - - /** - * Get a code that represents the component set, which can be passed between forum users, etc. - * - * @return a code representing some ids for the components and arrangement. Passing the same code to setCode() - * should re-create an identical reactor setup, even if other changes have happened in the meantime. - */ - public String getCode() { - return "erp=" + buildCodeString(); - } - - /** - * Sets a code to configure the entire grid all at once. Expects the code to have originally been output by - * getCode(). - * - * @param code the code of the reactor setup to use. - */ - public void setCode(final String code) { - int pos = 0; - int[][] ids = new int[grid.length][grid[0].length]; - char[][][] paramTypes = new char[grid.length][grid[0].length][MAX_PARAM_TYPES]; - int[][][] params = new int[grid.length][grid[0].length][MAX_PARAM_TYPES]; - if (code.startsWith("erp=")) { - readCodeString(code.substring(4)); - } else if (code.length() >= 108 && code.matches("[0-9A-Za-z(),|]+")) { // NOI18N - try { - for (int row = 0; row < grid.length; row++) { - for (int col = 0; col < grid[row].length; col++) { - ids[row][col] = Integer.parseInt(code.substring(pos, pos + 2), 16); - pos += 2; - int paramNum = 0; - if (pos + 1 < code.length() && code.charAt(pos) == '(') { - paramTypes[row][col][paramNum] = code.charAt(pos + 1); - int tempPos = pos + 2; - StringBuilder param = new StringBuilder(10); - while (tempPos < code.length() && code.charAt(tempPos) != ')') { - if (code.charAt(tempPos) == ',') { - params[row][col][paramNum] = Integer.parseInt(param.toString(), 36); - paramNum++; - if (tempPos + 1 < code.length()) { - tempPos++; - paramTypes[row][col][paramNum] = code.charAt(tempPos); - } - param.setLength(0); - } else { - param.append(code.charAt(tempPos)); - } - tempPos++; - } - params[row][col][paramNum] = Integer.parseInt(param.toString(), 36); - pos = tempPos + 1; - } - } - } - for (int row = 0; row < grid.length; row++) { - for (int col = 0; col < grid[row].length; col++) { - final ReactorItem component = ComponentFactory.createComponent(ids[row][col]); - for (int paramNum = 0; paramNum < MAX_PARAM_TYPES; paramNum++) { - switch (paramTypes[row][col][paramNum]) { - case 'h': - component.setInitialHeat(params[row][col][paramNum]); - break; - case 'a': - component.setAutomationThreshold(params[row][col][paramNum]); - break; - case 'p': - component.setReactorPause(params[row][col][paramNum]); - break; - default: - break; - } - } - setComponentAt(row, col, component); - } - } - if (code.split("\\|").length > 1) { - String extraCode = code.split("\\|")[1]; - switch (extraCode.charAt(0)) { - case 'f': - fluid = true; - break; - case 'e': - fluid = false; - break; - default: - break; - } - switch (extraCode.charAt(1)) { - case 's': - pulsed = false; - automated = false; - break; - case 'p': - pulsed = true; - automated = false; - break; - case 'a': - pulsed = true; - automated = true; - break; - default: - break; - } - switch (extraCode.charAt(2)) { - case 'i': - usingReactorCoolantInjectors = true; - break; - case 'n': - usingReactorCoolantInjectors = false; - break; - default: - break; - } - if (extraCode.length() > 3) { - currentHeat = Integer.parseInt(extraCode.substring(3), 36); - } else { - currentHeat = 0; - } - } - if (code.split("\\|").length > 2) { - String[] moreCodes = code.split("\\|"); - for (int i = 2; i < moreCodes.length; i++) { - switch (moreCodes[i].charAt(0)) { - case 'n': - onPulse = Integer.parseInt(moreCodes[i].substring(1), 36); - break; - case 'f': - offPulse = Integer.parseInt(moreCodes[i].substring(1), 36); - break; - case 's': - suspendTemp = Integer.parseInt(moreCodes[i].substring(1), 36); - break; - case 'r': - resumeTemp = Integer.parseInt(moreCodes[i].substring(1), 36); - break; - default: - break; - } - } - } - } catch (NumberFormatException e) { - e.printStackTrace(); - } - } else { - String tempCode = code; - if (code.startsWith("http://www.talonfiremage.pwp.blueyonder.co.uk/v3/reactorplanner.html?")) { // NOI18N - tempCode = code.replace("http://www.talonfiremage.pwp.blueyonder.co.uk/v3/reactorplanner.html?", ""); // NOI18N - } - if (tempCode.matches("[0-9a-z]+")) { // NOI18N - // Possibly a code from Talonius's old planner - handleTaloniusCode(tempCode); - } else if (code.matches("[0-9A-Za-z+/=]+")) { // NOI18N - // Try to handle it as a newer code with the "erp=" prefix stripped - readCodeString(code); - } else if (!code.isEmpty()) { - // JOptionPane.showMessageDialog(null, String.format(getI18n("Warning.InvalidReactorCode"), code), - // getI18n("Warning.Title"), JOptionPane.WARNING_MESSAGE); - } - } - } - - private void handleTaloniusCode(String tempCode) throws HeadlessException { - StringBuilder warnings = new StringBuilder(500); - TaloniusDecoder decoder = new TaloniusDecoder(tempCode); - // initial heat, in multiples of 100 - currentHeat = 100 * decoder.readInt(10); - // reactor grid - for (int x = 8; x >= 0; x--) { - for (int y = 5; y >= 0; y--) { - int nextValue = decoder.readInt(7); - - // items are no longer stackable in IC2 reactors, but stack sizes from the planner code still need to be - // handled - if (nextValue > 64) { - nextValue = decoder.readInt(7); - } - - switch (nextValue) { - case 0: - setComponentAt(y, x, null); - break; - case 1: - setComponentAt(y, x, ComponentFactory.createComponent("fuelRodUranium")); - break; - case 2: - setComponentAt(y, x, ComponentFactory.createComponent("dualFuelRodUranium")); - break; - case 3: - setComponentAt(y, x, ComponentFactory.createComponent("quadFuelRodUranium")); - break; - case 5: - setComponentAt(y, x, ComponentFactory.createComponent("neutronReflector")); - break; - case 6: - setComponentAt(y, x, ComponentFactory.createComponent("thickNeutronReflector")); - break; - case 7: - setComponentAt(y, x, ComponentFactory.createComponent("heatVent")); - break; - case 8: - setComponentAt(y, x, ComponentFactory.createComponent("reactorHeatVent")); - break; - case 9: - setComponentAt(y, x, ComponentFactory.createComponent("overclockedHeatVent")); - break; - case 10: - setComponentAt(y, x, ComponentFactory.createComponent("advancedHeatVent")); - break; - case 11: - setComponentAt(y, x, ComponentFactory.createComponent("componentHeatVent")); - break; - case 12: - setComponentAt(y, x, ComponentFactory.createComponent("rshCondensator")); - break; - case 13: - setComponentAt(y, x, ComponentFactory.createComponent("lzhCondensator")); - break; - case 14: - setComponentAt(y, x, ComponentFactory.createComponent("heatExchanger")); - break; - case 15: - setComponentAt(y, x, ComponentFactory.createComponent("coreHeatExchanger")); - break; - case 16: - setComponentAt(y, x, ComponentFactory.createComponent("componentHeatExchanger")); - break; - case 17: - setComponentAt(y, x, ComponentFactory.createComponent("advancedHeatExchanger")); - break; - case 18: - setComponentAt(y, x, ComponentFactory.createComponent("reactorPlating")); - break; - case 19: - setComponentAt(y, x, ComponentFactory.createComponent("heatCapacityReactorPlating")); - break; - case 20: - setComponentAt(y, x, ComponentFactory.createComponent("containmentReactorPlating")); - break; - case 21: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCell10k")); - break; - case 22: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCell30k")); - break; - case 23: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCell60k")); - break; - case 24: - warnings.append("Warning.Heating", y, x); - break; - case 32: - setComponentAt(y, x, ComponentFactory.createComponent("fuelRodThorium")); - break; - case 33: - setComponentAt(y, x, ComponentFactory.createComponent("dualFuelRodThorium")); - break; - case 34: - setComponentAt(y, x, ComponentFactory.createComponent("quadFuelRodThorium")); - break; - case 35: - warnings.append("Warning.Plutonium", y, x); - break; - case 36: - warnings.append("Warning.DualPlutonium", y, x); - break; - case 37: - warnings.append("Warning.QuadPlutonium", y, x); - break; - case 38: - setComponentAt(y, x, ComponentFactory.createComponent("iridiumNeutronReflector")); - break; - case 39: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCellHelium60k")); - break; - case 40: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCellHelium180k")); - break; - case 41: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCellHelium360k")); - break; - case 42: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCellNak60k")); - break; - case 43: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCellNak180k")); - break; - case 44: - setComponentAt(y, x, ComponentFactory.createComponent("coolantCellNak360k")); - break; - default: - warnings.append("Warning.Unrecognized", y, x); - break; - } - } - } - if (warnings.length() > 0) { - warnings.setLength(warnings.length() - 1); // to remove last newline character - // JOptionPane.showMessageDialog(null, warnings, "Warning.Title", JOptionPane.WARNING_MESSAGE); - } - } - - // reads a Base64 code string for the reactor, after stripping the prefix. - private void readCodeString(final String code) { - BigintStorage storage = BigintStorage.inputBase64(code); - // read the code revision from the code itself instead of making it part of the prefix. - int codeRevision = storage.extract(255); - int maxComponentHeat; - if (codeRevision == 3) maxComponentHeat = (int) 1080e3; - else maxComponentHeat = (int) 360e3; - // Check if the code revision is supported yet. - if (codeRevision > 3) { - throw new IllegalArgumentException("Unsupported code revision in reactor code."); - } - // for code revision 1 or newer, read whether the reactor is pulsed and/or automated next. - if (codeRevision >= 1) { - pulsed = storage.extract(1) > 0; - automated = storage.extract(1) > 0; - } - // read the grid next - for (int row = 0; row < grid.length; row++) { - for (int col = 0; col < grid[row].length; col++) { - int componentId = 0; - // Changes may be coming to the number of components available, so make sure to check the code revision - // number. - if (codeRevision <= 1) { - componentId = storage.extract(38); - } else if (codeRevision == 2) { - componentId = storage.extract(44); - } else { - componentId = storage.extract(ComponentFactory.MAX_COMPONENT_ID); - } - if (componentId != 0) { - ReactorItem component = ComponentFactory.createComponent(componentId); - int hasSpecialAutomationConfig = storage.extract(1); - if (hasSpecialAutomationConfig > 0) { - component.setInitialHeat(storage.extract(maxComponentHeat)); - if (codeRevision == 0 || (codeRevision >= 1 && automated)) { - component.setAutomationThreshold(storage.extract(maxComponentHeat)); - component.setReactorPause(storage.extract((int) 10e3)); - } - } - setComponentAt(row, col, component); - } else { - setComponentAt(row, col, null); - } - } - } - // next, read the inital temperature and other details. - currentHeat = storage.extract((int) 120e3); - if (codeRevision == 0 || (codeRevision >= 1 && pulsed)) { - onPulse = storage.extract((int) 5e6); - offPulse = storage.extract((int) 5e6); - suspendTemp = storage.extract((int) 120e3); - resumeTemp = storage.extract((int) 120e3); - } - fluid = storage.extract(1) > 0; - usingReactorCoolantInjectors = storage.extract(1) > 0; - if (codeRevision == 0) { - pulsed = storage.extract(1) > 0; - automated = storage.extract(1) > 0; - } - maxSimulationTicks = storage.extract((int) 5e6); - } - - // builds a Base64 code string, not including the prefix. - private String buildCodeString() { - BigintStorage storage = new BigintStorage(); - // first, store the extra details, in reverse order of expected reading. - storage.store(maxSimulationTicks, (int) 5e6); - storage.store(usingReactorCoolantInjectors ? 1 : 0, 1); - storage.store(fluid ? 1 : 0, 1); - if (pulsed) { - storage.store(resumeTemp, (int) 120e3); - storage.store(suspendTemp, (int) 120e3); - storage.store(offPulse, (int) 5e6); - storage.store(onPulse, (int) 5e6); - } - storage.store((int) currentHeat, (int) 120e3); - // grid is read (almost) first, so written (almost) last, and in reverse order - for (int row = grid.length - 1; row >= 0; row--) { - for (int col = grid[row].length - 1; col >= 0; col--) { - ReactorItem component = grid[row][col]; - if (component != null) { - int id = component.id; - // only store automation details for a component if non-default, and add a flag bit to indicate - // their presence. null components don't even need the flag bit. - if (component.getInitialHeat() > 0 - || component.getAutomationThreshold() - != ComponentFactory.getDefaultComponent(id).getAutomationThreshold() - || component.getReactorPause() - != ComponentFactory.getDefaultComponent(id).getReactorPause()) { - if (automated) { - storage.store(component.getReactorPause(), (int) 10e3); - storage.store(component.getAutomationThreshold(), (int) 1080e3); - } - storage.store((int) component.getInitialHeat(), (int) 1080e3); - storage.store(1, 1); - } else { - storage.store(0, 1); - } - storage.store(id, ComponentFactory.MAX_COMPONENT_ID); - } else { - storage.store(0, ComponentFactory.MAX_COMPONENT_ID); - } - } - } - storage.store(automated ? 1 : 0, 1); - storage.store(pulsed ? 1 : 0, 1); - // store the code revision, allowing values up to 255 (8 bits) before adjusting how it is stored in the code. - storage.store(3, 255); - return storage.outputBase64(); - } - - // Get an old-style (pre-2.3.1) code for the reactor, for pasting into older versions of the planner. - public String getOldCode() { - StringBuilder result = new StringBuilder(108); - for (int row = 0; row < grid.length; row++) { - for (int col = 0; col < grid[row].length; col++) { - final ReactorItem component = getComponentAt(row, col); - final int id = (component != null) ? component.id : 0; - result.append(String.format("%02X", id)); // NOI18N - if (component != null && (component.getInitialHeat() > 0 - || (automated && component.getAutomationThreshold() - != ComponentFactory.getDefaultComponent(id).getAutomationThreshold()) - || (automated && component.getReactorPause() - != ComponentFactory.getDefaultComponent(id).getReactorPause()))) { - result.append("("); - if (component.getInitialHeat() > 0) { - result.append(String.format("h%s,", Integer.toString((int) component.getInitialHeat(), 36))); // NOI18N - } - if (automated && component.getAutomationThreshold() - != ComponentFactory.getDefaultComponent(id).getAutomationThreshold()) { - result.append(String.format("a%s,", Integer.toString(component.getAutomationThreshold(), 36))); // NOI18N - } - if (automated && component.getReactorPause() - != ComponentFactory.getDefaultComponent(id).getReactorPause()) { - result.append(String.format("p%s,", Integer.toString(component.getReactorPause(), 36))); // NOI18N - } - result.setLength(result.length() - 1); // remove the last comma, whichever parameter it came from. - result.append(")"); - } - } - } - result.append('|'); - if (fluid) { - result.append('f'); - } else { - result.append('e'); - } - if (automated) { - result.append('a'); - } else if (pulsed) { - result.append('p'); - } else { - result.append('s'); - } - if (usingReactorCoolantInjectors) { - result.append('i'); - } else { - result.append('n'); - } - if (currentHeat > 0) { - result.append(Integer.toString((int) currentHeat, 36)); - } - if (pulsed && onPulse != DEFAULT_ON_PULSE) { - result.append(String.format("|n%s", Integer.toString(onPulse, 36))); - } - if (pulsed && offPulse != DEFAULT_OFF_PULSE) { - result.append(String.format("|f%s", Integer.toString(offPulse, 36))); - } - if (pulsed && suspendTemp != DEFAULT_SUSPEND_TEMP) { - result.append(String.format("|s%s", Integer.toString(suspendTemp, 36))); - } - if (pulsed && resumeTemp != DEFAULT_SUSPEND_TEMP) { - result.append(String.format("|r%s", Integer.toString(resumeTemp, 36))); - } - return result.toString(); - } - - /** - * Checks whether the reactor is to simulate a fluid-style reactor, rather than a direct EU-output reactor. - * - * @return true if this was set to be a fluid-style reactor, false if this was set to be direct EU-output reactor. - */ - public boolean isFluid() { - return fluid; - } - - /** - * Sets whether the reactor is to simulate a fluid-style reactor, rather than a direct EU-output reactor. - * - * @param fluid true if this is to be a fluid-style reactor, false if this is to be direct EU-output reactor. - */ - public void setFluid(final boolean fluid) { - this.fluid = fluid; - } - - /** - * Checks whether the reactor is using Reactor Coolant Injectors (RCIs) - * - * @return true if this reactor was set to use RCIs, false otherwise. - */ - public boolean isUsingReactorCoolantInjectors() { - return usingReactorCoolantInjectors; - } - - /** - * Sets whether the reactor is to use Reactor Coolant Injectors (RCIs) - * - * @param usingReactorCoolantInjectors true if this reactor should use RCIs, false otherwise. - */ - public void setUsingReactorCoolantInjectors(final boolean usingReactorCoolantInjectors) { - this.usingReactorCoolantInjectors = usingReactorCoolantInjectors; - } - - public int getOnPulse() { - return onPulse; - } - - public void setOnPulse(final int onPulse) { - this.onPulse = onPulse; - } - - public int getOffPulse() { - return offPulse; - } - - public void setOffPulse(final int offPulse) { - this.offPulse = offPulse; - } - - public int getSuspendTemp() { - return suspendTemp; - } - - public void setSuspendTemp(final int suspendTemp) { - this.suspendTemp = suspendTemp; - } - - public int getResumeTemp() { - return resumeTemp; - } - - public void setResumeTemp(final int resumeTemp) { - this.resumeTemp = resumeTemp; - } - - public boolean isPulsed() { - return pulsed; - } - - public void setPulsed(boolean pulsed) { - this.pulsed = pulsed; - } - - public boolean isAutomated() { - return automated; - } - - public void setAutomated(boolean automated) { - this.automated = automated; - } - - public int getMaxSimulationTicks() { - return maxSimulationTicks; - } - - public void setMaxSimulationTicks(int maxSimulationTicks) { - this.maxSimulationTicks = maxSimulationTicks; - } - - public void resetPulseConfig() { - onPulse = DEFAULT_ON_PULSE; - offPulse = DEFAULT_OFF_PULSE; - suspendTemp = DEFAULT_SUSPEND_TEMP; - resumeTemp = DEFAULT_RESUME_TEMP; - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/SimulationData.java b/src/main/java/Ic2ExpReactorPlanner/SimulationData.java deleted file mode 100644 index 614e903250..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/SimulationData.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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; - -/** - * Simple container for data from a simulation of an IC2 nuclear reactor, to allow comparison wtih another simulation. - * - * @author Brian McCloud - */ -public class SimulationData { - // Values should only be written to by the simulator class and read by other classes, but this is not yet strictly - // enforced. - // Enforcement might require refactoring this to be an inner class of the simulator. - - // Times to temperature thresholds - public int timeToBelow50 = Integer.MAX_VALUE; - public int timeToBurn = Integer.MAX_VALUE; - public int timeToEvaporate = Integer.MAX_VALUE; - public int timeToHurt = Integer.MAX_VALUE; - public int timeToLava = Integer.MAX_VALUE; - public int timeToXplode = Integer.MAX_VALUE; - - // Special, for calculating efficiency - public int totalRodCount = 0; - - // First component broken details - public int firstComponentBrokenTime = Integer.MAX_VALUE; - public int firstComponentBrokenRow = -1; - public int firstComponentBrokenCol = -1; - public String firstComponentBrokenDescription = ""; - public double prebreakTotalEUoutput = 0; - public double prebreakAvgEUoutput = 0; - public double prebreakMinEUoutput = Double.MAX_VALUE; - public double prebreakMaxEUoutput = 0; - public double prebreakTotalHUoutput = 0; - public double prebreakAvgHUoutput = 0; - public double prebreakMinHUoutput = Double.MAX_VALUE; - public double prebreakMaxHUoutput = 0; - - // First rod depleted details - public int firstRodDepletedTime = Integer.MAX_VALUE; - public int firstRodDepletedRow = -1; - public int firstRodDepletedCol = -1; - public String firstRodDepletedDescription = ""; - public double predepleteTotalEUoutput = 0; - public double predepleteAvgEUoutput = 0; - public double predepleteMinEUoutput = Double.MAX_VALUE; - public double predepleteMaxEUoutput = 0; - public double predepleteTotalHUoutput = 0; - public double predepleteAvgHUoutput = 0; - public double predepleteMinHUoutput = Double.MAX_VALUE; - public double predepleteMaxHUoutput = 0; - public double predepleteMinTemp = Double.MAX_VALUE; - public double predepleteMaxTemp = 0; - - // Completed-simulation details - public int totalReactorTicks = 0; - public int totalEUoutput = 0; - public int avgEUoutput = 0; - public double minEUoutput = Double.MAX_VALUE; - public int maxEUoutput = 0; - public int totalHUoutput = 0; - public int avgHUoutput = 0; - public double minHUoutput = Double.MAX_VALUE; - public int maxHUoutput = 0; - public int minTemp = (int) Double.MAX_VALUE; - public int maxTemp = 0; - public int explosionPower = 0; - - // Heating and Cooling details - public double hullHeating = 0; - public double componentHeating = 0; - public double hullCooling = 0; - public double hullCoolingCapacity = 0; - public double ventCooling = 0; - public double ventCoolingCapacity = 0; -} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java b/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java deleted file mode 100644 index 2ae559d9c6..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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; - -/** - * 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) { - super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); - } - - public Condensator(final Condensator other) { - super(other); - } - - @Override - public double adjustCurrentHeat(final double heat) { - if (heat < 0.0) { - return heat; - } - currentCondensatorCooling += heat; - bestCondensatorCooling = Math.max(currentCondensatorCooling, bestCondensatorCooling); - double acceptedHeat = Math.min(heat, getMaxHeat() - heat); - double result = heat - acceptedHeat; - currentHeat += acceptedHeat; - maxReachedHeat = Math.max(maxReachedHeat, currentHeat); - return result; - } - - @Override - public boolean needsCoolantInjected() { - return currentHeat > 0.85 * getMaxHeat(); - } - - @Override - public void injectCoolant() { - currentHeat = 0; - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java b/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java deleted file mode 100644 index ab7b2e5867..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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; - -/** - * 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) { - super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); - } - - public CoolantCell(final CoolantCell other) { - super(other); - } - - @Override - public double adjustCurrentHeat(final double heat) { - currentCellCooling += heat; - bestCellCooling = Math.max(currentCellCooling, bestCellCooling); - return super.adjustCurrentHeat(heat); - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java b/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java deleted file mode 100644 index 9a168bfa06..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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.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 { - - 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) { - super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); - this.switchSide = switchSide; - this.switchReactor = switchReactor; - } - - public Exchanger(final Exchanger other) { - super(other); - this.switchSide = other.switchSide; - this.switchReactor = other.switchReactor; - } - - @Override - public void transfer() { - List<ReactorItem> heatableNeighbors = new ArrayList<>(4); - ReactorItem component = parent.getComponentAt(row, col - 1); - if (component != null && component.isHeatAcceptor()) { - heatableNeighbors.add(component); - } - component = parent.getComponentAt(row, col + 1); - if (component != null && component.isHeatAcceptor()) { - heatableNeighbors.add(component); - } - component = parent.getComponentAt(row - 1, col); - if (component != null && component.isHeatAcceptor()) { - heatableNeighbors.add(component); - } - component = parent.getComponentAt(row + 1, col); - if (component != null && component.isHeatAcceptor()) { - heatableNeighbors.add(component); - } - // Code adapted from decompiled IC2 code, class ItemReactorHeatSwitch, with permission from Thunderdark. - double myHeat = 0; - if (switchSide > 0) { - for (ReactorItem heatableNeighbor : heatableNeighbors) { - double mymed = getCurrentHeat() * 100.0 / getMaxHeat(); - double heatablemed = heatableNeighbor.getCurrentHeat() * 100.0 / heatableNeighbor.getMaxHeat(); - - double add = (int) (heatableNeighbor.getMaxHeat() / 100.0 * (heatablemed + mymed / 2.0)); - if (add > switchSide) { - add = switchSide; - } - if (heatablemed + mymed / 2.0 < 1.0) { - add = switchSide / 2; - } - if (heatablemed + mymed / 2.0 < 0.75) { - add = switchSide / 4; - } - if (heatablemed + mymed / 2.0 < 0.5) { - add = switchSide / 8; - } - if (heatablemed + mymed / 2.0 < 0.25) { - add = 1; - } - if (Math.round(heatablemed * 10.0) / 10.0 > Math.round(mymed * 10.0) / 10.0) { - add -= 2 * add; - } else if (Math.round(heatablemed * 10.0) / 10.0 == Math.round(mymed * 10.0) / 10.0) { - add = 0; - } - myHeat -= add; - if (add > 0) { - currentComponentHeating += add; - } - add = heatableNeighbor.adjustCurrentHeat(add); - myHeat += add; - } - } - if (switchReactor > 0) { - double mymed = getCurrentHeat() * 100.0 / getMaxHeat(); - double Reactormed = parent.getCurrentHeat() * 100.0 / parent.getMaxHeat(); - - int add = (int) Math.round(parent.getMaxHeat() / 100.0 * (Reactormed + mymed / 2.0)); - if (add > switchReactor) { - add = switchReactor; - } - if (Reactormed + mymed / 2.0 < 1.0) { - add = switchSide / 2; - } - if (Reactormed + mymed / 2.0 < 0.75) { - add = switchSide / 4; - } - if (Reactormed + mymed / 2.0 < 0.5) { - add = switchSide / 8; - } - if (Reactormed + mymed / 2.0 < 0.25) { - add = 1; - } - if (Math.round(Reactormed * 10.0) / 10.0 > Math.round(mymed * 10.0) / 10.0) { - add -= 2 * add; - } else if (Math.round(Reactormed * 10.0) / 10.0 == Math.round(mymed * 10.0) / 10.0) { - add = 0; - } - myHeat -= add; - parent.adjustCurrentHeat(add); - if (add > 0) { - currentHullHeating = add; - } else { - currentHullCooling = -add; - } - } - adjustCurrentHeat(myHeat); - } - - @Override - public double getHullCoolingCapacity() { - return switchReactor; - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java b/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java deleted file mode 100644 index 480cced72b..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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.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 { - - private final int energyMult; - private final double heatMult; - private final int rodCount; - private 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; - this.rodCount = rodCount; - this.moxStyle = moxStyle; - } - - public FuelRod(final FuelRod other) { - super(other); - this.energyMult = other.energyMult; - this.heatMult = other.heatMult; - this.rodCount = other.rodCount; - this.moxStyle = other.moxStyle; - } - - @Override - public boolean isNeutronReflector() { - return !isBroken(); - } - - private int countNeutronNeighbors() { - int neutronNeighbors = 0; - ReactorItem component = parent.getComponentAt(row + 1, col); - if (component != null && component.isNeutronReflector()) { - neutronNeighbors++; - } - component = parent.getComponentAt(row - 1, col); - if (component != null && component.isNeutronReflector()) { - neutronNeighbors++; - } - component = parent.getComponentAt(row, col - 1); - if (component != null && component.isNeutronReflector()) { - neutronNeighbors++; - } - component = parent.getComponentAt(row, col + 1); - if (component != null && component.isNeutronReflector()) { - neutronNeighbors++; - } - return neutronNeighbors; - } - - protected void handleHeat(final int heat) { - List<ReactorItem> heatableNeighbors = new ArrayList<>(4); - ReactorItem component = parent.getComponentAt(row + 1, col); - if (component != null && component.isHeatAcceptor()) { - heatableNeighbors.add(component); - } - component = parent.getComponentAt(row - 1, col); - if (component != null && component.isHeatAcceptor()) { - heatableNeighbors.add(component); - } - component = parent.getComponentAt(row, col - 1); - if (component != null && component.isHeatAcceptor()) { - heatableNeighbors.add(component); - } - component = parent.getComponentAt(row, col + 1); - if (component != null && component.isHeatAcceptor()) { - heatableNeighbors.add(component); - } - if (heatableNeighbors.isEmpty()) { - parent.adjustCurrentHeat(heat); - currentHullHeating = heat; - } else { - currentComponentHeating = heat; - for (ReactorItem heatableNeighbor : heatableNeighbors) { - heatableNeighbor.adjustCurrentHeat(heat / heatableNeighbors.size()); - } - int remainderHeat = heat % heatableNeighbors.size(); - heatableNeighbors.get(0).adjustCurrentHeat(remainderHeat); - } - } - - @Override - public double generateHeat() { - int pulses = countNeutronNeighbors() + (rodCount == 1 ? 1 : (rodCount == 2) ? 2 : 3); - int heat = (int) (heatMult * pulses * (pulses + 1)); - if (moxStyle && parent.isFluid() && (parent.getCurrentHeat() / parent.getMaxHeat()) > 0.5) { - heat *= 2; - } - currentHeatGenerated = heat; - minHeatGenerated = Math.min(minHeatGenerated, heat); - maxHeatGenerated = Math.max(maxHeatGenerated, heat); - handleHeat(heat); - return currentHeatGenerated; - } - - @Override - public double generateEnergy() { - int pulses = countNeutronNeighbors() + (rodCount == 1 ? 1 : (rodCount == 2) ? 2 : 3); - double energy = energyMult * pulses; - if ("GT5".equals(sourceMod)) { - energy *= 2; // EUx2 if from GT5.09 or in GT5.09 mode - if (moxStyle) { - energy *= (1 + 1.5 * parent.getCurrentHeat() / parent.getMaxHeat()); - } - } else if ("GTNH".equals(sourceMod)) { - energy *= 10; // EUx10 if from GTNH or in GTNH mode - if (moxStyle) { - energy *= (1 + 1.5 * parent.getCurrentHeat() / parent.getMaxHeat()); - } - } else if (moxStyle) { - energy *= (1 + 4.0 * parent.getCurrentHeat() / parent.getMaxHeat()); - } - minEUGenerated = Math.min(minEUGenerated, energy); - maxEUGenerated = Math.max(maxEUGenerated, energy); - currentEUGenerated = energy; - parent.addEUOutput(energy); - applyDamage(1.0); - return energy; - } - - @Override - public int getRodCount() { - return rodCount; - } - - @Override - public double getCurrentOutput() { - if (parent != null) { - if (parent.isFluid()) { - return currentHeatGenerated; - } else { - return currentEUGenerated; - } - } - return 0; - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Plating.java b/src/main/java/Ic2ExpReactorPlanner/components/Plating.java deleted file mode 100644 index 8a1edf8d8f..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/components/Plating.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.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. - * - * @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, - final double explosionPowerMultiplier) { - super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); - this.heatAdjustment = heatAdjustment; - this.explosionPowerMultiplier = explosionPowerMultiplier; - } - - public Plating(Plating other) { - super(other); - this.heatAdjustment = other.heatAdjustment; - this.explosionPowerMultiplier = other.explosionPowerMultiplier; - } - - @Override - public void addToReactor(final Reactor parent, final int row, final int col) { - super.addToReactor(parent, row, col); - if (parent != null) { - parent.adjustMaxHeat(heatAdjustment); - } - } - - @Override - public void removeFromReactor() { - if (parent != null) { - parent.adjustMaxHeat(-heatAdjustment); - } - super.removeFromReactor(); - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java b/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java deleted file mode 100644 index 852817775d..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java +++ /dev/null @@ -1,534 +0,0 @@ -/* - * 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 static gregtech.api.enums.Mods.IndustrialCraft2; - -import java.util.HashMap; - -import Ic2ExpReactorPlanner.Reactor; -import gregtech.api.objects.GT_ItemStack; - -/** - * Represents an item (component) in an IndustrialCraft2 Experimental Nuclear Reactor. - * - * @author Brian McCloud - */ -public class ReactorItem { - - public static HashMap<String, ReactorItem> sComponentMap = new HashMap<String, ReactorItem>(); - // Fundamental values, set at object instantiation, should never need to be - // changed. - public final int id; - public final String baseName; // this is the non-localized version, for - // internal program use - public final String name; // this is expected to be localized, for display - // usage. - protected double maxDamage; - - public double getMaxDamage() { - return maxDamage; - } - - protected double maxHeat; - - public double getMaxHeat() { - return maxHeat; - } - - public final String sourceMod; // for potentially adjusting controls based - // on whether the mod is in use, will be - // null to indicate the item is part of base - // IC2. - public final GT_ItemStack mItem; - - // Simulation setting values - private double initialHeat = 0; - - public double getInitialHeat() { - return initialHeat; - } - - public void setInitialHeat(final double value) { - if (this.isHeatAcceptor() && value >= 0 && value < this.maxHeat) { - initialHeat = value; - } - } - - private int automationThreshold = 9000; - - public int getAutomationThreshold() { - return automationThreshold; - } - - public void setAutomationThreshold(final int value) { - if (maxHeat > 1 || maxDamage > 1) { - automationThreshold = value; - } - } - - private int reactorPause = 0; - - public int getReactorPause() { - return reactorPause; - } - - public void setReactorPause(final int value) { - if (maxHeat > 1 || maxDamage > 1) { - reactorPause = value; - } - } - - // fields below here are not to be copied by the copy constructor. - - // Parent reactor and position - protected Reactor parent = null; - protected int row = -10; - protected int col = -10; - - // Special variable for holding information about this item from last - // simulation. - // Usage of StringBuffer instead of StringBuilder is deliberate - this may - // be accessed by - // both the simulation worker thread and the event dispatch thread. - public final StringBuffer info = new StringBuffer(1000); - - // Calculated values - readable from outside, but only writable by - // subclasses. - protected double currentDamage = 0; - - public double getCurrentDamage() { - return currentDamage; - } - - protected double currentHeat = 0; - - public double getCurrentHeat() { - return currentHeat; - } - - protected double maxReachedHeat = 0; - - public double getMaxReachedHeat() { - return maxReachedHeat; - } - - protected double currentEUGenerated = 0; - - public double getCurrentEUGenerated() { - return currentEUGenerated; - } - - protected double minEUGenerated = Double.MAX_VALUE; - - public double getMinEUGenerated() { - return minEUGenerated; - } - - protected double maxEUGenerated = 0; - - public double getMaxEUGenerated() { - return maxEUGenerated; - } - - protected double currentHeatGenerated = 0; - - public double getCurrentHeatGenerated() { - return currentHeatGenerated; - } - - protected double minHeatGenerated = Double.MAX_VALUE; - - public double getMinHeatGenerated() { - return minHeatGenerated; - } - - protected double maxHeatGenerated = 0; - - public double getMaxHeatGenerated() { - return maxHeatGenerated; - } - - protected double currentHullHeating = 0; - - public double getCurrentHullHeating() { - return currentHullHeating; - } - - protected double currentComponentHeating = 0; - - public double getCurrentComponentHeating() { - return currentComponentHeating; - } - - protected double currentHullCooling = 0; - - public double getCurrentHullCooling() { - return currentHullCooling; - } - - protected double currentVentCooling = 0; - - public double getCurrentVentCooling() { - return currentVentCooling; - } - - protected double bestVentCooling = 0; - - public double getBestVentCooling() { - return bestVentCooling; - } - - protected double currentCellCooling = 0; - - public double getCurrentCellCooling() { - return currentCellCooling; - } - - protected double bestCellCooling = 0; - - public double getBestCellCooling() { - return bestCellCooling; - } - - protected double currentCondensatorCooling = 0; - - public double getCurrentCondensatorCooling() { - return currentCondensatorCooling; - } - - protected double bestCondensatorCooling = 0; - - public double getBestCondensatorCooling() { - return bestCondensatorCooling; - } - - protected double explosionPowerMultiplier = 1; - - 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()); - this.mItem = aItem; - this.maxDamage = maxDamage; - this.maxHeat = maxHeat; - if (maxHeat > 1) { - automationThreshold = (int) (maxHeat * 0.9); - } else if (maxDamage > 1) { - automationThreshold = (int) (maxDamage * 1.1); - } - if (sourceMod == null) { - sourceMod = IndustrialCraft2.ID; - } - this.sourceMod = sourceMod; - sComponentMap.put(sourceMod + "." + aItem.mItem.getUnlocalizedName() + "." + aItem.mMetaData, this); - } - - // Protected copy constructor for use by subclasses. Generalized copying - // should be done with a method in ComponentFactory (which can check which - // subclass copy constructor to use). - protected ReactorItem(final ReactorItem other) { - this.id = other.id; - this.baseName = other.baseName; - this.name = other.name; - this.mItem = other.mItem; - this.maxDamage = other.maxDamage; - this.maxHeat = other.maxHeat; - this.initialHeat = other.initialHeat; - this.automationThreshold = other.automationThreshold; - this.reactorPause = other.reactorPause; - this.sourceMod = other.sourceMod; - } - - /** - * Gets the name of the component, and the initial heat (if applicable). - * - * @return the name of this component, and potentially initial heat. - */ - @Override - public String toString() { - String result = name; - if (initialHeat > 0) { - result += String.format("\u0020(initial heat: %,d)", (int) initialHeat); - } - return result; - } - - /** - * 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. - */ - public boolean isHeatAcceptor() { - // maxHeat of 1 means this component never accepts heat (though it might - // take damage instead) - return maxHeat > 1 && !isBroken(); - } - - /** - * 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. - */ - public boolean isCoolable() { - return maxHeat > 1 && !(this instanceof Condensator); - } - - /** - * 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. - */ - public boolean isNeutronReflector() { - return false; - } - - /** - * Prepare for a new reactor tick. - */ - public void preReactorTick() { - currentHullHeating = 0.0; - currentComponentHeating = 0.0; - currentHullCooling = 0.0; - currentVentCooling = 0.0; - currentCellCooling = 0.0; - currentCondensatorCooling = 0.0; - currentEUGenerated = 0; - currentHeatGenerated = 0; - } - - /** - * Generate heat if appropriate for component type, and spread to reactor or adjacent cells. - * - * @return the amount of heat generated by this component. - */ - public double generateHeat() { - return 0.0; - } - - /** - * Generate energy if appropriate for component type. - * - * @return the number of EU generated by this component during the current reactor tick. - */ - public double generateEnergy() { - return 0.0; - } - - /** - * Dissipate (aka vent) heat if appropriate for component type. - * - * @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. - */ - 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. - * - * @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 - // a different reactor (unlikely) - removeFromReactor(); - this.parent = parent; - this.row = row; - this.col = col; - } - - /** - * 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; - this.row = -10; - this.col = -10; - } - - /** - * Resets heat to 0 (used when resetting simulation). - */ - public final void clearCurrentHeat() { - currentHeat = initialHeat; - bestVentCooling = 0.0; - bestCondensatorCooling = 0.0; - bestCellCooling = 0.0; - minEUGenerated = Double.MAX_VALUE; - maxEUGenerated = 0.0; - minHeatGenerated = Double.MAX_VALUE; - maxHeatGenerated = 0.0; - maxReachedHeat = initialHeat; - } - - /** - * 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) - */ - public double adjustCurrentHeat(final double heat) { - if (isHeatAcceptor()) { - double result = 0.0; - double tempHeat = getCurrentHeat(); - tempHeat += heat; - if (tempHeat > getMaxHeat()) { - result = getMaxHeat() - tempHeat + 1; - tempHeat = getMaxHeat(); - } else if (tempHeat < 0.0) { - result = tempHeat; - tempHeat = 0.0; - } - currentHeat = tempHeat; - maxReachedHeat = Math.max(maxReachedHeat, currentHeat); - return result; - } - return heat; - } - - /** - * 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. - * - * @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 - // damage (though it might accept heat instead) - // if someone actually writes a mod with such a flimsy component, I - // might have to rethink this. - if (maxDamage > 1 && damage > 0.0) { - currentDamage += damage; - } - } - - /** - * 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. - */ - public boolean isBroken() { - return currentHeat >= getMaxHeat() || currentDamage >= getMaxDamage(); - } - - /** - * 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. - */ - public int getRodCount() { - return 0; - } - - /** - * 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. - */ - public double getExplosionPowerOffset() { - if (!isBroken()) { - if (getRodCount() == 0 && isNeutronReflector()) { - return -1; - } - return 2 * getRodCount(); // all known fuel rods (including those - // from GT) use this formula, and - // non-rod components return 0 for - // getRodCount - } - return 0; - } - - /** - * 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. - */ - 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. - * - * @return the capacity of this component to vent heat. - */ - public double getVentCoolingCapacity() { - return 0; - } - - /** - * Finds the theoretical maximum hull cooling of this component. - * - * @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. - * - * @return the output of this component for the current reactor tick. - */ - public double getCurrentOutput() { - return 0; - } - - /** - * 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. - */ - 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. - * - * @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; - } - - /** - * Simulates having a coolant item added by a Reactor Coolant Injector. - */ - public void injectCoolant() { - // do nothing by default. - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java b/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java deleted file mode 100644 index f0b16f3d14..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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; - -/** - * 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; - } -} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Vent.java b/src/main/java/Ic2ExpReactorPlanner/components/Vent.java deleted file mode 100644 index e0f26416ac..0000000000 --- a/src/main/java/Ic2ExpReactorPlanner/components/Vent.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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.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 { - - private final int selfVent; - 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) { - super(id, baseName, aItem, maxDamage, maxHeat, sourceMod); - this.selfVent = selfVent; - this.hullDraw = hullDraw; - this.sideVent = sideVent; - } - - public Vent(final Vent other) { - super(other); - this.selfVent = other.selfVent; - this.hullDraw = other.hullDraw; - this.sideVent = other.sideVent; - } - - @Override - public double dissipate() { - double deltaHeat = Math.min(hullDraw, parent.getCurrentHeat()); - currentHullCooling = deltaHeat; - parent.adjustCurrentHeat(-deltaHeat); - this.adjustCurrentHeat(deltaHeat); - final double currentDissipation = Math.min(selfVent, getCurrentHeat()); - currentVentCooling = currentDissipation; - parent.ventHeat(currentDissipation); - adjustCurrentHeat(-currentDissipation); - if (sideVent > 0) { - List<ReactorItem> coolableNeighbors = new ArrayList<>(4); - ReactorItem component = parent.getComponentAt(row - 1, col); - if (component != null && component.isCoolable()) { - coolableNeighbors.add(component); - } - component = parent.getComponentAt(row, col + 1); - if (component != null && component.isCoolable()) { - coolableNeighbors.add(component); - } - component = parent.getComponentAt(row + 1, col); - if (component != null && component.isCoolable()) { - coolableNeighbors.add(component); - } - component = parent.getComponentAt(row, col - 1); - if (component != null && component.isCoolable()) { - coolableNeighbors.add(component); - } - for (ReactorItem coolableNeighbor : coolableNeighbors) { - double rejectedCooling = coolableNeighbor.adjustCurrentHeat(-sideVent); - double tempDissipatedHeat = sideVent + rejectedCooling; - parent.ventHeat(tempDissipatedHeat); - currentVentCooling += tempDissipatedHeat; - } - } - bestVentCooling = Math.max(bestVentCooling, currentVentCooling); - return currentDissipation; - } - - @Override - public double getVentCoolingCapacity() { - double result = selfVent; - if (sideVent > 0) { - ReactorItem component = parent.getComponentAt(row - 1, col); - if (component != null && component.isCoolable()) { - result += sideVent; - } - component = parent.getComponentAt(row, col + 1); - if (component != null && component.isCoolable()) { - result += sideVent; - } - component = parent.getComponentAt(row + 1, col); - if (component != null && component.isCoolable()) { - result += sideVent; - } - component = parent.getComponentAt(row, col - 1); - if (component != null && component.isCoolable()) { - result += sideVent; - } - } - return result; - } - - @Override - public double getHullCoolingCapacity() { - return hullDraw; - } - - @Override - public double getCurrentOutput() { - return currentVentCooling; - } -} diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index 5f6a807746..eb80f46d6f 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -274,8 +274,6 @@ public class RECIPES_Machines { multiSolarTower(); multiElementalDuplicator(); - computerCube(); - resonanceChambers(); modulators(); } @@ -313,18 +311,6 @@ public class RECIPES_Machines { MaterialUtils.getVoltageForTier(6)); } - private static void computerCube() { - - CORE.RA.addSixSlotAssemblingRecipe( - new ItemStack[] { CI.getNumberedAdvancedCircuit(20), CI.getTieredGTPPMachineCasing(4, 1), - CI.getCircuit(4, 8), CI.getFieldGenerator(2, 4), CI.getDoublePlate(4, 8), - CI.getRobotArm(4, 8) }, - Materials.Redstone.getMolten(144 * 32), - GregtechItemList.Gregtech_Computer_Cube_Machine.get(1), - 20 * 60 * 10, - MaterialUtils.getVoltageForTier(4)); - } - private static void gt4FarmManager() { ItemList[] aInputHatches = new ItemList[] { ItemList.Hatch_Input_LV, ItemList.Hatch_Input_MV, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index 3828a66353..fee3c12277 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -39,8 +39,6 @@ import gtPlusPlus.xmod.gregtech.api.util.GTPP_Config; import gtPlusPlus.xmod.gregtech.api.world.GTPP_Worldgen; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.blocks.fluid.GregtechFluidHandler; -import gtPlusPlus.xmod.gregtech.common.computer.GT_ComputerCube_Setup; -import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description; import gtPlusPlus.xmod.gregtech.common.items.MetaGeneratedGregtechTools; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMTE_ElementalDuplicator; import gtPlusPlus.xmod.gregtech.loaders.Gregtech_Blocks; @@ -127,8 +125,6 @@ public class HANDLER_GT { CokeAndPyrolyseOven.onLoadComplete(); generateElementalDuplicatorRecipes(); Meta_GT_Proxy.fixIC2FluidNames(); - GT_Computercube_Description.addStandardDescriptions(); - GT_ComputerCube_Setup.init(); RecipeLoader_AlgaeFarm.generateRecipes(); if (AdvancedSolarPanel.isModLoaded()) { RecipeLoader_MolecularTransformer.run(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java index e341ee5a8c..e4939eda42 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -162,7 +162,6 @@ public enum GregtechItemList implements GregtechItemContainer { // Computer Cube Gregtech_Computer_Cube, - Gregtech_Computer_Cube_Machine, // Casings for batteries Battery_Casing_Gem_1, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java index 0b7e44ce14..96ff9f6aef 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechOrePrefixes.java @@ -110,14 +110,7 @@ public enum GregtechOrePrefixes { // by // Calclavia chipset("Chipsets", "", "", true, true, false, false, false, false, false, false, false, false, 0, -1, 64, -1), // Introduced - // by - // Buildcraft - computer("Computers", "", "", true, true, false, false, true, false, false, false, false, false, 0, -1, 64, -1),; // A - // whole - // Computer. - // "computerMaster" - // = - // ComputerCube + ; public static volatile int VERSION = 508; @@ -208,8 +201,6 @@ public enum GregtechOrePrefixes { getTcAspectStack(TC_Aspects.ITER.name(), 2).addToAspectList(this.mAspects); } else if (this.name().startsWith("circuit")) { getTcAspectStack("COGNITIO", 1); - } else if (this.name().startsWith("computer")) { - getTcAspectStack("COGNITIO", 4).addToAspectList(this.mAspects); } else if (this.name().startsWith("battery")) { getTcAspectStack(TC_Aspects.ELECTRUM.name(), 1).addToAspectList(this.mAspects); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java index 8cf0e88473..f7cd6cab23 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GTPP_UITextures.java @@ -29,8 +29,6 @@ public class GTPP_UITextures { public static final UITexture BUTTON_STANDARD_BRONZE = UITexture .fullImage(GTPlusPlus.ID, "gui/button/standard_bronze"); - public static final UITexture BUTTON_STANDARD_16x16 = UITexture - .fullImage(GTPlusPlus.ID, "gui/button/standard_16x16"); public static final UITexture OVERLAY_SLOT_WEED_EX = UITexture.fullImage(GTPlusPlus.ID, "gui/overlay_slot/weed_ex"); public static final UITexture OVERLAY_SLOT_FERTILIZER = UITexture @@ -74,8 +72,6 @@ public class GTPP_UITextures { .fullImage(GTPlusPlus.ID, "gui/progressbar/boiler_empty"); public static final UITexture PROGRESSBAR_FUEL = UITexture.fullImage(GTPlusPlus.ID, "gui/progressbar/fuel"); public static final UITexture PROGRESSBAR_ARROW_2 = UITexture.fullImage(GTPlusPlus.ID, "gui/progressbar/arrow_2"); - public static final UITexture PROGRESSBAR_COMPUTER_ENERGY = UITexture - .fullImage(GTPlusPlus.ID, "gui/progressbar/computer_energy"); public static final UITexture PROGRESSBAR_PSS_ENERGY = UITexture .fullImage(GTPlusPlus.ID, "gui/progressbar/pss_energy"); @@ -100,16 +96,6 @@ public class GTPP_UITextures { public static final UITexture[] OVERLAY_BUTTON_MODE = IntStream.range(0, 10) // GT_MetaTileEntity_ElectricAutoWorkbench#MAX_MODES .mapToObj(i -> UITexture.fullImage(GTPlusPlus.ID, "gui/overlay_button/mode_" + i)) .collect(Collectors.toList()).toArray(new UITexture[0]); - public static final UITexture OVERLAY_BUTTON_COMPUTER_MODE = UITexture - .fullImage(GTPlusPlus.ID, "gui/overlay_button/computer_mode"); - public static final UITexture OVERLAY_BUTTON_SAVE = UITexture.fullImage(GTPlusPlus.ID, "gui/overlay_button/save"); - public static final UITexture OVERLAY_BUTTON_LOAD = UITexture.fullImage(GTPlusPlus.ID, "gui/overlay_button/load"); - public static final UITexture OVERLAY_BUTTON_NUCLEAR_SWITCH = UITexture - .fullImage(GTPlusPlus.ID, "gui/overlay_button/nuclear_switch"); - public static final UITexture OVERLAY_BUTTON_ARROW_LEFT = UITexture - .fullImage(GTPlusPlus.ID, "gui/overlay_button/arrow_left"); - public static final UITexture OVERLAY_BUTTON_ARROW_RIGHT = UITexture - .fullImage(GTPlusPlus.ID, "gui/overlay_button/arrow_right"); public static final UITexture[] OVERLAY_BUTTON_DIRECTION = new UITexture[] { UITexture.fullImage(GTPlusPlus.ID, "gui/overlay_button/bottom"), UITexture.fullImage(GTPlusPlus.ID, "gui/overlay_button/top"), @@ -139,14 +125,6 @@ public class GTPP_UITextures { .fullImage(GTPlusPlus.ID, "gui/picture/workbench_circle"); public static final UITexture PICTURE_ARROW_WHITE_DOWN = UITexture .fullImage(GTPlusPlus.ID, "gui/picture/arrow_white_down"); - public static final UITexture PICTURE_V202 = UITexture.fullImage(GTPlusPlus.ID, "gui/picture/v202"); - public static final UITexture PICTURE_COMPUTER_TOP = UITexture.fullImage(GTPlusPlus.ID, "gui/picture/computer_top"); - public static final UITexture PICTURE_COMPUTER_GRID = UITexture - .fullImage(GTPlusPlus.ID, "gui/picture/computer_grid"); - public static final UITexture PICTURE_ARROWS_SEPARATE = UITexture - .fullImage(GTPlusPlus.ID, "gui/picture/arrows_separate"); - public static final UITexture PICTURE_ARROWS_FUSION = UITexture - .fullImage(GTPlusPlus.ID, "gui/picture/arrows_fusion"); public static final UITexture PICTURE_REDSTONE_CIRCUIT_SCREEN = UITexture .fullImage(GTPlusPlus.ID, "gui/picture/redstone_circuit_screen"); public static final UITexture PICTURE_ELECTRICITY_ERROR = UITexture diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/DataStickSlotWidget.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/DataStickSlotWidget.java deleted file mode 100644 index 7070fe5c8d..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/widget/DataStickSlotWidget.java +++ /dev/null @@ -1,31 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.gui.widget; - -import com.gtnewhorizons.modularui.api.ModularUITextures; -import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; -import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; -import com.gtnewhorizons.modularui.common.widget.SlotWidget; - -import gregtech.api.enums.ItemList; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.util.GT_Utility; - -public class DataStickSlotWidget extends SlotWidget { - - public DataStickSlotWidget(IItemHandlerModifiable handler, int index) { - this(new BaseSlot(handler, index) { - - @Override - public int getSlotStackLimit() { - return 1; - } - }); - } - - private DataStickSlotWidget(BaseSlot slot) { - super(slot); - setFilter( - stack -> GT_Utility.areStacksEqual(stack, ItemList.Tool_DataStick.get(1), true) - || GT_Utility.areStacksEqual(stack, ItemList.Tool_DataOrb.get(1), true)); - setBackground(ModularUITextures.ITEM_SLOT, GT_UITextures.OVERLAY_SLOT_DATA_ORB); - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java index abcfa09f13..cac8aa742f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/TexturesGtBlock.java @@ -580,7 +580,6 @@ public class TexturesGtBlock { public static final CustomIcon Casing_Electric_Auto_Workbench_Side = new CustomIcon( "TileEntities/gt4/OVERLAY_SIDE_CABINET"); - public static final CustomIcon Casing_Computer_Cube = new CustomIcon("TileEntities/gt4/computer"); public static final CustomIcon Casing_CropHarvester_Cutter = new CustomIcon("TileEntities/gt4/OVERLAY_CROP"); public static final CustomIcon Casing_CropHarvester_Boxes = new CustomIcon("TileEntities/gt4/OVERLAY_BOXES"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java deleted file mode 100644 index e14d8eec78..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java +++ /dev/null @@ -1,81 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.computer; - -import static gregtech.api.enums.Mods.BartWorks; -import static gregtech.api.enums.Mods.GoodGenerator; -import static gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube.sReactorList; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; - -import Ic2ExpReactorPlanner.ComponentFactory; -import gregtech.api.enums.ItemList; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.util.GT_ModHandler; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.bartworks.BW_Utils; -import gtPlusPlus.xmod.goodgenerator.GG_Utils; - -public class GT_ComputerCube_Setup { - - public static void init() { - Logger.INFO( - "[Reactor Simulator] Added " + ComponentFactory.getComponentCount() - + " components to ComponentFactory."); - if (sReactorList == null) { - sReactorList = new ArrayList<GT_ItemStack>(); - - String[] aIc2Items = new String[] { "reactorUraniumSimple", "reactorUraniumDual", "reactorUraniumQuad", /* - * "reactorIsotopeCell", - */ - "reactorReflector", "reactorReflectorThick", "reactorCoolantSimple", "reactorCoolantTriple", - "reactorCoolantSix", "reactorCondensator", "reactorCondensatorLap", "reactorPlating", - "reactorPlatingHeat", "reactorPlatingExplosive", "reactorVent", "reactorVentCore", - "reactorVentGold", "reactorVentSpread", "reactorVentDiamond", "reactorHeatSwitch", - "reactorHeatSwitchCore", "reactorHeatSwitchSpread", - "reactorHeatSwitchDiamond", /* "reactorHeatpack", */ - }; - - for (String aItem : aIc2Items) { - ItemStack aStack = GT_ModHandler.getIC2Item(aItem, 1); - if (!ItemUtils.checkForInvalidItems(aStack)) { - Logger.INFO("Unable to find IC2 Item: " + aItem); - CORE.crash("Unable to find IC2 Item: " + aItem); - } else { - sReactorList.add(new GT_ItemStack(aStack.copy())); - } - } - - ItemList[] aGtItems = new ItemList[] { ItemList.Neutron_Reflector, ItemList.Moxcell_1, ItemList.Moxcell_2, - ItemList.Moxcell_4, /* ItemList.Uraniumcell_1, ItemList.Uraniumcell_2, ItemList.Uraniumcell_4, */ - ItemList.NaquadahCell_1, ItemList.NaquadahCell_2, ItemList.NaquadahCell_4, ItemList.ThoriumCell_1, - ItemList.ThoriumCell_2, ItemList.ThoriumCell_4, ItemList.MNqCell_1, ItemList.MNqCell_2, - ItemList.MNqCell_4, ItemList.Reactor_Coolant_He_1, ItemList.Reactor_Coolant_He_3, - ItemList.Reactor_Coolant_He_6, ItemList.Reactor_Coolant_NaK_1, ItemList.Reactor_Coolant_NaK_3, - ItemList.Reactor_Coolant_NaK_6, ItemList.Reactor_Coolant_Sp_1, ItemList.Reactor_Coolant_Sp_2, - ItemList.Reactor_Coolant_Sp_3, ItemList.Reactor_Coolant_Sp_6 }; - - for (ItemList aItem : aGtItems) { - sReactorList.add(new GT_ItemStack(aItem.get(1))); - } - - if (BartWorks.isModLoaded()) { - ArrayList<ItemStack> aBartReactorItems = BW_Utils.getAll(1); - for (ItemStack aReactorItem : aBartReactorItems) { - sReactorList.add(new GT_ItemStack(aReactorItem)); - } - } - - if (GoodGenerator.isModLoaded()) { - ArrayList<ItemStack> aGlodReactorItems = GG_Utils.getAll(1); - for (ItemStack aReactorItem : aGlodReactorItems) { - sReactorList.add(new GT_ItemStack(aReactorItem)); - } - } - Logger.INFO( - "[Reactor Simulator] Added " + sReactorList.size() + " components to GT_TileEntity_ComputerCube."); - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java deleted file mode 100644 index 2e7a7c7ffb..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java +++ /dev/null @@ -1,294 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.computer; - -import java.util.ArrayList; - -import net.minecraft.item.ItemStack; - -import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; - -public class GT_Computercube_Description { - - public static ArrayList<GT_Computercube_Description> sDescriptions = new ArrayList<GT_Computercube_Description>(); - - public String[] mDescription; - - public ItemStack[] mStacks; - - public GT_Computercube_Description(String[] aDescription, ItemStack[] aStacks) { - this.mDescription = aDescription; - this.mStacks = aStacks; - sDescriptions.add(this); - } - - public static void addStandardDescriptions() { - Logger.INFO("Adding Default Description Set of the Computer Cube"); - new GT_Computercube_Description( - new String[] { "Lightning Rod", "Also known as the Bane of", "Alblaka. The Lightning Rod", - "enables you to gain Energy", "from Lightning! To set it up", "you just need the Block", - "itself, 4 HV-Transformers", "and a crapton of Ironfences,", "which you then place on top", - "of it. After that you have to", "wait for a Thunderstorm and", "when you are lucky you get", - "2.5 MFSU of Energy out of", "it. If a Rod is high enough", "then Rain is also enough to", - "get stroke, but with less", "probability ofcourse." }, - new ItemStack[] { GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), - GT_ModHandler.getIC2Item("ironFence", 1), GT_ModHandler.getIC2Item("ironFence", 1), - ItemList.Machine_IV_LightningRod.get(1), null, null, null, null, null, null, null, null, - null }); - new GT_Computercube_Description( - new String[] { "Quantum Chest", "You want to store tons of", "Materials into your Chests", - "but you hate the Item limit", "of them? Not anymore! The", "Quantum Chest is able to", - "store an INFINITE* amount", "of one single Item type per", "Chest.", - "This Chest stores your Items", "like Data and ever has a", "Stack of the Item ready for", - "extraction. It is compatible", "with any Item that doesnt", "have a NBT-Tag. You ask what", - "NBT is? I know it, thats enough.", "Up to 2147483391*" }, - new ItemStack[] { ItemList.Quantum_Chest_IV.get(1), ItemList.Quantum_Chest_EV.get(1), - ItemList.Quantum_Chest_HV.get(1), ItemList.Quantum_Chest_MV.get(1), - ItemList.Quantum_Chest_LV.get(1), null, null, null, null, null, null, null, null, null }); - new GT_Computercube_Description( - new String[] { "Quantum Tank", "You want to store tons of", "Fluids into your Tanks", - "but you hate the capacity", "of them? Not anymore! The", "Quantum Tank is able to", - "store an INFINITE* amount", "of one single Fluid type per", "Tank.", - "This Tank stores your Fluids", "like Data and ever has a", "Stack of the Fluid ready for", - "extraction. It is compatible", "with any Fluid. ", "You ask what", - "NBT is? I know it, thats enough.", "* = 2147483391" }, - new ItemStack[] { ItemList.Quantum_Tank_IV.get(1), ItemList.Quantum_Tank_EV.get(1), - ItemList.Quantum_Tank_HV.get(1), ItemList.Quantum_Tank_MV.get(1), - ItemList.Quantum_Tank_LV.get(1), null, null, null, null, null, null, null, null, null }); - new GT_Computercube_Description( - new String[] { "Computer Cube", "The Device you are", "currently using. This Computer", - "is running the G.L.A.D.-OS,", "which is containing many", "usefull Apps:", "- Reactor Planner", - "- Seedbag Scanner", "- Recipelists for GT-Devices", "- ", "- ", "- ", "- ", "- ", - "And the Description List you", "are currently reading.", "~This Device has private Access~" }, - new ItemStack[] { null, null, null, null, GregtechItemList.Gregtech_Computer_Cube_Machine.get(1), null, - null, null, null, null, null, null, null, null }); - /* - * new GT_Computercube_Description(new String[] { "UUM-Assembler", "It's like an automatic", - * "Crafting Table just for UUM", "It can store 20 UUM-Recipes", "and produces those on demand", - * "It costs 512EU per used piece", "of Universal-Usable-Matter(TM).", "The integrated Quantum Chest", - * "allows it to store all your", "UUM inside it.", "Top and Bottom are for Input,", - * "while the Output is on the", "Sides. The Output is designed,", "to work with RP-Managers, so", - * "build it into your recursive", "Autocraftingsystem.", "" }, new ItemStack[] { null, null, null, - * GT_ModHandler.getIC2Item("matter", 1), new ItemStack(GregTech_API.sBlockList[1], 1, 5), null, null, null, - * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Sonictron", - * "You like Music? Then the", "Sonictron 9001 is your best", "choice! You can compose Alarms,", - * "Doorbell Sounds or boring", "Elevator Music, with the 64 Slots", "inside it. Just leftclick them", - * "to switch the Sound, rightclick", "them to switch the modulation", "and shiftclick to remove it.", - * "Then apply Redstone to play", "With the mobile Version you can", "play sounds everywhere, after", - * "you copied them from a normal", "Sonictron via rightclicking", "Sneakrightclicking pastes", - * "Emits Redstone when finished." }, new ItemStack[] { null, null, null, GregTech_API.getGregTechItem(32, 1, - * 0), new ItemStack(GregTech_API.sBlockList[1], 1, 6), null, null, null, null, null, null, null, null, null }); - * new GT_Computercube_Description(new String[] { "L.E.S.U.", "The unlaggiest Multiblock ever!", - * "One Controllerblock, and as many", "'stupid' Storageblocks as you want.", "To use it, place one Controller", - * "and then place the LESU-Storages", "adjacent to it or other placed", "LESU-Storages. The Tier (max EU/t)", - * "of it depends on the amount of", "adjacent Storages. The", "Storageblocks are NOT TileEntities,", - * "what means that they cause as much", "Lag as a random Dirtblock. And the", - * "Controller Block only checks ONCE", "for the Storages, so no", "Blockiterationlag, AT. ALL. Anyone,", - * "who says that they lag gets murdered!" }, new ItemStack[] { null, null, null, new - * ItemStack(GregTech_API.sBlockList[0], 1, 6), new ItemStack(GregTech_API.sBlockList[1], 1, 7), null, null, - * null, null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "I.D.S.U.", - * "The Interdimensional Storage Unit", "is a Device, which is like a", "wireless, crossdimensional and", - * "enderchestlike EU-Storage Block", "", "Every Player has one Network of", "these. The ID is determined by", - * "the Hashcode of the Name from the", "first Player, who opens it's GUI", "", "It stores up to 1 Billion EU", - * "and emits EV. But you need at", "least two of them for Energy", "Transfer", "", "" }, new ItemStack[] { - * null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 8), null, null, null, null, null, null, - * null, null, null }); new GT_Computercube_Description(new String[] { "A.E.S.U.", - * "The Adjustable Energy Storage Unit", "is like 10 MFSU and has an", "adjustable Output between 0 and", - * "2048EU/t. You could use it as a", "Transformer. It is Tier-IV, so", "it's basically needed to charge", - * "Energy Orbs and Lapotron Packs", "", "Not much else to say about it.", "", "", "", "", "", "", "" }, new - * ItemStack[] { null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 9), null, null, null, - * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Charge-O-Mat", - * "An automatable Charging Bench", "It puts (de-)charged Tools into", "the right Outputslots, which are", - * "accessible on the Sides of it.", "", "The Energy Orb inside stores enough", - * "to charge your QSuit almost instantly", "", "This is a Tier-V Charging Station", - * "even when the Max-IN/OUT is only", "2048EU/t. It also charges your Armor", - * "when you are standing close to it.", "", "If you apply Redstone, then it", "decharges instead.", "" }, new - * ItemStack[] { null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 10), null, null, null, - * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Centrifuge", - * "This is a Machine to seperate", "Isotopes.", "", "It has a maximum Consumption Rate", - * "of 5EU/t, and its Maxinput is", "32EU/t. The time it needs depends", "on the Recipe you use.", "", - * "It needs Tin Cells for some Recipes,", "which you put in the Top Left Slot", "", "Top = Input", - * "Bottom = Tin Cells", "Side = Output", "", "You can pipe Lava into this Device" }, new ItemStack[] { null, - * null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 11), null, null, null, null, null, null, null, - * null, null }); new GT_Computercube_Description(new String[] { "Electrolyzer", - * "This is a Machine to seperate", "Molecules and electrolyze", "Watercells.", "", - * "It has a maximum Consumption Rate", "of 128EU/t, and its Maxinput is", "128EU/t. The time it needs depends", - * "on the Recipe you use.", "", "It needs Tin Cells for some Recipes,", - * "which you put in the Bottom Left Slot", "", "Top = Input", "Bottom = Tin Cells", "Side = Output", "" }, new - * ItemStack[] { null, null, null, null, new ItemStack(GregTech_API.sBlockList[1], 1, 25), null, null, null, - * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Grinder", - * "This Machines purpose is to", "macerate and grind Ores.", "It can ONLY grind Ores, don't", - * "try regular Macerator Recipes.", "It has a fixed Consumption Rate", "of 128EU/t, and its Maxinput is", - * "128EU/t. The time it needs is", "5 seconds per Ore Block", "It needs Water for most Recipes,", - * "which you put in the Bottom Left Slot", "Top = Input", "Bottom = Water", "Side = Output", - * "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", "for this Device. (see GUI)" - * }, new ItemStack[] { null, new ItemStack(Block.field_71943_B, 1), new ItemStack(GregTech_API.sBlockList[0], - * 1, 14), new ItemStack(GregTech_API.sBlockList[0], 1, 13), new ItemStack(GregTech_API.sBlockList[1], 1, 28), - * null, null, null, null, null, null, null, null, null }); - */ - new GT_Computercube_Description( - new String[] { "Electric Blast Furnace", "You may know the Blast Furnace", - "of Railcraft. This one works", "similar, as it can also produce", - "Steel out of Iron and Coal.", "", "Its heat Capacity depends on the", - "used Machine Casings for building", "it. The better they are, the more", - "Heat it can achieve.", "", "Top = Input 1", "Bottom = Input 2", "Side = Output", - "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", - "for this Device. (see GUI)" }, - new ItemStack[] { null, null, null, ItemList.Casing_HeatProof.get(1), - ItemList.Machine_Multi_BlastFurnace.get(1), ItemList.Casing_Coil_Cupronickel.get(1), - ItemList.Casing_Coil_Kanthal.get(1), ItemList.Casing_Coil_Nichrome.get(1), - ItemList.Casing_Coil_TungstenSteel.get(1), ItemList.Casing_Coil_HSSG.get(1), - ItemList.Casing_Coil_HSSS.get(1), ItemList.Casing_Coil_Naquadah.get(1), - ItemList.Casing_Coil_NaquadahAlloy.get(1), null }); - /* - * new GT_Computercube_Description(new String[] { "Sawmill", "This Device turns your Logs", - * "into more Planks, than a normal", "Steve can produce with his Hands.", "", - * "Its byproduct, Wood Pulp, can be", "compressed into special Planks,", "which are burning like Charcoal.", - * "", "It needs Water for most Recipes,", "which you put in the Bottom Left Slot", "Top = Input", - * "Water Sides = Water", "Saw Side = Output", "Its a lagfree Multiblock Structure,", - * "so you need a special Machine Casing", "for this Device. (see GUI)" }, new ItemStack[] { null, null, - * GT_MetaItem_Material.instance.getStack(15, 1), GT_MetaItem_Dust.instance.getStack(15, 1), new - * ItemStack(GregTech_API.sBlockList[1], 1, 32), null, null, null, null, null, null, null, null, null }); - */ - new GT_Computercube_Description( - new String[] { "Implosion Compressor", "You need to turn Dusts back", "into Gems? Or do you just want", - "to make Iridium Plates?", "With a bit ITNT you can achieve", "that in this Device!", "", - "We strongly recommend to use", "Flint Dust instead of Flints", "for making the ITNT.", "", - "Top = Input", "Explosion Sides = Output", "ITNT Side = ITNT Input", - "Its a lagfree Multiblock Structure,", "so you need a special Machine Casing", - "for this Device. (see GUI)" }, - new ItemStack[] { null, null, null, - GT_ModHandler.getIC2Item("industrialTnt", 1, new ItemStack(net.minecraft.init.Blocks.tnt, 1)), - ItemList.Machine_Multi_ImplosionCompressor.get(1), null, null, null, null, null, null, null, - null, null }); - /* - * new GT_Computercube_Description(new String[] { "Superconductor", "Expensive, but superconducting", - * "nearly infinite EU/p and it has", "no Cableloss!", "Do not confuse this with the", "Superconductor Item!", - * "", "Supercondensator", "This is a special kind of Transformer", "It allows you to convert anything down", - * "to 8192 EU/t, what is like a normal HVT.", "But if you apply Redstone to it then it", - * "outputs friggin 1000000EU/t!!!", "", "You also need it for the Fusion Reactor.", - * "Some Machines will require that high", "Voltage in a short period of time." }, new ItemStack[] { null, null, - * GregTech_API.getGregTechItem(3, 1, 2), new ItemStack(GregTech_API.sBlockList[1], 1, 12), new - * ItemStack(GregTech_API.sBlockList[1], 1, 15), null, null, null, null, null, null, null, null, null }); new - * GT_Computercube_Description(new String[] { "Player Detector", "This nice little Device is able", - * "to detect Players in a Range of", "16-Spherical Meters and a", "EU-Consumption of 2.5EU/t.", "", - * "It can be switched to 3 Diffrent", "Modes, to detect YOURSELF, OTHERS", - * "and ALL Players by Rightclicking it.", "", "It doesnt detect regular Mobs.", "", "", "", "", "", - * "~This Device has private Access~" }, new ItemStack[] { null, null, null, null, new - * ItemStack(GregTech_API.sBlockList[1], 1, 13), null, null, null, null, null, null, null, null, null }); - */ - new GT_Computercube_Description( - new String[] { "Matter Fabricator", "The Matter Fabricator is nothing", - "else than a Mass Fabricator, which", "can ONLY run on Scrap and other", "Amplifiers.", "", - "With the Default Config it is 100", "times more expensive than normal.", - "Of course you can set the Config", "to 166666, to get your normal", - "Massfabricationrate back, or you", "could make Mass Fabrication even", - "cheaper, if you really want to", "make Mass Fabrication that easy", "", "", "" }, - new ItemStack[] { null, null, null, GT_Utility.getFluidDisplayStack(FluidUtils.getUUM(1), false), - ItemList.Machine_LV_Massfab.get(1), null, null, null, null, null, null, null, null, null }); - new GT_Computercube_Description( - new String[] { "Electric Autocrafting Tables", "These are Crafting Tables for the", - "common need of autocrafting in", "Factories. One Craft needs 5000EU to", - "be performed, so you have actually to", "lay Wires to it. This Table is", - "unique as its also able, to give you", "the used Capsulecellcontainers, made", - "by Industrial Corp, back.", "You may use that behaviour to", - "craft anything releated to chemics,", "like the 2xKNO3-Recipe for Saltpeter.", - "The 5 Modes are the following:", "1. Craft Recipe, 2. All 5 Modes", - "3. Craft all as single Items", "4. 2x2-Grid and 5. a 3x3-Grid.", - "It accepts only 32EU/p as Input." }, - new ItemStack[] { null, null, null, null, GregtechItemList.GT4_Electric_Auto_Workbench_LV.get(1), null, - null, null, null, null, null, null, null, null }); - /* - * new GT_Computercube_Description(new String[] { "Automation with GregTech", - * "Translocators and Buffers are the", "newest Way to automate your Machines.", - * "Screw Buildcraft, these EU-wasting", "Devices are much more awesome.", - * "They output 32EU/t to their directed", "IN- and OUT-puts, making them usefull", - * "for things, like saving wires.", "Translocators are taking Stuff from", - * "the Block at their green Inputfacing", "and putting it into the Block at the", - * "red Outputfacing. Buffers do the same,", "but the grab Items from their own", - * "Inventory, what makes them usefull", "as Pipe-replacement.", "Buffers also have Redstone Intelligence,", - * "which you can configure in their GUI." }, new ItemStack[] { null, null, new - * ItemStack(GregTech_API.sBlockList[1], 1, 19), new ItemStack(GregTech_API.sBlockList[1], 1, 18), new - * ItemStack(GregTech_API.sBlockList[1], 1, 17), null, null, null, null, null, null, null, null, null }); new - * GT_Computercube_Description(new String[] { "Silver Ore", "It's rarity is similar to Gold", - * "Silver can be used, to make", "Circuits cheaper, or you can use", "it for Redpowerstuff.", "", "", "", "", - * "", "", "", "", "", "", "", "" }, new ItemStack[] { null, null, GT_OreDictUnificator.get("dustSilver", 1), - * GregTech_API.getGregTechItem(0, 1, 17), new ItemStack(GregTech_API.sBlockList[2], 1, 1), null, null, null, - * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Sapphires and Rubys", - * "These spawn exactly like Emeralds.", "But Rubies are found in Deserts,", "while Sapphires can be found in", - * "Oceans.", "", "They currently make only a cheaper", "Recipe for Energycrystals and", - * "Lapotroncrystals, but they are", "Redpower Compatible.", "", "They also sometimes drop random", - * "other Gems, like Garnet for Ruby", "or green Sapphire for Sapphire", "in addition.", "", "" }, new - * ItemStack[] { null, GregTech_API.getGregTechItem(0, 1, 32), new ItemStack(GregTech_API.sBlockList[2], 1, 3), - * GregTech_API.getGregTechItem(0, 1, 33), new ItemStack(GregTech_API.sBlockList[2], 1, 4), null, null, null, - * null, null, null, null, null, null }); new GT_Computercube_Description(new String[] { "Bauxite Ore", - * "The Stuff out of which you can", "produce Aluminium and also", "Titanium.", - * "You find this Ore in Plains and", "Forests.", "", "If you think Aluminium is useless", - * "then note, that mobs NEVER spawn", "ontop of an Aluminium Block", "(Same applies also for Silver-,", - * "Gem- and Iridium Blocks)", "Production Chain:", "macerating Bauxite Ore", "electrolyzing 24 Bauxite Dust", - * "smelting Aluminium Dust in a", "Blast Furnace" }, new ItemStack[] { new - * ItemStack(GregTech_API.sBlockList[0], 1, 7), GregTech_API.getGregTechItem(0, 1, 18), - * GregTech_API.getGregTechItem(1, 1, 18), GregTech_API.getGregTechItem(1, 1, 17), new - * ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null, null, null, null, null }); new - * GT_Computercube_Description(new String[] { "Titanium", "Produced by centrifuging Bauxitedust", - * "as a byproduct, this Material can make", "anything much more resistant against", "damage, like Explosions.", - * "Blocks made of Titaniumingots have a", "large Blastresistance", "", "It can also be used to craft tons of", - * "mixed Metal Ingots", "", "", "", "", "", "", "" }, new ItemStack[] { new - * ItemStack(GregTech_API.sBlockList[0], 1, 8), GregTech_API.getGregTechItem(0, 1, 19), - * GregTech_API.getGregTechItem(1, 1, 19), GregTech_API.getGregTechItem(1, 1, 17), new - * ItemStack(GregTech_API.sBlockList[2], 1, 5), null, null, null, null, null, null, null, null, null }); new - * GT_Computercube_Description(new String[] { "Iridium Ore", "You can find it only when you", - * "stripmine very large Areas with", "Quarries and such. There is only", "one in every 5th-10th Chunk.", - * "It's even more rare in Oceans!", "", "Some people disable the UUM-Recipe", - * "for Iridium, for making getting it", "an Achievement.", "", "However Iridium Ore contains traces", - * "of Platinum, so it's best to use the", "Industrial Grinder for this Ore.", "", "", "" }, new ItemStack[] { - * null, null, GT_OreDictUnificator.get("plateAlloyIridium", 1), GT_ModHandler.getIC2Item("iridiumOre", 1), new - * ItemStack(GregTech_API.sBlockList[2], 1, 2), null, null, null, null, null, null, null, null, null }); new - * GT_Computercube_Description(new String[] { "Helium Coolant Cell", "These are just cheaper, than the", - * "Water based Coolant Cells, and can", "also hold six times more Heat.", "", - * "Helium Cells can also be used for", "making Luminators and Mininglasers", "", "", "", "", "", "", "", "", - * "", "" }, new ItemStack[] { GregTech_API.getGregTechItem(2, 1, 6), GregTech_API.getGregTechItem(2, 1, 3), - * GregTech_API.getGregTechItem(34, 1, 0), GregTech_API.getGregTechItem(35, 1, 0), - * GregTech_API.getGregTechItem(36, 1, 0), null, null, null, null, null, null, null, null, null }); new - * GT_Computercube_Description(new String[] { "Destructopack", "Open its GUI via rightclick and", - * "dump all the useless Stuff from", "your Inventory into it, instead of", "littering Items into the World.", - * "", "", "", "", "", "", "", "", "", "", "", "" }, new ItemStack[] { null, null, null, null, - * GregTech_API.getGregTechItem(33, 1, 0), null, null, null, null, null, null, null, null, null }); - */ - new GT_Computercube_Description( - new String[] { "Data Orbs", "They store Data.", "", "Rightclick on a Computer Cube, to", - "extract a Reactorplan", "", "Sneak-Rightclick on it, to insert", "a Reactorplan", "", - "Works also with Sonictrons", "", "", "", "", "", "", "" }, - new ItemStack[] { null, null, null, null, ItemList.Tool_DataOrb.get(1), null, null, null, null, null, - null, null, null, null }); - new GT_Computercube_Description( - new String[] { "Energy Orbs", "100 Million EU in one Orb!", "", "This is a Tier-IV-Energystorage", - "So a MFSU is not enough for it!", "", "Use it to create a Lapotron Pack,", - "which is like an ultimate Lap Pack!", "", "", "", "", "", "", "", "", "" }, - new ItemStack[] { null, null, null, null, ItemList.Energy_LapotronicOrb.get(1), null, null, null, null, - null, null, null, null, null }); - new GT_Computercube_Description( - new String[] { "Iridium Neutron Reflector", "It's used for Fusion Reactor Coils,", - "and works like a normal one", "inside a Reactor, but it's also", "INDESTRUCTIBLE*.", "", "", - "", "", "", "", "", "", "", "", "", "* = for weardown" }, - new ItemStack[] { null, null, null, null, ItemList.Neutron_Reflector.get(1), null, null, null, null, - null, null, null, null, null }); - /* - * new GT_Computercube_Description(new String[] { "Rock Cutter", "You want to get whole Blocks, but", - * "your Drill is not enchantable?", "The Rock Cutter has an awesome", "SilkTouch-III-Function!", "", - * "It works like a Drill, but you", "get the whole Block instead of", "'macerated' Ores!", "", - * "Put those Blocks into a Macerator", "and double your Diamond Income!", "", "Or better. Use the Industrial", - * "Grinder to get even more", "Resources!", "" }, new ItemStack[] { null, null, null, null, - * GregTech_API.getGregTechItem(46, 1, 0), null, null, null, null, null, null, null, null, null }); new - * GT_Computercube_Description(new String[] { "Tesla Staff", "This completly untested PvP-Weapon", - * "destroys electric Armor in one hit", "", "The Energy Orb inside it must be", - * "fully charged to let this work.", "", "We are not responsible for any", "Electrocution Damage to yourself,", - * "while using it.", "", "We also dont even know, if this", "Weapon has any effect AT ALL.", "", "", "", "" }, - * new ItemStack[] { null, null, null, null, GregTech_API.getGregTechItem(47, 1, 0), null, null, null, null, - * null, null, null, null, null }); - */ - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java deleted file mode 100644 index 31f378066f..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java +++ /dev/null @@ -1,152 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.computer; - -import java.util.ArrayList; -import java.util.HashMap; - -import Ic2ExpReactorPlanner.AutomationSimulator; -import Ic2ExpReactorPlanner.Reactor; -import Ic2ExpReactorPlanner.SimulationData; -import Ic2ExpReactorPlanner.components.ReactorItem; -import gregtech.api.objects.GT_ItemStack; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube; - -public class GT_Computercube_Simulator { - - private static final HashMap<Integer, Pair<Integer, Integer>> sSlotPositions = new HashMap<Integer, Pair<Integer, Integer>>(); - - static { - int aSlot = 4; - for (int column = 0; column < 6; column++) { - for (int row = 0; row < 9; row++) { - sSlotPositions.put(aSlot++, new Pair<Integer, Integer>(row, column)); - } - } - } - - private final Reactor reactor = new Reactor(); - - public AutomationSimulator simulator = null; - /** - * The reactor that was last simulated. - */ - public Reactor simulatedReactor = null; - - private String currentReactorCode = null; - - private String currentReactorOldCode = null; - - private ArrayList<String> output = new ArrayList<String>(); - - private final GT_TileEntity_ComputerCube mTile; - - public GT_Computercube_Simulator(GT_TileEntity_ComputerCube aTile) { - mTile = aTile; - } - - public void slotClick(int aSlot, GT_ItemStack aStack) { - - /* - * if (selection != null) { componentToPlace = ComponentFactory.createComponent(selection.getActionCommand()); - * if (componentToPlace != null) { - * componentToPlace.setInitialHeat(((Number)componentHeatSpinner.getValue()).intValue()); - * componentToPlace.setAutomationThreshold(((Number)placingThresholdSpinner.getValue()).intValue()); - * componentToPlace.setReactorPause(((Number)placingReactorPauseSpinner.getValue()).intValue()); } } - */ - if (aSlot >= 4 && aSlot < 58) { - Pair<Integer, Integer> aSpot = sSlotPositions.get(aSlot); - ReactorItem aItem; - if (aStack == null) { - aItem = null; - } else { - - Logger.INFO( - "Using lookup key: " + ItemUtils.getModId( - aStack.toStack()) + "." + aStack.mItem.getUnlocalizedName() + "." + aStack.mMetaData); - aItem = ReactorItem.sComponentMap.get( - ItemUtils.getModId(aStack.toStack()) + "." - + aStack.mItem.getUnlocalizedName() - + "." - + aStack.mMetaData); - } - int aRow = aSpot.getKey(); - int aColumn = aSpot.getValue(); - Logger.INFO("Putting " + (aItem == null ? "null" : aItem.name) + " at x:" + aRow + ", y:" + aColumn); - reactor.setComponentAt(aColumn, aRow, aItem); - currentReactorCode = reactor.getCode(); - currentReactorOldCode = reactor.getOldCode(); - Logger.INFO("Code: " + currentReactorCode); - } - // maxHeatLabel.setText(formatI18n("UI.MaxHeatSpecific", reactor.getMaxHeat())); - // heatSpinnerModel.setMaximum(reactor.getMaxHeat() - 1); - // heatSpinnerModel.setValue(Math.min(((Number)heatSpinnerModel.getValue()).intValue(), reactor.getMaxHeat() - - // 1)); - // temperatureEffectsLabel.setText(formatI18n("UI.TemperatureEffectsSpecific", (int) (reactor.getMaxHeat() * - // 0.4), (int) (reactor.getMaxHeat() * 0.5), (int) (reactor.getMaxHeat() * 0.7), (int) (reactor.getMaxHeat() * - // 0.85), (int) (reactor.getMaxHeat() * 1.0))); - } - - public void simulate() { - /* - * if (Utils.isClient()) { return; } - */ - if (simulator != null && simulator.isRunning()) { - Logger.INFO("Simulator Running, Stopping."); - simulator.cancel(); - } - Logger.INFO("Starting Simulator."); - mTile.mHeat = 0; - mTile.mEU = 0; - currentReactorCode = reactor.getCode(); - currentReactorOldCode = reactor.getOldCode(); - output.clear(); - simulatedReactor = new Reactor(); - simulatedReactor.setCode(reactor.getCode()); - Logger.INFO("Making new AutomationSimulator."); - simulator = new AutomationSimulator(simulatedReactor, output, mTile); - Logger.INFO("Starting AutomationSimulator.process()."); - simulator.process(); - Logger.INFO("Done."); - - SimulationData aData = simulator.getData(); - if (aData != null && aData.totalReactorTicks > 0) { - mTile.mEU = aData.avgEUoutput * aData.totalReactorTicks; - mTile.mEUOut = aData.avgEUoutput; - mTile.mHeat = aData.avgHUoutput; - mTile.mMaxHeat = aData.maxHUoutput; - mTile.mExplosionStrength = aData.explosionPower; - mTile.mHEM = (float) aData.hullHeating; - mTile.mProgress = aData.totalReactorTicks; - } - - for (String s : output) { - Logger.INFO(" " + s); - } - } - - public ArrayList<String> getOutputData() { - return output; - } - - private void clearGrid() { - reactor.clearGrid(); - /* - * for (int i = 0; i < reactorButtons.length; i++) { for (int j = 0; j < reactorButtons[i].length; j++) { - * reactorButtons[i][j].setIcon(null); reactorButtons[i][j].setToolTipText(null); - * reactorButtonPanels[i][j].setBackground(Color.LIGHT_GRAY); } } - */ - output.clear(); - /* - * materialsArea.setText(reactor.getMaterials().toString()); - * componentListArea.setText(reactor.getComponentList().toString()); - * maxHeatLabel.setText(formatI18n("UI.MaxHeatSpecific", reactor.getMaxHeat())); - * heatSpinnerModel.setMaximum(reactor.getMaxHeat() - 1); heatSpinnerModel.setValue(Math.min(((Number) - * heatSpinnerModel.getValue()).intValue(), reactor.getMaxHeat() - 1)); - * temperatureEffectsLabel.setText(formatI18n("UI.TemperatureEffectsSpecific", (int)(reactor.getMaxHeat() * - * 0.4), (int)(reactor.getMaxHeat() * 0.5), (int)(reactor.getMaxHeat() * 0.7), (int)(reactor.getMaxHeat() * - * 0.85), (int)(reactor.getMaxHeat() * 1.0))); lockCode = true; codeField.setText(null); lockCode = false; - */ - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java deleted file mode 100644 index aa0b703a1e..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java +++ /dev/null @@ -1,1420 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.tileentities.misc; - -import static gregtech.api.enums.GT_Values.V; -import static gregtech.api.util.GT_Recipe.GT_Recipe_Map.sScannerFakeRecipes; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.stream.Collectors; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; - -import com.gtnewhorizons.modularui.api.ModularUITextures; -import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; -import com.gtnewhorizons.modularui.api.screen.ModularWindow; -import com.gtnewhorizons.modularui.api.screen.UIBuildContext; -import com.gtnewhorizons.modularui.common.internal.wrapper.BaseSlot; -import com.gtnewhorizons.modularui.common.widget.ButtonWidget; -import com.gtnewhorizons.modularui.common.widget.DrawableWidget; -import com.gtnewhorizons.modularui.common.widget.FakeSyncWidget; -import com.gtnewhorizons.modularui.common.widget.ProgressBar; -import com.gtnewhorizons.modularui.common.widget.SlotWidget; -import com.gtnewhorizons.modularui.common.widget.TextWidget; - -import Ic2ExpReactorPlanner.SimulationData; -import cpw.mods.fml.common.FMLCommonHandler; -import gregtech.api.GregTech_API; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.gui.modularui.GT_UIInfos; -import gregtech.api.gui.modularui.GT_UITextures; -import gregtech.api.interfaces.ITexture; -import gregtech.api.interfaces.modularui.IAddGregtechLogo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.objects.ItemData; -import gregtech.api.util.GT_AssemblyLineUtils; -import gregtech.api.util.GT_Assemblyline_Server; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; -import gregtech.api.util.GT_Utility; -import gregtech.common.items.behaviors.Behaviour_DataOrb; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.xmod.gregtech.api.gui.GTPP_UITextures; -import gtPlusPlus.xmod.gregtech.api.gui.widget.DataStickSlotWidget; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; -import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description; -import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Simulator; - -public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank implements IAddGregtechLogo { - - public static int MODE_MAIN = 0; - public static int MODE_REACTOR_PLANNER = 1; - public static int MODE_SCANNER = 2; - public static int MODE_CENTRIFUGE = 3; - public static int MODE_FUSION = 4; - public static int MODE_INFO = 5; - public static int MODE_ELECTROLYZER = 6; - - public static boolean mSeedscanner = true; - - public static boolean mReactorplanner = true; - - public static ArrayList<GT_ItemStack> sReactorList; - - public boolean mStarted = false; - - public int mMode = 0; - - public int mHeat = 0; - - public long mEUOut = 0; - - public int mMaxHeat = 1; - - public long mEU = 0; - - public int mProgress = 0; - public int mMaxProgress = 0; - - public int mEUTimer = 0; - - public int mEULast1 = 0; - - public int mEULast2 = 0; - - public int mEULast3 = 0; - - public int mEULast4 = 0; - - public float mHEM = 1.0F, mExplosionStrength = 0.0F; - - public String mFusionOutput = ""; - - private boolean mNeedsUpdate; - - private GT_Computercube_Simulator mSimulator; - - public GT_TileEntity_ComputerCube(final int aID, final String aDescription) { - super(aID, "computer.cube", "Computer Cube MKII", 5, 114, aDescription); - } - - public GT_TileEntity_ComputerCube(final String aName, final String aDescription, final ITexture[][][] aTextures) { - super(aName, 5, 114, aDescription, aTextures); - } - - @Override - public String[] getDescription() { - return new String[] { this.mDescription, "Built in Reactor Planner", "Built in Scanner", "Built in Info-Bank", - "Displays Fusion Recipes", CORE.GT_Tooltip.get() }; - } - - @Override - public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { - GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer); - return true; - } - - @Override - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_TileEntity_ComputerCube(this.mName, this.mDescription, this.mTextures); - } - - @Override - public boolean isAccessAllowed(EntityPlayer aPlayer) { - ItemStack tStack = aPlayer.getCurrentEquippedItem(); - if (tStack != null && ItemList.Tool_DataOrb.isStackEqual(tStack)) { - return false; - } - return true; - } - - public final GT_Computercube_Simulator getSimulator() { - return this.mSimulator; - } - - public final void setSimulator(GT_Computercube_Simulator mSimulator) { - this.mSimulator = mSimulator; - } - - @Override - public boolean isSimpleMachine() { - return true; - } - - @Override - public boolean isEnetInput() { - return true; - } - - @Override - public boolean isInputFacing(ForgeDirection aDirection) { - return true; - } - - @Override - public long maxAmperesIn() { - return 4; - } - - @Override - public long maxEUInput() { - return GT_Values.V[4]; - } - - @Override - public long maxEUStore() { - return GT_Values.V[5] * 1024; - } - - @Override - public boolean ownerControl() { - return false; - } - - @Override - public int getSizeInventory() { - return 114; - } - - @Override - public boolean isValidSlot(int aIndex) { - return (aIndex > 53 && aIndex < 58); - } - - @Override - public boolean isFacingValid(ForgeDirection facing) { - return true; - } - - public void saveNuclearReactor() { - for (int i = 0; i < 54; i++) { - if (this.mInventory[i] == null) { - this.mInventory[i + 59] = null; - } else { - this.mInventory[i + 59] = this.mInventory[i].copy(); - } - } - } - - public void loadNuclearReactor() { - for (int i = 0; i < 54; i++) { - if (this.mInventory[i + 59] == null) { - this.mInventory[i] = null; - } else { - this.mInventory[i] = this.mInventory[i + 59].copy(); - } - } - } - - public int getXCoord() { - return this.getBaseMetaTileEntity().getXCoord(); - } - - public int getYCoord() { - return this.getBaseMetaTileEntity().getYCoord(); - } - - public int getZCoord() { - return this.getBaseMetaTileEntity().getZCoord(); - } - - public void reset() { - this.mEU = 0; - this.mHeat = 0; - this.mEUOut = 0; - this.mMaxHeat = 10000; - this.mHEM = 1.0F; - this.mExplosionStrength = 0.0F; - this.mProgress = 0; - this.mMaxProgress = 0; - this.mFusionOutput = ""; - this.mInventory[113] = null; - int i; - for (i = 0; i < 54; i++) { - this.mInventory[i] = null; - this.mInventory[i + 59] = null; - } - for (i = 54; i < 58; i++) { - if (this.mInventory[i] != null) { - if (!this.getWorld().isRemote) this.getWorld().spawnEntityInWorld( - (Entity) new EntityItem( - this.getWorld(), - this.getXCoord() + 0.5D, - this.getYCoord() + 0.5D, - this.getZCoord() + 0.5D, - this.mInventory[i])); - this.mInventory[i] = null; - } - } - } - - public void switchModeForward() { - int aTempMode = mMode; - aTempMode++; - if (aTempMode == MODE_ELECTROLYZER || aTempMode == MODE_CENTRIFUGE) { - aTempMode++; - } - if (aTempMode >= 7) { - aTempMode = 0; - } - mMode = aTempMode; - switchMode(); - } - - public void switchModeBackward() { - int aTempMode = mMode; - aTempMode--; - if (aTempMode == MODE_ELECTROLYZER || aTempMode == MODE_CENTRIFUGE) { - aTempMode--; - } - if (aTempMode < 0) { - aTempMode = 6; - } - mMode = aTempMode; - switchMode(); - } - - private void switchMode() { - reset(); - if (this.mMode == MODE_REACTOR_PLANNER && !mReactorplanner) { - switchMode(); - return; - } - if (this.mMode == MODE_SCANNER && !mSeedscanner) { - switchMode(); - return; - } - if (this.mMode == MODE_CENTRIFUGE) { - showCentrifugeRecipe(0); - } - if (this.mMode == MODE_FUSION) { - showFusionRecipe(0); - } - if (this.mMode == MODE_INFO) { - showDescription(0); - } - if (this.mMode == MODE_ELECTROLYZER) { - showElectrolyzerRecipe(0); - } - this.getWorld().addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 10, - this.mMode); - this.getWorld().addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 11, - this.mMaxHeat); - } - - public void showDescription(int aIndex) { - this.mExplosionStrength = 0.0F; - if (GT_Computercube_Description.sDescriptions.isEmpty()) { - return; - } - if (aIndex >= GT_Computercube_Description.sDescriptions.size() || aIndex < 0) aIndex = 0; - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[0] == null) { - this.mInventory[59] = null; - } else { - this.mInventory[59] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[0].copy(); - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[1] == null) { - this.mInventory[60] = null; - } else { - this.mInventory[60] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[1].copy(); - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[2] == null) { - this.mInventory[61] = null; - } else { - this.mInventory[61] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[2].copy(); - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[3] == null) { - this.mInventory[62] = null; - } else { - this.mInventory[62] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[3].copy(); - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[4] == null) { - this.mInventory[63] = null; - } else { - this.mInventory[63] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[4].copy(); - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[5] == null) { - this.mInventory[64] = null; - } else { - this.mInventory[64] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[5].copy(); - this.mExplosionStrength = 100.0F; - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[6] == null) { - this.mInventory[65] = null; - } else { - this.mInventory[65] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[6].copy(); - this.mExplosionStrength = 100.0F; - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[7] == null) { - this.mInventory[66] = null; - } else { - this.mInventory[66] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[7].copy(); - this.mExplosionStrength = 100.0F; - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[8] == null) { - this.mInventory[67] = null; - } else { - this.mInventory[67] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[8].copy(); - this.mExplosionStrength = 100.0F; - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[9] == null) { - this.mInventory[68] = null; - } else { - this.mInventory[68] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[9].copy(); - this.mExplosionStrength = 100.0F; - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[10] == null) { - this.mInventory[69] = null; - } else { - this.mInventory[69] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[10].copy(); - this.mExplosionStrength = 100.0F; - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[11] == null) { - this.mInventory[70] = null; - } else { - this.mInventory[70] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[11].copy(); - this.mExplosionStrength = 100.0F; - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[12] == null) { - this.mInventory[71] = null; - } else { - this.mInventory[71] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[12].copy(); - this.mExplosionStrength = 100.0F; - } - if (((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(aIndex)).mStacks[13] == null) { - this.mInventory[72] = null; - } else { - this.mInventory[72] = ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions - .get(aIndex)).mStacks[13].copy(); - this.mExplosionStrength = 100.0F; - } - this.mMaxHeat = aIndex; - this.getWorld().addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 11, - this.mMaxHeat); - } - - public void switchDescriptionPageForward() { - if (++this.mMaxHeat >= GT_Computercube_Description.sDescriptions.size()) this.mMaxHeat = 0; - showDescription(this.mMaxHeat); - } - - public void switchDescriptionPageBackward() { - if (--this.mMaxHeat < 0) this.mMaxHeat = GT_Computercube_Description.sDescriptions.size() - 1; - showDescription(this.mMaxHeat); - } - - public void showCentrifugeRecipe(int aIndex) { - /* - * if (aIndex >= GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size() || aIndex < 0) aIndex = 0; GT_Recipe - * tRecipe = GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.get(aIndex); if (tRecipe != null) { if - * (tRecipe.mInput1 == null) { this.mInventory[59] = null; } else { this.mInventory[59] = - * tRecipe.mInput1.copy(); } if (tRecipe.mInput2 == null) { this.mInventory[60] = null; } else { - * this.mInventory[60] = tRecipe.mInput2.copy(); } if (tRecipe.mOutput1 == null) { this.mInventory[61] = null; } - * else { this.mInventory[61] = tRecipe.mOutput1.copy(); } if (tRecipe.mOutput2 == null) { this.mInventory[62] = - * null; } else { this.mInventory[62] = tRecipe.mOutput2.copy(); } if (tRecipe.mOutput3 == null) { - * this.mInventory[63] = null; } else { this.mInventory[63] = tRecipe.mOutput3.copy(); } if (tRecipe.mOutput4 == - * null) { this.mInventory[64] = null; } else { this.mInventory[64] = tRecipe.mOutput4.copy(); } this.mEU = - * tRecipe.mDuration * 5; this.mMaxHeat = aIndex; } this.getWorld().addBlockEvent(this.xCoord, this.yCoord, - * this.zCoord, (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat); - */ } - - public void switchCentrifugePageForward() { - if (++this.mMaxHeat >= GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size()) this.mMaxHeat = 0; - // showCentrifugeRecipe(this.mMaxHeat); - } - - public void switchCentrifugePageBackward() { - if (--this.mMaxHeat < 0) this.mMaxHeat = GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size() - 1; - // showCentrifugeRecipe(this.mMaxHeat); - } - - public void showElectrolyzerRecipe(int aIndex) { - /* - * if (aIndex >= GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size() || aIndex < 0) aIndex = 0; GT_Recipe - * tRecipe = GT_Recipe_Map.sElectrolyzerRecipes.get(aIndex); if (tRecipe != null) { if (tRecipe.mInput1 == null) - * { this.mInventory[59] = null; } else { this.mInventory[59] = tRecipe.mInput1.copy(); } if (tRecipe.mInput2 == - * null) { this.mInventory[60] = null; } else { this.mInventory[60] = tRecipe.mInput2.copy(); } if - * (tRecipe.mOutput1 == null) { this.mInventory[61] = null; } else { this.mInventory[61] = - * tRecipe.mOutput1.copy(); } if (tRecipe.mOutput2 == null) { this.mInventory[62] = null; } else { - * this.mInventory[62] = tRecipe.mOutput2.copy(); } if (tRecipe.mOutput3 == null) { this.mInventory[63] = null; - * } else { this.mInventory[63] = tRecipe.mOutput3.copy(); } if (tRecipe.mOutput4 == null) { this.mInventory[64] - * = null; } else { this.mInventory[64] = tRecipe.mOutput4.copy(); } this.mEU = tRecipe.mDuration * - * tRecipe.mEUt; this.mMaxHeat = aIndex; } this.getWorld().addBlockEvent(this.xCoord, this.yCoord, this.zCoord, - * (GregTech_API.sBlockList[1]).field_71990_ca, 11, this.mMaxHeat); - */ } - - public void switchElectrolyzerPageForward() { - if (++this.mMaxHeat >= GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size()) this.mMaxHeat = 0; - showElectrolyzerRecipe(this.mMaxHeat); - } - - public void switchElectrolyzerPageBackward() { - if (--this.mMaxHeat < 0) this.mMaxHeat = GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size() - 1; - showElectrolyzerRecipe(this.mMaxHeat); - } - - public static ArrayList<GT_Recipe> sFusionReactorRecipes = new ArrayList<GT_Recipe>(); - - public void showFusionRecipe(int aIndex) { - - if (sFusionReactorRecipes.isEmpty()) { - for (GT_Recipe aRecipe : GT_Recipe_Map.sFusionRecipes.mRecipeList) { - sFusionReactorRecipes.add(aRecipe); - } - Collections.sort(sFusionReactorRecipes); - } - - if (aIndex >= sFusionReactorRecipes.size() || aIndex < 0) { - aIndex = 0; - } - GT_Recipe tRecipe = sFusionReactorRecipes.get(aIndex); - if (tRecipe != null) { - if (tRecipe.mFluidInputs[0] == null) { - this.mInventory[59] = null; - } else { - this.mInventory[59] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[0], true); - } - if (tRecipe.mFluidInputs[1] == null) { - this.mInventory[60] = null; - } else { - this.mInventory[60] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidInputs[1], true); - } - if (tRecipe.mFluidOutputs[0] == null) { - this.mInventory[61] = null; - } else { - this.mInventory[61] = GT_Utility.getFluidDisplayStack(tRecipe.mFluidOutputs[0], true); - } - this.mEU = tRecipe.mSpecialValue; - this.mEUOut = tRecipe.mEUt; - this.mHeat = tRecipe.mDuration; - this.mMaxHeat = aIndex; - this.mFusionOutput = tRecipe.mFluidOutputs[0].getLocalizedName(); - } - this.getWorld().addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 11, - this.mMaxHeat); - } - - public void switchFusionPageForward() { - if (++this.mMaxHeat >= sFusionReactorRecipes.size()) this.mMaxHeat = 0; - showFusionRecipe(this.mMaxHeat); - } - - public void switchFusionPageBackward() { - if (--this.mMaxHeat < 0) this.mMaxHeat = sFusionReactorRecipes.size() - 1; - showFusionRecipe(this.mMaxHeat); - } - - public void switchNuclearReactor() { - if (this.mStarted) { - stopNuclearReactor(); - } else { - startNuclearReactor(); - } - } - - public void startNuclearReactor() { - this.mStarted = true; - this.mHeat = 0; - this.mEU = 0; - mSimulator.simulate(); - } - - public void stopNuclearReactor() { - this.mStarted = false; - mSimulator.simulate(); - } - - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("mMode", this.mMode); - aNBT.setInteger("mProgress", this.mProgress); - aNBT.setInteger("mMaxProgress", this.mMaxProgress); - aNBT.setBoolean("mStarted", this.mStarted); - int[] aSplitLong1 = MathUtils.splitLongIntoTwoIntegers(mEU); - aNBT.setInteger("mEU1", aSplitLong1[0]); - aNBT.setInteger("mEU2", aSplitLong1[1]); - aNBT.setInteger("mHeat", this.mHeat); - int[] aSplitLong2 = MathUtils.splitLongIntoTwoIntegers(mEUOut); - aNBT.setInteger("mEUOut1", aSplitLong2[0]); - aNBT.setInteger("mEUOut2", aSplitLong2[1]); - aNBT.setInteger("mMaxHeat", this.mMaxHeat); - aNBT.setFloat("mHEM", this.mHEM); - aNBT.setFloat("mExplosionStrength", this.mExplosionStrength); - aNBT.setString("mFusionOutput", this.mFusionOutput); - } - - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - this.mMode = aNBT.getInteger("mMode"); - this.mProgress = aNBT.getInteger("mProgress"); - this.mMaxProgress = aNBT.getInteger("mMaxProgress"); - this.mStarted = aNBT.getBoolean("mStarted"); - int partA = aNBT.getInteger("mEU1"); - int partB = aNBT.getInteger("mEU2"); - this.mEU = MathUtils.combineTwoIntegersToLong(partA, partB); - this.mHeat = aNBT.getInteger("mHeat"); - partA = aNBT.getInteger("mEUOut1"); - partB = aNBT.getInteger("mEUOut2"); - this.mEUOut = MathUtils.combineTwoIntegersToLong(partA, partB); - this.mMaxHeat = aNBT.getInteger("mMaxHeat"); - this.mHEM = aNBT.getFloat("mHEM"); - this.mExplosionStrength = aNBT.getFloat("mExplosionStrength"); - this.mFusionOutput = aNBT.getString("mFusionOutput"); - } - - @Override - public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { - super.onFirstTick(aBaseMetaTileEntity); - } - - @Override - public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); - - if (mSimulator == null) { - mSimulator = new GT_Computercube_Simulator(this); - } - if (this.getBaseMetaTileEntity().isClientSide()) { - this.getWorld().markBlockForUpdate(this.getXCoord(), this.getYCoord(), this.getZCoord()); - this.mNeedsUpdate = false; - } else { - this.mNeedsUpdate = false; - } - if (this.getBaseMetaTileEntity().isServerSide()) { - if (this.mMode == MODE_SCANNER) { - /* - * if (this.mInventory[55] == null) { this.mInventory[55] = this.mInventory[54]; this.mInventory[54] = - * null; } - */ - if (this.mInventory[57] == null) { - this.mInventory[57] = this.mInventory[56]; - this.mInventory[56] = null; - } - - // 54 - 55 || 56 - 57 - // Do scanny bits - if (mSeedscanner && this.mMode == MODE_SCANNER) { - /* - * if (doScan(this.mInventory[55]) == 4) { if ((this.mInventory[57] != null) && - * (this.mInventory[57].getUnlocalizedName().equals("gt.metaitem.01.32707"))) { - * GT_Mod.instance.achievements.issueAchievement(aBaseMetaTileEntity.getWorld(). - * getPlayerEntityByName(aBaseMetaTileEntity.getOwnerName()), "scanning"); } } - */ - /* - * if (this.mEU > 0) { if (!this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(this.mEU, false)) - * { this.mProgress = 0; } } - */ - } - - /* - * if (mSeedscanner && this.mInventory[55] != null && GT_Utility.areStacksEqual(this.mInventory[55], - * Ic2Items.cropSeed, true) && this.mInventory[55].getTagCompound() != null) { if - * (this.mInventory[55].getTagCompound().getByte("scan") < 4) { if (this.mProgress >= 100) { - * this.mInventory[55].getTagCompound().setByte("scan", (byte) 4); this.mProgress = 0; } else if - * (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(100, false)) { this.mProgress++; } } else { - * this.mProgress = 0; if (this.mInventory[56] == null) { this.mInventory[56] = this.mInventory[55]; - * this.mInventory[55] = null; } } } else { this.mProgress = 0; if (this.mInventory[56] == null) { - * this.mInventory[56] = this.mInventory[55]; this.mInventory[55] = null; } } - */ - } - - if (this.mMode == MODE_REACTOR_PLANNER && mReactorplanner - && this.mSimulator != null - && this.mSimulator.simulator != null - && this.mSimulator.simulatedReactor != null) { - SimulationData aData = this.mSimulator.simulator.getData(); - if (aData != null && aData.totalReactorTicks > 0 && this.mProgress != aData.totalReactorTicks) { - Logger.INFO("Updating Variables"); - this.mEU = aData.avgEUoutput; - this.mEUOut = (aData.totalEUoutput / aData.totalReactorTicks); - this.mHeat = aData.avgHUoutput; - this.mMaxHeat = aData.maxHUoutput; - this.mExplosionStrength = aData.explosionPower; - this.mHEM = (float) aData.hullHeating; - this.mProgress = aData.totalReactorTicks; - } - } - - if (aTick % 20L == 0L) { - this.getWorld().addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 10, - this.mMode); - this.getWorld().addBlockEvent( - this.getXCoord(), - this.getYCoord(), - this.getZCoord(), - GregTech_API.sBlockMachines, - 11, - this.mMaxHeat); - } - } - } - - @Override - public void receiveClientEvent(byte aEventID, byte aValue) { - super.receiveClientEvent(aEventID, aValue); - if (this.getWorld().isRemote) switch (aEventID) { - case 10: - this.mNeedsUpdate = true; - this.mMode = aValue; - break; - case 11: - this.mMaxHeat = aValue; - break; - } - return; - } - - @Override - public void onValueUpdate(byte aValue) { - super.onValueUpdate(aValue); - this.mNeedsUpdate = true; - } - - @Override - public void onMachineBlockUpdate() { - super.onMachineBlockUpdate(); - this.mNeedsUpdate = true; - } - - @Override - public boolean canInsertItem(int i, ItemStack itemstack, int j) { - return (this.mMode == MODE_SCANNER) ? ((i == 54 || i == 55)) : false; - } - - @Override - public boolean canExtractItem(int i, ItemStack itemstack, int j) { - return (this.mMode == MODE_SCANNER) ? ((i == 56 || i == 57)) : false; - } - - public World getWorld() { - return this.getBaseMetaTileEntity().getWorld(); - } - - @Override - public boolean doesFillContainers() { - return false; - } - - @Override - public boolean doesEmptyContainers() { - return false; - } - - @Override - public boolean canTankBeFilled() { - return false; - } - - @Override - public boolean canTankBeEmptied() { - return false; - } - - @Override - public boolean displaysItemStack() { - return false; - } - - @Override - public boolean displaysStackSize() { - return false; - } - - @Override - public ITexture[][][] getTextureSet(final ITexture[] aTextures) { - final ITexture[][][] rTextures = new ITexture[10][17][]; - for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = this.getFront(i); - rTextures[1][i + 1] = this.getSides(i); - rTextures[2][i + 1] = this.getSides(i); - rTextures[3][i + 1] = this.getSides(i); - rTextures[4][i + 1] = this.getSides(i); - rTextures[5][i + 1] = this.getFront(i); - rTextures[6][i + 1] = this.getSides(i); - rTextures[7][i + 1] = this.getSides(i); - rTextures[8][i + 1] = this.getSides(i); - rTextures[9][i + 1] = this.getSides(i); - } - return rTextures; - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side, - final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) { - return this.mTextures[(side == facing ? 0 - : side == facing.getOpposite() ? 1 - : side == ForgeDirection.DOWN ? 2 : side == ForgeDirection.UP ? 3 : 4)][aColorIndex + 1]; - } - - public ITexture[] getFront(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_3) }; - } - - public ITexture[] getSides(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Computer_Cube) }; - } - - protected static final int DID_NOT_FIND_RECIPE = 0, FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1, - FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2; - - /** - * Calcualtes overclocked ness using long integers - * - * @param aEUt - recipe EUt - * @param aDuration - recipe Duration - */ - protected void calculateOverclockedNess(int aEUt, int aDuration) { - if (mTier == 0) { - // Long time calculation - long xMaxProgresstime = ((long) aDuration) << 1; - if (xMaxProgresstime > Integer.MAX_VALUE - 1) { - // make impossible if too long - mEU = Integer.MAX_VALUE - 1; - mMaxProgress = Integer.MAX_VALUE - 1; - } else { - mEU = aEUt >> 2; - mMaxProgress = (int) xMaxProgresstime; - } - } else { - // Long EUt calculation - long xEUt = aEUt; - // Isnt too low EUt check? - long tempEUt = Math.max(xEUt, V[1]); - - mMaxProgress = aDuration; - - while (tempEUt <= V[mTier - 1] * (long) this.maxAmperesIn()) { - tempEUt <<= 2; // this actually controls overclocking - // xEUt *= 4;//this is effect of everclocking - mMaxProgress >>= 1; // this is effect of overclocking - xEUt = mMaxProgress == 0 ? xEUt >> 1 : xEUt << 2; // U know, if the time is less than 1 tick make the - // machine use 2x less power - } - if (xEUt > Integer.MAX_VALUE - 1) { - mEU = Integer.MAX_VALUE - 1; - mMaxProgress = Integer.MAX_VALUE - 1; - } else { - mEU = (int) xEUt; - if (mEU == 0) mEU = 1; - if (mMaxProgress == 0) mMaxProgress = 1; // set time to 1 tick - } - } - } - - public int doScan(ItemStack aInput) { - if (this.mMode != MODE_SCANNER) { - return DID_NOT_FIND_RECIPE; - } - ItemStack aStack = aInput; - if (this.mInventory[56] != null) { - return DID_NOT_FIND_RECIPE; - } else if ((GT_Utility.isStackValid(aStack)) && (aStack.stackSize > 0)) { - - if (ItemList.IC2_Crop_Seeds.isStackEqual(aStack, true, true)) { - NBTTagCompound tNBT = aStack.getTagCompound(); - if (tNBT == null) { - tNBT = new NBTTagCompound(); - } - if (tNBT.getByte("scan") < 4) { - tNBT.setByte("scan", (byte) 4); - calculateOverclockedNess(8, 160); - // In case recipe is too OP for that machine - if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - } else { - this.mMaxProgress = 1; - this.mEU = 1; - } - aStack.stackSize -= 1; - this.mInventory[57] = GT_Utility.copyAmount(1L, aStack); - this.mInventory[57].setTagCompound(tNBT); - return 2; - } - - if (ItemList.Tool_DataOrb.isStackEqual(getSpecialSlot(), false, true)) { - if (ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) { - aStack.stackSize -= 1; - this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); - calculateOverclockedNess(30, 512); - // In case recipe is too OP for that machine - if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - return 2; - } - ItemData tData = GT_OreDictUnificator.getAssociation(aStack); - if ((tData != null) && ((tData.mPrefix == OrePrefixes.dust) || (tData.mPrefix == OrePrefixes.cell)) - && (tData.mMaterial.mMaterial.mElement != null) - && (!tData.mMaterial.mMaterial.mElement.mIsIsotope) - && (tData.mMaterial.mMaterial != Materials.Magic) - && (tData.mMaterial.mMaterial.getMass() > 0L)) { - getSpecialSlot().stackSize -= 1; - aStack.stackSize -= 1; - - this.mInventory[57] = ItemList.Tool_DataOrb.get(1L); - Behaviour_DataOrb.setDataTitle(this.mInventory[57], "Elemental-Scan"); - Behaviour_DataOrb.setDataName(this.mInventory[57], tData.mMaterial.mMaterial.mElement.name()); - calculateOverclockedNess(30, GT_Utility.safeInt(tData.mMaterial.mMaterial.getMass() * 8192L)); - // In case recipe is too OP for that machine - if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - return 2; - } - } - - if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true)) { - if (ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) { - aStack.stackSize -= 1; - this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); - calculateOverclockedNess(30, 128); - // In case recipe is too OP for that machine - if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - return 2; - } - if (aStack.getItem() == Items.written_book) { - getSpecialSlot().stackSize -= 1; - aStack.stackSize -= 1; - - this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); - this.mInventory[57].setTagCompound(aStack.getTagCompound()); - calculateOverclockedNess(30, 128); - // In case recipe is too OP for that machine - if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - return 2; - } - if (aStack.getItem() == Items.filled_map) { - getSpecialSlot().stackSize -= 1; - aStack.stackSize -= 1; - - this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); - this.mInventory[57].setTagCompound( - GT_Utility.getNBTContainingShort( - new NBTTagCompound(), - "map_id", - (short) aStack.getItemDamage())); - calculateOverclockedNess(30, 128); - // In case recipe is too OP for that machine - if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - return 2; - } - } - - if (ItemList.Tool_DataStick.isStackEqual(getSpecialSlot(), false, true) && aStack != null) { - for (GT_Recipe.GT_Recipe_AssemblyLine tRecipe : GT_Recipe.GT_Recipe_AssemblyLine.sAssemblylineRecipes) { - if (GT_Utility.areStacksEqual(tRecipe.mResearchItem, aStack, true)) { - boolean failScanner = true; - for (GT_Recipe scannerRecipe : sScannerFakeRecipes.mRecipeList) { - if (GT_Utility.areStacksEqual(scannerRecipe.mInputs[0], aStack, true)) { - failScanner = false; - break; - } - } - if (failScanner) { - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - } - - String s = tRecipe.mOutput.getDisplayName(); - if (FMLCommonHandler.instance().getEffectiveSide().isServer()) { - s = GT_Assemblyline_Server.lServerNames.get(tRecipe.mOutput.getDisplayName()); - if (s == null) s = tRecipe.mOutput.getDisplayName(); - } - this.mInventory[57] = GT_Utility.copyAmount(1L, getSpecialSlot()); - - // Use Assline Utils - if (GT_AssemblyLineUtils.setAssemblyLineRecipeOnDataStick(this.mInventory[57], tRecipe)) { - aStack.stackSize -= 1; - calculateOverclockedNess(30, tRecipe.mResearchTime); - // In case recipe is too OP for that machine - if (mMaxProgress == Integer.MAX_VALUE - 1 && mEU == Integer.MAX_VALUE - 1) - return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS; - getSpecialSlot().stackSize -= 1; - return 2; - } - } - } - } - } - return 0; - } - - private ItemStack getSpecialSlot() { - return this.mInventory[54]; - } - - @Override - public boolean useModularUI() { - return true; - } - - @Override - public void addGregTechLogo(ModularWindow.Builder builder) {} - - @Override - public int getGUIWidth() { - return mMode == 5 ? 226 : 176; - } - - @Override - public boolean doesBindPlayerInventory() { - return mMode != 1 && mMode != 5; - } - - @Override - public void addUIWidgets(ModularWindow.Builder builder, UIBuildContext buildContext) { - switch (mMode) { - case 0: - addPage0(builder); - break; - case 1: - addPage1(builder); - break; - case 2: - addPage2(builder); - break; - case 3: - addPage3(builder); - break; - case 4: - addPage4(builder); - break; - case 5: - addPage5(builder); - break; - case 6: - addPage6(builder); - break; - } - - builder.widget(new ButtonWidget().setOnClick((clickData, widget) -> { - if (clickData.mouseButton == 0) { - switchModeForward(); - } else if (clickData.mouseButton == 1) { - switchModeBackward(); - } - if (!widget.isClient()) { - GT_UIInfos.openGTTileEntityUI(getBaseMetaTileEntity(), widget.getContext().getPlayer()); - } - }).setBackground(GTPP_UITextures.BUTTON_STANDARD_16x16, GTPP_UITextures.OVERLAY_BUTTON_COMPUTER_MODE) - .setPos(156 + (mMode == 5 ? 50 : 0), 4).setSize(16, 16)); - } - - private void addPage0(ModularWindow.Builder builder) { - builder.widget( - new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_COMPUTER_TOP).setPos(32, 4).setSize(112, 76)) - .widget( - new ProgressBar() - .setProgress( - () -> (float) getBaseMetaTileEntity().getStoredEU() - / getBaseMetaTileEntity().getEUCapacity()) - .setTexture(GTPP_UITextures.PROGRESSBAR_COMPUTER_ENERGY, 96) - .setDirection(ProgressBar.Direction.RIGHT).setPos(44, 8).setSize(96, 5)) - .widget( - new TextWidget("Solaris 1.7.10").setDefaultColor(Utils.rgbtoHexValue(100, 190, 255)) - .setPos(56, 70)); - } - - private void addPage1(ModularWindow.Builder builder) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 103).setSize(150, 59)) - .widget(new DrawableWidget().setDrawable(ModularUITextures.ITEM_SLOT).setPos(4, 4).setSize(146, 98)) - .widget(new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_V202).setPos(155, 103).setSize(17, 5)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> saveNuclearReactor()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_SAVE) - .setPos(156, 54).setSize(16, 16)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> loadNuclearReactor()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_LOAD) - .setPos(156, 70).setSize(16, 16)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchNuclearReactor()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_NUCLEAR_SWITCH) - .setPos(156, 86).setSize(16, 16)); - SlotWidget displaySlot = new NuclearSlotWidget(inventoryHandler, 54, null); - for (int i = 0; i < 9 * 6; i++) { - builder.widget( - new NuclearSlotWidget(inventoryHandler, i, displaySlot.getMcSlot()) - .setBackground(GT_UITextures.TRANSPARENT).setPos(5 + (i % 9) * 16, 5 + (i / 9) * 16)); - } - builder.widget( - displaySlot.setBackground(getGUITextureSet().getItemSlot(), GTPP_UITextures.OVERLAY_SLOT_ARROW_4) - .setPos(152, 27)); - builder.widget(new TextWidget("Reactorstats:").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 108)) - .widget( - TextWidget.dynamicString(() -> GT_Utility.formatNumbers(mEU) + "EU at " + mEUOut + "EU/t") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 120)) - .widget( - TextWidget.dynamicString(() -> "HEM: " + (mHEM / 10000.0F)) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 128)) - .widget( - TextWidget.dynamicString( - () -> GT_Utility.formatNumbers(mHeat) + "/" - + GT_Utility.formatNumbers(mMaxHeat) - + "Heat") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 136)) - .widget( - TextWidget.dynamicString(() -> "Explosionpower: " + (mExplosionStrength / 100.0F)) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 144)) - .widget( - TextWidget.dynamicString(() -> "Runtime: " + ((mProgress > 0) ? (mProgress / 20) : 0) + "secs") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 152)); - } - - private void addPage2(ModularWindow.Builder builder) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(48, 4).setSize(81, 67)); - builder.widget(new DataStickSlotWidget(inventoryHandler, 54).setPos(7, 27)) - .widget( - new SlotWidget(inventoryHandler, 55) - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_MICROSCOPE) - .setPos(25, 27)) - .widget(new SlotWidget(inventoryHandler, 56).setAccess(true, false).setPos(133, 27)) - .widget(new SlotWidget(inventoryHandler, 57).setAccess(true, false).setPos(151, 27)); - builder.widget( - new TextWidget("Scanner").setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mProgress == 0) - .setPos(51, 7)) - .widget( - new TextWidget("Can be used to").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mProgress == 0).setPos(51, 24)) - .widget( - new TextWidget("scan things").setDefaultColor(COLOR_TEXT_WHITE.get()) - .setEnabled(widget -> mProgress == 0).setPos(51, 32)) - .widget( - new TextWidget("Currently").setDefaultColor(Utils.rgbtoHexValue(200, 20, 20)) - .setEnabled(widget -> mProgress == 0).setPos(51, 48)) - .widget( - new TextWidget("Disabled").setDefaultColor(Utils.rgbtoHexValue(200, 20, 20)) - .setEnabled(widget -> mProgress == 0).setPos(51, 56)) - .widget( - new TextWidget("Progress:") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled( - widget -> mProgress != 0) - .setPos(51, 24)) - .widget( - TextWidget.dynamicString( - () -> MathUtils.findPercentage(mProgress, getBaseMetaTileEntity().getMaxProgress()) - + " %") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setEnabled(widget -> mProgress != 0) - .setPos(51, 32)) - .widget(new FakeSyncWidget.IntegerSyncer(() -> mProgress, val -> mProgress = val)); - } - - private void addPage3(ModularWindow.Builder builder) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(86, 41)) - .widget( - new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROWS_SEPARATE).setPos(110, 23) - .setSize(40, 40)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchCentrifugePageBackward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) - .setPos(88, 65).setSize(16, 16)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchCentrifugePageForward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) - .setPos(104, 65).setSize(16, 16)) - .widget( - SlotWidget.phantom(inventoryHandler, 59).disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CENTRIFUGE) - .setPos(121, 34)) - .widget( - SlotWidget.phantom(inventoryHandler, 60).disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CANISTER) - .setPos(91, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 61).disableInteraction().setPos(121, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 62).disableInteraction().setPos(151, 34)) - .widget(SlotWidget.phantom(inventoryHandler, 63).disableInteraction().setPos(121, 64)) - .widget(SlotWidget.phantom(inventoryHandler, 64).disableInteraction().setPos(91, 34)) - .widget(new TextWidget("Centrifuge").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 7)) - .widget( - TextWidget - .dynamicString( - () -> "Recipe: " + (mMaxHeat + 1) - + "/" - + GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size()) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 23)) - .widget( - TextWidget.dynamicString(() -> "EU: " + GT_Utility.formatNumbers(mEU)) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 31)); - } - - private void addPage4(ModularWindow.Builder builder) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(116, 61)) - .widget( - new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROWS_FUSION).setPos(121, 23) - .setSize(29, 40)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchFusionPageBackward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) - .setPos(88, 65).setSize(16, 16)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchFusionPageForward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) - .setPos(104, 65).setSize(16, 16)) - .widget(SlotWidget.phantom(inventoryHandler, 59).disableInteraction().setPos(121, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 60).disableInteraction().setPos(121, 64)) - .widget(SlotWidget.phantom(inventoryHandler, 61).disableInteraction().setPos(151, 34)) - .widget(new TextWidget("Fusionreactor").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 7)) - .widget( - TextWidget - .dynamicString( - () -> "Recipe: " + (mMaxHeat + 1) - + "/" - + GT_TileEntity_ComputerCube.sFusionReactorRecipes.size()) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 15)) - .widget( - TextWidget.dynamicString(() -> "Start: " + GT_Utility.formatNumbers(mEU) + "EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 23)) - .widget( - TextWidget.dynamicString(() -> "EU/t: " + GT_Utility.formatNumbers(mEUOut)) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 31)) - .widget( - TextWidget.dynamicString(() -> GT_Utility.formatNumbers(mHeat) + " Ticks") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 39)) - .widget( - TextWidget.dynamicString( - () -> GT_TileEntity_ComputerCube.sFusionReactorRecipes.get(mMaxHeat).mFluidOutputs[0] - .getLocalizedName()) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 55)) - .widget( - TextWidget - .dynamicString( - () -> mEUOut < 0 ? "IN: " + GT_Utility.formatNumbers(-mEUOut * mHeat) + "EU" - : "OUT: " + GT_Utility.formatNumbers(mEUOut * mHeat) + "EU") - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 47)); - } - - private void addPage5(ModularWindow.Builder builder) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(200, 141)) - .widget( - new DrawableWidget() - .setDrawable( - () -> mExplosionStrength != 0 ? GTPP_UITextures.PICTURE_COMPUTER_GRID : null) - .setPos(152, 6).setSize(50, 50)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchDescriptionPageBackward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) - .setPos(190, 146).setSize(16, 16)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchDescriptionPageForward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) - .setPos(206, 146).setSize(16, 16)); - for (int i = 0; i < 5; i++) { - builder.widget(SlotWidget.phantom(inventoryHandler, i + 59).disableInteraction().setPos(205, 37 + i * 18)); - } - for (int i = 0; i < 9; i++) { - builder.widget( - SlotWidget.phantom(inventoryHandler, i + 64).disableInteraction() - .setBackground(GT_UITextures.TRANSPARENT).setPos(152 + (i % 3) * 16, 6 + (i / 3) * 16)); - } - int descriptionMaxLines = GT_Computercube_Description.sDescriptions.stream() - .sorted((d1, d2) -> d2.mDescription.length - d1.mDescription.length).collect(Collectors.toList()) - .get(0).mDescription.length; - for (int i = 0; i < descriptionMaxLines; i++) { - final int index = i; - builder.widget(TextWidget.dynamicString(() -> { - if (mMaxHeat >= 0 && mMaxHeat < GT_Computercube_Description.sDescriptions.size()) { - String[] descriptions = GT_Computercube_Description.sDescriptions.get(mMaxHeat).mDescription; - if (index < descriptions.length) { - return descriptions[index]; - } - } - return ""; - }).setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 7 + index * 8)); - } - } - - private void addPage6(ModularWindow.Builder builder) { - builder.widget( - new DrawableWidget().setDrawable(GT_UITextures.PICTURE_SCREEN_BLACK).setPos(4, 4).setSize(86, 41)) - .widget( - new DrawableWidget().setDrawable(GTPP_UITextures.PICTURE_ARROWS_SEPARATE).setPos(110, 23) - .setSize(40, 40)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchElectrolyzerPageBackward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_ARROW_LEFT) - .setPos(88, 65).setSize(16, 16)) - .widget( - new ButtonWidget().setOnClick((clickData, widget) -> switchElectrolyzerPageForward()) - .setBackground( - GTPP_UITextures.BUTTON_STANDARD_16x16, - GTPP_UITextures.OVERLAY_BUTTON_ARROW_RIGHT) - .setPos(104, 65).setSize(16, 16)) - .widget( - SlotWidget.phantom(inventoryHandler, 59).disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CHARGER) - .setPos(121, 34)) - .widget( - SlotWidget.phantom(inventoryHandler, 60).disableInteraction() - .setBackground(getGUITextureSet().getItemSlot(), GT_UITextures.OVERLAY_SLOT_CANISTER) - .setPos(91, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 61).disableInteraction().setPos(121, 4)) - .widget(SlotWidget.phantom(inventoryHandler, 62).disableInteraction().setPos(151, 34)) - .widget(SlotWidget.phantom(inventoryHandler, 63).disableInteraction().setPos(121, 64)) - .widget(SlotWidget.phantom(inventoryHandler, 64).disableInteraction().setPos(91, 34)) - .widget(new TextWidget("Electrolyzer").setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 7)) - .widget( - TextWidget - .dynamicString( - () -> "Recipe: " + (mMaxHeat + 1) - + "/" - + GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size()) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 23)) - .widget( - TextWidget.dynamicString(() -> "EU: " + GT_Utility.formatNumbers(mEU)) - .setDefaultColor(COLOR_TEXT_WHITE.get()).setPos(7, 31)); - } - - private class NuclearSlotWidget extends SlotWidget { - - private final Slot displaySlot; - - public NuclearSlotWidget(IItemHandlerModifiable handler, int index, Slot displaySlot) { - super(BaseSlot.phantom(handler, index)); - if (displaySlot != null) { - this.displaySlot = displaySlot; - } else { - this.displaySlot = getMcSlot(); - } - } - - @Override - protected void phantomClick(ClickData clickData, ItemStack cursorStack) { - final int aSlotIndex = getMcSlot().getSlotIndex() + 4; - final Slot tSlot = getMcSlot(); - final ItemStack tStack = tSlot.getStack(); - if (clickData.shift) { - tSlot.putStack(null); - getSimulator().slotClick(aSlotIndex, null); - return; - } - if (clickData.mouseButton == 1) { - tSlot.putStack(null); - } - if (clickData.mouseButton == 0) { - if (tStack == null) { - if (displaySlot.getStack() != null && aSlotIndex != 58) { - tSlot.putStack(displaySlot.getStack().copy()); - getSimulator().slotClick(aSlotIndex, new GT_ItemStack(displaySlot.getStack().copy())); - } else { - tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(0).mItem, 1)); - getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(0)); - } - return; - } - for (int i = 1; i < GT_TileEntity_ComputerCube.sReactorList.size(); i++) { - if (GT_TileEntity_ComputerCube.sReactorList.get(i - 1).mItem == tStack.getItem()) { - tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(i).mItem, 1, 0)); - getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(i)); - /* - * if (tSlot.getStack() != null && tSlot.getStack().getItem() == - * GT_ModHandler.getIC2Item("reactorIsotopeCell", 1).getItem()) { - * tSlot.getStack().setItemDamage(tSlot.getStack().getMaxDamage() - 1); } - */ - return; - } - } - tSlot.putStack(null); - getSimulator().slotClick(aSlotIndex, null); - return; - } - if (tStack == null) return; - if (tStack.stackSize < tStack.getMaxStackSize()) { - tStack.stackSize++; - return; - } - tStack.stackSize = 1; - } - - @Override - protected void handleDragAndDropServer(ClickData clickData, ItemStack draggedStack) {} - - @Override - public List<String> getExtraTooltip() { - return Collections.emptyList(); - } - } -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java index d803aa4ba2..bc03c53089 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java @@ -11,7 +11,6 @@ import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_CropHarvestor; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_AutoCrafter; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GT4Entity_ThermalBoiler; -import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube; import gtPlusPlus.xmod.gregtech.common.tileentities.redstone.GT_MetaTileEntity_RedstoneButtonPanel; import gtPlusPlus.xmod.gregtech.common.tileentities.redstone.GT_MetaTileEntity_RedstoneCircuitBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.redstone.GT_MetaTileEntity_RedstoneLamp; @@ -40,13 +39,6 @@ public class Gregtech4Content { basic(); automation(); redstone(); - computer(); - } - - private static void computer() { - Logger.INFO("Gregtech 4 Content | Registering Computer Cube."); - GregtechItemList.Gregtech_Computer_Cube_Machine - .set(new GT_TileEntity_ComputerCube(31130, "C-O-M-P-U-T-E-R").getStackForm(1L)); } private static void workbenches() { diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/computer.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/computer.png Binary files differdeleted file mode 100644 index 76ebee594c..0000000000 --- a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/computer.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/button/standard_16x16.png b/src/main/resources/assets/miscutils/textures/gui/button/standard_16x16.png Binary files differdeleted file mode 100644 index d948efe088..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/button/standard_16x16.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/arrow_left.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/arrow_left.png Binary files differdeleted file mode 100644 index 2c5c4eea7f..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/overlay_button/arrow_left.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/arrow_right.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/arrow_right.png Binary files differdeleted file mode 100644 index 5b07b9a40a..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/overlay_button/arrow_right.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/computer_mode.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/computer_mode.png Binary files differdeleted file mode 100644 index 4d78156f5a..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/overlay_button/computer_mode.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/load.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/load.png Binary files differdeleted file mode 100644 index 5454fae5d5..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/overlay_button/load.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/nuclear_switch.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/nuclear_switch.png Binary files differdeleted file mode 100644 index 2c9f29ba6b..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/overlay_button/nuclear_switch.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/overlay_button/save.png b/src/main/resources/assets/miscutils/textures/gui/overlay_button/save.png Binary files differdeleted file mode 100644 index 5fa728aab7..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/overlay_button/save.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/picture/arrows_fusion.png b/src/main/resources/assets/miscutils/textures/gui/picture/arrows_fusion.png Binary files differdeleted file mode 100644 index 7f49e70938..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/picture/arrows_fusion.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/picture/arrows_separate.png b/src/main/resources/assets/miscutils/textures/gui/picture/arrows_separate.png Binary files differdeleted file mode 100644 index 0190583629..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/picture/arrows_separate.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/picture/computer_grid.png b/src/main/resources/assets/miscutils/textures/gui/picture/computer_grid.png Binary files differdeleted file mode 100644 index 3f6a15a804..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/picture/computer_grid.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/picture/computer_top.png b/src/main/resources/assets/miscutils/textures/gui/picture/computer_top.png Binary files differdeleted file mode 100644 index ecb9368c92..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/picture/computer_top.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/picture/v202.png b/src/main/resources/assets/miscutils/textures/gui/picture/v202.png Binary files differdeleted file mode 100644 index 678a15fbad..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/picture/v202.png +++ /dev/null diff --git a/src/main/resources/assets/miscutils/textures/gui/progressbar/computer_energy.png b/src/main/resources/assets/miscutils/textures/gui/progressbar/computer_energy.png Binary files differdeleted file mode 100644 index ca2f6cb6e3..0000000000 --- a/src/main/resources/assets/miscutils/textures/gui/progressbar/computer_energy.png +++ /dev/null |