diff options
author | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-01-29 19:15:48 +0000 |
---|---|---|
committer | Alkalus <3060479+draknyte1@users.noreply.github.com> | 2022-01-29 19:15:48 +0000 |
commit | c0da5cc4ea19dfb2a05e64ce09d808b4efdc95b1 (patch) | |
tree | 2b549b5dfe3f80421ae2d45e041f929ea46d59aa | |
parent | b926dfb3bc67b74b53749a3e420a8a6ce0fba6a7 (diff) | |
parent | 0de849179b344dfddc68393aaa23b3b75b307670 (diff) | |
download | GT5-Unofficial-c0da5cc4ea19dfb2a05e64ce09d808b4efdc95b1.tar.gz GT5-Unofficial-c0da5cc4ea19dfb2a05e64ce09d808b4efdc95b1.tar.bz2 GT5-Unofficial-c0da5cc4ea19dfb2a05e64ce09d808b4efdc95b1.zip |
Merge branch 'master' of https://github.com/GTNewHorizons/GTplusplus into St00f
# Conflicts:
# .gitignore
# dependencies.gradle
# src/main/java/gtPlusPlus/core/config/ConfigHandler.java
# src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java
# src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java
# src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java
# src/main/resources/assets/miscutils/lang/en_US.lang
545 files changed, 18514 insertions, 7000 deletions
diff --git a/build.gradle b/build.gradle index b647108772..7914dd81b4 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 1642484596 +//version: 1643020202 /* DO NOT CHANGE THIS FILE! @@ -32,16 +32,18 @@ buildscript { } } dependencies { - classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.5' + classpath 'com.github.GTNewHorizons:ForgeGradle:1.2.7' } } plugins { id 'idea' + id 'eclipse' id 'scala' id("org.ajoberstar.grgit") version("3.1.1") id("com.github.johnrengelman.shadow") version("4.0.4") id("com.palantir.git-version") version("0.12.3") + id('de.undercouch.download') version('4.1.2') id("maven-publish") } @@ -172,6 +174,19 @@ else { archivesBaseName = modId } + +def arguments = [] +def jvmArguments = [] + +if(usesMixins.toBoolean()) { + arguments += [ + "--tweakClass org.spongepowered.asm.launch.MixinTweaker" + ] + jvmArguments += [ + "-Dmixin.debug.countInjections=true", "-Dmixin.debug.verbose=true", "-Dmixin.debug.export=true" + ] +} + minecraft { version = minecraftVersion + "-" + forgeVersion + "-" + minecraftVersion runDir = "run" @@ -191,6 +206,20 @@ minecraft { replace gradleTokenGroupName, modGroup } } + + clientIntellijRun { + args(arguments) + jvmArgs(jvmArguments) + + if(developmentEnvironmentUserName) { + args("--username", developmentEnvironmentUserName) + } + } + + serverIntellijRun { + args(arguments) + jvmArgs(jvmArguments) + } } if(file("addon.gradle").exists()) { @@ -322,15 +351,6 @@ afterEvaluate { } runClient { - def arguments = [] - - if(usesMixins.toBoolean()) { - arguments += [ - "--mods=../build/libs/$modId-${version}.jar", - "--tweakClass org.spongepowered.asm.launch.MixinTweaker" - ] - } - if(developmentEnvironmentUserName) { arguments += [ "--username", @@ -339,19 +359,12 @@ runClient { } args(arguments) + jvmArgs(jvmArguments) } runServer { - def arguments = [] - - if (usesMixins.toBoolean()) { - arguments += [ - "--mods=../build/libs/$modId-${version}.jar", - "--tweakClass org.spongepowered.asm.launch.MixinTweaker" - ] - } - args(arguments) + jvmArgs(jvmArguments) } tasks.withType(JavaExec).configureEach { @@ -494,11 +507,21 @@ artifacts { } } +// The gradle metadata includes all of the additional deps that we disabled from POM generation (including forgeBin with no groupID), +// and isn't strictly needed with the POM so just disable it. +tasks.withType(GenerateModuleMetadata) { + enabled = false +} + + // publishing publishing { publications { maven(MavenPublication) { - artifact source: usesShadowedDependencies.toBoolean() ? shadowJar : jar, classifier: "" + from components.java + if(usesShadowedDependencies.toBoolean()) { + artifact source: shadowJar, classifier: "" + } if(!noPublishedSources) { artifact source: sourcesJar, classifier: "src" } @@ -511,6 +534,18 @@ publishing { artifactId = System.getenv("ARTIFACT_ID") ?: project.name // Using the identified version, not project.version as it has the prepended 1.7.10 version = System.getenv("RELEASE_VERSION") ?: identifiedVersion + + // Remove all non GTNH deps here. + // Original intention was to remove an invalid forgeBin being generated without a groupId (mandatory), but + // it also removes all of the MC deps + pom.withXml { + Node pomNode = asNode() + pomNode.dependencies.'*'.findAll() { + it.groupId.text() != 'com.github.GTNewHorizons' + }.each() { + it.parent().remove(it) + } + } } } @@ -581,6 +616,72 @@ configure(updateBuildScript) { description = 'Updates the build script to the latest version' } +// Deobfuscation + +def deobf(String sourceURL) { + try { + URL url = new URL(sourceURL) + String fileName = url.getFile() + + //get rid of directories: + int lastSlash = fileName.lastIndexOf("/") + if(lastSlash > 0) { + fileName = fileName.substring(lastSlash + 1) + } + //get rid of extension: + if(fileName.endsWith(".jar")) { + fileName = fileName.substring(0, fileName.lastIndexOf(".")) + } + + String hostName = url.getHost() + if(hostName.startsWith("www.")) { + hostName = hostName.substring(4) + } + List parts = Arrays.asList(hostName.split("\\.")) + Collections.reverse(parts) + hostName = String.join(".", parts) + + return deobf(sourceURL, hostName + "/" + fileName) + } catch(Exception e) { + return deobf(sourceURL, "deobf/" + String.valueOf(sourceURL.hashCode())) + } +} + +// The method above is to be prefered. Use this method if the filename is not at the end of the URL. +def deobf(String sourceURL, String fileName) { + String cacheDir = System.getProperty("user.home") + "/.gradle/caches/" + String bon2Dir = cacheDir + "forge_gradle/deobf" + String bon2File = bon2Dir + "/BON2-2.5.0.jar" + String obfFile = cacheDir + "modules-2/files-2.1/" + fileName + ".jar" + String deobfFile = cacheDir + "modules-2/files-2.1/" + fileName + "-deobf.jar" + + if(file(deobfFile).exists()) { + return files(deobfFile) + } + + download { + src 'https://github.com/GTNewHorizons/BON2/releases/download/2.5.0/BON2-2.5.0.CUSTOM-all.jar' + dest bon2File + quiet true + overwrite false + } + + download { + src sourceURL + dest obfFile + quiet true + overwrite false + } + + exec { + commandLine 'java', '-jar', bon2File, '--inputJar', obfFile, '--outputJar', deobfFile, '--mcVer', '1.7.10', '--mappingsVer', 'stable_12', '--notch' + workingDir bon2Dir + standardOutput = new ByteArrayOutputStream() + } + + return files(deobfFile) +} + // Helper methods def checkPropertyExists(String propertyName) { diff --git a/dependencies.gradle b/dependencies.gradle index 60c3818e72..298fd97adf 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,14 +1,15 @@ // Add your dependencies here dependencies { - compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.18:dev") - compile("com.github.GTNewHorizons:StructureLib:1.0.14:dev") - compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.1.22-GTNH:dev") - compileOnly("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") - compileOnly("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") + compile("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.19:dev") + compile("com.github.GTNewHorizons:StructureLib:1.0.15:dev") + compile("com.github.GTNewHorizons:NotEnoughItems:2.2.3-GTNH:dev") + compile("com.github.GTNewHorizons:CodeChickenCore:1.1.3:dev") + compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.1:dev") compile("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev") compile("curse.maven:cofh-core-69162:2388751") + compile("curse.maven:advsolar-362768:2885953") compileOnly("com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-70-GTNH:dev") { transitive = false @@ -16,7 +17,7 @@ dependencies { compileOnly("com.github.GTNewHorizons:Baubles:1.0.1.14:dev") { transitive = false } - compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:dev") { + compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.5:dev") { transitive = false } compileOnly("com.github.GTNewHorizons:Railcraft:9.13.5:dev") { diff --git a/gradle.properties b/gradle.properties index b59d9e5e45..caa0268734 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,15 +15,15 @@ autoUpdateBuildScript = false minecraftVersion = 1.7.10 forgeVersion = 10.13.4.1614 -# Select a username for testing your mod with breakpoints. You may leave this empty for a random user name each time you +# Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you # restart Minecraft in development. Choose this dependent on your mod: # Do you need consistent player progressing (for example Thaumcraft)? -> Select a name # Do you need to test how your custom blocks interacts with a player that is not the owner? -> leave name empty -developmentEnvironmentUserName = "Developer" +developmentEnvironmentUserName = Developer # Define a source file of your project with: # public static final String VERSION = "GRADLETOKEN_VERSION"; -# The string's content will be replaced with your mods version when compiled. You should use this to specify your mod's +# The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's # version in @Mod([...], version = VERSION, [...]) # Leave these properties empty to skip individual token replacements replaceGradleTokenInFile = CORE.java @@ -32,7 +32,7 @@ gradleTokenModName = gradleTokenVersion = GRADLETOKEN_VERSION gradleTokenGroupName = -# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise you can +# In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # leave this property empty. # Example value: apiPackage = api + modGroup = com.myname.mymodid -> com.myname.mymodid.api apiPackage = @@ -48,7 +48,7 @@ mixinPlugin = # Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail! mixinsPackage = # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! -# This parameter is for legacy compatability only +# This parameter is for legacy compatibility only # Example value: coreModClass = asm.FMLPlugin + modGroup = com.myname.mymodid -> com.myname.mymodid.asm.FMLPlugin coreModClass = preloader.asm.Preloader_FMLLoadingPlugin # If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class diff --git a/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java b/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java new file mode 100644 index 0000000000..729642e837 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/AutomationSimulator.java @@ -0,0 +1,691 @@ +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/BigintStorage.java b/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java new file mode 100644 index 0000000000..03960cd7b1 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/BigintStorage.java @@ -0,0 +1,60 @@ +package Ic2ExpReactorPlanner; + +import java.math.BigInteger; +import java.util.Base64; + +/** + * Stores numbers of varying size inside a BigInteger, expecting each to have + * a defined limit (which need not be an exact power of 2). Numbers are to be + * extracted in reverse order they were stored, and special values can be used + * to make certain values optional for inclusion (the calling class is + * responsible for handling this logic, though). + * @author Brian McCloud + */ +public class BigintStorage { + private BigInteger storedValue = BigInteger.ZERO; + + /** + * Stores the specified value. Requires that 0 <= value <= max. + * @param value the value to store. + * @param max the expected maximum for the value. + */ + public void store(int value, int max) { + if (value < 0 || value > max) { + throw new IllegalArgumentException(); + } + storedValue = storedValue.multiply(BigInteger.valueOf(max + 1)).add(BigInteger.valueOf(value)); + } + + /** + * Extracts a value based on the specified maximum. + * @param max the expected maximum for the value. + * @return the extracted value. + */ + public int extract(int max) { + BigInteger[] values = storedValue.divideAndRemainder(BigInteger.valueOf(max + 1)); + storedValue = values[0]; + return values[1].intValue(); + } + + /** + * Takes input of a Base64 string, and converts it to a BigintStorage. + * @param code the Base64-encoded string (presumed to be from @outputBase64) + * @return the converted storage object. + */ + public static BigintStorage inputBase64(String code) { + BigintStorage result = new BigintStorage(); + byte[] temp = Base64.getDecoder().decode(code); + result.storedValue = new BigInteger(temp); + return result; + } + + /** + * Outputs the current value of this BigintStorage as a Base64-encoded string. + * @return the Base64-encoded string. + */ + public String outputBase64() { + byte[] temp = storedValue.toByteArray(); + return Base64.getEncoder().encodeToString(temp); + } +} diff --git a/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java b/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java new file mode 100644 index 0000000000..c613f27a32 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/ComponentFactory.java @@ -0,0 +1,231 @@ +/* + * 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.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.stream.Collectors; + +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.core.lib.LoadedMods; +import gtPlusPlus.xmod.bartworks.BW_Utils; +import gtPlusPlus.xmod.bartworks.BW_Utils.NonMeta_MaterialItem; +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 (LoadedMods.BartWorks) { + ITEM_LIST.put(aID++, new FuelRod(51, "fuelRodTiberium", new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_1, 1)), 50e3, 1, "Bartworks", 100, 1, 1, false)); + ITEM_LIST.put(aID++, new FuelRod(52, "dualFuelRodTiberium", new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_2, 1)), 50e3, 1, "Bartworks", 200, 2, 2, false)); + ITEM_LIST.put(aID++, new FuelRod(53, "quadFuelRodTiberium", new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_4, 1)), 50e3, 1, "Bartworks", 400, 4, 4, false)); + ITEM_LIST.put(aID++, new FuelRod(54, "fuelRodTheCore", new GT_ItemStack(BW_Utils.getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TheCoreCell, 1)), 100e3, 1, "Bartworks", 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 (LoadedMods.GoodGenerator) { + ITEM_LIST.put(aID++, new FuelRod(59, "fuelRodCompressedUranium", new GT_ItemStack(GG_Utils.getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium, 1)), 50e3, 1, "GoodGenerator", 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", 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", 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", 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", 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", 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 new file mode 100644 index 0000000000..83b6c511ad --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/Reactor.java @@ -0,0 +1,752 @@ +/* + * 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.HeadlessException; +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 new file mode 100644 index 0000000000..39ecdbc5f5 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/SimulationData.java @@ -0,0 +1,79 @@ +/* + * 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/TaloniusDecoder.java b/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java new file mode 100644 index 0000000000..89232eb007 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/TaloniusDecoder.java @@ -0,0 +1,26 @@ + +package Ic2ExpReactorPlanner; + +import java.math.BigInteger; + +/** + * Pulls values out of codes from Talonius's old reactor planner. + * @author Brian McCloud + */ +public class TaloniusDecoder { + private BigInteger dataStack = null; + + public TaloniusDecoder(final String dataCode) { + dataStack = new BigInteger(dataCode, 36); + } + + public int readInt(final int bits) { + return readBigInteger(bits).intValue(); + } + + private BigInteger readBigInteger(final int bits) { + BigInteger data = dataStack.and(BigInteger.ONE.shiftLeft(bits).subtract(BigInteger.ONE)); + dataStack = dataStack.shiftRight(bits); + return data; + } +} diff --git a/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java b/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java new file mode 100644 index 0000000000..d38db4c704 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/Condensator.java @@ -0,0 +1,48 @@ +/* + * 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 new file mode 100644 index 0000000000..f152b49985 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/CoolantCell.java @@ -0,0 +1,31 @@ +/* + * 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 new file mode 100644 index 0000000000..efb9a826e2 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/Exchanger.java @@ -0,0 +1,130 @@ +/* + * 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 new file mode 100644 index 0000000000..588e221424 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/FuelRod.java @@ -0,0 +1,166 @@ +/* + * 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; + + private static boolean GT509behavior = false; + private static boolean GTNHbehavior = false; + + public static void setGT509Behavior(boolean value) { + GT509behavior = value; + } + + public static void setGTNHBehavior(boolean value) { + GTNHbehavior = value; + } + + public FuelRod(final int id, final String baseName, GT_ItemStack aItem, final double maxDamage, final double maxHeat, final String sourceMod, + final int energyMult, final double heatMult, final int rodCount, final boolean moxStyle) { + 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 (GT509behavior || "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 (GTNHbehavior || "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 new file mode 100644 index 0000000000..d792e06035 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/Plating.java @@ -0,0 +1,49 @@ +/* + * 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 new file mode 100644 index 0000000000..9a9b1ce341 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/ReactorItem.java @@ -0,0 +1,531 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package Ic2ExpReactorPlanner.components; + +import java.util.HashMap; +import java.util.ResourceBundle; + +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 = "IC2"; + } + 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 new file mode 100644 index 0000000000..7851a62804 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/Reflector.java @@ -0,0 +1,63 @@ +/* + * 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 new file mode 100644 index 0000000000..a43383f694 --- /dev/null +++ b/src/main/java/Ic2ExpReactorPlanner/components/Vent.java @@ -0,0 +1,110 @@ +/* + * 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/gregtech/api/util/GTPP_Recipe.java b/src/main/java/gregtech/api/util/GTPP_Recipe.java index 1d04e8af6e..0b081adec4 100644 --- a/src/main/java/gregtech/api/util/GTPP_Recipe.java +++ b/src/main/java/gregtech/api/util/GTPP_Recipe.java @@ -4,7 +4,11 @@ import static gregtech.api.enums.GT_Values.E; import static gregtech.api.enums.GT_Values.RES_PATH_GUI; import static gregtech.api.enums.GT_Values.W; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; import codechicken.nei.PositionedStack; import gregtech.api.GregTech_API; @@ -14,7 +18,6 @@ import gregtech.api.objects.GT_ItemStack; import gtPlusPlus.api.interfaces.IComparableRecipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.minecraft.NoConflictGTRecipeMap; import gtPlusPlus.core.lib.CORE; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; @@ -338,7 +341,7 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { public static final GTPP_Recipe_Map_Internal sChemicalDehydratorRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.chemicaldehydrator", "Dehydrator", null, RES_PATH_GUI + "basicmachines/Dehydrator", 2, 9, 0, 0, 1, E, 1, E, true, true); public static final GTPP_Recipe_Map_Internal sVacuumFurnaceRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(500), "gtpp.recipe.vacfurnace", "Vacuum Furnace", null, "gregtech:textures/gui/basicmachines/Default", 6, 6, 1, 0, 1, "Heat Capacity: ", 1, " K", false, true); public static final GTPP_Recipe_Map_Internal sAlloyBlastSmelterRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.alloyblastsmelter", "Alloy Blast Smelter", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 9, 9, 1, 0, 1, E, 1, E, true, true); - public static final GTPP_Recipe_Map_Internal sSteamTurbineFuels = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10), "gtpp.recipe.steamturbinefuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, true); + public static final GTPP_Recipe_Map_Internal sSteamTurbineFuels = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(10), "gtpp.recipe.steamturbinefuel", "GeoThermal Fuel", null, RES_PATH_GUI + "basicmachines/Default", 1, 1, 0, 0, 1, "Fuel Value: ", 1000, " EU", true, false); //LFTR recipes public static final GTPP_Recipe_Map_Internal sLiquidFluorineThoriumReactorRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(50), "gtpp.recipe.lftr", "Liquid Fluoride Thorium Reactor", null, RES_PATH_GUI + "basicmachines/FissionFuel", 0, 0, 0, 2, 0, "Power: ", 1, " EU/t per Dynamo", true, true); @@ -358,6 +361,13 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { //Basic Washer Map public static final GTPP_Recipe_Map_Internal sSimpleWasherRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.simplewasher", "Simple Dust Washer", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, true); + //Molecular Transformer Map + public static final GTPP_Recipe_Map_Internal sMolecularTransformerRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.moleculartransformer", "Molecular Transformer", null, RES_PATH_GUI + "basicmachines/Scanner", 1, 1, 0, 0, 1, E, 1, E, true, true); + + //Elemental Duplicator Map + public static final GTPP_Recipe_Map_Internal sElementalDuplicatorRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(3), "gtpp.recipe.elementaldupe", "Elemental Duplicator", null, RES_PATH_GUI + "basicmachines/Replicator", 1, 1, 0, 1, 1, E, 1, E, true, false); + + //public static final GT_Recipe_Map sSimpleWasherRecipes_FakeFuckBW = new GT_Recipe_Map(new HashSet<GT_Recipe>(3), "gtpp.recipe.simplewasher", "Fuck you Bart", null, RES_PATH_GUI + "basicmachines/PotionBrewer", 1, 1, 0, 0, 1, E, 1, E, true, false); public static final GTPP_Recipe_Map_Internal sChemicalPlantRecipes = new GTPP_Recipe_Map_Internal( @@ -386,8 +396,13 @@ public class GTPP_Recipe extends GT_Recipe implements IComparableRecipe { //Thermal Boiler map public static final GT_Recipe.GT_Recipe_Map_Fuel sThermalFuels = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.thermalgeneratorfuel", "Thermal Generator Fuel", null, "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, - "Fuel Value: ", 1000, " EU", true, false); + null, 1000, null, true, false); + //Solar Tower map + public static final GT_Recipe.GT_Recipe_Map_Fuel sSolarTowerRecipes = new GT_Recipe_Map_Fuel(new HashSet<GT_Recipe>(10), "gtpp.recipe.solartower", + "Solar Tower", null, "gregtech:textures/gui/basicmachines/Default", 1, 1, 0, 0, 1, + null, 1000, null, true, false); + //Cyclotron recipe map public static final GTPP_Recipe_Map_Internal sCyclotronRecipes = new GTPP_Recipe_Map_Internal(new HashSet<GT_Recipe>(200), "gtpp.recipe.cyclotron", "COMET - Compact Cyclotron", null, RES_PATH_GUI + "basicmachines/BlastSmelter", 2, 16, 0, 0, 1, E, 1, E, true, true); diff --git a/src/main/java/gregtech/api/util/HotFuel.java b/src/main/java/gregtech/api/util/HotFuel.java index c9a6dcf7c5..e709926f83 100644 --- a/src/main/java/gregtech/api/util/HotFuel.java +++ b/src/main/java/gregtech/api/util/HotFuel.java @@ -22,7 +22,21 @@ public class HotFuel { GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(x); } - + public static void addNewHotFuel(FluidStack aInput1, FluidStack aOutput1, FluidStack aOutput2, int aSpecialValue) { + GTPP_Recipe x = new GTPP_Recipe( + false, + null, + null, + null, + null, + new FluidStack[]{aInput1}, + new FluidStack[]{aOutput1, aOutput2}, + 20, //1 Second + 0, //No Eu produced + aSpecialValue //Magic Number + ); + GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.addRecipe(x); + } } diff --git a/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java b/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java index 6fe4209efe..5cf323c7e2 100644 --- a/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java +++ b/src/main/java/gtPlusPlus/api/helpers/GregtechPlusPlus_API.java @@ -5,6 +5,7 @@ import java.util.HashMap; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.WeightedCollection; import gtPlusPlus.api.objects.minecraft.multi.SpecialMultiBehaviour; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy_RTG; import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler; @@ -12,6 +13,15 @@ import net.minecraft.block.Block; import net.minecraft.item.ItemStack; public class GregtechPlusPlus_API { + + + public static class MolecularTransformer_API { + + public static boolean addRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU) { + return CORE.RA.addMolecularTransformerRecipe(aInput, aOutput, aDuration, aEU, 1); + } + + } public static class Multiblock_API { diff --git a/src/main/java/gtPlusPlus/core/block/ModBlocks.java b/src/main/java/gtPlusPlus/core/block/ModBlocks.java index b51915bb7b..5b29d9a636 100644 --- a/src/main/java/gtPlusPlus/core/block/ModBlocks.java +++ b/src/main/java/gtPlusPlus/core/block/ModBlocks.java @@ -13,11 +13,22 @@ import gtPlusPlus.core.block.general.PlayerDoors; import gtPlusPlus.core.block.general.antigrief.BlockWitherProof; import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneDetector; import gtPlusPlus.core.block.general.redstone.BlockGenericRedstoneTest; -import gtPlusPlus.core.block.machine.*; +import gtPlusPlus.core.block.machine.CircuitProgrammer; +import gtPlusPlus.core.block.machine.DecayablesChest; +import gtPlusPlus.core.block.machine.EggBox; +import gtPlusPlus.core.block.machine.FishTrap; +import gtPlusPlus.core.block.machine.HeliumGenerator; +import gtPlusPlus.core.block.machine.Machine_ModularityTable; +import gtPlusPlus.core.block.machine.Machine_PestKiller; +import gtPlusPlus.core.block.machine.Machine_PooCollector; +import gtPlusPlus.core.block.machine.Machine_ProjectTable; +import gtPlusPlus.core.block.machine.Machine_RoundRobinator; +import gtPlusPlus.core.block.machine.Machine_SuperJukebox; +import gtPlusPlus.core.block.machine.Machine_TradeTable; +import gtPlusPlus.core.block.machine.VolumetricFlaskSetter; import gtPlusPlus.core.block.machine.bedrock.Mining_Head_Fake; import gtPlusPlus.core.block.machine.bedrock.Mining_Pipe_Fake; import gtPlusPlus.core.fluids.FluidRegistryHandler; -import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -32,8 +43,6 @@ public final class ModBlocks { public static Block blockFakeMiningHead; public static Block blockFishTrap; - public static Block blockWorkbench; - public static Block blockWorkbenchAdvanced; public static Block blockDecayablesChest; public static Block blockEggBox; @@ -50,6 +59,7 @@ public final class ModBlocks { public static Block blockCasings5Misc; public static Block blockCasingsTieredGTPP; public static Block blockSpecialMultiCasings; + public static Block blockSpecialMultiCasings2; public static Block blockCustomMachineCasings; public static Block blockMetaTileEntity; @@ -109,8 +119,6 @@ public final class ModBlocks { FluidRegistryHandler.registerFluids(); //Workbench - blockWorkbench = new Machine_Workbench().setHardness(1.5F); - blockWorkbenchAdvanced = new Machine_WorkbenchAdvanced().setHardness(2.5F); blockHeliumGenerator = new HeliumGenerator(); blockFirePit = new FirePit(); blockFishTrap = new FishTrap(); diff --git a/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java b/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java index 03ca846b7d..2cf40160a3 100644 --- a/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java +++ b/src/main/java/gtPlusPlus/core/block/general/BlockCompressedObsidian.java @@ -23,7 +23,7 @@ import gtPlusPlus.core.lib.CORE; public class BlockCompressedObsidian extends BlockObsidian { - private final IIcon textureArray[] = new IIcon[6]; + private final IIcon textureArray[] = new IIcon[11]; public BlockCompressedObsidian() { this.setBlockName("blockCompressedObsidian"); @@ -36,9 +36,12 @@ public class BlockCompressedObsidian extends BlockObsidian { @Override public MapColor getMapColor(final int meta) { - if (meta != 5) { + if (meta < 5) { return MapColor.obsidianColor; } + if (meta > 5) { + return MapColor.goldColor; + } else { return MapColor.sandColor; } @@ -53,6 +56,11 @@ public class BlockCompressedObsidian extends BlockObsidian { this.textureArray[3] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian4"); this.textureArray[4] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian5"); this.textureArray[5] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "obsidian_invert"); + this.textureArray[6] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone1"); + this.textureArray[7] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone2"); + this.textureArray[8] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone3"); + this.textureArray[9] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone4"); + this.textureArray[10] = iicon.registerIcon(CORE.MODID + ":" + "compressed/" + "glowstone5"); } /** @@ -71,7 +79,7 @@ public class BlockCompressedObsidian extends BlockObsidian { @Override public void getSubBlocks(final Item item, final CreativeTabs tab, final List list) { - for (int i = 0; i < 6; i++) { + for (int i = 0; i < 11; i++) { list.add(new ItemStack(item, 1, i)); } } diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_Workbench.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_Workbench.java deleted file mode 100644 index 5c08612042..0000000000 --- a/src/main/java/gtPlusPlus/core/block/machine/Machine_Workbench.java +++ /dev/null @@ -1,152 +0,0 @@ -package gtPlusPlus.core.block.machine; - -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.LanguageRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.EnumCreatureType; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import gtPlusPlus.GTplusplus; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; -import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import ic2.core.item.tool.ItemToolWrench; - -@Optional.Interface(iface = "crazypants.enderio.api.tool.ITool", modid = "EnderIO") -public class Machine_Workbench extends BlockContainer -{ - @SideOnly(Side.CLIENT) - private IIcon textureTop; - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - @SideOnly(Side.CLIENT) - private IIcon textureFront; - - @SuppressWarnings("deprecation") - public Machine_Workbench() - { - super(Material.iron); - this.setBlockName("blockWorkbenchGT"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, "blockWorkbenchGT"); - LanguageRegistry.addName(this, "Bronze Workbench"); - - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) - { - return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) - { - this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet"); - this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_top_crafting"); - this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side"); - this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "bronze_side_cabinet"); - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz) - { - - ItemStack heldItem = null; - if (world.isRemote){ - heldItem = PlayerUtils.getItemStackInPlayersHand(); - } - - boolean holdingWrench = false; - - if (heldItem != null){ - holdingWrench = isWrench(heldItem); - } - - if (world.isRemote) { - return true; - } - - final TileEntity te = world.getTileEntity(x, y, z); - if ((te != null) && (te instanceof TileEntityWorkbench)) - { - if (!holdingWrench){ - player.openGui(GTplusplus.instance, 3, world, x, y, z); - return true; - } - Logger.INFO("Holding a Wrench, doing wrench things instead."); - } - return false; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityWorkbench(); - } - - public static boolean isWrench(final ItemStack item){ - if (item.getItem() instanceof ItemToolWrench){ - return true; - } - if (LoadedMods.BuildCraft){ - return checkBuildcraftWrench(item); - } - if (LoadedMods.EnderIO){ - return checkEnderIOWrench(item); - } - return false; - } - - @Optional.Method(modid = "EnderIO") - private static boolean checkEnderIOWrench(final ItemStack item) { - if (ReflectionUtils.doesClassExist("crazypants.enderio.api.tool.ITool")) { - Class<?> wrenchClass; - wrenchClass = ReflectionUtils.getClass("crazypants.enderio.api.tool.ITool"); - if (wrenchClass.isInstance(item.getItem())) { - return true; - } - } - return false; - } - - @Optional.Method(modid = "Buildcraft") - private static boolean checkBuildcraftWrench(final ItemStack item) { - if (ReflectionUtils.doesClassExist("buildcraft.api.tools.IToolWrench")) { - Class<?> wrenchClass; - wrenchClass = ReflectionUtils.getClass("buildcraft.api.tools.IToolWrench"); - if (wrenchClass.isInstance(item.getItem())) { - return true; - } - } - return false; - } - - @Override - public boolean canCreatureSpawn(final EnumCreatureType type, final IBlockAccess world, final int x, final int y, final int z) { - return false; - } - -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java b/src/main/java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java deleted file mode 100644 index af2f9f82e0..0000000000 --- a/src/main/java/gtPlusPlus/core/block/machine/Machine_WorkbenchAdvanced.java +++ /dev/null @@ -1,111 +0,0 @@ -package gtPlusPlus.core.block.machine; - -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.LanguageRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -import gtPlusPlus.core.creative.AddToCreativeTab; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; - -public class Machine_WorkbenchAdvanced extends BlockContainer -{ - @SideOnly(Side.CLIENT) - private IIcon textureTop; - @SideOnly(Side.CLIENT) - private IIcon textureBottom; - @SideOnly(Side.CLIENT) - private IIcon textureFront; - - @SuppressWarnings("deprecation") - public Machine_WorkbenchAdvanced() - { - super(Material.iron); - this.setBlockName("blockWorkbenchGTAdvanced"); - this.setCreativeTab(AddToCreativeTab.tabMachines); - GameRegistry.registerBlock(this, "blockWorkbenchGTAdvanced"); - LanguageRegistry.addName(this, "Advanced Workbench"); - - } - - /** - * Gets the block's texture. Args: side, meta - */ - @Override - @SideOnly(Side.CLIENT) - public IIcon getIcon(final int p_149691_1_, final int p_149691_2_) - { - return p_149691_1_ == 1 ? this.textureTop : (p_149691_1_ == 0 ? this.textureBottom : ((p_149691_1_ != 2) && (p_149691_1_ != 4) ? this.blockIcon : this.textureFront)); - } - - @Override - @SideOnly(Side.CLIENT) - public void registerBlockIcons(final IIconRegister p_149651_1_) - { - this.blockIcon = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top"); - this.textureTop = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "cover_crafting"); - this.textureBottom = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top"); - this.textureFront = p_149651_1_.registerIcon(CORE.MODID + ":" + "TileEntities/" + "machine_top"); - } - - /** - * Called upon block activation (right click on the block.) - */ - @Override - public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float lx, final float ly, final float lz) - { - - /*final ItemStack heldItem = PlayerUtils.getItemStackInPlayersHand(player); - if (world.isRemote) { - return true; - } - boolean holdingWrench = false; - - if (heldItem != null){ - if (heldItem.getItem() instanceof ItemToolWrench){ - holdingWrench = true; - } - else if (heldItem.getItem() instanceof IToolWrench){ - holdingWrench = true; - } - else if (heldItem.getItem() instanceof ITool){ - holdingWrench = true; - } - else if (heldItem.getItem() instanceof GT_MetaGenerated_Tool){ - GT_MetaGenerated_Tool testTool = (GT_MetaGenerated_Tool) heldItem.getItem(); - if (testTool.canWrench(player, x, y, z)){ - holdingWrench = true; - } - } - else { - holdingWrench = false; - } - } - - - final TileEntity te = world.getTileEntity(x, y, z); - if ((te != null) && (te instanceof TileEntityWorkbenchAdvanced)) - { - if (!holdingWrench){ - player.openGui(GTplusplus.instance, 4, world, x, y, z); - return true; - } - Utils.LOG_INFO("Holding a Wrench, doing wrench things instead."); - }*/ - return false; - } - - @Override - public TileEntity createNewTileEntity(final World world, final int p_149915_2_) { - return new TileEntityWorkbenchAdvanced(128000, 2); - } -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java index d89d320da5..951b10b432 100644 --- a/src/main/java/gtPlusPlus/core/config/ConfigHandler.java +++ b/src/main/java/gtPlusPlus/core/config/ConfigHandler.java @@ -108,7 +108,7 @@ public class ConfigHandler { disableZombieReinforcement = config.getBoolean("disableZombieReinforcement", "features", false, "Disables Zombie Reinforcement on hard difficutly."); enableWatchdogBGM = config.getInt("enableWatchdogBGM", "features", 0, 0, Short.MAX_VALUE, "Set to a value greater than 0 to reduce the ticks taken to delay between BGM tracks. Acceptable Values are 1-32767, where 0 is disabled. Vanilla Uses 12,000 & 24,000. 200 is 10s."); hideUniversalCells = config.getBoolean("hideUniversalCells", "features", true, "Hides every filled IC2 Universal Cell from NEI."); - + // Biomes EVERGLADES_ID = config.getInt("darkworld_ID", "worldgen", 227, 1, 254, "The ID of the Dark Dimension."); EVERGLADESBIOME_ID = config.getInt("darkbiome_ID", "worldgen", 238, 1, 254, "The biome within the Dark Dimension."); @@ -134,6 +134,7 @@ public class ConfigHandler { pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = config.get("pollution", "pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc", pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc, "pollution rate in gibbl/s for the Large processing factory in misc mode").getInt(pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc); pollutionPerSecondMultiIndustrialPlatePress_ModeForming = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeForming", pollutionPerSecondMultiIndustrialPlatePress_ModeForming, "pollution rate in gibbl/s for the Industrial material press in forming mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeForming); pollutionPerSecondMultiIndustrialPlatePress_ModeBending = config.get("pollution", "pollutionPerSecondMultiIndustrialPlatePress_ModeBending", pollutionPerSecondMultiIndustrialPlatePress_ModeBending, "pollution rate in gibbl/s for the Industrial material press in bending mode").getInt(pollutionPerSecondMultiIndustrialPlatePress_ModeBending); + pollutionPerSecondMultiIndustrialForgeHammer = config.get("pollution", "pollutionPerSecondMultiIndustrialForgeHammer", pollutionPerSecondMultiIndustrialForgeHammer, "pollution rate in gibbl/s for the Industrial Forge Hammer").getInt(pollutionPerSecondMultiIndustrialForgeHammer); pollutionPerSecondMultiIndustrialSifter = config.get("pollution", "pollutionPerSecondMultiIndustrialSifter", pollutionPerSecondMultiIndustrialSifter, "pollution rate in gibbl/s for the Large Sifter").getInt(pollutionPerSecondMultiIndustrialSifter); pollutionPerSecondMultiIndustrialThermalCentrifuge = config.get("pollution", "pollutionPerSecondMultiIndustrialThermalCentrifuge", pollutionPerSecondMultiIndustrialThermalCentrifuge, "pollution rate in gibbl/s for the Large thermal refinery").getInt(pollutionPerSecondMultiIndustrialThermalCentrifuge); pollutionPerSecondMultiIndustrialVacuumFreezer = config.get("pollution", "pollutionPerSecondMultiIndustrialVacuumFreezer", pollutionPerSecondMultiIndustrialVacuumFreezer, "pollution rate in gibbl/s for the Cryogenic freezer").getInt(pollutionPerSecondMultiIndustrialVacuumFreezer); @@ -158,6 +159,7 @@ public class ConfigHandler { pollutionPerSecondMultiTreeFarm = config.get("pollution", "pollutionPerSecondMultiTreeFarm", pollutionPerSecondMultiTreeFarm, "pollution rate in gibbl/s for the Tree growth simulator").getInt(pollutionPerSecondMultiTreeFarm); pollutionPerSecondMultiFrothFlotationCell = config.get("pollution", "pollutionPerSecondMultiFrothFlotationCell", pollutionPerSecondMultiFrothFlotationCell, "pollution rate in gibbl/s for the Flotation cell regulator").getInt(pollutionPerSecondMultiFrothFlotationCell); pollutionPerSecondMultiAutoCrafter = config.get("pollution", "pollutionPerSecondMultiAutoCrafter", pollutionPerSecondMultiAutoCrafter, "pollution rate in gibbl/s for the Large-Scale auto assembler v1.01").getInt(pollutionPerSecondMultiAutoCrafter); + pollutionPerSecondMultiMolecularTransformer = config.get("pollution", "pollutionPerSecondMultiMolecularTransformer", pollutionPerSecondMultiMolecularTransformer, "pollution rate in gibbl/s for the Multiblock Molecular Transformer").getInt(pollutionPerSecondMultiMolecularTransformer); pollutionPerSecondMultiThermalBoiler = config.get("pollution", "pollutionPerSecondMultiThermalBoiler", pollutionPerSecondMultiThermalBoiler, "pollution rate in gibbl/s for the Thermal boiler").getInt(pollutionPerSecondMultiThermalBoiler); pollutionPerSecondMultiAlgaePond = config.get("pollution", "pollutionPerSecondMultiAlgaePond", pollutionPerSecondMultiAlgaePond, "pollution rate in gibbl/s for the Algae farm").getInt(pollutionPerSecondMultiAlgaePond); basePollutionPerSecondSemiFluidGenerator = config.get("pollution", "basePollutionPerSecondSemiFluidGenerator", basePollutionPerSecondSemiFluidGenerator, "base pollution rate in gibbl/s for the single block semi fluid generators").getInt(basePollutionPerSecondSemiFluidGenerator); diff --git a/src/main/java/gtPlusPlus/core/container/Container_Workbench.java b/src/main/java/gtPlusPlus/core/container/Container_Workbench.java deleted file mode 100644 index 55ef1a3d0c..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_Workbench.java +++ /dev/null @@ -1,413 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.*; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.world.World; - -import gregtech.api.gui.GT_Slot_Holo; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.interfaces.IItemBlueprint; -import gtPlusPlus.core.inventories.InventoryWorkbenchChest; -import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots; -import gtPlusPlus.core.inventories.InventoryWorkbenchTools; -import gtPlusPlus.core.item.general.ItemBlueprint; -import gtPlusPlus.core.slots.*; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class Container_Workbench extends Container { - - protected TileEntityWorkbench tile_entity; - public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); - public final InventoryWorkbenchChest inventoryChest; - public final InventoryWorkbenchTools inventoryTool; - public final InventoryWorkbenchHoloSlots inventoryHolo; - //public final InventoryWorkbenchHoloCrafting inventoryCrafting; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - public static int HoloSlotNumber = 6; - public static int InputSlotNumber = 0; //Number of Slots in the Crafting Grid - public static int StorageSlotNumber = 16; //Number of slots in storage area - public static int ToolSlotNumber = 5; // Number of slots in the tool area up top - public static int InOutputSlotNumber = InputSlotNumber + StorageSlotNumber + ToolSlotNumber + HoloSlotNumber; //Same plus Output Slot - public static int InventorySlotNumber = 36; //Inventory Slots (Inventory and Hotbar) - public static int InventoryOutSlotNumber = InventorySlotNumber + 1; //Inventory Slot Number + Output - public static int FullSlotNumber = InventorySlotNumber + InOutputSlotNumber; //All slots - - private final int slotOutput = 0; - private final int[] slotHolo = new int[5]; - private final int[] slotCrafting = new int[9]; - private final int[] slotStorage = new int[16]; - private final int[] slotTools = new int[5]; - - public void moveCraftingToChest(){ - //Check Chest Space - for (int i=0;i<9;i++){ - if (this.craftMatrix.getStackInSlot(i) != null){ - for (int r=0;r<16;r++){ - if ((this.inventoryChest.getStackInSlot(r) == null) || ((this.inventoryChest.getStackInSlot(r).getItem() == this.craftMatrix.getStackInSlot(i).getItem()) && ((64-this.craftMatrix.getStackInSlot(i).stackSize) <= (64-this.craftMatrix.getStackInSlot(i).stackSize)))){ - this.inventoryChest.setInventorySlotContents(r, this.craftMatrix.getStackInSlot(i)); - this.craftMatrix.setInventorySlotContents(i, null); - break; - } - } - } - } - //For Each Space or already existing itemstack, move one itemstack or fill current partial stack - //Remove old itemstack or partial stack from crafting grid - } - - public void moveChestToCrafting(){ - //Check Crafting items and slots - for (int i=0;i<9;i++){ - if ((this.craftMatrix.getStackInSlot(i) == null) || (this.craftMatrix.getStackInSlot(i).stackSize > 0)){ - for (int r=0;r<16;r++){ - if (this.inventoryChest.getStackInSlot(r) != null){ - this.craftMatrix.setInventorySlotContents(i, this.craftMatrix.getStackInSlot(r)); - this.inventoryChest.setInventorySlotContents(r, null); - } - } - } - } - //For Each already existing itemstack, fill current partial stack - //Remove partial stack from chest area - } - - - public Container_Workbench(final InventoryPlayer inventory, final TileEntityWorkbench tile){ - this.tile_entity = tile; - this.inventoryChest = tile.inventoryChest; - this.inventoryTool = tile.inventoryTool; - this.inventoryHolo = tile.inventoryHolo; - //this.inventoryCrafting = tile.inventoryCrafting; - - int var6; - int var7; - this.worldObj = tile.getWorldObj(); - this.posX = tile.xCoord; - this.posY = tile.yCoord; - this.posZ = tile.zCoord; - - int o=0; - - //Output slot - this.addSlotToContainer(new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64)); - //Util Slots - this.addSlotToContainer(new SlotBlueprint(this.inventoryHolo, 1, 136, 28)); //Blueprint - this.addSlotToContainer(new SlotNoInput(this.inventoryHolo, 2, 154, 28)); //Hopper - this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 3, 154, 64, false, false, 64)); //Parking - //Holo Slots - this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 4, 154, 46, false, false, 1)); - this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 5, 136, 46, false, false, 1)); - - for (int i=1; i<6; i++){ - this.slotHolo[o] = o+1; - o++; - } - - o=0; - - this.updateCraftingMatrix(); - - //Crafting Grid - for (var6 = 0; var6 < 3; ++var6) - { - for (var7 = 0; var7 < 3; ++var7) - { - //this.addSlotToContainer(new Slot(this.craftMatrix, var7 + (var6 * 3), 82 + (var7 * 18), 28 + (var6 * 18))); - - /*if (this.inventoryCrafting.getStackInSlot(o) != null){ - this.craftMatrix.setInventorySlotContents(o, inventoryCrafting.getStackInSlot(o)); - this.inventoryCrafting.setInventorySlotContents(o, null); - } */ - this.slotCrafting[o] = o+6; - o++; - } - } - - o=0; - - //Storage Side - for (var6 = 0; var6 < 4; ++var6) - { - for (var7 = 0; var7 < 4; ++var7) - { - //Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18)); - this.addSlotToContainer(new Slot(this.inventoryChest, var7 + (var6 * 4), 8 + (var7 * 18), 7 + (var6 * 18))); - this.slotStorage[o] = o+15; - o++; - } - } - - o=0; - - //Tool Slots - for (var6 = 0; var6 < 1; ++var6) - { - for (var7 = 0; var7 < 5; ++var7) - { - this.addSlotToContainer(new SlotGtTool(this.inventoryTool, var7 + (var6 * 3), 82 + (var7 * 18), 8 + (var6 * 18))); - this.slotTools[o] = o+31; - o++; - } - } - - //Player Inventory - for (var6 = 0; var6 < 3; ++var6) - { - for (var7 = 0; var7 < 9; ++var7) - { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - //Player Hotbar - for (var6 = 0; var6 < 9; ++var6) - { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - - this.onCraftMatrixChanged(this.craftMatrix); - - } - - @Override - public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer){ - - if (!aPlayer.worldObj.isRemote){ - if ((aSlotIndex == 999) || (aSlotIndex == -999)){ - //Utils.LOG_WARNING("??? - "+aSlotIndex); - } - - if (aSlotIndex == this.slotOutput){ - Logger.WARNING("Player Clicked on the output slot"); - //TODO - } - - for (final int x : this.slotHolo){ - if (aSlotIndex == x){ - Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); - if (x == 1){ - Logger.WARNING("Player Clicked Blueprint slot in the Holo Grid"); - } - else if (x == 2){ - Logger.WARNING("Player Clicked Right Arrow slot in the Holo Grid"); - if (this.inventoryHolo.getStackInSlot(1) != null){ - Logger.WARNING("Found an ItemStack."); - if (this.inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){ - Logger.WARNING("Found a blueprint."); - final ItemStack tempBlueprint = this.inventoryHolo.getStackInSlot(1); - final ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem(); - if ((this.inventoryHolo.getStackInSlot(0) != null) && !tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Logger.WARNING("Output slot was not empty."); - Logger.WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); - tempItemBlueprint.setBlueprint(this.inventoryHolo.getStackInSlot(1), this.craftMatrix, this.inventoryHolo.getStackInSlot(0)); - final ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint); - this.inventoryHolo.setInventorySlotContents(1, newTempBlueprint); - Logger.WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); - } - else { - if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Logger.WARNING("Blueprint already holds a recipe."); - } - else { - Logger.WARNING("Output slot was empty."); - } - } - } - else { - Logger.WARNING("ItemStack found was not a blueprint."); - } - } - else { - Logger.WARNING("No ItemStack found in Blueprint slot."); - } - } - else if (x == 3){ - Logger.WARNING("Player Clicked Big [P] slot in the Holo Grid"); - } - else if (x == 4){ - Logger.WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); - } - else if (x == 5){ - Logger.WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); - } - } - } - - for (final int x : this.slotCrafting){ - if (aSlotIndex == x){ - Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); - } - } - for (final int x : this.slotStorage){ - if (aSlotIndex == x){ - Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid"); - } - } - for (final int x : this.slotTools){ - if (aSlotIndex == x){ - Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid"); - } - } - } - //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid"); - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - private void updateCraftingMatrix() { - for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) { - //this.craftMatrix.setInventorySlotContents(i, this.tile_entity.inventoryCrafting.getStackInSlot(i)); - } - } - - @Override - public void onCraftMatrixChanged(final IInventory iiventory) { - this.tile_entity.inventoryCraftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); - } - - @Override - public void onContainerClosed(final EntityPlayer par1EntityPlayer) - { - super.onContainerClosed(par1EntityPlayer); - this.saveCraftingMatrix(); - } - - private void saveCraftingMatrix() { - for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) { - //this.tile_entity.inventoryCrafting.setInventorySlotContents(i, this.craftMatrix.getStackInSlot(i)); - } - } - - - - - /*@Override - public void onCraftMatrixChanged(IInventory par1IInventory){ - //Custom Recipe Handler - //craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj)); - - //Vanilla CraftingManager - Utils.LOG_WARNING("checking crafting grid for a valid output."); - ItemStack temp = CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj); - if (temp != null){ - Utils.LOG_WARNING("Output found. "+temp.getDisplayName()+" x"+temp.stackSize); - craftResult.setInventorySlotContents(slotOutput, temp); - } - else { - Utils.LOG_WARNING("No Valid output found."); - craftResult.setInventorySlotContents(slotOutput, null); - } - }*/ - - /*@Override - public void onContainerClosed(EntityPlayer par1EntityPlayer) - { - for (int o=0; o<craftMatrix.getSizeInventory(); o++){ - this.inventoryCrafting.setInventorySlotContents(o, craftMatrix.getStackInSlot(o)); - this.craftMatrix.setInventorySlotContents(o, null); - }*/ - - //super.onContainerClosed(par1EntityPlayer); - - /*if (worldObj.isRemote) - { - return; - } - - for (int i = 0; i < InputSlotNumber; i++) - { - ItemStack itemstack = craftMatrix.getStackInSlotOnClosing(i); - - if (itemstack != null) - { - par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false); - } - }*/ - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer){ - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockWorkbench){ - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) - { - ItemStack var3 = null; - final Slot var4 = (Slot)this.inventorySlots.get(par2); - - if ((var4 != null) && var4.getHasStack()) - { - final ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - if (par2 == 0) - { - if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) - { - return null; - } - - var4.onSlotChange(var5, var3); - } - else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber)) - { - if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) - { - return null; - } - } - else if ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber)) - { - if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false)) - { - return null; - } - } - else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false)) - { - return null; - } - - if (var5.stackSize == 0) - { - var4.putStack((ItemStack)null); - } - else - { - var4.onSlotChanged(); - } - - if (var5.stackSize == var3.stackSize) - { - return null; - } - - var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - - //Can merge Slot - @Override - public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { - return (p_94530_2_.inventory != this.tile_entity.inventoryCraftResult) && super.func_94530_a(p_94530_1_, p_94530_2_); - } - - -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java b/src/main/java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java deleted file mode 100644 index dc499c570f..0000000000 --- a/src/main/java/gtPlusPlus/core/container/Container_WorkbenchAdvanced.java +++ /dev/null @@ -1,377 +0,0 @@ -package gtPlusPlus.core.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.*; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraft.world.World; - -import gregtech.api.gui.GT_Slot_Holo; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.interfaces.IItemBlueprint; -import gtPlusPlus.core.inventories.*; -import gtPlusPlus.core.item.general.ItemBlueprint; -import gtPlusPlus.core.slots.*; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; -import gtPlusPlus.core.util.minecraft.ItemUtils; - -public class Container_WorkbenchAdvanced extends Container { - - protected TileEntityWorkbenchAdvanced tile_entity; - public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 3); - public final InventoryWorkbenchChest inventoryChest; - public final InventoryWorkbenchToolsElectric inventoryTool; - public final InventoryWorkbenchHoloSlots inventoryHolo; - public final InventoryWorkbenchHoloCrafting inventoryCrafting; - - private final World worldObj; - private final int posX; - private final int posY; - private final int posZ; - - public static int HoloSlotNumber = 6; - public static int InputSlotNumber = 9; //Number of Slots in the Crafting Grid - public static int StorageSlotNumber = 16; //Number of slots in storage area - public static int ToolSlotNumber = 5; // Number of slots in the tool area up top - public static int InOutputSlotNumber = InputSlotNumber + StorageSlotNumber + ToolSlotNumber + HoloSlotNumber; //Same plus Output Slot - public static int InventorySlotNumber = 36; //Inventory Slots (Inventory and Hotbar) - public static int InventoryOutSlotNumber = InventorySlotNumber + 1; //Inventory Slot Number + Output - public static int FullSlotNumber = InventorySlotNumber + InOutputSlotNumber; //All slots - - private final int slotOutput = 0; - private final int[] slotHolo = new int[5]; - private final int[] slotCrafting = new int[9]; - private final int[] slotStorage = new int[16]; - private final int[] slotTools = new int[5]; - - public Container_WorkbenchAdvanced(final InventoryPlayer inventory, final TileEntityWorkbenchAdvanced tile){ - this.tile_entity = tile; - this.inventoryChest = tile.inventoryChest; - this.inventoryTool = tile.inventoryTool; - this.inventoryHolo = tile.inventoryHolo; - this.inventoryCrafting = tile.inventoryCrafting; - - int var6; - int var7; - this.worldObj = tile.getWorldObj(); - this.posX = tile.xCoord; - this.posY = tile.yCoord; - this.posZ = tile.zCoord; - - int o=0; - - //Output slot - this.addSlotToContainer(new SlotOutput(inventory.player, this.craftMatrix, tile.inventoryCraftResult, 0, 136, 64)); - //Util Slots - this.addSlotToContainer(new SlotBlueprint(this.inventoryHolo, 1, 136, 28)); //Blueprint - this.addSlotToContainer(new SlotNoInput(this.inventoryHolo, 2, 154, 28)); //Hopper - this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 3, 154, 64, false, false, 64)); //Parking - //Holo Slots - this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 4, 154, 46, false, false, 1)); - this.addSlotToContainer(new GT_Slot_Holo(this.inventoryHolo, 5, 136, 46, false, false, 1)); - - for (int i=1; i<6; i++){ - this.slotHolo[o] = o+1; - o++; - } - - o=0; - - this.updateCraftingMatrix(); - - //Crafting Grid - for (var6 = 0; var6 < 3; ++var6) - { - for (var7 = 0; var7 < 3; ++var7) - { - this.addSlotToContainer(new Slot(this.craftMatrix, var7 + (var6 * 3), 82 + (var7 * 18), 28 + (var6 * 18))); - - /*if (this.inventoryCrafting.getStackInSlot(o) != null){ - this.craftMatrix.setInventorySlotContents(o, inventoryCrafting.getStackInSlot(o)); - this.inventoryCrafting.setInventorySlotContents(o, null); - } */ - this.slotCrafting[o] = o+6; - o++; - } - } - - o=0; - - //Storage Side - for (var6 = 0; var6 < 4; ++var6) - { - for (var7 = 0; var7 < 4; ++var7) - { - //Utils.LOG_WARNING("Adding slots at var:"+(var7 + var6 * 4)+" x:"+(8 + var7 * 18)+" y:"+(7 + var6 * 18)); - this.addSlotToContainer(new Slot(this.inventoryChest, var7 + (var6 * 4), 8 + (var7 * 18), 7 + (var6 * 18))); - this.slotStorage[o] = o+15; - o++; - } - } - - o=0; - - //Tool Slots - for (var6 = 0; var6 < 1; ++var6) - { - for (var7 = 0; var7 < 5; ++var7) - { - this.addSlotToContainer(new SlotGtToolElectric(this.inventoryTool, var7 + (var6 * 3), 82 + (var7 * 18), 8 + (var6 * 18), 3, false)); - this.slotTools[o] = o+31; - o++; - } - } - - //Player Inventory - for (var6 = 0; var6 < 3; ++var6) - { - for (var7 = 0; var7 < 9; ++var7) - { - this.addSlotToContainer(new Slot(inventory, var7 + (var6 * 9) + 9, 8 + (var7 * 18), 84 + (var6 * 18))); - } - } - - //Player Hotbar - for (var6 = 0; var6 < 9; ++var6) - { - this.addSlotToContainer(new Slot(inventory, var6, 8 + (var6 * 18), 142)); - } - - this.onCraftMatrixChanged(this.craftMatrix); - - } - - @Override - public ItemStack slotClick(final int aSlotIndex, final int aMouseclick, final int aShifthold, final EntityPlayer aPlayer){ - - if (!aPlayer.worldObj.isRemote){ - if ((aSlotIndex == 999) || (aSlotIndex == -999)){ - //Utils.LOG_WARNING("??? - "+aSlotIndex); - } - - if (aSlotIndex == this.slotOutput){ - Logger.WARNING("Player Clicked on the output slot"); - //TODO - } - - for (final int x : this.slotHolo){ - if (aSlotIndex == x){ - Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the Holo Grid"); - if (x == 1){ - Logger.WARNING("Player Clicked Blueprint slot in the Holo Grid"); - } - else if (x == 2){ - Logger.WARNING("Player Clicked Right Arrow slot in the Holo Grid"); - if (this.inventoryHolo.getStackInSlot(1) != null){ - Logger.WARNING("Found an ItemStack."); - if (this.inventoryHolo.getStackInSlot(1).getItem() instanceof IItemBlueprint){ - Logger.WARNING("Found a blueprint."); - final ItemStack tempBlueprint = this.inventoryHolo.getStackInSlot(1); - final ItemBlueprint tempItemBlueprint = (ItemBlueprint) tempBlueprint.getItem(); - if ((this.inventoryHolo.getStackInSlot(0) != null) && !tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Logger.WARNING("Output slot was not empty."); - Logger.WARNING("Trying to manipulate NBT data on the blueprint stack, then replace it with the new one."); - tempItemBlueprint.setBlueprint(this.inventoryHolo.getStackInSlot(1), this.craftMatrix, this.inventoryHolo.getStackInSlot(0)); - final ItemStack newTempBlueprint = ItemUtils.getSimpleStack(tempItemBlueprint); - this.inventoryHolo.setInventorySlotContents(1, newTempBlueprint); - Logger.WARNING(ItemUtils.getArrayStackNames(tempItemBlueprint.getBlueprint(newTempBlueprint))); - } - else { - if (tempItemBlueprint.hasBlueprint(tempBlueprint)){ - Logger.WARNING("Blueprint already holds a recipe."); - } - else { - Logger.WARNING("Output slot was empty."); - } - } - } - else { - Logger.WARNING("ItemStack found was not a blueprint."); - } - } - else { - Logger.WARNING("No ItemStack found in Blueprint slot."); - } - } - else if (x == 3){ - Logger.WARNING("Player Clicked Big [P] slot in the Holo Grid"); - } - else if (x == 4){ - Logger.WARNING("Player Clicked Transfer to Crafting Grid slot in the Holo Grid"); - } - else if (x == 5){ - Logger.WARNING("Player Clicked Transfer to Storage Grid slot in the Holo Grid"); - } - } - } - - for (final int x : this.slotCrafting){ - if (aSlotIndex == x){ - Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the crafting Grid"); - } - } - for (final int x : this.slotStorage){ - if (aSlotIndex == x){ - Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the storage Grid"); - } - } - for (final int x : this.slotTools){ - if (aSlotIndex == x){ - Logger.WARNING("Player Clicked slot "+aSlotIndex+" in the tool Grid"); - } - } - } - //Utils.LOG_WARNING("Player Clicked slot "+aSlotIndex+" in the Grid"); - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - private void updateCraftingMatrix() { - for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) { - this.craftMatrix.setInventorySlotContents(i, this.tile_entity.inventoryCrafting.getStackInSlot(i)); - } - } - - @Override - public void onCraftMatrixChanged(final IInventory iiventory) { - this.tile_entity.inventoryCraftResult.setInventorySlotContents(0, CraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); - } - - @Override - public void onContainerClosed(final EntityPlayer par1EntityPlayer) - { - super.onContainerClosed(par1EntityPlayer); - this.saveCraftingMatrix(); - } - - private void saveCraftingMatrix() { - for (int i = 0; i < this.craftMatrix.getSizeInventory(); i++) { - this.tile_entity.inventoryCrafting.setInventorySlotContents(i, this.craftMatrix.getStackInSlot(i)); - } - } - - - - - /*@Override - public void onCraftMatrixChanged(IInventory par1IInventory){ - //Custom Recipe Handler - //craftResult.setInventorySlotContents(0, Workbench_CraftingHandler.getInstance().findMatchingRecipe(craftMatrix, worldObj)); - - //Vanilla CraftingManager - Utils.LOG_WARNING("checking crafting grid for a valid output."); - ItemStack temp = CraftingManager.getInstance().findMatchingRecipe(craftMatrix, worldObj); - if (temp != null){ - Utils.LOG_WARNING("Output found. "+temp.getDisplayName()+" x"+temp.stackSize); - craftResult.setInventorySlotContents(slotOutput, temp); - } - else { - Utils.LOG_WARNING("No Valid output found."); - craftResult.setInventorySlotContents(slotOutput, null); - } - }*/ - - /*@Override - public void onContainerClosed(EntityPlayer par1EntityPlayer) - { - for (int o=0; o<craftMatrix.getSizeInventory(); o++){ - this.inventoryCrafting.setInventorySlotContents(o, craftMatrix.getStackInSlot(o)); - this.craftMatrix.setInventorySlotContents(o, null); - }*/ - - //super.onContainerClosed(par1EntityPlayer); - - /*if (worldObj.isRemote) - { - return; - } - - for (int i = 0; i < InputSlotNumber; i++) - { - ItemStack itemstack = craftMatrix.getStackInSlotOnClosing(i); - - if (itemstack != null) - { - par1EntityPlayer.dropPlayerItemWithRandomChoice(itemstack, false); - } - }*/ - - @Override - public boolean canInteractWith(final EntityPlayer par1EntityPlayer){ - if (this.worldObj.getBlock(this.posX, this.posY, this.posZ) != ModBlocks.blockWorkbench){ - return false; - } - - return par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64D; - } - - - @Override - public ItemStack transferStackInSlot(final EntityPlayer par1EntityPlayer, final int par2) - { - ItemStack var3 = null; - final Slot var4 = (Slot)this.inventorySlots.get(par2); - - if ((var4 != null) && var4.getHasStack()) - { - final ItemStack var5 = var4.getStack(); - var3 = var5.copy(); - - if (par2 == 0) - { - if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, true)) - { - return null; - } - - var4.onSlotChange(var5, var3); - } - else if ((par2 >= InOutputSlotNumber) && (par2 < InventoryOutSlotNumber)) - { - if (!this.mergeItemStack(var5, InventoryOutSlotNumber, FullSlotNumber, false)) - { - return null; - } - } - else if ((par2 >= InventoryOutSlotNumber) && (par2 < FullSlotNumber)) - { - if (!this.mergeItemStack(var5, InOutputSlotNumber, InventoryOutSlotNumber, false)) - { - return null; - } - } - else if (!this.mergeItemStack(var5, InOutputSlotNumber, FullSlotNumber, false)) - { - return null; - } - - if (var5.stackSize == 0) - { - var4.putStack((ItemStack)null); - } - else - { - var4.onSlotChanged(); - } - - if (var5.stackSize == var3.stackSize) - { - return null; - } - - var4.onPickupFromSlot(par1EntityPlayer, var5); - } - - return var3; - } - - //Can merge Slot - @Override - public boolean func_94530_a(final ItemStack p_94530_1_, final Slot p_94530_2_) { - return (p_94530_2_.inventory != this.tile_entity.inventoryCraftResult) && super.func_94530_a(p_94530_1_, p_94530_2_); - } - - -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_Workbench.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_Workbench.java deleted file mode 100644 index 861c2ba6b6..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_Workbench.java +++ /dev/null @@ -1,81 +0,0 @@ -package gtPlusPlus.core.gui.machine; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import gtPlusPlus.core.container.Container_Workbench; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; - -@SideOnly(Side.CLIENT) -public class GUI_Workbench extends GuiContainer { - - private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/BronzeCraftingTable.png"); - - public boolean moveItemsToChest = false; - public boolean moveItemsToCrafting = false; - - public GUI_Workbench(final InventoryPlayer player_inventory, final TileEntityWorkbench tile){ - super(new Container_Workbench(player_inventory, tile)); - } - - - @Override - protected void drawGuiContainerForegroundLayer(final int i, final int j){ - //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752); - //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - - } - - - @Override - protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){ - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - this.mc.renderEngine.bindTexture(craftingTableGuiTextures); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } - - - //This method is called when the Gui is first called! - @Override - public void initGui() - { - //You have to add this line for the Gui to function properly! - super.initGui(); - - //The parameters of GuiButton are(id, x, y, width, height, text); - //this.buttonList.add(new GuiButton( 1, 367, 132, 18, 18, "X")); - //this.buttonList.add(new GuiButton( 2, 385, 132, 18, 18, "Y")); - //NOTE: the id always has to be different or else it might get called twice or never! - - //Add any other buttons here too! - } - - @Override - protected void actionPerformed(final GuiButton B) - { - //If the button id is different, or you have mrs buttons, create another if block for that too! - if(B.id == 1){ - System.out.println("Trying to empty crafting grid to the storage compartment."); - //moveItemsToChest = true; - ((Container_Workbench) this.inventorySlots).moveCraftingToChest(); - } - else if(B.id == 2){ - System.out.println("Trying to move items into the crafting grid."); - //moveItemsToCrafting = true; - ((Container_Workbench) this.inventorySlots).moveChestToCrafting(); - } - - - } - -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java b/src/main/java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java deleted file mode 100644 index 20183eb0b0..0000000000 --- a/src/main/java/gtPlusPlus/core/gui/machine/GUI_WorkbenchAdvanced.java +++ /dev/null @@ -1,42 +0,0 @@ -package gtPlusPlus.core.gui.machine; - -import org.lwjgl.opengl.GL11; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; - -import gtPlusPlus.core.container.Container_WorkbenchAdvanced; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; - -@SideOnly(Side.CLIENT) -public class GUI_WorkbenchAdvanced extends GuiContainer { - - private static final ResourceLocation craftingTableGuiTextures = new ResourceLocation(CORE.MODID, "textures/gui/AdvancedCraftingTable.png"); - - public GUI_WorkbenchAdvanced(final InventoryPlayer player_inventory, final TileEntityWorkbenchAdvanced tile){ - super(new Container_WorkbenchAdvanced(player_inventory, tile)); - } - - - @Override - protected void drawGuiContainerForegroundLayer(final int i, final int j){ - //this.fontRendererObj.drawString(I18n.format("Workbench", new Object[0]), 28, 6, 4210752); - //this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); - } - - - @Override - protected void drawGuiContainerBackgroundLayer(final float f, final int i, final int j){ - GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); - this.mc.renderEngine.bindTexture(craftingTableGuiTextures); - final int x = (this.width - this.xSize) / 2; - final int y = (this.height - this.ySize) / 2; - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } - -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java index bb47bb2380..1db54a4933 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java @@ -135,7 +135,7 @@ public class COMPAT_HANDLER { GregtechIndustrialCuttingFactory.run(); //GregtechMiniRaFusion.run(); GregtechComponentAssembler.run(); - //GregtechTeslaTower.run(); + GregtechTeslaTower.run(); GregtechSuperChests.run(); GregtechIndustrialFishPond.run(); GregtechTieredChunkloaders.run(); @@ -151,7 +151,7 @@ public class COMPAT_HANDLER { GregtechCustomHatches.run(); //GregtechNaqReactor.run(); GregtechIndustrialArcFurnace.run(); - //GregtechSolarTower.run(); + GregtechSolarTower.run(); GregtechLargeTurbinesAndHeatExchanger.run(); GregtechPowerBreakers.run(); GregtechFluidReactor.run(); @@ -159,7 +159,9 @@ public class COMPAT_HANDLER { GregtechIndustrialAlloySmelter.run(); GregtechIsaMill.run(); GregtechSteamMultis.run(); - //GregtechIndustrialElementDuplicator.run(); + GregtechIndustrialForgeHammer.run(); + GregtechMolecularTransformer.run(); + GregtechIndustrialElementDuplicator.run(); GregtechIndustrialRockBreaker.run(); GregtechIndustrialChisel.run(); diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java index 9a1b551d30..166c0f228b 100644 --- a/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java +++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_IntermodStaging.java @@ -4,6 +4,7 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLLoadCompleteEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; +import gtPlusPlus.xmod.advsolar.HANDLER_AdvSolar; import gtPlusPlus.xmod.bartcrops.HANDLER_CropsPlusPlus; import gtPlusPlus.xmod.bop.HANDLER_BiomesOPlenty; import gtPlusPlus.xmod.computronics.HANDLER_Computronics; @@ -81,6 +82,7 @@ public class COMPAT_IntermodStaging { HANDLER_Reliquary.postInit(); HANDLER_OpenBlocks.postInit(); HANDLER_SpiceOfLife.postInit(); + HANDLER_AdvSolar.postInit(); } public static void onLoadComplete(FMLLoadCompleteEvent event) { diff --git a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java index 0567d6c5dd..1be3578ed0 100644 --- a/src/main/java/gtPlusPlus/core/handler/GuiHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/GuiHandler.java @@ -5,7 +5,19 @@ import cpw.mods.fml.common.network.NetworkRegistry; import gtPlusPlus.GTplusplus; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox; -import gtPlusPlus.core.container.*; +import gtPlusPlus.core.container.Container_BackpackBase; +import gtPlusPlus.core.container.Container_CircuitProgrammer; +import gtPlusPlus.core.container.Container_DecayablesChest; +import gtPlusPlus.core.container.Container_EggBox; +import gtPlusPlus.core.container.Container_FishTrap; +import gtPlusPlus.core.container.Container_Grindle; +import gtPlusPlus.core.container.Container_ModularityTable; +import gtPlusPlus.core.container.Container_PestKiller; +import gtPlusPlus.core.container.Container_ProjectTable; +import gtPlusPlus.core.container.Container_RoundRobinator; +import gtPlusPlus.core.container.Container_SuperJukebox; +import gtPlusPlus.core.container.Container_TradeTable; +import gtPlusPlus.core.container.Container_VolumetricFlaskSetter; import gtPlusPlus.core.container.box.LunchBoxContainer; import gtPlusPlus.core.container.box.MagicBagContainer; import gtPlusPlus.core.container.box.ToolBoxContainer; @@ -16,7 +28,17 @@ import gtPlusPlus.core.gui.item.GuiBaseGrindle; import gtPlusPlus.core.gui.item.box.LunchBoxGui; import gtPlusPlus.core.gui.item.box.MagicBagGui; import gtPlusPlus.core.gui.item.box.ToolBoxGui; -import gtPlusPlus.core.gui.machine.*; +import gtPlusPlus.core.gui.machine.GUI_CircuitProgrammer; +import gtPlusPlus.core.gui.machine.GUI_DecayablesChest; +import gtPlusPlus.core.gui.machine.GUI_EggBox; +import gtPlusPlus.core.gui.machine.GUI_FishTrap; +import gtPlusPlus.core.gui.machine.GUI_ModularityTable; +import gtPlusPlus.core.gui.machine.GUI_PestKiller; +import gtPlusPlus.core.gui.machine.GUI_ProjectTable; +import gtPlusPlus.core.gui.machine.GUI_RoundRobinator; +import gtPlusPlus.core.gui.machine.GUI_SuperJukebox; +import gtPlusPlus.core.gui.machine.GUI_TradeTable; +import gtPlusPlus.core.gui.machine.GUI_VolumetricFlaskSetter; import gtPlusPlus.core.interfaces.IGuiManager; import gtPlusPlus.core.inventories.BaseInventoryBackpack; import gtPlusPlus.core.inventories.BaseInventoryGrindle; @@ -24,14 +46,16 @@ import gtPlusPlus.core.inventories.box.LunchBoxInventory; import gtPlusPlus.core.inventories.box.MagicBagInventory; import gtPlusPlus.core.inventories.box.ToolBoxInventory; import gtPlusPlus.core.tileentities.base.TileEntityBase; -import gtPlusPlus.core.tileentities.general.*; +import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer; +import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; +import gtPlusPlus.core.tileentities.general.TileEntityEggBox; +import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; +import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter; import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; @@ -88,11 +112,10 @@ public class GuiHandler implements IGuiHandler { if (te != null) { if (ID == GUI4) { - return new Container_Workbench(player.inventory, (TileEntityWorkbench) te); + //return new Container_Workbench(player.inventory, (TileEntityWorkbench) te); } else if (ID == GUI5) { Logger.INFO("sad"); - return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te); - + //return new Container_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te); } else if (ID == GUI6) { return new Container_FishTrap(player.inventory, (TileEntityFishTrap) te); } else if (ID == GUI7) { @@ -154,10 +177,10 @@ public class GuiHandler implements IGuiHandler { if (te != null) { if (ID == GUI4) { - return new GUI_Workbench(player.inventory, (TileEntityWorkbench) te); + //return new GUI_Workbench(player.inventory, (TileEntityWorkbench) te); } else if (ID == GUI5) { Logger.INFO("sad"); - return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te); + //return new GUI_WorkbenchAdvanced(player.inventory, (TileEntityWorkbenchAdvanced) te); } else if (ID == GUI6) { return new GUI_FishTrap(player.inventory, (TileEntityFishTrap) te); } else if (ID == GUI7) { diff --git a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java index 10dea8a7bf..de3e958b2d 100644 --- a/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java +++ b/src/main/java/gtPlusPlus/core/handler/events/GeneralTooltipEventHandler.java @@ -1,16 +1,22 @@ package gtPlusPlus.core.handler.events; +import static gregtech.api.enums.GT_Values.MOD_ID_APC; + +import advsolar.common.AdvancedSolarPanel; +import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import gregtech.api.enums.ItemList; import gtPlusPlus.GTplusplus; import gtPlusPlus.GTplusplus.INIT_PHASE; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import net.minecraft.block.Block; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.event.entity.player.ItemTooltipEvent; @@ -80,6 +86,10 @@ public class GeneralTooltipEventHandler { event.toolTip.add("Max Capacity: "+MathUtils.formatNumbers(32000)+"L"); } + if (LoadedMods.AdvancedSolarPanel) { + molecularTransformer(event); + } + if (CORE.ConfigSwitches.enableAnimatedTurbines) { boolean shift = false; @@ -114,4 +124,11 @@ public class GeneralTooltipEventHandler { } + @Optional.Method(modid = "AdvancedSolarPanel") + public static void molecularTransformer(ItemTooltipEvent event) { + if (event.itemStack.getItem() == Item.getItemFromBlock(AdvancedSolarPanel.blockMolecularTransformer)) { + event.toolTip.add(""+EnumChatFormatting.RED+"Disabled, Use the multiblock"); + } + } + } diff --git a/src/main/java/gtPlusPlus/core/item/ModItems.java b/src/main/java/gtPlusPlus/core/item/ModItems.java index 7342c55939..8b72b9c7c9 100644 --- a/src/main/java/gtPlusPlus/core/item/ModItems.java +++ b/src/main/java/gtPlusPlus/core/item/ModItems.java @@ -310,6 +310,8 @@ public final class ModItems { public static ItemGenericToken itemGenericToken; public static Item itemControlCore; + + public static Item itemSunnariumBit; public static ItemStack itemHotTitaniumIngot; @@ -447,27 +449,8 @@ public final class ModItems { try{ - - /** - * Try generate dusts for missing rare earth materials if they don't exist - */ - - if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1))){ - ItemUtils.generateSpecialUseDusts("Gadolinium", "Gadolinium", Materials.Gadolinium.mElement.name(), Utils.rgbtoHexValue(226, 172, 9)); - } - if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustYtterbium", 1))){ - ItemUtils.generateSpecialUseDusts("Ytterbium", "Ytterbium", Materials.Ytterbium.mElement.name(), Utils.rgbtoHexValue(Materials.Yttrium.mRGBa[0]-60, Materials.Yttrium.mRGBa[1]-60, Materials.Yttrium.mRGBa[2]-60)); - } - if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSamarium", 1))){ - ItemUtils.generateSpecialUseDusts("Samarium", "Samarium", Materials.Samarium.mElement.name(), Utils.rgbtoHexValue(161, 168, 114)); - } - if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustLanthanum", 1))){ - ItemUtils.generateSpecialUseDusts("Lanthanum", "Lanthanum", Materials.Lanthanum.mElement.name(), Utils.rgbtoHexValue(106, 127, 163)); - } - if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGermanium", 1))){ - ItemUtils.generateSpecialUseDusts("Germanium", "Germanium", "Ge", ELEMENT.getInstance().GERMANIUM.getRgbAsHex()); - } - + + registerCustomMaterialComponents(); //Elements generate first so they can be used in compounds. //Missing Elements @@ -855,36 +838,6 @@ public final class ModItems { if (!FluidRegistry.isFluidRegistered("xpjuice")){ FluidUtils.generateFluidNoPrefix("xpjuice", "xpjuice", 0, new short[]{50, 150, 50, 100}); } - - //Just an unusual plate needed for some black magic. - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateClay", 1) == null){ - itemPlateClay = new BaseItemPlate(NONMATERIAL.CLAY); - } - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleClay", 1) == null){ - itemDoublePlateClay = new BaseItemPlateDouble(NONMATERIAL.CLAY); - } - - //Need this for Mutagenic Frames - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilUranium235", 1) == null){ - itemFoilUranium235 = new BaseItemFoil(ELEMENT.getInstance().URANIUM235); - } - - //A small gear needed for wizardry. - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gearGtSmallWroughtIron", 1) == null){ - itemSmallWroughtIronGear = new BaseItemSmallGear(NONMATERIAL.WROUGHT_IRON); - } - //Krypton Processing - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1) == null){ - itemHotTitaniumIngot = ItemUtils.getSimpleStack(new BaseItemIngot(ELEMENT.getInstance().TITANIUM, ComponentTypes.HOTINGOT)); - } - else { - itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1); - } - - //Need this for Laurenium - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIndium", 1) == null){ - itemDustIndium = new BaseItemDust(ELEMENT.getInstance().INDIUM); - } //Industrial Diamonds itemExquisiteIndustrialDiamond = new CoreItem("IndustrialDiamondExquisite", "High Quality Industrial Diamond", tabMisc); @@ -894,97 +847,7 @@ public final class ModItems { ItemUtils.addItemToOreDictionary(tempStack, "gemExquisiteDiamond"); ItemUtils.addItemToOreDictionary(tempStack, "craftingExquisiteIndustrialDiamond"); - //Custom GT++ Crafting Components - - //Springs - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.WHITE_METAL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.NITINOL_60); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.AQUATIC_STEEL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.EGLIN_STEEL); - - //Small Springs - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.MARAGING250); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.NICHROME); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STABALLOY); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STEEL_BLACK); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.BLACK_TITANIUM); - - //Fine Wire - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.STANDALONE.WHITE_METAL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().PALLADIUM); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().ZIRCONIUM); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.LEAGRISIUM); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.BABBIT_ALLOY); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.KOBOLDITE); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.HG1223); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.QUANTUM); - - //Dense Plates - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.POTIN); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.AQUATIC_STEEL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.BRONZE); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.OSMIRIDIUM); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.QUANTUM); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STEEL_BLACK); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STAINLESS_STEEL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.EGLIN_STEEL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.MARAGING300); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.TALONITE); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.HYPOGEN); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.RHUGNOR); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ADVANCED_NITINOL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ASTRAL_TITANIUM); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.WHITE_METAL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.BLACK_METAL); - MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.GRANITE); - - - - - //Special Sillyness - if (true) { - - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateSodium", 1) == null){ - new BaseItemPlate(ELEMENT.getInstance().SODIUM); - } - - Material meatRaw = NONMATERIAL.MEAT; - // A plate of Meat. - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateMeatRaw", 1) == null){ - itemPlateRawMeat = new BaseItemPlate(meatRaw); - ItemUtils.registerFuel(ItemUtils.getSimpleStack(itemPlateRawMeat), 100); - } - // A Block of Meat. - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("blockMeatRaw", 1) == null){ - blockRawMeat = new BlockBaseModular(meatRaw, BlockTypes.STANDARD); - ItemUtils.registerFuel(ItemUtils.getSimpleStack(blockRawMeat), 900); - } - } - - - // A plate of Vanadium. - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateVanadium", 1) == null){ - itemPlateVanadium = new BaseItemPlate(ELEMENT.getInstance().VANADIUM); - } - //A plate of Lithium. - if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateLithium", 1) == null){ - itemPlateLithium = new BaseItemPlate(ELEMENT.getInstance().LITHIUM); - } - - //A plate of Europium. - if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){ - itemPlateEuropium = new BaseItemPlate(ELEMENT.getInstance().EUROPIUM); - } - if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){ - itemDoublePlateEuropium = new BaseItemPlateDouble(ELEMENT.getInstance().EUROPIUM); - } - - //Tumbaga Mix (For Simple Crafting) - dustTumbagaMix = ItemUtils.generateSpecialUseDusts("MixTumbaga", "Tumbaga Mix", "Au2Cu", Utils.rgbtoHexValue(255, 150, 80))[0]; - /* * Decayable Materials */ @@ -1018,6 +881,8 @@ public final class ModItems { itemDragonJar = new ItemEntityCatcher(); itemControlCore = new ItemControlCore(); + + itemSunnariumBit = new ItemSunnariumBit(); //Chemistry new CoalTar(); @@ -1241,4 +1106,148 @@ public final class ModItems { itemGenericToken.register(3, "Hand Pump Trade Token III", 1, "Craft into a Tier III Hand pump"); itemGenericToken.register(4, "Hand Pump Trade Token IV", 1, "Craft into a Tier IV Hand pump"); } + + public static void registerCustomMaterialComponents() { + //Custom GT++ Crafting Components + + /** + * Try generate dusts for missing rare earth materials if they don't exist + */ + + if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGadolinium", 1))){ + ItemUtils.generateSpecialUseDusts("Gadolinium", "Gadolinium", Materials.Gadolinium.mElement.name(), Utils.rgbtoHexValue(226, 172, 9)); + } + if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustYtterbium", 1))){ + ItemUtils.generateSpecialUseDusts("Ytterbium", "Ytterbium", Materials.Ytterbium.mElement.name(), Utils.rgbtoHexValue(Materials.Yttrium.mRGBa[0]-60, Materials.Yttrium.mRGBa[1]-60, Materials.Yttrium.mRGBa[2]-60)); + } + if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustSamarium", 1))){ + ItemUtils.generateSpecialUseDusts("Samarium", "Samarium", Materials.Samarium.mElement.name(), Utils.rgbtoHexValue(161, 168, 114)); + } + if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustLanthanum", 1))){ + ItemUtils.generateSpecialUseDusts("Lanthanum", "Lanthanum", Materials.Lanthanum.mElement.name(), Utils.rgbtoHexValue(106, 127, 163)); + } + if (!ItemUtils.checkForInvalidItems(ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustGermanium", 1))){ + ItemUtils.generateSpecialUseDusts("Germanium", "Germanium", "Ge", ELEMENT.getInstance().GERMANIUM.getRgbAsHex()); + } + + //Just an unusual plate needed for some black magic. + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateClay", 1) == null){ + itemPlateClay = new BaseItemPlate(NONMATERIAL.CLAY); + } + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleClay", 1) == null){ + itemDoublePlateClay = new BaseItemPlateDouble(NONMATERIAL.CLAY); + } + + //Need this for Mutagenic Frames + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("foilUranium235", 1) == null){ + itemFoilUranium235 = new BaseItemFoil(ELEMENT.getInstance().URANIUM235); + } + + //A small gear needed for wizardry. + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("gearGtSmallWroughtIron", 1) == null){ + itemSmallWroughtIronGear = new BaseItemSmallGear(NONMATERIAL.WROUGHT_IRON); + } + //Krypton Processing + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1) == null){ + itemHotTitaniumIngot = ItemUtils.getSimpleStack(new BaseItemIngot(ELEMENT.getInstance().TITANIUM, ComponentTypes.HOTINGOT)); + } + else { + itemHotTitaniumIngot = ItemUtils.getItemStackOfAmountFromOreDictNoBroken("ingotHotTitanium", 1); + } + + //Need this for Laurenium + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("dustIndium", 1) == null){ + itemDustIndium = new BaseItemDust(ELEMENT.getInstance().INDIUM); + } + + //Springs + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ELEMENT.STANDALONE.WHITE_METAL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.NITINOL_60); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.AQUATIC_STEEL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SPRING, ALLOY.EGLIN_STEEL); + + //Small Springs + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.MARAGING250); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.NICHROME); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STABALLOY); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.STEEL_BLACK); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.SMALLSPRING, ALLOY.BLACK_TITANIUM); + + //Fine Wire + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.STANDALONE.WHITE_METAL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().PALLADIUM); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ELEMENT.getInstance().ZIRCONIUM); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.LEAGRISIUM); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.BABBIT_ALLOY); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.KOBOLDITE); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.HG1223); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.FINEWIRE, ALLOY.QUANTUM); + + //Dense Plates + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.POTIN); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.AQUATIC_STEEL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.BRONZE); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.OSMIRIDIUM); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.QUANTUM); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STEEL_BLACK); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.STAINLESS_STEEL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.EGLIN_STEEL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.MARAGING300); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ALLOY.TALONITE); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.HYPOGEN); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.RHUGNOR); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ADVANCED_NITINOL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.ASTRAL_TITANIUM); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.CELESTIAL_TUNGSTEN); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.WHITE_METAL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.BLACK_METAL); + MaterialUtils.generateComponentAndAssignToAMaterial(ComponentTypes.PLATEHEAVY, ELEMENT.STANDALONE.GRANITE); + + + + + //Special Sillyness + if (true) { + + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateSodium", 1) == null){ + new BaseItemPlate(ELEMENT.getInstance().SODIUM); + } + + Material meatRaw = NONMATERIAL.MEAT; + // A plate of Meat. + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateMeatRaw", 1) == null){ + itemPlateRawMeat = new BaseItemPlate(meatRaw); + ItemUtils.registerFuel(ItemUtils.getSimpleStack(itemPlateRawMeat), 100); + } + // A Block of Meat. + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("blockMeatRaw", 1) == null){ + blockRawMeat = new BlockBaseModular(meatRaw, BlockTypes.STANDARD); + ItemUtils.registerFuel(ItemUtils.getSimpleStack(blockRawMeat), 900); + } + } + + + // A plate of Vanadium. + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateVanadium", 1) == null){ + itemPlateVanadium = new BaseItemPlate(ELEMENT.getInstance().VANADIUM); + } + + //A plate of Lithium. + if (ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateLithium", 1) == null){ + itemPlateLithium = new BaseItemPlate(ELEMENT.getInstance().LITHIUM); + } + + //A plate of Europium. + if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){ + itemPlateEuropium = new BaseItemPlate(ELEMENT.getInstance().EUROPIUM); + } + if ((ItemUtils.getItemStackOfAmountFromOreDictNoBroken("plateDoubleEuropium", 1) == null) && CORE.ConfigSwitches.enableCustom_Pipes){ + itemDoublePlateEuropium = new BaseItemPlateDouble(ELEMENT.getInstance().EUROPIUM); + } + + //Tumbaga Mix (For Simple Crafting) + dustTumbagaMix = ItemUtils.generateSpecialUseDusts("MixTumbaga", "Tumbaga Mix", "Au2Cu", Utils.rgbtoHexValue(255, 150, 80))[0]; + + } } diff --git a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java index 1dc9996cde..9590ec2848 100644 --- a/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java +++ b/src/main/java/gtPlusPlus/core/item/base/BaseItemComponent.java @@ -5,15 +5,19 @@ import java.util.*; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; + +import gregtech.api.GregTech_API; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.TextureSet; import gregtech.api.util.GT_LanguageManager; +import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.creative.AddToCreativeTab; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.Material; +import gtPlusPlus.core.material.state.MaterialState; import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.data.StringUtils; import gtPlusPlus.core.util.math.MathUtils; @@ -118,6 +122,12 @@ public class BaseItemComponent extends Item{ aMap.put(aKey, ItemUtils.getSimpleStack(this)); Logger.MATERIALS("Registering a material component. Item: ["+componentMaterial.getUnlocalizedName()+"] Map: ["+aKey+"]"); Material.mComponentMap.put(componentMaterial.getUnlocalizedName(), aMap); + if (componentType == ComponentTypes.PLATE) { + GregTech_API.registerCover(componentMaterial.getPlate(1), new GT_RenderedTexture(componentMaterial.getTextureSet().mTextures[71], componentMaterial.getRGBA(), false), null); + } + else if (componentType == ComponentTypes.PLATEDOUBLE) { + GregTech_API.registerCover(componentMaterial.getPlateDouble(1), new GT_RenderedTexture(componentMaterial.getTextureSet().mTextures[72], componentMaterial.getRGBA(), false), null); + } return true; } else { @@ -341,38 +351,39 @@ public class BaseItemComponent extends Item{ ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {0}); ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-1, new Short[] {0}); short[] er = this.componentMaterial.getRGBA(); - short value = 1; + short value = 0; Short[] ht = new Short[] {er[0], er[1], er[2]}; - for (int y = 0; y < 40; y++) { - if (y < 20) { + int aMaxCycles = 200; + for (int y = 0; y < aMaxCycles; y++) { + if (y < (50)) { value = 1; } - else { + else if (y < (100)) { + value = 0; + } + else if (y < (150)) { value = -1; } - short r = (short) (ht[0] + value); - short g = (short) (ht[1] + value); - short b = (short) (ht[2] + value); + else { + value = 0; + } + short r = (short) Math.max(Math.min(255, (ht[0] + value)), 0); + short g = (short) Math.max(Math.min(255, (ht[1] + value)), 0); + short b = (short) Math.max(Math.min(255, (ht[2] + value)), 0); Short[] qq = new Short[] {(short) Math.min(255, r), (short) Math.min(255, g), (short) Math.min(255, b)}; ht = qq; ((Map<Integer, Short[]>) extraData).put(y, qq); } + ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-2, new Short[] {(short) (((Map<Integer, Short[]>) extraData).size()-1)}); } if (extraData != null) { Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0]; - Short aSize = 40; + Short aSize = (short) (((Map<Integer, Short[]>) extraData).size() - 3); short nextFrame = (short) ((aCurrentFrame < aSize) ? (aCurrentFrame+1) : 0); Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData).get(aCurrentFrame < aSize ? (int) aCurrentFrame : 0); - ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame}); - return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]); - - - /*Short aCurrentFrame = ((Map<Integer, Short[]>) extraData).get((int) Short.MAX_VALUE)[0]; - Short[] aCurrentFrameRGB = ((Map<Integer, Short[]>) extraData).get((int) aCurrentFrame); - short nextFrame = aCurrentFrame < 40 ? aCurrentFrame++ : 0; - ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame}); - return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]);*/ + ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE, new Short[] {nextFrame}); + return Utils.rgbtoHexValue(aCurrentFrameRGB[0], aCurrentFrameRGB[1], aCurrentFrameRGB[2]); } } @@ -388,35 +399,200 @@ public class BaseItemComponent extends Item{ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 0}); //Slowly start adding in some red to get to yellow: ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 255, 0}); //Then, take out the green to get to red: ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 204, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 153, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 102, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 51, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 0}); @@ -424,15 +600,90 @@ public class BaseItemComponent extends Item{ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {255, 0, 255}); @@ -440,15 +691,90 @@ public class BaseItemComponent extends Item{ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {204, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {153, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] {102, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 51, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 0, 255}); @@ -456,15 +782,90 @@ public class BaseItemComponent extends Item{ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 51, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 102, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 153, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 204, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 255}); @@ -472,16 +873,76 @@ public class BaseItemComponent extends Item{ ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 204}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 153}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 102}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); + ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); ((Map<Integer, Short[]>) extraData).put(aSlot++, new Short[] { 0, 255, 51}); - ((Map<Integer, Short[]>) extraData).put((int) Byte.MAX_VALUE, new Short[] {(short) (((Map<Integer, Short[]>) extraData).size()-1)}); + ((Map<Integer, Short[]>) extraData).put((int) Short.MAX_VALUE-2, new Short[] {(short) (((Map<Integer, Short[]>) extraData).size()-1)}); } diff --git a/src/main/java/gtPlusPlus/core/item/base/wire/BaseItemFineWire.java b/src/main/java/gtPlusPlus/core/item/base/wire/BaseItemFineWire.java new file mode 100644 index 0000000000..846c282af3 --- /dev/null +++ b/src/main/java/gtPlusPlus/core/item/base/wire/BaseItemFineWire.java @@ -0,0 +1,12 @@ +package gtPlusPlus.core.item.base.wire; + +import gtPlusPlus.core.item.base.BaseItemComponent; +import gtPlusPlus.core.material.Material; + +public class BaseItemFineWire extends BaseItemComponent{ + + public BaseItemFineWire(final Material material) { + super(material, BaseItemComponent.ComponentTypes.FINEWIRE); + } + +} diff --git a/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java b/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java index d8ddb26675..b7bf8a7c8e 100644 --- a/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java +++ b/src/main/java/gtPlusPlus/core/item/crafting/ItemDummyResearch.java @@ -29,7 +29,8 @@ public class ItemDummyResearch extends ItemGenericToken { RESEARCH_7_ADV_METALLURGY("Advanced Metallurgy", "Advanced Material Sciences!"), RESEARCH_8_TURBINE_AUTOMATION("Turbine Automation", "You really don't want to share this with anyone!"), RESEARCH_9_CLOAKING("Cloaking Technologies", "Sneaking around like a mouse"), - RESEARCH_10_SPARGING("Gas Sparging", "Blowing gas for results"); + RESEARCH_10_SPARGING("Gas Sparging", "Blowing gas for results"), + RESEARCH_11_MOLECULAR_TRANSFORMER("Molecular Transformation", "Turning things into something better"); diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java b/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java index 5be184b3db..16d0c0253b 100644 --- a/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java +++ b/src/main/java/gtPlusPlus/core/item/general/ItemAreaClear.java @@ -30,7 +30,7 @@ public class ItemAreaClear extends CoreItem { public IIcon[] mIcon = new IIcon[1]; public ItemAreaClear() { - super("itemDebugClearing", AddToCreativeTab.tabMachines, 1, 100, new String[] {EnumChatFormatting.OBFUSCATED+"F A M C Y N A M E"}, EnumRarity.rare, + super("itemDebugClearing", AddToCreativeTab.tabMachines, 1, 100, new String[] {EnumChatFormatting.OBFUSCATED+"F A N C Y N A M E"}, EnumRarity.rare, EnumChatFormatting.BOLD, false, null); } @@ -160,16 +160,16 @@ public class ItemAreaClear extends CoreItem { int y1 = pos.yPos; int z1 = pos.zPos; - int x2 = (x1-10); + int x2 = (x1-15); int y2 = (y1-1); - int z2 = (z1-10); + int z2 = (z1-15); fillBlockColumn(world, new BlockPos(x2, y2, z2, world)); return true; } public boolean fillBlockColumn(World world, BlockPos pos){ - for (int i=0; i<21; i++){ + for (int i=0; i<30; i++){ fillBlockRow(world, new BlockPos(pos.xPos, pos.yPos, pos.zPos+i, world)); } return true; @@ -177,9 +177,10 @@ public class ItemAreaClear extends CoreItem { public boolean fillBlockRow(World world, BlockPos pos){ for (int j=0; j<2; j++){ - for (int i=0; i<21; i++){ + for (int i=0; i<30; i++){ if (world.getBlock(pos.xPos+i, pos.yPos+j, pos.zPos) != Blocks.bedrock){ - world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.grass); + world.setBlock(pos.xPos+i, pos.yPos+j, pos.zPos, Blocks.dirt); + world.setBlockMetadataWithNotify(pos.xPos+i, pos.yPos+j, pos.zPos, 2, 2); } } } diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java b/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java index eded4e2585..5df17979a9 100644 --- a/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java +++ b/src/main/java/gtPlusPlus/core/item/general/ItemBlueprint.java @@ -71,7 +71,7 @@ public class ItemBlueprint extends Item implements IItemBlueprint{ @Override public String getItemStackDisplayName(final ItemStack p_77653_1_) { - return "Blueprint [I am useless]"; + return "Blueprint"; } @Override @@ -103,7 +103,7 @@ public class ItemBlueprint extends Item implements IItemBlueprint{ ItemStack[] blueprint = new ItemStack[9]; if (itemStack.hasTagCompound()){ final NBTTagCompound nbt = itemStack.getTagCompound(); - final NBTTagList list = nbt.getTagList("Items", 10); + final NBTTagList list = nbt.getTagList("Inventory", 10); blueprint = new ItemStack[INV_SIZE]; for(int i = 0;i<list.tagCount();i++) { @@ -135,7 +135,7 @@ public class ItemBlueprint extends Item implements IItemBlueprint{ list.appendTag(data); } } - nbt.setTag("Items", list); + nbt.setTag("Inventory", list); itemStack.setTagCompound(nbt); return itemStack; } diff --git a/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java b/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java new file mode 100644 index 0000000000..0b61a06934 --- /dev/null +++ b/src/main/java/gtPlusPlus/core/item/general/ItemSunnariumBit.java @@ -0,0 +1,16 @@ +package gtPlusPlus.core.item.general; + +import gtPlusPlus.core.creative.AddToCreativeTab; +import gtPlusPlus.core.item.base.CoreItem; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.item.EnumRarity; +import net.minecraft.util.EnumChatFormatting; + +public class ItemSunnariumBit extends CoreItem { + + public ItemSunnariumBit() { + super("SunnariumBit", "Sunnarium Bit", AddToCreativeTab.tabMisc, 64, 0, new String[] {}, EnumRarity.uncommon, EnumChatFormatting.GOLD, false, null); + this.setTextureName(CORE.MODID+":"+"itemSunnariumBit"); + } + +} diff --git a/src/main/java/gtPlusPlus/core/lib/CORE.java b/src/main/java/gtPlusPlus/core/lib/CORE.java index 9ae37ff0a2..076616f569 100644 --- a/src/main/java/gtPlusPlus/core/lib/CORE.java +++ b/src/main/java/gtPlusPlus/core/lib/CORE.java @@ -277,6 +277,7 @@ public class CORE { public static int pollutionPerSecondMultiIndustrialMultiMachine_ModeMisc = 600; public static int pollutionPerSecondMultiIndustrialPlatePress_ModeForming = 240; public static int pollutionPerSecondMultiIndustrialPlatePress_ModeBending = 480; + public static int pollutionPerSecondMultiIndustrialForgeHammer = 250; public static int pollutionPerSecondMultiIndustrialSifter = 40; public static int pollutionPerSecondMultiIndustrialThermalCentrifuge = 1000; public static int pollutionPerSecondMultiIndustrialVacuumFreezer = 500; @@ -300,6 +301,7 @@ public class CORE { public static int pollutionPerSecondMultiFrothFlotationCell = 0; public static int pollutionPerSecondMultiAutoCrafter = 500; public static int pollutionPerSecondMultiThermalBoiler = 700; + public static int pollutionPerSecondMultiMolecularTransformer = 1000; public static int pollutionPerSecondMultiAlgaePond = 0; public static int pollutionPerSecondMultiIndustrialRockBreaker = 100; public static int pollutionPerSecondMultiIndustrialChisel = 50; @@ -334,28 +336,33 @@ public class CORE { } public static final void crash(String aReason) { - Logger.INFO("=========================================================="); - Logger.INFO("[GT++ CRASH]"); - Logger.INFO("=========================================================="); - Logger.INFO("Oooops..."); - Logger.INFO("This should only happy in a development environment or when something really bad happens."); - Logger.INFO("Reason: "+aReason); - Logger.INFO("=========================================================="); - Logger.INFO("Called from: "+ReflectionUtils.getMethodName(1)); - Logger.INFO(ReflectionUtils.getMethodName(2)); - Logger.INFO(ReflectionUtils.getMethodName(3)); - Logger.INFO(ReflectionUtils.getMethodName(4)); - Logger.INFO(ReflectionUtils.getMethodName(5)); - Logger.INFO(ReflectionUtils.getMethodName(6)); - Logger.INFO(ReflectionUtils.getMethodName(7)); - Logger.INFO(ReflectionUtils.getMethodName(8)); - Logger.INFO(ReflectionUtils.getMethodName(9)); - Logger.INFO(ReflectionUtils.getMethodName(10)); - Logger.INFO(ReflectionUtils.getMethodName(11)); - Logger.INFO(ReflectionUtils.getMethodName(12)); - Logger.INFO(ReflectionUtils.getMethodName(13)); - Logger.INFO(ReflectionUtils.getMethodName(14)); - Logger.INFO(ReflectionUtils.getMethodName(15)); + try { + Logger.INFO("=========================================================="); + Logger.INFO("[GT++ CRASH]"); + Logger.INFO("=========================================================="); + Logger.INFO("Oooops..."); + Logger.INFO("This should only happy in a development environment or when something really bad happens."); + Logger.INFO("Reason: "+aReason); + Logger.INFO("=========================================================="); + Logger.INFO("Called from: "+ReflectionUtils.getMethodName(1)); + Logger.INFO(ReflectionUtils.getMethodName(2)); + Logger.INFO(ReflectionUtils.getMethodName(3)); + Logger.INFO(ReflectionUtils.getMethodName(4)); + Logger.INFO(ReflectionUtils.getMethodName(5)); + Logger.INFO(ReflectionUtils.getMethodName(6)); + Logger.INFO(ReflectionUtils.getMethodName(7)); + Logger.INFO(ReflectionUtils.getMethodName(8)); + Logger.INFO(ReflectionUtils.getMethodName(9)); + Logger.INFO(ReflectionUtils.getMethodName(10)); + Logger.INFO(ReflectionUtils.getMethodName(11)); + Logger.INFO(ReflectionUtils.getMethodName(12)); + Logger.INFO(ReflectionUtils.getMethodName(13)); + Logger.INFO(ReflectionUtils.getMethodName(14)); + Logger.INFO(ReflectionUtils.getMethodName(15)); + } + catch (Throwable t) { + t.printStackTrace(); + } FMLCommonHandler.instance().exitJava(0, true); } diff --git a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java index 4f7a10be78..9f5882c5ea 100644 --- a/src/main/java/gtPlusPlus/core/lib/LoadedMods.java +++ b/src/main/java/gtPlusPlus/core/lib/LoadedMods.java @@ -24,6 +24,7 @@ public class LoadedMods { public static boolean Simply_Jetpacks = false; public static boolean RFTools = false; public static boolean Thaumcraft = false; + public static boolean ThaumicBases = false; public static boolean Baubles = false; public static boolean Extra_Utils = false; public static boolean PneumaticCraft = false; @@ -41,6 +42,7 @@ public class LoadedMods { public static boolean MiscUtils = true; //Dummy For MetaData Lookups in MT Wrapper public static boolean ThermalFoundation = false; public static boolean IHL = false; + public static boolean AdvancedSolarPanel = false; public static boolean OpenComputers = false; //OpenComputers public static boolean OpenBlocks = false; public static boolean Computronics = false; //computronics @@ -61,8 +63,8 @@ public class LoadedMods { public static boolean Reliquary = false; public static boolean SpiceOfLife = false; public static boolean RemoteIO = false; - - + public static boolean BartWorks = false; + public static boolean GoodGenerator = false; private static int totalMods; @SuppressWarnings("deprecation") @@ -118,6 +120,21 @@ public class LoadedMods { Logger.INFO("Components enabled for: Tinkers Construct"); totalMods++; } + if (isModLoaded("AdvancedSolarPanel")){ + AdvancedSolarPanel = true; + Logger.INFO("Components enabled for: Advanced Solar Panels"); + totalMods++; + } + if (isModLoaded("GoodGenerator")) { + GoodGenerator = true; + Logger.INFO("Components enabled for: GoodGenerator"); + totalMods++; + } + if (isModLoaded("bartworks")) { + BartWorks = true; + Logger.INFO("Components enabled for: BartWorks"); + totalMods++; + } if (isModLoaded("BuildCraft")){ BuildCraft = true; Logger.INFO("Components enabled for: BuildCraft"); @@ -168,6 +185,11 @@ public class LoadedMods { Logger.INFO("Components enabled for: Thaumcraft"); totalMods++; } + if (isModLoaded("thaumicbases")){ + ThaumicBases = true; + Logger.INFO("Components enabled for: Thaumic Bases"); + totalMods++; + } if (isModLoaded("BiomesOPlenty")){ BiomesOPlenty = true; Logger.INFO("Components enabled for: BiomesOPlenty"); diff --git a/src/main/java/gtPlusPlus/core/material/ALLOY.java b/src/main/java/gtPlusPlus/core/material/ALLOY.java index fd7547970c..ba0963397c 100644 --- a/src/main/java/gtPlusPlus/core/material/ALLOY.java +++ b/src/main/java/gtPlusPlus/core/material/ALLOY.java @@ -22,10 +22,10 @@ public final class ALLOY { "Energy Crystal", //Material Name MaterialState.SOLID, //State new short[]{228, 255, 0, 0}, //Material Colour - 5660, //Melting Point in C - 7735, //Boiling Point in C - 150, //Protons - 80, //Neutrons + 4660, //Melting Point in C + 5735, //Boiling Point in C + 90, //Protons + 40, //Neutrons true, //Uses Blast furnace? "⬟ ⯂ ⬢ ⬣ ⯃ ⯄", //Material Stacks with Percentage of required elements. diff --git a/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java b/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java index 2740f49d71..31ad5e466b 100644 --- a/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java +++ b/src/main/java/gtPlusPlus/core/material/MISC_MATERIALS.java @@ -15,11 +15,82 @@ public final class MISC_MATERIALS { */ public static void run() { + MaterialUtils.generateSpecialDustAndAssignToAMaterial(POTASSIUM_NITRATE, false); + MaterialUtils.generateSpecialDustAndAssignToAMaterial(SODIUM_NITRATE, false); MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_OXIDE, false); MaterialUtils.generateSpecialDustAndAssignToAMaterial(STRONTIUM_HYDROXIDE, false); WATER.registerComponentForMaterial(FluidUtils.getWater(1000)); } + public static final Material POTASSIUM_NITRATE = new Material( + "Potassium Nitrate", + MaterialState.SOLID, //State + null, + null, + -1, + -1, + -1, + -1, + false, + "KNO3", + 0, + false, + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().POTASSIUM, 1), + new MaterialStack(ELEMENT.getInstance().NITROGEN, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 3) + }); + public static final Material SODIUM_NITRATE = new Material( + "Sodium Nitrate", + MaterialState.SOLID, //State + null, + null, + -1, + -1, + -1, + -1, + false, + "NaNO3", + 0, + false, + new MaterialStack[]{ + new MaterialStack(ELEMENT.getInstance().SODIUM, 1), + new MaterialStack(ELEMENT.getInstance().NITROGEN, 1), + new MaterialStack(ELEMENT.getInstance().OXYGEN, 3) + }); + + public static final Material SOLAR_SALT_COLD = new Material( + "Solar Salt (Cold)", + MaterialState.PURE_LIQUID, //State + null, //Material Colour + -1, //Melting Point in C + -1, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(POTASSIUM_NITRATE, 4), + new MaterialStack(SODIUM_NITRATE, 6) + }); + + public static final Material SOLAR_SALT_HOT = new Material( + "Solar Salt (Hot)", + MaterialState.PURE_LIQUID, //State + new short[] {200, 25, 25}, //Material Colour + 1200, //Melting Point in C + 3300, //Boiling Point in C + -1, //Protons + -1, + false, //Uses Blast furnace? + //Material Stacks with Percentage of required elements. + new MaterialStack[]{ + new MaterialStack(POTASSIUM_NITRATE, 4), + new MaterialStack(SODIUM_NITRATE, 6) + }); + + + public static final Material STRONTIUM_OXIDE = new Material( "Strontium Oxide", MaterialState.SOLID, diff --git a/src/main/java/gtPlusPlus/core/material/Material.java b/src/main/java/gtPlusPlus/core/material/Material.java index 0e9eb9b376..64b705629e 100644 --- a/src/main/java/gtPlusPlus/core/material/Material.java +++ b/src/main/java/gtPlusPlus/core/material/Material.java @@ -25,6 +25,7 @@ import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.xmod.gregtech.api.enums.CustomOrePrefix; +import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; import gtPlusPlus.xmod.thaumcraft.objects.wrapper.aspect.TC_Aspect_Wrapper; import gtPlusPlus.xmod.tinkers.material.BaseTinkersMaterial; import net.minecraft.block.Block; @@ -50,7 +51,7 @@ public class Material { private TextureSet textureSet; private Fluid mFluid; - private Fluid vPlasma; + private Fluid mPlasma; private boolean vGenerateCells; @@ -493,11 +494,14 @@ public class Material { mFluid = generateFluid(); } } - this.vPlasma = this.generatePlasma(); + // Don't generate plasma for composites + if (this.getComposites().isEmpty()) { + this.mPlasma = this.generatePlasma(); + } } else { this.mFluid = null; - this.vPlasma = null; + this.mPlasma = null; } String ratio = ""; if (this.vSmallestRatio != null) { @@ -869,6 +873,14 @@ public class Material { public final ItemStack getScrew(final int stacksize){ return getComponentByPrefix(OrePrefixes.screw, stacksize); } + + public final ItemStack getFineWire(final int stacksize){ + return getComponentByPrefix(OrePrefixes.wireFine, stacksize); + } + + public final ItemStack getFoil(final int stacksize){ + return getComponentByPrefix(OrePrefixes.foil, stacksize); + } public final ItemStack getRing(final int stacksize){ return getComponentByPrefix(OrePrefixes.ring, stacksize); @@ -893,6 +905,59 @@ public class Material { public final ItemStack getNugget(final int stacksize){ return getComponentByPrefix(OrePrefixes.nugget, stacksize); } + + public final ItemStack getWire01(final int stacksize) { + return getComponentByPrefix(OrePrefixes.wireGt01, stacksize); + } + + public final ItemStack getWire02(final int stacksize) { + return getComponentByPrefix(OrePrefixes.wireGt02, stacksize); + } + + public final ItemStack getWire04(final int stacksize) { + return getComponentByPrefix(OrePrefixes.wireGt04, stacksize); + } + + public final ItemStack getWire08(final int stacksize) { + return getComponentByPrefix(OrePrefixes.wireGt08, stacksize); + } + + public final ItemStack getWire12(final int stacksize) { + return getComponentByPrefix(OrePrefixes.wireGt12, stacksize); + } + + public final ItemStack getWire16(final int stacksize) { + return getComponentByPrefix(OrePrefixes.wireGt16, stacksize); + } + + public final ItemStack getCable01(final int stacksize) { + return getComponentByPrefix(OrePrefixes.cableGt01, stacksize); + } + + public final ItemStack getCable02(final int stacksize) { + return getComponentByPrefix(OrePrefixes.cableGt02, stacksize); + } + + public final ItemStack getCable04(final int stacksize) { + return getComponentByPrefix(OrePrefixes.cableGt04, stacksize); + } + + public final ItemStack getCable08(final int stacksize) { + return getComponentByPrefix(OrePrefixes.cableGt08, stacksize); + } + + public final ItemStack getCable12(final int stacksize) { + return getComponentByPrefix(OrePrefixes.cableGt12, stacksize); + } + + public final ItemStack getCable16(final int stacksize) { + if (GregtechConduits.cableGt16 != null) { + return getComponentByPrefix(GregtechConduits.cableGt16, stacksize); + } + else { + return ItemUtils.getErrorStack(stacksize); + } + } /** * Ore Components @@ -1281,6 +1346,10 @@ public class Material { public Fluid getFluid() { return mFluid; } + + public Fluid getPlasma() { + return mPlasma; + } final public FluidStack getFluidStack(final int fluidAmount) { if (this.mFluid == null){ diff --git a/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java b/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java index d1ea784b81..aac3bc3e92 100644 --- a/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java +++ b/src/main/java/gtPlusPlus/core/material/MaterialGenerator.java @@ -67,26 +67,6 @@ public class MaterialGenerator { private static volatile Item temp; @SuppressWarnings("unused") private static volatile Block tempBlock; - - - public static boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid) { - return addFluidExtractionRecipe(aEmpty, aRemains, aFluid, null, null); - } - - /** - * Called Reflectively from CORE.RA.addFluidExtractionRecipe - * @param aSpecial - * @return - */ - public static boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, Integer aDuration, Integer aEU) { - RecipeGen_FluidCanning g = new RecipeGen_FluidCanning(true, aEmpty, aRemains, aFluid, aDuration, aEU); - if (g != null && g.valid()) { - //Logger.INFO("[FIND] Adding Extraction recipe for "+ItemUtils.getItemName(aEmpty)+", "+ItemUtils.getItemName(aRemains)+", "+ItemUtils.getFluidName(aFluid)); - return true; - } - Logger.INFO("[ERROR] FAILED adding Extraction recipe for "+ItemUtils.getItemName(aEmpty)+", "+ItemUtils.getItemName(aRemains)+", "+ItemUtils.getFluidName(aFluid)); - return false; - } public static boolean addFluidCannerRecipe(ItemStack aEmpty, ItemStack aFullContainer, FluidStack aFluidIn, FluidStack rFluidOut) { diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java index 3cc48ba345..808c977ef0 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_GREGTECH.java @@ -4,15 +4,13 @@ import static gtPlusPlus.core.lib.CORE.GTNH; import java.util.ArrayList; +import advsolar.common.AdvancedSolarPanel; import cpw.mods.fml.common.Loader; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; -import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_OreDictUnificator; -import gregtech.api.util.HotFuel; -import gregtech.api.util.ThermalFuel; +import gregtech.api.util.*; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.ModItems; @@ -94,6 +92,7 @@ public class RECIPES_GREGTECH { chemplantRecipes(); packagerRecipes(); alloySmelterRecipes(); + implosionRecipes(); /** @@ -102,14 +101,9 @@ public class RECIPES_GREGTECH { RECIPES_SeleniumProcessing.init(); RECIPES_RareEarthProcessing.init(); - - - - - addFuels(); } - + private static void alloySmelterRecipes() { //Wood's Glass Laser Lens @@ -119,12 +113,23 @@ public class RECIPES_GREGTECH { GregtechItemList.Laser_Lens_WoodsGlass.get(1), 20 * 300, MaterialUtils.getVoltageForTier(3)); - + } + private static void packagerRecipes() { - - + + + } + + private static void implosionRecipes() { + + GT_Values.RA.addImplosionRecipe( + ItemUtils.getSimpleStack(ModItems.itemSunnariumBit, 9), + 16, + ItemUtils.getSimpleStack(AdvancedSolarPanel.itemSunnariumPart, 1), + GT_OreDictUnificator.get(OrePrefixes.dustTiny, Materials.Glowstone, 8)); + } private static void chemplantRecipes() { @@ -479,21 +484,21 @@ public class RECIPES_GREGTECH { //Hypogen Creation GT_Values.RA.addFusionReactorRecipe( - Materials.Neutronium.getMolten(128), - ALLOY.QUANTUM.getFluidStack(256), - ELEMENT.STANDALONE.HYPOGEN.getFluidStack(4), + ELEMENT.STANDALONE.DRAGON_METAL.getFluidStack(144), + ELEMENT.STANDALONE.RHUGNOR.getFluidStack(288), + ELEMENT.STANDALONE.HYPOGEN.getFluidStack(36), 2048 * 4, - (int) MaterialUtils.getVoltageForTier(9), + MaterialUtils.getVoltageForTier(9), 600000000 * 2); //Rhugnor GT_Values.RA.addFusionReactorRecipe( - GenericChem.TEFLON.getFluidStack(64), - ALLOY.PIKYONIUM.getFluidStack(128), - ELEMENT.STANDALONE.RHUGNOR.getFluidStack(8), - 2048 * 4, - (int) MaterialUtils.getVoltageForTier(7), - 150000000 * 2); + MaterialUtils.getMaterial("Infinity", "Neutronium").getMolten(144), + ALLOY.QUANTUM.getFluidStack(288), + ELEMENT.STANDALONE.RHUGNOR.getFluidStack(144), + 512, + MaterialUtils.getVoltageForTier(8), + 2000000000); } @@ -884,7 +889,12 @@ public class RECIPES_GREGTECH { 20 * 60 * 5, MaterialUtils.getVoltageForTier(5)); - + GT_Values.RA.addLaserEngraverRecipe( + GregtechItemList.Laser_Lens_WoodsGlass.get(0), + ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 8, 1), + ItemUtils.getSimpleStack(ModItems.itemSunnariumBit, 3), + 20 * 60 * 5, + MaterialUtils.getVoltageForTier(3)); } @@ -1690,7 +1700,7 @@ public class RECIPES_GREGTECH { GT_Values.RA.addFuel(ItemUtils.simpleMetaStack("EnderIO:bucketHootch", 0, 1), null, 36, 0); } - HotFuel.addNewHotFuel(GT_ModHandler.getLava(83), GT_Values.NF, + HotFuel.addNewHotFuel(FluidUtils.getLava(83), FluidUtils.getPahoehoeLava(83), new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("nuggetCopper", 1), ItemUtils.getItemStackOfAmountFromOreDict("nuggetTin", 1), ItemUtils.getItemStackOfAmountFromOreDict("nuggetGold", 1), @@ -1700,7 +1710,7 @@ public class RECIPES_GREGTECH { ItemUtils.getSimpleStack(Blocks.obsidian) }, new int[] { 2000, 1000, 250, 250, 250, 250, 500 }, 0); - HotFuel.addNewHotFuel(FluidUtils.getFluidStack("ic2pahoehoelava", 83), GT_Values.NF, + HotFuel.addNewHotFuel(FluidUtils.getPahoehoeLava(83), GT_Values.NF, new ItemStack[] { ItemUtils.getItemStackOfAmountFromOreDict("nuggetBronze", 1), ItemUtils.getItemStackOfAmountFromOreDict("nuggetElectrum", 1), @@ -1709,6 +1719,12 @@ public class RECIPES_GREGTECH { ItemUtils.getSimpleStack(Blocks.obsidian) }, new int[] { 750, 250, 250, 250, 1850 }, 0); + HotFuel.addNewHotFuel( + MISC_MATERIALS.SOLAR_SALT_HOT.getFluidStack(1000), + MISC_MATERIALS.SOLAR_SALT_COLD.getFluidStack(1000), + FluidUtils.getSuperHeatedSteam(10000), + 0); + /* * HotFuel.addNewHotFuel( FluidUtils.getFluidStack("ic2hotcoolant", * 100), GT_Values.NF, new ItemStack[]{}, new int[]{}, 0); @@ -1743,7 +1759,22 @@ public class RECIPES_GREGTECH { } private static void centrifugeRecipes() { - + + GT_Values.RA.addCentrifugeRecipe( + CI.getNumberedAdvancedCircuit(2), + MISC_MATERIALS.SOLAR_SALT_COLD.getCell(10), + null, + null, + MISC_MATERIALS.SODIUM_NITRATE.getDust(6), + MISC_MATERIALS.POTASSIUM_NITRATE.getDust(4), + CI.emptyCells(10), + null, + null, + null, + null, + 20 * 30, + 120); + } private static void mixerRecipes() { @@ -1758,7 +1789,20 @@ public class RECIPES_GREGTECH { null, 600, 60); - + + GT_Values.RA.addMixerRecipe( + CI.getNumberedAdvancedCircuit(2), + CI.emptyCells(10), + MISC_MATERIALS.SODIUM_NITRATE.getDust(6), + MISC_MATERIALS.POTASSIUM_NITRATE.getDust(4), + null, + null, + MISC_MATERIALS.SOLAR_SALT_COLD.getCell(10), + 20 * 10, + 120); + + + } private static void chemicalReactorRecipes() { @@ -1786,7 +1830,26 @@ public class RECIPES_GREGTECH { FluidUtils.getFluidStack("sulfuricacid", 4000), FluidUtils.getFluidStack("sulfuricapatite", 8000), ItemUtils.getItemStackOfAmountFromOreDict("dustSmallSulfur", 8), - 20 * 20); + 20 * 20); + + GT_Values.RA.addChemicalRecipe( + Materials.Potassium.getDust(1), + CI.getNumberedAdvancedCircuit(1), + Materials.NitricAcid.getFluid(1000), + GT_Values.NF, + MISC_MATERIALS.POTASSIUM_NITRATE.getDust(1), + 100, + 30); + + GT_Values.RA.addChemicalRecipe( + ItemUtils.getSimpleStack(AgriculturalChem.mSodiumCarbonate, 1), + CI.getNumberedAdvancedCircuit(1), + Materials.NitricAcid.getFluid(1000), + GT_Values.NF, + MISC_MATERIALS.SODIUM_NITRATE.getDust(1), + 100, + 30); + } diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java index 0482921c9a..25c5ee5f9e 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_General.java @@ -17,6 +17,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ALLOY; import gtPlusPlus.core.material.ELEMENT; +import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.*; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; @@ -28,6 +29,7 @@ import gtPlusPlus.xmod.gregtech.common.helpers.VolumetricFlaskHelper; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; public class RECIPES_General { @@ -40,8 +42,10 @@ public class RECIPES_General { static ItemStack OUTPUT_Blueprint; static ItemStack RECIPE_CraftingTable; static String RECIPE_BronzePlate = "plateBronze"; + static String RECIPE_StainlessPlate = "plateStainlessSteel"; static ItemStack RECIPE_BasicCasingIC2; static ItemStack OUTPUT_Workbench_Bronze; + static ItemStack OUTPUT_Workbench_Advanced; static ItemStack RECIPE_HydrogenDust; public static void loadRecipes(){ @@ -53,8 +57,9 @@ public class RECIPES_General { RECIPE_CraftingTable = ItemUtils.getSimpleStack(Blocks.crafting_table); RECIPE_HydrogenDust = ItemUtils.getSimpleStack(ModItems.itemHydrogenBlob); RECIPE_BasicCasingIC2 = ItemUtils.getItemStackFromFQRN("IC2:blockMachine", 1); - OUTPUT_Workbench_Bronze = ItemUtils.getSimpleStack(ModBlocks.blockWorkbench); - OUTPUT_Blueprint = ItemUtils.getSimpleStack(ModItems.itemBlueprintBase); + OUTPUT_Workbench_Bronze = GregtechItemList.GT4_Workbench_Bronze.get(1); + OUTPUT_Workbench_Advanced = GregtechItemList.GT4_Workbench_Advanced.get(1); + OUTPUT_Blueprint = ItemUtils.getSimpleStack(ModItems.itemBlueprintBase, 2); run(); addCompressedObsidian(); migratedRecipes(); @@ -63,18 +68,24 @@ public class RECIPES_General { private static void run() { //Workbench Blueprint - /*RecipeUtils.addShapedRecipe( + RecipeUtils.addShapedRecipe( RECIPE_Paper, RECIPE_LapisDust, NULL, RECIPE_Paper, RECIPE_LapisDust, NULL, RECIPE_LapisDust, RECIPE_LapisDust, NULL, - OUTPUT_Blueprint);*/ + OUTPUT_Blueprint); //Bronze Workbench - /*RecipeUtils.addShapedRecipe( + RecipeUtils.addShapedRecipe( RECIPE_BronzePlate, RECIPE_CraftingTable, RECIPE_BronzePlate, RECIPE_BronzePlate, RECIPE_BasicCasingIC2, RECIPE_BronzePlate, - RECIPE_BronzePlate, RECIPE_BronzePlate, RECIPE_BronzePlate, - OUTPUT_Workbench_Bronze);*/ + RECIPE_BronzePlate, CI.getTieredCircuitOreDictName(0), RECIPE_BronzePlate, + OUTPUT_Workbench_Bronze); + + RecipeUtils.addShapedRecipe( + RECIPE_StainlessPlate, CI.getTieredCircuitOreDictName(3), RECIPE_StainlessPlate, + RECIPE_StainlessPlate, OUTPUT_Workbench_Bronze, RECIPE_StainlessPlate, + RECIPE_StainlessPlate, CI.getTieredCircuitOreDictName(3), RECIPE_StainlessPlate, + OUTPUT_Workbench_Advanced); //Generates recipes for the Dull shard when TC is not installed. if (!LoadedMods.Thaumcraft) { @@ -110,6 +121,25 @@ public class RECIPES_General { } + if (OreDictionary.doesOreNameExist("dustPotassiumNitrade")) { + ItemStack aDustKNO3 = ItemUtils.getItemStackOfAmountFromOreDict("dustPotassiumNitrade", 1); + ItemStack aDustGtppKNO3 = MISC_MATERIALS.POTASSIUM_NITRATE.getDust(1); + if (RecipeUtils.addShapedRecipe( + null, null, null, + null, "dustPotassiumNitrade", null, + null, null, null, + ItemUtils.getSimpleStack(aDustGtppKNO3, 1))) { + Logger.INFO("Add conversion recipe (GT Potassium Nitrade -> GT++ Potassium Nitrate)"); + } + if (RecipeUtils.addShapedRecipe( + null, null, null, + null, "dustPotassiumNitrate", null, + null, null, null, + ItemUtils.getSimpleStack(aDustKNO3, 1))) { + Logger.INFO("Add conversion recipe (GT++ Potassium Nitrate -> GT Potassium Nitrade)"); + } + } + //Rainforest oak Sapling if (RecipeUtils.addShapedRecipe( "stickWood", "stickWood", "stickWood", @@ -366,11 +396,12 @@ public class RECIPES_General { private static boolean addCompressedObsidian(){ //Invert Obsidian + ItemStack aInvertedObsidian = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1); if (RecipeUtils.addShapedRecipe( getSimpleStack(Items.redstone), getSimpleStack(Items.glowstone_dust), getSimpleStack(Items.redstone), getSimpleStack(Items.glowstone_dust), ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 1, 1), getSimpleStack(Items.glowstone_dust), getSimpleStack(Items.redstone), getSimpleStack(Items.glowstone_dust), getSimpleStack(Items.redstone), - ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1))){ + aInvertedObsidian)){ Logger.INFO("Added a recipe for Inverted Obsidian."); } @@ -379,6 +410,12 @@ public class RECIPES_General { for (int r=0;r<5;r++){ mItems[r+1] = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, r, 1); } + + final ItemStack[] mItems2 = new ItemStack[6]; + mItems2[0] = ItemUtils.getSimpleStack(Blocks.glowstone); + for (int r=0;r<5;r++){ + mItems2[r+1] = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 6+r, 1); + } //Compressed Obsidian 1-5 for (int r=0;r<5;r++){ @@ -399,6 +436,26 @@ public class RECIPES_General { } } + + //Compressed Glowstone 1-5 + for (int r=0;r<5;r++){ + + final ItemStack input = mItems2[r]; + final ItemStack output = mItems2[r+1]; + + if (RecipeUtils.addShapedRecipe( + input, input, input, + input, r == 2 ? aInvertedObsidian : input, input, + input, input, input, + output)){ + Logger.INFO("Added a recipe for Compressed Glowstone ["+r+"]"); + } + + if (RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{output}, ItemUtils.getSimpleStack(input, 9))){ + Logger.INFO("Added a shapeless recipe for Compressed Glowstone ["+r+"]"); + } + + } return true; } diff --git a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java index cd8d9311c0..e2cd1daeb3 100644 --- a/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java +++ b/src/main/java/gtPlusPlus/core/recipe/RECIPES_Machines.java @@ -253,18 +253,628 @@ public class RECIPES_Machines { chemPlant(); zyngen(); milling(); - sparging(); + sparging(); chisels(); rockBreaker(); + + gt4FarmManager(); + gt4Redstone(); + gt4Inventory(); + + multiGeneratorArray(); + multiForgeHammer(); + multiMolecularTransformer(); + multiXlTurbines(); + multiSolarTower(); + multiElementalDuplicator(); + + computerCube(); + + resonanceChambers(); + modulators(); + + + } + + 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, ItemList.Hatch_Input_HV, + ItemList.Hatch_Input_EV, ItemList.Hatch_Input_IV, ItemList.Hatch_Input_LuV, + ItemList.Hatch_Input_ZPM, ItemList.Hatch_Input_UV + }; + GregtechItemList[] aOutputMachines = new GregtechItemList[] { + GregtechItemList.GT4_Crop_Harvester_LV, GregtechItemList.GT4_Crop_Harvester_MV, GregtechItemList.GT4_Crop_Harvester_HV, + GregtechItemList.GT4_Crop_Harvester_EV, GregtechItemList.GT4_Crop_Harvester_IV, GregtechItemList.GT4_Crop_Harvester_LuV, + GregtechItemList.GT4_Crop_Harvester_ZPM, GregtechItemList.GT4_Crop_Harvester_UV + }; + + int aTier = 1; + for (int i=0;i<8;i++) { + RecipeUtils.addShapedRecipe( + CI.getRobotArm(aTier, 1), CI.getSensor(aTier, 1), CI.getRobotArm(aTier, 1), + ItemUtils.getOrePrefixStack(OrePrefixes.toolHeadSense, CI.tieredMaterials[aTier], 1), CI.getTieredMachineHull(aTier, 1), ItemUtils.getOrePrefixStack(OrePrefixes.toolHeadSense, CI.tieredMaterials[aTier], 1), + CI.getTieredCircuitOreDictName(aTier), aInputHatches[i].get(1), CI.getTieredCircuitOreDictName(aTier), + aOutputMachines[i].get(1)); + aTier++; + } + + } + + private static void gt4Redstone() { + + RecipeUtils.addShapedRecipe( + "plateIron", "plateGlass", "plateIron", + "plateGlass", ItemUtils.getSimpleStack(Blocks.redstone_lamp), "plateGlass", + "plateIron", "plateGlass", "plateIron", + GregtechItemList.GT4_Redstone_Lamp.get(2)); + RecipeUtils.addShapedRecipe( + "plateAluminium", "plateGlass", "plateAluminium", + "plateGlass", ItemUtils.getSimpleStack(Blocks.redstone_lamp), "plateGlass", + "plateAluminium", "plateGlass", "plateAluminium", + GregtechItemList.GT4_Redstone_Lamp.get(8)); + + RecipeUtils.addShapedRecipe( + "plateIron", "plateIron", "plateIron", + ItemUtils.getSimpleStack(Items.comparator), ItemList.Cover_Screen.get(1), ItemUtils.getSimpleStack(Items.comparator), + "plateIron", "plateIron", "plateIron", + GregtechItemList.GT4_Redstone_Display.get(2)); + RecipeUtils.addShapedRecipe( + "plateAluminium", "plateAluminium", "plateAluminium", + ItemUtils.getSimpleStack(Items.comparator), ItemList.Cover_Screen.get(1), ItemUtils.getSimpleStack(Items.comparator), + "plateAluminium", "plateAluminium", "plateAluminium", + GregtechItemList.GT4_Redstone_Display.get(8)); + + RecipeUtils.addShapedRecipe( + "plateIron", "plateIron", "plateIron", + ItemUtils.getSimpleStack(Items.comparator), ItemList.Cover_EnergyDetector.get(1), ItemUtils.getSimpleStack(Items.comparator), + "plateIron", "plateIron", "plateIron", + GregtechItemList.GT4_Redstone_Scale.get(2)); + RecipeUtils.addShapedRecipe( + "plateAluminium", "plateAluminium", "plateAluminium", + ItemUtils.getSimpleStack(Items.comparator), ItemList.Cover_EnergyDetector.get(1), ItemUtils.getSimpleStack(Items.comparator), + "plateAluminium", "plateAluminium", "plateAluminium", + GregtechItemList.GT4_Redstone_Scale.get(8)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getTieredMachineHull(1), + ItemUtils.getSimpleStack(Blocks.stone_button, 16) + }, + null, + GregtechItemList.GT4_Redstone_Button_Panel.get(1), + 800, + 4); + + RecipeUtils.addShapedRecipe( + "plateIron", ItemUtils.getSimpleStack(Items.repeater), "plateIron", + ItemUtils.getSimpleStack(Items.comparator), CI.getTieredCircuitOreDictName(1), ItemUtils.getSimpleStack(Items.comparator), + "plateIron", ItemUtils.getSimpleStack(Items.repeater), "plateIron", + GregtechItemList.GT4_Redstone_Circuit.get(1)); + RecipeUtils.addShapedRecipe( + "plateAluminium", ItemUtils.getSimpleStack(Items.repeater), "plateAluminium", + ItemUtils.getSimpleStack(Items.comparator), CI.getTieredCircuitOreDictName(1), ItemUtils.getSimpleStack(Items.comparator), + "plateAluminium", ItemUtils.getSimpleStack(Items.repeater), "plateAluminium", + GregtechItemList.GT4_Redstone_Circuit.get(2)); + + } + + private static void gt4Inventory() { + + ItemList[] aEnergyHatches = new ItemList[] { + ItemList.Hatch_Energy_LV, ItemList.Hatch_Energy_MV, ItemList.Hatch_Energy_HV, + ItemList.Hatch_Energy_EV, ItemList.Hatch_Energy_IV, ItemList.Hatch_Energy_LuV, + ItemList.Hatch_Energy_ZPM, ItemList.Hatch_Energy_UV + }; + + ItemList[] aRegulators = new ItemList[] { + ItemList.Automation_Regulator_LV, ItemList.Automation_Regulator_MV, ItemList.Automation_Regulator_HV, + ItemList.Automation_Regulator_EV, ItemList.Automation_Regulator_IV, ItemList.Automation_Regulator_LuV, + ItemList.Automation_Regulator_ZPM, ItemList.Automation_Regulator_UV + }; + + GregtechItemList[] aOutputInventoryManager = new GregtechItemList[] { + GregtechItemList.GT4_Electric_Inventory_Manager_LV, GregtechItemList.GT4_Electric_Inventory_Manager_MV, GregtechItemList.GT4_Electric_Inventory_Manager_HV, + GregtechItemList.GT4_Electric_Inventory_Manager_EV, GregtechItemList.GT4_Electric_Inventory_Manager_IV, GregtechItemList.GT4_Electric_Inventory_Manager_LuV, + GregtechItemList.GT4_Electric_Inventory_Manager_ZPM, GregtechItemList.GT4_Electric_Inventory_Manager_UV + }; + + int aTier = 1; + for (int i=0;i<8;i++) { + RecipeUtils.addShapedRecipe( + CI.getTieredCircuitOreDictName(aTier), aRegulators[i].get(1), CI.getTieredCircuitOreDictName(aTier), + CI.getRobotArm(aTier, 1), CI.getTieredMachineHull(aTier), CI.getRobotArm(aTier, 1), + CI.getTieredCircuitOreDictName(aTier), aEnergyHatches[i].get(1), CI.getTieredCircuitOreDictName(aTier), + aOutputInventoryManager[i].get(1)); + aTier++; + } + + GregtechItemList[] aOutputElectricCraftingTable = new GregtechItemList[] { + GregtechItemList.GT4_Electric_Auto_Workbench_LV, GregtechItemList.GT4_Electric_Auto_Workbench_MV, GregtechItemList.GT4_Electric_Auto_Workbench_HV, + GregtechItemList.GT4_Electric_Auto_Workbench_EV, GregtechItemList.GT4_Electric_Auto_Workbench_IV, GregtechItemList.GT4_Electric_Auto_Workbench_LuV, + GregtechItemList.GT4_Electric_Auto_Workbench_ZPM, GregtechItemList.GT4_Electric_Auto_Workbench_UV + }; + + aTier = 1; + for (int i=0;i<8;i++) { + RecipeUtils.addShapedRecipe( + ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1), ItemUtils.getSimpleStack(Blocks.crafting_table), ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1), + CI.getTieredCircuitOreDictName(aTier), CI.getTieredMachineHull(aTier), CI.getTieredCircuitOreDictName(aTier), + ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1), CI.getRobotArm(aTier, 1), ItemUtils.getOrePrefixStack(OrePrefixes.plate, CI.tieredMaterials[aTier], 1), + aOutputElectricCraftingTable[i].get(1)); + aTier++; + } + + } + + private static void multiGeneratorArray() { + GT_ModHandler.addCraftingRecipe( + ItemList.Processing_Array.get(1L), + CI.bitsd, + new Object[]{"CTC", "FMF", "CBC", + 'M', CI.getTieredGTPPMachineCasing(4, 1), + 'B', OrePrefixes.pipeHuge.get(Materials.StainlessSteel), + 'C', OrePrefixes.circuit.get(Materials.Data), + 'F', ItemList.Electric_Pump_EV, + 'T', CI.getSensor(4, 1)}); + } + + private static void multiForgeHammer() { + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getTieredGTPPMachineCasing(4, 1), + ItemList.Machine_IV_Hammer.get(1), + CI.getPlate(4, 8), + CI.getBolt(5, 32), + ELEMENT.getInstance().ZIRCONIUM.getFineWire(32), + ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 4) + }, + CI.getTieredFluid(4, 144 * 12), + GregtechItemList.Controller_IndustrialForgeHammer.get(1), + 20 * 30, + MaterialUtils.getVoltageForTier(5)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getTieredGTPPMachineCasing(3, 1), + ItemList.Casing_HeatProof.get(1), + CI.getPlate(4, 2), + CI.getBolt(4, 8), + ALLOY.BABBIT_ALLOY.getFineWire(16), + ItemUtils.getItemStackOfAmountFromOreDict("circuitGood", 4) + }, + CI.getTieredFluid(4, 144 * 2), + GregtechItemList.Casing_IndustrialForgeHammer.get(1), + 20 * 30, + MaterialUtils.getVoltageForTier(4)); + } + private static void multiMolecularTransformer() { + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getTieredGTPPMachineCasing(6, 1), + CI.getPlate(5, 16), + CI.getBolt(5, 32), + ALLOY.HG1223.getFineWire(64), + CI.getEmitter(4, 8), + ItemUtils.getItemStackOfAmountFromOreDict("circuitMaster", 10) + }, + CI.getTieredFluid(5, 144 * 16), + ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_11_MOLECULAR_TRANSFORMER, 1), + 20 * 60, + MaterialUtils.getVoltageForTier(5)); + + CORE.RA.addAssemblylineRecipe( + ItemDummyResearch.getResearchStack(ASSEMBLY_LINE_RESEARCH.RESEARCH_11_MOLECULAR_TRANSFORMER, 1), + 20 * 60 * 30, + new Object[] { + ALLOY.HG1223.getFineWire(64), + ALLOY.HG1223.getFineWire(64), + ItemList.Electric_Motor_IV.get(GTNH ? 32 : 16), + ItemList.Energy_LapotronicOrb.get(GTNH ? 32 : 16), + CI.getTieredComponent(OrePrefixes.cableGt12, 6, GTNH ? 32 : 16), + CI.getTieredComponent(OrePrefixes.wireGt16, 5, GTNH ? 64 : 32), + ALLOY.ZERON_100.getFrameBox(4), + ALLOY.ZIRCONIUM_CARBIDE.getPlateDouble(32), + ALLOY.BABBIT_ALLOY.getPlate(64), + ALLOY.LEAGRISIUM.getGear(GTNH ? 16 : 8), + new Object[] {CI.getTieredCircuitOreDictName(4), 64}, + new Object[] {CI.getTieredCircuitOreDictName(5), 32}, + new Object[] {CI.getTieredCircuitOreDictName(6), 16}, + GregtechItemList.Laser_Lens_WoodsGlass.get(1), + }, + new FluidStack[] { + ALLOY.NITINOL_60.getFluidStack(144 * 9 * (GTNH ? 4 : 2)), + ALLOY.INCOLOY_MA956.getFluidStack(144 * 9 * (GTNH ? 32 : 8)), + ALLOY.KANTHAL.getFluidStack(144 * 1 * (GTNH ? 16 : 4)), + }, + GregtechItemList.Controller_MolecularTransformer.get(1), + 20 * 60 * 10 * (GTNH ? 2 : 1), + (int) MaterialUtils.getVoltageForTier(6)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(16), + CI.getPlate(6, 4), + CI.getScrew(6, 8), + ELEMENT.getInstance().PALLADIUM.getFineWire(16), + CI.getSensor(5, 2), + ItemUtils.getItemStackOfAmountFromOreDict("circuitElite", 4) + }, + CI.getTieredFluid(5, 144 * 4), + GregtechItemList.Casing_Molecular_Transformer_1.get(1), + 20 * 20, + MaterialUtils.getVoltageForTier(5)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(16), + CI.getPlate(5, 4), + CI.getScrew(5, 8), + ItemList.Casing_Coil_Nichrome.get(2), + CI.getFieldGenerator(3, 2), + ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 8) + }, + CI.getTieredFluid(5, 144 * 4), + GregtechItemList.Casing_Molecular_Transformer_2.get(1), + 20 * 20, + MaterialUtils.getVoltageForTier(5)); + + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(16), + ItemUtils.getSimpleStack(Blocks.glowstone, 16), + CI.getGear(5, 8), + ELEMENT.getInstance().TITANIUM.getWire04(4), + CI.getFieldGenerator(4, 2), + ItemUtils.getItemStackOfAmountFromOreDict("circuitData", 8) + }, + CI.getTieredFluid(5, 144 * 4), + GregtechItemList.Casing_Molecular_Transformer_3.get(1), + 20 * 60, + MaterialUtils.getVoltageForTier(5)); + + } + + private static void multiXlTurbines() { + + RecipeUtils.addShapedRecipe( + CI.getDoublePlate(4, 1), CI.getElectricMotor(3, 1), CI.getDoublePlate(4, 1), + ItemUtils.getItemStackOfAmountFromOreDict("cellLubricant", 1), ItemList.Casing_Gearbox_Titanium.get(1), ItemUtils.getItemStackOfAmountFromOreDict("cellLubricant", 1), + CI.getDoublePlate(4, 1), CI.getElectricMotor(3, 1), CI.getDoublePlate(4, 1), + GregtechItemList.Casing_Turbine_Shaft.get(1)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.Casing_Turbine.get(1), + CI.getPlate(4, 4), + CI.getScrew(4, 8), + CI.getCircuit(4, 4), + CI.getGear(3, 8) + }, + CI.tieredMaterials[3].getMolten(144 * 8), + GregtechItemList.Hatch_Turbine_Rotor.get(1), + 20 * 60, + MaterialUtils.getVoltageForTier(4)); + + // Steam + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.Casing_Turbine.get(1), + CI.getPlate(3, 4), + CI.getScrew(3, 8), + }, + CI.tieredMaterials[2].getMolten(144 * 2), + GregtechItemList.Casing_Turbine_LP.get(1), + 20 * 5, + MaterialUtils.getVoltageForTier(3)); + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.LargeSteamTurbine.get(1), + CI.getPlate(4, 8), + CI.getScrew(4, 16), + CI.getGear(4, 4), + CI.getCircuit(4, 8) + }, + CI.tieredMaterials[4].getMolten(144 * 8), + GregtechItemList.Large_Steam_Turbine.get(1), + 20 * 60, + MaterialUtils.getVoltageForTier(4)); + + // Gas + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.Casing_Turbine1.get(1), + CI.getPlate(4, 4), + CI.getScrew(4, 8), + }, + CI.tieredMaterials[3].getMolten(144 * 2), + GregtechItemList.Casing_Turbine_Gas.get(1), + 20 * 5, + MaterialUtils.getVoltageForTier(4)); + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.LargeGasTurbine.get(1), + CI.getPlate(5, 8), + CI.getScrew(5, 16), + CI.getGear(5, 4), + CI.getCircuit(5, 8) + }, + CI.tieredMaterials[5].getMolten(144 * 8), + GregtechItemList.Large_Gas_Turbine.get(1), + 20 * 60, + MaterialUtils.getVoltageForTier(5)); + + // HP Steam + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.Casing_Turbine2.get(1), + CI.getPlate(5, 4), + CI.getScrew(5, 8), + }, + CI.tieredMaterials[4].getMolten(144 * 2), + GregtechItemList.Casing_Turbine_HP.get(1), + 20 * 5, + MaterialUtils.getVoltageForTier(5)); + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.LargeHPSteamTurbine.get(1), + CI.getPlate(6, 8), + CI.getScrew(6, 16), + CI.getGear(6, 4), + CI.getCircuit(6, 8) + }, + CI.tieredMaterials[6].getMolten(144 * 8), + GregtechItemList.Large_HPSteam_Turbine.get(1), + 20 * 60, + MaterialUtils.getVoltageForTier(6)); + + // Plasma + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.Casing_Turbine3.get(1), + CI.getPlate(6, 4), + CI.getScrew(6, 8), + }, + CI.tieredMaterials[5].getMolten(144 * 2), + GregtechItemList.Casing_Turbine_Plasma.get(1), + 20 * 5, + MaterialUtils.getVoltageForTier(6)); + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(18), + ItemList.LargePlasmaTurbine.get(1), + CI.getPlate(7, 8), + CI.getScrew(7, 16), + CI.getGear(7, 4), + CI.getCircuit(7, 8) + }, + CI.tieredMaterials[7].getMolten(144 * 8), + GregtechItemList.Large_Plasma_Turbine.get(1), + 20 * 60, + MaterialUtils.getVoltageForTier(7)); + + + } + + private static void multiSolarTower() { + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(17), + CI.getTieredGTPPMachineCasing(3, 4), + ALLOY.MARAGING250.getPlate(8), + ALLOY.MARAGING250.getBolt(8), + ALLOY.MARAGING250.getScrew(8), + CI.getCircuit(5, 8) + }, + CI.getTieredFluid(3, 144 * 16), + GregtechItemList.Industrial_Solar_Tower.get(1), + 20 * 30, + MaterialUtils.getVoltageForTier(4)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(17), + ALLOY.MARAGING350.getFrameBox(1), + ALLOY.STAINLESS_STEEL.getPlate(4), + ALLOY.MARAGING350.getScrew(8) + }, + CI.getTieredFluid(3, 144 * 4), + GregtechItemList.Casing_SolarTower_Structural.get(1), + 20 * 30, + MaterialUtils.getVoltageForTier(3)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(17), + ALLOY.MARAGING250.getFrameBox(1), + ALLOY.STAINLESS_STEEL.getPlate(4), + ALLOY.MARAGING250.getBolt(16), + ELEMENT.getInstance().ALUMINIUM.getScrew(8) + }, + CI.getTieredFluid(3, 144 * 4), + GregtechItemList.Casing_SolarTower_SaltContainment.get(1), + 20 * 30, + MaterialUtils.getVoltageForTier(3)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(17), + ALLOY.MARAGING250.getFrameBox(1), + ALLOY.STEEL_BLACK.getPlate(4), + ALLOY.MARAGING250.getScrew(8) + }, + CI.getAlternativeTieredFluid(3, 144 * 4), + GregtechItemList.Casing_SolarTower_HeatContainment.get(1), + 20 * 30, + MaterialUtils.getVoltageForTier(3)); + + CORE.RA.addSixSlotAssemblingRecipe( + new ItemStack[] { + CI.getNumberedAdvancedCircuit(17), + CI.getTieredGTPPMachineCasing(2, 1), + CI.getPlate(3, 2), + CI.getGear(3, 4), + CI.getElectricMotor(3, 2), + CI.getCircuit(3, 4) + + }, + CI.getTertiaryTieredFluid(3, 144 * 4), + GregtechItemList.Solar_Tower_Reflector.get(1), + 20 * 60, + MaterialUtils.getVoltageForTier(3)); + + } + + private static void multiElementalDuplicator() { + + CORE.RA.addAssemblylineRecipe( + ItemList.Machine_IV_Replicator.get(1), + 20 * 60 * 60 * 12, + new Object[] { + CI.getTieredMachineHull(7, 4), + CI.getFieldGenerator(5, GTNH ? 32 : 16), + CI.getElectricMotor(7, GTNH ? 32 : 16), + CI.getElectricPiston(7, GTNH ? 16 : 4), + CI.getEnergyCore(6, GTNH ? 8 : 2), + CI.getPlate(7, GTNH ? 32 : 16), + CI.getScrew(7, GTNH ? 64 : 32), + CI.getBolt(6, GTNH ? 64 : 32), + CI.getTieredComponent(OrePrefixes.rod, 6, GTNH ? 20 : 10), + new Object[] {CI.getTieredCircuitOreDictName(7), 20}, + ItemList.Tool_DataOrb.get(32), + GregtechItemList.Laser_Lens_Special.get(1) + }, + new FluidStack[] { + CI.getTieredFluid(7, 144 * 32), + CI.getAlternativeTieredFluid(6, 144 * 16), + CI.getTertiaryTieredFluid(6, 144 * 16), + ALLOY.BABBIT_ALLOY.getFluidStack(128 * 144), + + }, + GregtechItemList.Controller_ElementalDuplicator.get(1), + 20 * 60 * 60 * (GTNH ? 2 : 1), + (int) MaterialUtils.getVoltageForTier(7)); + + CORE.RA.addAssemblylineRecipe( + GregtechItemList.Modulator_III.get(1), + 20 * 60 * 60 * 4, + new Object[] { + CI.getTieredGTPPMachineCasing(7, 2), + CI.getFieldGenerator(4, GTNH ? 8 : 4), + CI.getEnergyCore(4, GTNH ? 8 : 2), + CI.getPlate(7, GTNH ? 16 : 8), + CI.getScrew(6, GTNH ? 32 : 16), + CI.getBolt(6, GTNH ? 32 : 16), + CI.getTieredComponent(OrePrefixes.rod, 5, GTNH ? 32 : 16), + new Object[] {CI.getTieredCircuitOreDictName(6), 32}, + ItemList.Tool_DataOrb.get(32), + }, + new FluidStack[] { + CI.getTieredFluid(6, 144 * 16), + CI.getAlternativeTieredFluid(5, 144 * 8), + CI.getTertiaryTieredFluid(5, 144 * 8), + ALLOY.BABBIT_ALLOY.getFluidStack(64 * 144), + + }, + GregtechItemList.Hatch_Input_Elemental_Duplicator.get(1), + 20 * 60 * 60 * (GTNH ? 4 : 2), + (int) MaterialUtils.getVoltageForTier(6)); + + CORE.RA.addAssemblylineRecipe( + GregtechItemList.ResonanceChamber_III.get(1), + 20 * 60 * 60 * 2, + new Object[] { + CI.getTieredMachineHull(6, 5), + CI.getFieldGenerator(3, GTNH ? 32 : 16), + CI.getEnergyCore(2, GTNH ? 8 : 2), + CI.getPlate(7, GTNH ? 8 : 4), + CI.getScrew(7, GTNH ? 8 : 4), + CI.getBolt(6, GTNH ? 16 : 8), + CI.getTieredComponent(OrePrefixes.rod, 5, GTNH ? 8 : 4), + new Object[] {CI.getTieredCircuitOreDictName(5), 4}, + ItemList.Tool_DataStick.get(4), + }, + new FluidStack[] { + CI.getTieredFluid(5, 144 * 16), + CI.getAlternativeTieredFluid(4, 144 * 8), + CI.getTertiaryTieredFluid(4, 144 * 8), + ALLOY.BABBIT_ALLOY.getFluidStack(16 * 144), + + }, + GregtechItemList.Casing_ElementalDuplicator.get(1), + 20 * 60 * (GTNH ? 20 : 10), + (int) MaterialUtils.getVoltageForTier(6)); + + } + + private static void resonanceChambers() { + int aFieldTier = 1; + int aCasingTier = 4; + for (int i = 0; i < 4; i++) { + RecipeUtils.addShapedRecipe( + CI.getDoublePlate(aCasingTier, 1), CI.getFieldGenerator(aFieldTier, 1), CI.getDoublePlate(aCasingTier, 1), + CI.getFieldGenerator(aFieldTier, 1), CI.getTieredMachineCasing(aCasingTier), CI.getFieldGenerator(aFieldTier, 1), + CI.getDoublePlate(aCasingTier, 1), CI.getFieldGenerator(aFieldTier, 1), CI.getDoublePlate(aCasingTier, 1), + ItemUtils.simpleMetaStack(ModBlocks.blockSpecialMultiCasings2, i, 1)); + aCasingTier++; + aFieldTier++; + } + } + + private static void modulators() { + int aCasingTier = 4; + for (int i = 4; i < 8; i++) { + RecipeUtils.addShapedRecipe( + CI.getTieredCircuitOreDictName(aCasingTier), CI.getPlate(aCasingTier, 1), CI.getTieredCircuitOreDictName(aCasingTier), + CI.getPlate(aCasingTier, 1), CI.getTieredMachineCasing(aCasingTier), CI.getPlate(aCasingTier, 1), + CI.getTieredCircuitOreDictName(aCasingTier), CI.getPlate(aCasingTier, 1), CI.getTieredCircuitOreDictName(aCasingTier), + ItemUtils.simpleMetaStack(ModBlocks.blockSpecialMultiCasings2, i, 1)); + aCasingTier++; + } + } + private static void zyngen() { CORE.RA.addSixSlotAssemblingRecipe( new ItemStack[] { CI.getNumberedAdvancedCircuit(6), CI.getTieredMachineHull(4), - ItemList.Machine_EV_AlloySmelter.get(1), + ItemList.Machine_IV_AlloySmelter.get(1), CI.getGear(3, 16), CI.getBolt(3, 64), CI.getPlate(4, 16) @@ -925,6 +1535,21 @@ public class RECIPES_Machines { if (CORE.ConfigSwitches.enableMachine_FluidTanks){ Logger.WARNING("Is New Horizons Loaded? "+GTNH); if (!GTNH){ + + // Allows clearing stored fluids. + GregtechItemList[] aTanks = new GregtechItemList[] { + GregtechItemList.GT_FluidTank_ULV, GregtechItemList.GT_FluidTank_LV, GregtechItemList.GT_FluidTank_MV, + GregtechItemList.GT_FluidTank_HV, GregtechItemList.GT_FluidTank_EV, GregtechItemList.GT_FluidTank_IV, + GregtechItemList.GT_FluidTank_LuV, GregtechItemList.GT_FluidTank_ZPM, GregtechItemList.GT_FluidTank_UV, + GregtechItemList.GT_FluidTank_MAX}; + for (GregtechItemList aTank : aTanks) { + RecipeUtils.addShapedGregtechRecipe( + aTank.get(1), null, null, + null, null, null, + null, null, null, + aTank.get(1)); + } + RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[1], CI.component_Plate[1], CI.component_Plate[1], CI.component_Plate[1], pipeTier1, CI.component_Plate[1], @@ -993,6 +1618,16 @@ public class RECIPES_Machines { CI.component_Plate[8] = "plateDarkSteel"; ItemStack waterBucket = ItemUtils.getSimpleStack(Items.water_bucket); + // Allows clearing stored fluids. + GregtechItemList[] aTanks = new GregtechItemList[] {GregtechItemList.GT_FluidTank_ULV, GregtechItemList.GT_FluidTank_LV, GregtechItemList.GT_FluidTank_MV, GregtechItemList.GT_FluidTank_HV}; + for (GregtechItemList aTank : aTanks) { + RecipeUtils.addShapedGregtechRecipe( + aTank.get(1), null, null, + null, null, null, + null, null, null, + aTank.get(1)); + } + RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[1], CI.component_Plate[5], CI.component_Plate[1], CI.component_Plate[4], pipeTier1, CI.component_Plate[4], @@ -1406,6 +2041,8 @@ public class RECIPES_Machines { } //Air Intake Hatch + ItemList FluidRegulator_IV = ItemUtils.getValueOfItemList("FluidRegulator_IV", ItemList.Pump_IV); + ItemStack aTieredFluidRegulator = CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK ? FluidRegulator_IV.get(1) : ItemList.Pump_IV.get(1); RecipeUtils.addShapedGregtechRecipe( CI.component_Plate[6], ItemList.Casing_Grate.get(1), CI.component_Plate[6], CI.component_Plate[6], CI.getFluidRegulator(5, 1), CI.component_Plate[6], @@ -1424,6 +2061,7 @@ public class RECIPES_Machines { CI.getPlate(7, 1), CI.getFluidRegulator(7, 1), CI.getPlate(7, 1), CI.getTieredCircuit(7), ItemList.Hatch_Input_ZPM.get(1), CI.getTieredCircuit(7), GregtechItemList.Hatch_Air_Intake_Extreme.get(1)); + if (CORE.ConfigSwitches.enableMultiblock_LiquidFluorideThoriumReactor){ //Thorium Reactor @@ -2796,7 +3434,8 @@ public class RECIPES_Machines { } } for (int a=0;a<5;a++) { - for (int i = 0;i<16;i++) { + for (int i = 0;i<16;i++) { + if (GTNH) continue; ItemStack aInput = aInputs[a][i]; ItemStack aOutput = aOutputs[a][i]; if (GT_Values.RA.addCutterRecipe( diff --git a/src/main/java/gtPlusPlus/core/recipe/common/CI.java b/src/main/java/gtPlusPlus/core/recipe/common/CI.java index f6af91a040..f656cfe9f0 100644 --- a/src/main/java/gtPlusPlus/core/recipe/common/CI.java +++ b/src/main/java/gtPlusPlus/core/recipe/common/CI.java @@ -190,6 +190,13 @@ public class CI { public static ItemStack explosiveTNT; public static ItemStack explosiveITNT; + public static Materials[] tieredMaterials = new Materials[] { + Materials.Iron, Materials.Steel, Materials.Aluminium, + Materials.StainlessSteel, Materials.Titanium, Materials.TungstenSteel, + Materials.Chrome, Materials.Iridium, Materials.Osmium, + Materials.Neutronium + };; + public static void preInit(){ //Tiered Components @@ -543,7 +550,7 @@ public class CI { ALLOY.TUMBAGA, ALLOY.EGLIN_STEEL, ALLOY.INCONEL_792, - ALLOY.TUNGSTEN_TITANIUM_CARBIDE, + ALLOY.INCOLOY_MA956, ALLOY.NITINOL_60, ALLOY.ZERON_100, ALLOY.PIKYONIUM, @@ -572,7 +579,7 @@ public class CI { ELEMENT.getInstance().LEAD, ELEMENT.getInstance().ALUMINIUM, ELEMENT.STANDALONE.BLACK_METAL, - ELEMENT.getInstance().TUNGSTEN, + ELEMENT.getInstance().TITANIUM, ALLOY.HASTELLOY_N, ALLOY.ENERGYCRYSTAL, ALLOY.TRINIUM_NAQUADAH_CARBON, @@ -681,6 +688,14 @@ public class CI { public static ItemStack getBolt(int aTier, int aAmount) { return getTieredComponent(OrePrefixes.bolt, aTier, aAmount); } + + public static ItemStack getScrew(int aTier, int aAmount) { + return getTieredComponent(OrePrefixes.screw, aTier, aAmount); + } + + public static ItemStack getCircuit(int aTier, int aAmount) { + return getTieredComponent(OrePrefixes.circuit, aTier, aAmount); + } public static ItemStack getTieredComponent(OrePrefixes aPrefix, int aTier, int aAmount) { aTier = Math.max(0, aTier); @@ -694,12 +709,12 @@ public class CI { } if (aPrefix == OrePrefixes.circuit) { - if (aTier == 4) { + /*if (aTier == 4) { return ItemUtils.getSimpleStack(CI.getDataStick(), aAmount); } else if (aTier == 5) { return ItemUtils.getSimpleStack(CI.getDataOrb(), aAmount); - } + }*/ return ItemUtils.getOrePrefixStack(OrePrefixes.circuit, aMaterial_Circuits[aTier], aAmount); } diff --git a/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java b/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java index 62b545c5c8..0fcbb6a576 100644 --- a/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java +++ b/src/main/java/gtPlusPlus/core/tileentities/ModTileEntities.java @@ -5,7 +5,15 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.block.general.BlockSuperLight.TileEntitySuperLight; import gtPlusPlus.core.block.machine.Machine_SuperJukebox.TileEntitySuperJukebox; import gtPlusPlus.core.lib.LoadedMods; -import gtPlusPlus.core.tileentities.general.*; +import gtPlusPlus.core.tileentities.general.TileEntityCircuitProgrammer; +import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest; +import gtPlusPlus.core.tileentities.general.TileEntityEggBox; +import gtPlusPlus.core.tileentities.general.TileEntityFirepit; +import gtPlusPlus.core.tileentities.general.TileEntityFishTrap; +import gtPlusPlus.core.tileentities.general.TileEntityInfiniteFluid; +import gtPlusPlus.core.tileentities.general.TileEntityPlayerDoorBase; +import gtPlusPlus.core.tileentities.general.TileEntityVolumetricFlaskSetter; +import gtPlusPlus.core.tileentities.general.TileEntityXpConverter; import gtPlusPlus.core.tileentities.machines.TileEntityAdvPooCollector; import gtPlusPlus.core.tileentities.machines.TileEntityModularityTable; import gtPlusPlus.core.tileentities.machines.TileEntityPestKiller; @@ -13,8 +21,6 @@ import gtPlusPlus.core.tileentities.machines.TileEntityPooCollector; import gtPlusPlus.core.tileentities.machines.TileEntityProjectTable; import gtPlusPlus.core.tileentities.machines.TileEntityRoundRobinator; import gtPlusPlus.core.tileentities.machines.TileEntityTradeTable; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbench; -import gtPlusPlus.core.tileentities.machines.TileEntityWorkbenchAdvanced; import gtPlusPlus.plugin.villagers.tile.TileEntityGenericSpawner; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; @@ -24,8 +30,6 @@ public class ModTileEntities { Logger.INFO("Registering Tile Entities."); GameRegistry.registerTileEntity(TileEntityPooCollector.class, "TileEntityPooCollector"); GameRegistry.registerTileEntity(TileEntityAdvPooCollector.class, "TileEntityAdvPooCollector"); - GameRegistry.registerTileEntity(TileEntityWorkbench.class, "TileWorkbench"); - GameRegistry.registerTileEntity(TileEntityWorkbenchAdvanced.class, "TileWorkbenchAdvanced"); GameRegistry.registerTileEntity(TileEntityFishTrap.class, "TileFishTrap"); GameRegistry.registerTileEntity(TileEntityFirepit.class, "TileFirePit"); GameRegistry.registerTileEntity(TileEntityInfiniteFluid.class, "TileInfiniteFluid"); diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java deleted file mode 100644 index a2db2326a9..0000000000 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbench.java +++ /dev/null @@ -1,172 +0,0 @@ -package gtPlusPlus.core.tileentities.machines; - -import java.util.List; -import java.util.Vector; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCraftResult; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; - -import gtPlusPlus.core.inventories.InventoryWorkbenchChest; -import gtPlusPlus.core.inventories.InventoryWorkbenchHoloSlots; -import gtPlusPlus.core.inventories.InventoryWorkbenchTools; -import ic2.api.network.INetworkDataProvider; -import ic2.api.network.INetworkUpdateListener; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; - -public class TileEntityWorkbench extends TileEntity implements INetworkDataProvider, INetworkUpdateListener, IWrenchable{ - - //Credit to NovaViper in http://www.minecraftforge.net/forum/index.php?topic=26439.0 - Helped me restructure my Inventory system and now the crafting matrix works better. - - public InventoryWorkbenchChest inventoryChest; - public InventoryWorkbenchTools inventoryTool; - public InventoryWorkbenchHoloSlots inventoryHolo; - //public InventoryWorkbenchHoloCrafting inventoryCrafting; - - public IInventory inventoryCraftResult = new InventoryCraftResult(); - - public TileEntityWorkbench(){ - this.inventoryTool = new InventoryWorkbenchTools();//number of slots - without product slot - this.inventoryChest = new InventoryWorkbenchChest();//number of slots - without product slot - this.inventoryHolo = new InventoryWorkbenchHoloSlots(); - //this.inventoryCrafting = new InventoryWorkbenchHoloCrafting(); - this.canUpdate(); - } - - public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) - { - if(!nbt.hasKey(tag)) - { - nbt.setTag(tag, new NBTTagCompound()); - } - return nbt.getCompoundTag(tag); - } - - @Override - public void writeToNBT(final NBTTagCompound nbt) - { - super.writeToNBT(nbt); - - nbt.setShort("facing", this.facing); - - this.inventoryChest.writeToNBT(this.getTag(nbt, "ContentsChest")); - this.inventoryTool.writeToNBT(this.getTag(nbt, "ContentsTools")); - //inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting")); - this.inventoryHolo.writeToNBT(this.getTag(nbt, "ContentsHolo")); - - // Write Crafting Matrix to NBT - final NBTTagList craftingTag = new NBTTagList(); - /*for (int currentIndex = 0; currentIndex < this.inventoryCrafting.getSizeInventory(); ++currentIndex) { - if (this.inventoryCrafting.getStackInSlot(currentIndex) != null) { - final NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte) currentIndex); - this.inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound); - craftingTag.appendTag(tagCompound); - } - }*/ - - nbt.setTag("CraftingMatrix", craftingTag); - // Write craftingResult to NBT - if (this.inventoryCraftResult.getStackInSlot(0) != null) { - nbt.setTag("CraftingResult", this.inventoryCraftResult.getStackInSlot(0).writeToNBT(new NBTTagCompound())); - } - - } - - @Override - public void readFromNBT(final NBTTagCompound nbt) - { - super.readFromNBT(nbt); - - this.prevFacing = (this.facing = nbt.getShort("facing")); - - this.inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest")); - this.inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools")); - //inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting")); - this.inventoryHolo.readFromNBT(nbt.getCompoundTag("ContentsHolo")); - - // Read in the Crafting Matrix from NBT - final NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10); - /*this.inventoryCrafting = new InventoryWorkbenchHoloCrafting(); //TODO: magic number - for (int i = 0; i < craftingTag.tagCount(); ++i) { - final NBTTagCompound tagCompound = craftingTag.getCompoundTagAt(i); - final byte slot = tagCompound.getByte("Slot"); - if ((slot >= 0) && (slot < this.inventoryCrafting.getSizeInventory())) { - this.inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound)); - } - }*/ - - - // Read craftingResult from NBT - final NBTTagCompound tagCraftResult = nbt.getCompoundTag("CraftingResult"); - this.inventoryCraftResult.setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(tagCraftResult)); - - } - - @Override - public List<String> getNetworkedFields(){ - final List<String> ret = new Vector(2); - ret.add("facing"); - return ret; - } - - - @Override - public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) - { - return false; - } - - private short facing = 0; - public short prevFacing = 0; - - @Override - public void setFacing(final short facing1) - { - this.facing = facing1; - if (this.prevFacing != facing1) { - IC2.network.get().updateTileEntityField(this, "facing"); - } - this.prevFacing = facing1; - } - - @Override - public short getFacing() - { - return this.facing; - } - - - @Override - public boolean wrenchCanRemove(final EntityPlayer entityPlayer) - { - return true; - } - - @Override - public float getWrenchDropRate() - { - return 1.0F; - } - - @Override - public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) - { - return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1, this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord)); - } - - @Override - public void onNetworkUpdate(final String field) { - - this.prevFacing = this.facing; - - } - - - -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java b/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java deleted file mode 100644 index 264323388f..0000000000 --- a/src/main/java/gtPlusPlus/core/tileentities/machines/TileEntityWorkbenchAdvanced.java +++ /dev/null @@ -1,245 +0,0 @@ -package gtPlusPlus.core.tileentities.machines; - -import java.util.List; -import java.util.Vector; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.InventoryCraftResult; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; - -import gtPlusPlus.core.inventories.*; -import ic2.api.energy.event.EnergyTileLoadEvent; -import ic2.api.energy.event.EnergyTileUnloadEvent; -import ic2.api.energy.tile.IEnergySink; -import ic2.api.network.INetworkDataProvider; -import ic2.api.network.INetworkUpdateListener; -import ic2.api.tile.IWrenchable; -import ic2.core.IC2; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; - -public class TileEntityWorkbenchAdvanced extends TileEntity implements IEnergySink, INetworkDataProvider, INetworkUpdateListener, IWrenchable{ - - //Credit to NovaViper in http://www.minecraftforge.net/forum/index.php?topic=26439.0 - Helped me restructure my Inventory system and now the crafting matrix works better. - - public InventoryWorkbenchChest inventoryChest; - public InventoryWorkbenchToolsElectric inventoryTool; - public InventoryWorkbenchHoloSlots inventoryHolo; - public InventoryWorkbenchHoloCrafting inventoryCrafting; - - public IInventory inventoryCraftResult = new InventoryCraftResult(); - - //Wrench Code - private short facing = 0; - public short prevFacing = 0; - - //E-Net Code - public double energy = 0.0D; - public int maxEnergy; - private boolean addedToEnergyNet = false; - private int tier; - private float guiChargeLevel; - - - public TileEntityWorkbenchAdvanced(final int maxenergy, final int tier1){ - this.inventoryTool = new InventoryWorkbenchToolsElectric();//number of slots - without product slot - this.inventoryChest = new InventoryWorkbenchChest();//number of slots - without product slot - this.inventoryHolo = new InventoryWorkbenchHoloSlots(); - this.inventoryCrafting = new InventoryWorkbenchHoloCrafting(); - this.canUpdate(); - - //Electric Stats - this.maxEnergy = maxenergy; - this.tier = tier1; - - } - - public NBTTagCompound getTag(final NBTTagCompound nbt, final String tag) - { - if(!nbt.hasKey(tag)) - { - nbt.setTag(tag, new NBTTagCompound()); - } - return nbt.getCompoundTag(tag); - } - - @Override - public void writeToNBT(final NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setDouble("energy", this.energy); - nbt.setShort("facing", this.facing); - - this.inventoryChest.writeToNBT(this.getTag(nbt, "ContentsChest")); - this.inventoryTool.writeToNBT(this.getTag(nbt, "ContentsTools")); - //inventoryCrafting.writeToNBT(getTag(nbt, "ContentsCrafting")); - this.inventoryHolo.writeToNBT(this.getTag(nbt, "ContentsHolo")); - - // Write Crafting Matrix to NBT - final NBTTagList craftingTag = new NBTTagList(); - for (int currentIndex = 0; currentIndex < this.inventoryCrafting.getSizeInventory(); ++currentIndex) { - if (this.inventoryCrafting.getStackInSlot(currentIndex) != null) { - final NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte) currentIndex); - this.inventoryCrafting.getStackInSlot(currentIndex).writeToNBT(tagCompound); - craftingTag.appendTag(tagCompound); - } - } - - nbt.setTag("CraftingMatrix", craftingTag); - // Write craftingResult to NBT - if (this.inventoryCraftResult.getStackInSlot(0) != null) { - nbt.setTag("CraftingResult", this.inventoryCraftResult.getStackInSlot(0).writeToNBT(new NBTTagCompound())); - } - - } - - @Override - public void readFromNBT(final NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.energy = nbt.getDouble("energy"); - - this.prevFacing = (this.facing = nbt.getShort("facing")); - - this.inventoryChest.readFromNBT(nbt.getCompoundTag("ContentsChest")); - this.inventoryTool.readFromNBT(nbt.getCompoundTag("ContentsTools")); - //inventoryCrafting.readFromNBT(nbt.getCompoundTag("ContentsCrafting")); - this.inventoryHolo.readFromNBT(nbt.getCompoundTag("ContentsHolo")); - - // Read in the Crafting Matrix from NBT - final NBTTagList craftingTag = nbt.getTagList("CraftingMatrix", 10); - this.inventoryCrafting = new InventoryWorkbenchHoloCrafting(); //TODO: magic number - for (int i = 0; i < craftingTag.tagCount(); ++i) { - final NBTTagCompound tagCompound = craftingTag.getCompoundTagAt(i); - final byte slot = tagCompound.getByte("Slot"); - if ((slot >= 0) && (slot < this.inventoryCrafting.getSizeInventory())) { - this.inventoryCrafting.setInventorySlotContents(slot, ItemStack.loadItemStackFromNBT(tagCompound)); - } - } - - - // Read craftingResult from NBT - final NBTTagCompound tagCraftResult = nbt.getCompoundTag("CraftingResult"); - this.inventoryCraftResult.setInventorySlotContents(0, ItemStack.loadItemStackFromNBT(tagCraftResult)); - - } - - @Override - public boolean acceptsEnergyFrom(final TileEntity emitter, final ForgeDirection direction) - { - return true; - } - - @Override - public double getDemandedEnergy() - { - return this.maxEnergy - this.energy; - } - - @Override - public int getSinkTier() - { - return this.tier; - } - - @Override - public double injectEnergy(final ForgeDirection directionFrom, final double amount, final double voltage) - { - if (this.energy >= this.maxEnergy) { - return amount; - } - this.energy += amount; - return 0.0D; - } - - public final float getChargeLevel() - { - return this.guiChargeLevel; - } - - public void setTier(final int tier1) - { - if (this.tier == tier1) { - return; - } - final boolean addedToENet = this.addedToEnergyNet; - if (addedToENet) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this)); - this.addedToEnergyNet = false; - } - this.tier = tier1; - - for (int i=0; i<this.inventoryTool.getSizeInventory(); i++){ - //this.inventoryTool..setTier(tier1); TODO - } - - if (addedToENet) - { - MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); - this.addedToEnergyNet = true; - } - } - - @Override - public List<String> getNetworkedFields(){ - final List<String> ret = new Vector(2); - ret.add("facing"); - return ret; - } - - - @Override - public boolean wrenchCanSetFacing(final EntityPlayer entityPlayer, final int side) - { - return false; - } - - @Override - public void setFacing(final short facing1) - { - this.facing = facing1; - if (this.prevFacing != facing1) { - IC2.network.get().updateTileEntityField(this, "facing"); - } - this.prevFacing = facing1; - } - - @Override - public short getFacing() - { - return this.facing; - } - - - @Override - public boolean wrenchCanRemove(final EntityPlayer entityPlayer) - { - return true; - } - - @Override - public float getWrenchDropRate() - { - return 1.0F; - } - - @Override - public ItemStack getWrenchDrop(final EntityPlayer entityPlayer) - { - return new ItemStack(this.worldObj.getBlock(this.xCoord, this.yCoord, this.zCoord), 1, this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord)); - } - - @Override - public void onNetworkUpdate(final String field) { - - this.prevFacing = this.facing; - - } - -}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java index ef5db6e4e0..4ff929c643 100644 --- a/src/main/java/gtPlusPlus/core/util/math/MathUtils.java +++ b/src/main/java/gtPlusPlus/core/util/math/MathUtils.java @@ -16,12 +16,12 @@ public class MathUtils { final static Random rand = CORE.RANDOM; - /** Formats a number with group separator and at most 2 fraction digits. */ - private static final NumberFormat sNumberFormat = NumberFormat.getInstance(); - - static { - sNumberFormat.setMaximumFractionDigits(2); - } + /** Formats a number with group separator and at most 2 fraction digits. */ + private static final NumberFormat sNumberFormat = NumberFormat.getInstance(); + + static { + sNumberFormat.setMaximumFractionDigits(2); + } /** * Returns a psuedo-random number between min and max, inclusive. @@ -567,7 +567,7 @@ public class MathUtils { return 0; } } - + public static <V> V safeCast(Object aNumberType) { long a1; double a2; @@ -586,7 +586,7 @@ public class MathUtils { String s = ""+a1; Short s1 = Short.valueOf(s); return (V) s1; - + } } else if ((aNumberType.getClass() == int.class) || (aNumberType instanceof Integer)){ @@ -594,7 +594,7 @@ public class MathUtils { String s = ""+a1; Integer s1 = Integer.valueOf(s); return (V) s1; - + } } else if ((aNumberType.getClass() == long.class) || (aNumberType instanceof Long)){ @@ -609,7 +609,7 @@ public class MathUtils { String s = ""+a1; Float s1 = Float.valueOf(s); return (V) s1; - + } } else if ((aNumberType.getClass() == double.class) || (aNumberType instanceof Double)){ @@ -617,40 +617,40 @@ public class MathUtils { String s = ""+a1; Double s1 = Double.valueOf(s); return (V) s1; - + } } - + Integer o = 0; return (V) o; - + } - + public static byte getSafeByte(Byte b) { Byte a = safeCast(b); return a.byteValue(); } - + public static short getSafeShort(Short b) { Short a = safeCast(b); return a.shortValue(); } - + public static int getSafeInt(Integer b) { Integer a = safeCast(b); return a.intValue(); } - + public static long getSafeLong(Long b) { Long a = safeCast(b); return a.longValue(); } - + public static float getSafeFloat(Float b) { Float a = safeCast(b); return a.floatValue(); } - + public static double getSafeDouble(Double b) { Double a = safeCast(b); return a.doubleValue(); @@ -712,7 +712,7 @@ public class MathUtils { public static int balance(int aInput, int aMin, int aMax) { return Math.max(Math.min(aInput, aMax), aMin); } - + /** * Balances a number within a range. * @param aInput - The number to balance @@ -723,7 +723,7 @@ public class MathUtils { public static Number balance(Number aInput, Number aMin, Number aMax) { return max(min(aInput, aMax), aMin); } - + /** * Balances a number within a range. * @param aInput - The number to balance @@ -734,7 +734,7 @@ public class MathUtils { public static int balanceInt(Number aInput, Number aMin, Number aMax) { return MathUtils.safeCast_LongToInt((long) balance(max(min(aInput, aMax), aMin), Integer.MIN_VALUE, Integer.MAX_VALUE)); } - + /** * Balances a number within a range. * @param aInput - The number to balance @@ -750,51 +750,62 @@ public class MathUtils { int aAmount = Math.max(Math.min(i, aMax), aMin); return aAmount; } - + public static Pair<Integer, Integer> splitLongIntoIntegers(long aLong){ int aIntMaxInLong = (int) Math.min(Integer.MAX_VALUE, Math.floor(aLong/Integer.MAX_VALUE)); int aRemainder = (int) (aLong - (aIntMaxInLong * Integer.MAX_VALUE)); return new Pair<Integer, Integer>(aIntMaxInLong, aRemainder); } - - - /** - * Returns the smaller of two {@code Number}s. That is, - * the result the argument closer to the value of - * {@link Long#MIN_VALUE}. If the arguments have the same - * value, the result is that same value. - * - * @param a an argument. - * @param b another argument. - * @return the smaller of {@code a} and {@code b}. - */ - public static Number min(Number a, Number b) { - return (a.longValue() <= b.longValue()) ? a : b; - } - - /** - * Returns the greater of two {@code Number}s. That is, the - * result is the argument closer to the value of - * {@link Long#MAX_VALUE}. If the arguments have the same value, - * the result is that same value. - * - * @param a an argument. - * @param b another argument. - * @return the larger of {@code a} and {@code b}. - */ - public static Number max(Number a, Number b) { - return (a.longValue() >= b.longValue()) ? a : b; - } - - public static String formatNumbers(long aNumber) { - return sNumberFormat.format(aNumber); - } - - public static String formatNumbers(double aNumber) { - return sNumberFormat.format(aNumber); - } + + + /** + * Returns the smaller of two {@code Number}s. That is, + * the result the argument closer to the value of + * {@link Long#MIN_VALUE}. If the arguments have the same + * value, the result is that same value. + * + * @param a an argument. + * @param b another argument. + * @return the smaller of {@code a} and {@code b}. + */ + public static Number min(Number a, Number b) { + return (a.longValue() <= b.longValue()) ? a : b; + } + + /** + * Returns the greater of two {@code Number}s. That is, the + * result is the argument closer to the value of + * {@link Long#MAX_VALUE}. If the arguments have the same value, + * the result is that same value. + * + * @param a an argument. + * @param b another argument. + * @return the larger of {@code a} and {@code b}. + */ + public static Number max(Number a, Number b) { + return (a.longValue() >= b.longValue()) ? a : b; + } + + public static long combineTwoIntegersToLong(int a, int b) { + long val = (((long) a) << 32) | (b & 0xffffffffL); + return val; + } + public static int[] splitLongIntoTwoIntegers(long aNum) { + int a = (int) (aNum >> 32); + int b = (int) aNum; + return new int[] {a, b}; + } + + public static String formatNumbers(long aNumber) { + return sNumberFormat.format(aNumber); + } + + public static String formatNumbers(double aNumber) { + return sNumberFormat.format(aNumber); + } + } diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java index 0323bf0161..0ccd752775 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/MaterialUtils.java @@ -18,6 +18,7 @@ import gtPlusPlus.core.client.CustomTextureSet.TextureSets; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.item.base.BaseItemComponent.ComponentTypes; import gtPlusPlus.core.item.base.plates.BaseItemPlateHeavy; +import gtPlusPlus.core.item.base.wire.BaseItemFineWire; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialStack; @@ -457,6 +458,9 @@ public class MaterialUtils { if (aType == ComponentTypes.PLATEHEAVY) { aGC = new BaseItemPlateHeavy(aMaterial); } + else if (aType == ComponentTypes.FINEWIRE) { + aGC = new BaseItemFineWire(aMaterial); + } else { aGC = new BaseItemComponent(aMaterial, aType); } diff --git a/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java b/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java index da5bc071bc..595635d411 100644 --- a/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java +++ b/src/main/java/gtPlusPlus/core/util/minecraft/RecipeUtils.java @@ -703,14 +703,14 @@ public static int mInvalidID = 1; CORE.crash("Bad Shaped Recipe."); } } - Logger.INFO("Using String: "+aFullString); + Logger.RECIPE("Using String: "+aFullString); String aRow1 = aFullString.substring(0, 3); String aRow2 = aFullString.substring(3, 6); String aRow3 = aFullString.substring(6, 9); - Logger.INFO(""+aRow1); - Logger.INFO(""+aRow2); - Logger.INFO(""+aRow3); + Logger.RECIPE(""+aRow1); + Logger.RECIPE(""+aRow2); + Logger.RECIPE(""+aRow3); String[] aStringData = new String[] {aRow1, aRow2, aRow3}; Object[] aDataObject = new Object[19]; @@ -730,10 +730,10 @@ public static int mInvalidID = 1; aIndex++; } - Logger.INFO("Data Size: "+aDataObject.length); + Logger.RECIPE("Data Size: "+aDataObject.length); aDataObject = ArrayUtils.removeNulls(aDataObject); - Logger.INFO("Clean Size: "+aDataObject.length); - Logger.INFO("ArrayData: "+Arrays.toString(aDataObject)); + Logger.RECIPE("Clean Size: "+aDataObject.length); + Logger.RECIPE("ArrayData: "+Arrays.toString(aDataObject)); ShapedOreRecipe aRecipe = new ShapedOreRecipe(aOutputStack, aDataObject); diff --git a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java index 48cdb18d7c..a5e0bea0cb 100644 --- a/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java +++ b/src/main/java/gtPlusPlus/core/util/reflect/ReflectionUtils.java @@ -22,7 +22,6 @@ import com.google.common.reflect.ClassPath; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.util.data.StringUtils; -import gtPlusPlus.xmod.gregtech.common.StaticFields59; public class ReflectionUtils { @@ -271,6 +270,21 @@ public class ReflectionUtils { } } + public static Field[] getAllFields(final Class<?> aClass) { + if (aClass == null) { + return null; + } + Field[] aFields = aClass.getDeclaredFields(); + for (Field f : aFields) { + CachedField y = mCachedFields.get(aClass.getName()+"."+f.getName()); + if (y == null) { + makeFieldAccessible(f); + cacheField(aClass, f); + } + } + return aFields; + } + /** * Returns a cached {@link Field} object. * @param aInstance - {@link Object} to get the field instance from. @@ -335,6 +349,9 @@ public class ReflectionUtils { public static String getMethodName(final int depth) { final StackTraceElement[] ste = new Throwable().getStackTrace(); //System. out.println(ste[ste.length-depth].getClassName()+"#"+ste[ste.length-depth].getMethodName()); + if (ste.length < depth) { + return "No valid stack."; + } return ste[depth+1].getMethodName(); } @@ -441,7 +458,7 @@ public class ReflectionUtils { t.printStackTrace(); } } - + /** * Allows to change the state of an immutable instance. Huh?!? */ @@ -529,7 +546,7 @@ public class ReflectionUtils { Logger.REFLECTION("Invoke failed or did something wrong."); return false; } - + public static boolean invokeVoid(Object objectInstance, Method method, Object[] values){ if (method == null || values == null || (!ReflectionUtils.isStaticMethod(method) && objectInstance == null)){ //Logger.REFLECTION("Null value when trying to Dynamically invoke "+methodName+" on an object of type: "+objectInstance.getClass().getName()); @@ -543,8 +560,8 @@ public class ReflectionUtils { if (mInvokingMethod != null){ Logger.REFLECTION(methodName+" was not null."); mInvokingMethod.invoke(objectInstance, values); - Logger.REFLECTION("Successfully invoked "+methodName+"."); - return true; + Logger.REFLECTION("Successfully invoked "+methodName+"."); + return true; } } catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { @@ -589,7 +606,7 @@ public class ReflectionUtils { String classname = objectInstance != null ? objectInstance.getClass().getCanonicalName() : method.getDeclaringClass().getCanonicalName(); Logger.REFLECTION("Trying to invoke "+methodName+" on an instance of "+classname+"."); try { - return method.invoke(objectInstance, values); + return method.invoke(objectInstance, values); } catch (SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { Logger.REFLECTION("Failed to Dynamically invoke "+methodName+" on an object of type: "+classname); diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java new file mode 100644 index 0000000000..fc2c16b423 --- /dev/null +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MolecularTransformer.java @@ -0,0 +1,35 @@ +package gtPlusPlus.nei; + +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.util.math.MathUtils; + +public class GT_NEI_MolecularTransformer extends GTPP_NEI_DefaultHandler { + + public GT_NEI_MolecularTransformer() { + super(GTPP_Recipe_Map.sMolecularTransformerRecipes); + } + + @Override + public TemplateRecipeHandler newInstance() { + return new GT_NEI_MolecularTransformer(); + } + + @Override + public void drawExtras(final int aRecipeIndex) { + GT_Recipe aRecipe = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe; + final long tEUt = aRecipe.mEUt; + final long tDuration = aRecipe.mDuration; + if (tEUt != 0) { + drawText(10, 73, "Total: " + MathUtils.formatNumbers((long) (tDuration * tEUt)) + " EU", -16777216); + drawText(10, 83, "Usage: " + MathUtils.formatNumbers(tEUt * aRecipe.mSpecialValue) + " EU/t", -16777216); + drawText(10, 93, "Voltage: " + MathUtils.formatNumbers(tEUt) + " EU", -16777216); + drawText(10, 103, "Amperage: " + aRecipe.mSpecialValue, -16777216); + } + if (tDuration > 0) { + drawText(10, 113, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Long.valueOf(tDuration / 20))) + " secs", -16777216); + } + } + +} diff --git a/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java new file mode 100644 index 0000000000..e5666d84b4 --- /dev/null +++ b/src/main/java/gtPlusPlus/nei/GT_NEI_MultiSolarTower.java @@ -0,0 +1,36 @@ +package gtPlusPlus.nei; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import codechicken.nei.recipe.TemplateRecipeHandler; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.core.util.math.MathUtils; + +public class GT_NEI_MultiSolarTower extends GT_NEI_MultiNoCell { + + public GT_NEI_MultiSolarTower(GT_Recipe_Map aMap) { + super(aMap); + } + + @Override + public TemplateRecipeHandler newInstance() { + return new GT_NEI_MultiSolarTower(mRecipeMap); + } + + @Override + public String getGuiTexture() { + return RES_PATH_GUI + "basicmachines/FissionFuel.png"; + } + + @Override + public void drawExtras(final int aRecipeIndex) { + final int tDuration = ((CachedDefaultRecipe) this.arecipes.get(aRecipeIndex)).mRecipe.mDuration; + if (tDuration > 0) { + drawText(10, 90, "Time: " + (tDuration < 20 ? "< 1" : MathUtils.formatNumbers(Integer.valueOf(tDuration / 20))) + " secs", -16777216); + } + drawText(5, 100, "Solar Heater rings boost tier", -16777216); + drawText(5, 110, "R1:T1, R2:T2, R3:T4, R4:T8, R5:T16", -16777216); + drawText(5, 120, "Input Amount = 1000 x T", -16777216); + } + +} diff --git a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java index 0b3cf8e66e..3686cd5dba 100644 --- a/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java +++ b/src/main/java/gtPlusPlus/nei/NEI_GT_Config.java @@ -25,13 +25,16 @@ implements IConfigureNEI { mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sChemicalPlantRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sOreMillRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sFlotationCellRecipes.mUnlocalizedName); - mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sVacuumFurnaceRecipes.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMolecularTransformerRecipes.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockElectrolyzerRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sMultiblockMixerRecipes_GT.mUnlocalizedName); mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sAlloyBlastSmelterRecipes.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sThermalFuels.mUnlocalizedName); + mUniqueRecipeMapHandling.add(GTPP_Recipe_Map.sSolarTowerRecipes.mUnlocalizedName); // Standard GT Recipe Maps Logger.INFO("NEI Registration: "+GTPP_Recipe_Map_Internal.sMappingsEx.size()+" sMappingEx"); @@ -52,6 +55,8 @@ implements IConfigureNEI { Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sChemicalPlantRecipes.mNEIName); new GT_NEI_FluidReactor(); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMolecularTransformerRecipes.mNEIName); + new GT_NEI_MolecularTransformer(); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sOreMillRecipes.mNEIName); new GT_NEI_MillingMachine(); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sFlotationCellRecipes.mNEIName); @@ -62,6 +67,10 @@ implements IConfigureNEI { new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sFissionFuelProcessing); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sVacuumFurnaceRecipes.mNEIName); new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sVacuumFurnaceRecipes); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sThermalFuels.mNEIName); + new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sThermalFuels); + Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sSolarTowerRecipes.mNEIName); + new GT_NEI_MultiSolarTower(GTPP_Recipe_Map.sSolarTowerRecipes); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sAdvFreezerRecipes_GT.mNEIName); new GT_NEI_MultiNoCell(GTPP_Recipe_Map.sAdvFreezerRecipes_GT); Logger.INFO("NEI Registration: Registering NEI handler for "+GTPP_Recipe_Map.sMultiblockCentrifugeRecipes_GT.mNEIName); diff --git a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java index 7bc2316a04..325345fc05 100644 --- a/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java +++ b/src/main/java/gtPlusPlus/nei/NEI_IMC_Sender.java @@ -1,6 +1,7 @@ package gtPlusPlus.nei; import cpw.mods.fml.common.event.FMLInterModComms; +import gtPlusPlus.core.lib.LoadedMods; import net.minecraft.nbt.NBTTagCompound; public class NEI_IMC_Sender { @@ -23,11 +24,16 @@ public class NEI_IMC_Sender { setNBTInfoAndSendIt("gtpp.recipe.multielectro", "gregtech:gt.blockmachines:796", 1); setNBTInfoAndSendIt("gtpp.recipe.simplewasher", "gregtech:gt.blockmachines:767"); setNBTInfoAndSendIt("gtpp.recipe.vacfurnace", "gregtech:gt.blockmachines:995", 1); + setNBTInfoAndSendIt("gtpp.recipe.thermalgeneratorfuel", "gregtech:gt.blockmachines:875", 1); + setNBTInfoAndSendIt("gtpp.recipe.solartower", "gregtech:gt.blockmachines:863", 1); setNBTInfoAndSendIt("gtpp.recipe.fissionfuel", "gregtech:gt.blockmachines:835", 1); setNBTInfoAndSendIt("gtpp.recipe.lftr", "gregtech:gt.blockmachines:751", 1); setNBTInfoAndSendIt("gtpp.recipe.lftr.sparging", "gregtech:gt.blockmachines:31035", 1); setNBTInfoAndSendIt("gtpp.recipe.coldtrap", "gregtech:gt.blockmachines:31034"); setNBTInfoAndSendIt("gtpp.recipe.reactorprocessingunit", "gregtech:gt.blockmachines:31032"); + if (LoadedMods.AdvancedSolarPanel) { + setNBTInfoAndSendIt("gtpp.recipe.moleculartransformer", "AdvancedSolarPanel:BlockMolecularTransformer"); + } } diff --git a/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java b/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java index b52f4eb67e..fd07fd1bbe 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java +++ b/src/main/java/gtPlusPlus/preloader/asm/Preloader_FMLLoadingPlugin.java @@ -8,6 +8,8 @@ import java.util.Map; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.SortingIndex; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.preloader.Preloader_Logger; @@ -74,6 +76,7 @@ public class Preloader_FMLLoadingPlugin implements IFMLLoadingPlugin { CORE_Preloader.DEV_ENVIRONMENT = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment"); CORE_Preloader.DEBUG_MODE = AsmConfig.debugMode; Preloader_Logger.INFO("Running on "+gtPlusPlus.preloader.CORE_Preloader.JAVA_VERSION+" | Development Environment: "+CORE_Preloader.DEV_ENVIRONMENT); + //Preloader_Logger.INFO("Is Client? "+Utils.isClient()+" | Is Server? "+Utils.isServer()); Locale aDefaultLocale = Locale.getDefault(); NumberFormat aFormat = NumberFormat.getInstance(); Locale aDisplayLocale = ReflectionUtils.getFieldValue(ReflectionUtils.getField(Locale.class, "defaultDisplayLocale")); diff --git a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java index e2d34c38e7..25ec9a8338 100644 --- a/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java +++ b/src/main/java/gtPlusPlus/preloader/asm/transformers/ClassTransformer_GT_Client.java @@ -383,23 +383,24 @@ public class ClassTransformer_GT_Client { * GT_Client's onPostLoad */ - public static void onPostLoad() { - try { - for (int i = 0; i < GregTech_API.METATILEENTITIES.length; i++) { - try { - if (GregTech_API.METATILEENTITIES[i] != null) { - GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip((EntityPlayer) null, true); - } - } - catch (Throwable t) { - GT_Log.err.println("Error in MetaTileEntity with ID of "+i); - t.printStackTrace(GT_Log.err); - } - } - } catch (Throwable var2) { - var2.printStackTrace(); - } - } + public static void onPostLoad() { + try { + for (int i = 0; i < GregTech_API.METATILEENTITIES.length; i++) { + try { + if (GregTech_API.METATILEENTITIES[i] != null) { + GregTech_API.METATILEENTITIES[i].getStackForm(1L).getTooltip((EntityPlayer) null, true); + } + } + catch (Throwable t) { + GT_Log.err.println("Error in MetaTileEntity with ID of " + i); + t.printStackTrace(GT_Log.err); + } + } + } + catch (Throwable var2) { + var2.printStackTrace(); + } + } diff --git a/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java b/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java new file mode 100644 index 0000000000..38f0d5a89b --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/advsolar/HANDLER_AdvSolar.java @@ -0,0 +1,16 @@ +package gtPlusPlus.xmod.advsolar; + +import advsolar.common.AdvancedSolarPanel; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.RecipeUtils; + +public class HANDLER_AdvSolar { + + public static void postInit() { + if (LoadedMods.AdvancedSolarPanel) { + RecipeUtils.removeRecipeByOutput(ItemUtils.getSimpleStack(AdvancedSolarPanel.blockMolecularTransformer)); + } + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/bartworks/BW_Utils.java b/src/main/java/gtPlusPlus/xmod/bartworks/BW_Utils.java new file mode 100644 index 0000000000..d3386a1608 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/bartworks/BW_Utils.java @@ -0,0 +1,55 @@ +package gtPlusPlus.xmod.bartworks; + +import java.lang.reflect.Method; +import java.util.ArrayList; + +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import net.minecraft.item.ItemStack; + +public class BW_Utils { + + private final static Method sName; + private final static Method sGet; + private static final Class sClassBW_NonMeta_MaterialItems; + + static { + sName = ReflectionUtils.getMethod(Enum.class, "name"); + sClassBW_NonMeta_MaterialItems = ReflectionUtils.getClass("com.github.bartimaeusnek.bartworks.system.material.BW_NonMeta_MaterialItems"); + sGet = ReflectionUtils.getMethod(sClassBW_NonMeta_MaterialItems, "get", long.class, Object[].class); + } + + public enum NonMeta_MaterialItem { + Depleted_Tiberium_1, + Depleted_Tiberium_2, + Depleted_Tiberium_4, + TiberiumCell_1, + TiberiumCell_2, + TiberiumCell_4, + TheCoreCell, + Depleted_TheCoreCell; + } + + public static ItemStack getBW_NonMeta_MaterialItems(NonMeta_MaterialItem aItem, long aAmount) { + if (sClassBW_NonMeta_MaterialItems != null && sClassBW_NonMeta_MaterialItems.isEnum()) { + for (Object obj : sClassBW_NonMeta_MaterialItems.getEnumConstants()) { + try { + if (aItem.name().equals(ReflectionUtils.invokeNonBool(obj, sName, new Object[] {}))) { + return ((ItemStack) ReflectionUtils.invokeNonBool(obj, sGet, new Object[] {aAmount, new Object[] {}})).copy(); + } + } catch (Throwable t) { + t.printStackTrace(); + } + } + } + return null; + } + + public static ArrayList<ItemStack> getAll(int aStackSize){ + ArrayList<ItemStack> aItems = new ArrayList<ItemStack>(); + aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_1, aStackSize)); + aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_2, aStackSize)); + aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TiberiumCell_4, aStackSize)); + aItems.add(getBW_NonMeta_MaterialItems(NonMeta_MaterialItem.TheCoreCell, aStackSize)); + return aItems; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/goodgenerator/GG_Utils.java b/src/main/java/gtPlusPlus/xmod/goodgenerator/GG_Utils.java new file mode 100644 index 0000000000..d501958fcd --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/goodgenerator/GG_Utils.java @@ -0,0 +1,55 @@ +package gtPlusPlus.xmod.goodgenerator; + +import java.lang.reflect.Field; +import java.util.ArrayList; + +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.reflect.ReflectionUtils; +import gtPlusPlus.xmod.bartworks.BW_Utils.NonMeta_MaterialItem; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class GG_Utils { + + private static final Class sClassFuelRodLoader; + private static final Field[] sClassFuelRodLoaderFields; + + static { + sClassFuelRodLoader = ReflectionUtils.getClass("goodgenerator.loader.FuelRodLoader"); + sClassFuelRodLoaderFields = ReflectionUtils.getAllFields(sClassFuelRodLoader); + } + + public enum GG_Fuel_Rod { + rodCompressedUranium, + rodCompressedUranium_2, + rodCompressedUranium_4, + rodCompressedPlutonium, + rodCompressedPlutonium_2, + rodCompressedPlutonium_4, + rodCompressedUraniumDepleted, + rodCompressedUraniumDepleted_2, + rodCompressedUraniumDepleted_4, + rodCompressedPlutoniumDepleted, + rodCompressedPlutoniumDepleted_2, + rodCompressedPlutoniumDepleted_4,; + } + + public static ItemStack getGG_Fuel_Rod(GG_Fuel_Rod aItem, int aAmount) { + if (sClassFuelRodLoader != null) { + return ItemUtils.getSimpleStack((Item) ReflectionUtils.getFieldValue(ReflectionUtils.getField(sClassFuelRodLoader, aItem.name())), aAmount); + } + return null; + } + + public static ArrayList<ItemStack> getAll(int aStackSize){ + ArrayList<ItemStack> aItems = new ArrayList<ItemStack>(); + aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium, aStackSize)); + aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_2, aStackSize)); + aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedUranium_4, aStackSize)); + aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium, aStackSize)); + aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_2, aStackSize)); + aItems.add(getGG_Fuel_Rod(GG_Fuel_Rod.rodCompressedPlutonium_4, aStackSize)); + return aItems; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java index a375f77cda..913b72fb0a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/HANDLER_GT.java @@ -9,17 +9,22 @@ import java.util.List; import cpw.mods.fml.common.event.FMLLoadCompleteEvent; import gregtech.api.GregTech_API; +import gregtech.api.enums.Element; import gregtech.api.enums.ItemList; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Config; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_ModHandler.RecipeBits; 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.GT_MetaGenerated_Tool_01; +import gregtech.common.items.behaviors.Behaviour_DataOrb; import gtPlusPlus.api.helpers.GregtechPlusPlus_API.Multiblock_API; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; @@ -32,6 +37,7 @@ import gtPlusPlus.core.handler.COMPAT_HANDLER; import gtPlusPlus.core.handler.OldCircuitHandler; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.CORE.ConfigSwitches; +import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.ELEMENT; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; @@ -48,7 +54,10 @@ import gtPlusPlus.xmod.gregtech.api.world.GTPP_Worldgen; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.StaticFields59; 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; import gtPlusPlus.xmod.gregtech.loaders.ProcessingAngleGrinder; import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricButcherKnife; @@ -57,11 +66,13 @@ import gtPlusPlus.xmod.gregtech.loaders.ProcessingElectricSnips; import gtPlusPlus.xmod.gregtech.loaders.ProcessingToolHeadChoocher; import gtPlusPlus.xmod.gregtech.loaders.misc.AddCustomMachineToPA; import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_AlgaeFarm; +import gtPlusPlus.xmod.gregtech.loaders.recipe.RecipeLoader_MolecularTransformer; import gtPlusPlus.xmod.gregtech.recipes.RecipesToRemove; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechConduits; import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechNitroDieselFix; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; public class HANDLER_GT { @@ -165,8 +176,14 @@ public class HANDLER_GT { } RecipesToRemove.go(); convertPyroToCokeOven(); + generateElementalDuplicatorRecipes(); Meta_GT_Proxy.fixIC2FluidNames(); + GT_Computercube_Description.addStandardDescriptions(); + GT_ComputerCube_Setup.init(); RecipeLoader_AlgaeFarm.generateRecipes(); + if (LoadedMods.AdvancedSolarPanel) { + RecipeLoader_MolecularTransformer.run(); + } } public static void addNewOrePrefixes() { @@ -176,6 +193,59 @@ public class HANDLER_GT { } } + + private static void generateElementalDuplicatorRecipes() { + for (GT_Recipe aRecipe : GT_Recipe_Map.sReplicatorFakeRecipes.mRecipeList) { + Object aDataOrb = aRecipe.mSpecialItems; + if (aDataOrb != null) { + ItemStack aOutput = aRecipe.mOutputs[0]; + if (aOutput != null) { + FluidStack aFluid = aRecipe.mFluidInputs[0]; + if (aFluid != null && aFluid.amount > 0) { + ItemStack tDataOrb = GregtechMTE_ElementalDuplicator.getSpecialSlotStack(aRecipe); + Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(tDataOrb)).mLinkedMaterials.get(0); + FluidStack aOutputFluid = null; + ItemStack aOutputItem = null; + if (tMaterial != null) { + boolean aUsingFluid = false; + if ((aOutputItem = GT_OreDictUnificator.get(OrePrefixes.dust, tMaterial, 1L)) == null) { + if ((aOutputItem = GT_OreDictUnificator.get(OrePrefixes.cell, tMaterial, 1L)) != null) { + aOutputFluid = GT_Utility.getFluidForFilledItem(aOutputItem, true); + aUsingFluid = true; + } + } + GTPP_Recipe aNewRecipe = new GTPP_Recipe( + false, + new ItemStack[] {}, + new ItemStack[] {!aUsingFluid ? aOutputItem : null}, + aRecipe.mSpecialItems, + null, + aRecipe.mFluidInputs, + new FluidStack[] {aUsingFluid ? aOutputFluid : null}, + aRecipe.mDuration, + aRecipe.mEUt, + aRecipe.mFluidInputs[0].amount); + GTPP_Recipe_Map.sElementalDuplicatorRecipes.add(aNewRecipe); + + Logger.INFO("[EM] Generated recipe for "+tMaterial.mLocalizedName+", Outputs "+(aUsingFluid ? "Fluid" : "Dust")); + } + } + else { + Logger.INFO("[EM] Bad UU Requirement. "+RecipeUtils.getRecipeInfo(aRecipe)); + } + } + else { + Logger.INFO("[EM] Bad Output. "+RecipeUtils.getRecipeInfo(aRecipe)); + } + } + else { + Logger.INFO("[EM] Bad Data Orb. "+RecipeUtils.getRecipeInfo(aRecipe)); + } + } + int aSize = GTPP_Recipe_Map.sElementalDuplicatorRecipes.mRecipeList.size(); + Logger.INFO("[EM] Generated "+aSize+"/"+GT_Recipe_Map.sReplicatorFakeRecipes.mRecipeList.size()+" Replicator recipes."); + } + private static void convertPyroToCokeOven() { if (ReflectionUtils.doesFieldExist(GT_Recipe.GT_Recipe_Map.class, "sPyrolyseRecipes")) { int aCount = 0; 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 a8ee2e24ad..7e81f1c514 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/enums/GregtechItemList.java @@ -105,6 +105,7 @@ public enum GregtechItemList implements GregtechItemContainer { //Computer Cube Gregtech_Computer_Cube, + Gregtech_Computer_Cube_Machine, //Casings for batteries Battery_Casing_Gem_1, Battery_Casing_Gem_2, @@ -301,7 +302,7 @@ public enum GregtechItemList implements GregtechItemContainer { //Tesla Tower - /*TelsaTower,*/ + TelsaTower, Casing_TeslaTower, @@ -334,7 +335,7 @@ public enum GregtechItemList implements GregtechItemContainer { Machine_Adv_DistillationTower, //Advanced Assembly Line - /*Machine_Adv_AssemblyLine,*/ + Machine_Adv_AssemblyLine, //Advanced Vacuum Freezer Industrial_Cryogenic_Freezer, @@ -363,13 +364,14 @@ public enum GregtechItemList implements GregtechItemContainer { Casing_Industrial_Arc_Furnace, //Solar Tower - /*Industrial_Solar_Tower,*/ + Industrial_Solar_Tower, Casing_SolarTower_Structural, Casing_SolarTower_SaltContainment, Casing_SolarTower_HeatContainment, //Larger Turbines - /*Large_Steam_Turbine, Large_HPSteam_Turbine, */ + Large_Steam_Turbine, Large_HPSteam_Turbine, + Large_Gas_Turbine, Large_Plasma_Turbine, Casing_Turbine_Shaft, Casing_Turbine_LP, Casing_Turbine_HP, Casing_Turbine_Gas, Casing_Turbine_Plasma, @@ -407,6 +409,16 @@ public enum GregtechItemList implements GregtechItemContainer { Controller_ElementalDuplicator, Casing_ElementalDuplicator, + // Forge Hammer + Controller_IndustrialForgeHammer, + Casing_IndustrialForgeHammer, + + // Molecular Transformer + Controller_MolecularTransformer, + Casing_Molecular_Transformer_1, + Casing_Molecular_Transformer_2, + Casing_Molecular_Transformer_3, + // Big Steam Macerator Controller_SteamMaceratorMulti, @@ -444,7 +456,7 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_Reservoir, //XL Turbine Rotor Hatch - /*Hatch_Turbine_Rotor,*/ + Hatch_Turbine_Rotor, //Standard Turbine Rotor Hatch Hatch_Input_TurbineHousing, @@ -500,12 +512,25 @@ public enum GregtechItemList implements GregtechItemContainer { Hatch_SuperBus_Output_MAX, - - //---------------------------------------------------------------------------- + /** + * Blocks + */ + + + ResonanceChamber_I, + ResonanceChamber_II, + ResonanceChamber_III, + ResonanceChamber_IV, + Modulator_I, + Modulator_II, + Modulator_III, + Modulator_IV, + + //---------------------------------------------------------------------------- /** @@ -528,10 +553,44 @@ public enum GregtechItemList implements GregtechItemContainer { //infinite Items Infinite_Item_Chest, + //GT4 Redstone + GT4_Redstone_Lamp, + GT4_Redstone_Button_Panel, + GT4_Redstone_Scale, + GT4_Redstone_Display, + GT4_Redstone_Circuit, //Gt4 Workbenches GT4_Workbench_Bronze, GT4_Workbench_Advanced, + + //GT4 automation + GT4_Electric_Auto_Workbench_LV, + GT4_Electric_Auto_Workbench_MV, + GT4_Electric_Auto_Workbench_HV, + GT4_Electric_Auto_Workbench_EV, + GT4_Electric_Auto_Workbench_IV, + GT4_Electric_Auto_Workbench_LuV, + GT4_Electric_Auto_Workbench_ZPM, + GT4_Electric_Auto_Workbench_UV, + GT4_Electric_Inventory_Manager_LV, + GT4_Electric_Inventory_Manager_MV, + GT4_Electric_Inventory_Manager_HV, + GT4_Electric_Inventory_Manager_EV, + GT4_Electric_Inventory_Manager_IV, + GT4_Electric_Inventory_Manager_LuV, + GT4_Electric_Inventory_Manager_ZPM, + GT4_Electric_Inventory_Manager_UV, + + //GT4 Crop Harvester + GT4_Crop_Harvester_LV, + GT4_Crop_Harvester_MV, + GT4_Crop_Harvester_HV, + GT4_Crop_Harvester_EV, + GT4_Crop_Harvester_IV, + GT4_Crop_Harvester_LuV, + GT4_Crop_Harvester_ZPM, + GT4_Crop_Harvester_UV, //Geothermal Engines @@ -573,7 +632,7 @@ public enum GregtechItemList implements GregtechItemContainer { SimpleDustWasher_UV, //Solar Tower Reflector - /*Solar_Tower_Reflector,*/ + Solar_Tower_Reflector, //Super Tier Chests Super_Chest_LV, Super_Chest_MV, Super_Chest_HV, Super_Chest_EV, Super_Chest_IV, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java new file mode 100644 index 0000000000..fe100955e0 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_DataHatch.java @@ -0,0 +1,82 @@ +package gtPlusPlus.xmod.gregtech.api.gui; + +import gregtech.api.enums.ItemList; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.slots.SlotIntegratedCircuit; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class CONTAINER_DataHatch extends GT_ContainerMetaTile_Machine { + + public CONTAINER_DataHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + @Override + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 0, 53, 8)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 1, 71, 8)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 2, 89, 8)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 3, 107, 8)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 4, 53, 26)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 5, 71, 26)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 6, 89, 26)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 7, 107, 26)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 8, 53, 44)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 9, 71, 44)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 10, 89, 44)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 11, 107, 44)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 12, 53, 62)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 13, 71, 62)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 14, 89, 62)); + addSlotToContainer(new GT_Slot_DataOrb(mTileEntity, 15, 107, 62)); + addSlotToContainer(new SlotIntegratedCircuit(mTileEntity, 16, 19, 35)); + + } + + @Override + public int getSlotCount() { + return 17; + } + + @Override + public int getShiftClickSlotCount() { + return 0; + } + + @Override + public void putStackInSlot(int par1, ItemStack par2ItemStack) { + /*Logger.INFO("Slot: "+par1); + if (par1 < 16 && ItemList.Tool_DataOrb.isStackEqual(par2ItemStack)) { + super.putStackInSlot(par1, par2ItemStack); + } + if (par1 == 16 && ItemUtils.isControlCircuit(par2ItemStack)) { + super.putStackInSlot(par1, par2ItemStack); + }*/ + super.putStackInSlot(par1, par2ItemStack); + } + + @Override + public boolean canDragIntoSlot(Slot par1Slot) { + return super.canDragIntoSlot(par1Slot); + } + + public class GT_Slot_DataOrb extends Slot { + public GT_Slot_DataOrb(IInventory par1iInventory, int par2, int par3, int par4) { + super(par1iInventory, par2, par3, par4); + } + + @Override + public boolean isItemValid(ItemStack aStack) { + return ItemList.Tool_DataOrb.isStackEqual(aStack, false, true); + } + } + + + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java index 937513751b..94cfa5236d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/CONTAINER_PowerSubStation.java @@ -1,34 +1,44 @@ package gtPlusPlus.xmod.gregtech.api.gui; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; - +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.gui.GT_Container_MultiMachine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; - import gtPlusPlus.core.slots.SlotNoInput; - +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.storage.GregtechMetaTileEntity_PowerSubStationController; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.*; public class CONTAINER_PowerSubStation extends GT_Container_MultiMachine { - + + public long mStoredEU; + public int mStoredEU1; + public int mStoredEU2; + public long mMaxStoredEU; + public int mMaxStoredEU1; + public int mMaxStoredEU2; + public long mAverageEuAdded; + public int mAverageEuAdded1; + public int mAverageEuAdded2; + public long mAverageEuConsumed; + public int mAverageEuConsumed1; + public int mAverageEuConsumed2; + public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); } - public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, - final boolean bindInventory) { + public CONTAINER_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final boolean bindInventory) { super(aInventoryPlayer, aTileEntity, bindInventory); } public void addSlots(final InventoryPlayer aInventoryPlayer) { this.addSlotToContainer(new Slot((IInventory) this.mTileEntity, 1, 155, 5)); this.addSlotToContainer(new SlotNoInput((IInventory) this.mTileEntity, 2, 155, 23)); - - for (int i = 0; i < 9; ++i) { - this.addSlotToContainer(new Slot((IInventory) aInventoryPlayer, i, 8 + i * 18, 167)); - } - + + for (int i = 0; i < 9; ++i) { this.addSlotToContainer(new Slot((IInventory) aInventoryPlayer, i, 8 + i * 18, 167)); } + } public int getSlotCount() { @@ -38,4 +48,78 @@ public class CONTAINER_PowerSubStation extends GT_Container_MultiMachine { public int getShiftClickSlotCount() { return 1; } -}
\ No newline at end of file + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + + mStoredEU = mTileEntity.getStoredEU(); + mMaxStoredEU = mTileEntity.getEUCapacity(); + GregtechMetaTileEntity_PowerSubStationController aPSS = (GregtechMetaTileEntity_PowerSubStationController) mTileEntity.getMetaTileEntity(); + mAverageEuAdded = aPSS.getAverageEuAdded(); + mAverageEuConsumed = aPSS.getAverageEuConsumed(); + int[] aStored = MathUtils.splitLongIntoTwoIntegers(mStoredEU); + int[] aMaxStorage = MathUtils.splitLongIntoTwoIntegers(mMaxStoredEU); + int[] aAvgIn = MathUtils.splitLongIntoTwoIntegers(mAverageEuAdded); + int[] aAvgOut = MathUtils.splitLongIntoTwoIntegers(mAverageEuConsumed); + mStoredEU1 = aStored[0]; + mStoredEU2 = aStored[1]; + mMaxStoredEU1 = aMaxStorage[0]; + mMaxStoredEU2 = aMaxStorage[1]; + mAverageEuAdded1 = aAvgIn[0]; + mAverageEuAdded2 = aAvgIn[1]; + mAverageEuConsumed1 = aAvgOut[0]; + mAverageEuConsumed2 = aAvgOut[1]; + + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; + if (mTimer % 20 == 0) { + var1.sendProgressBarUpdate(this, 21, mStoredEU1); + var1.sendProgressBarUpdate(this, 22, mStoredEU2); + var1.sendProgressBarUpdate(this, 23, mMaxStoredEU1); + var1.sendProgressBarUpdate(this, 24, mMaxStoredEU2); + var1.sendProgressBarUpdate(this, 25, mAverageEuAdded1); + var1.sendProgressBarUpdate(this, 26, mAverageEuAdded2); + var1.sendProgressBarUpdate(this, 27, mAverageEuConsumed1); + var1.sendProgressBarUpdate(this, 28, mAverageEuConsumed2); + } + } + + } + + @SideOnly(Side.CLIENT) + @Override + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 21 : + mStoredEU1 = par2; + break; + case 22 : + mStoredEU2 = par2; + mStoredEU = MathUtils.combineTwoIntegersToLong(mStoredEU1, mStoredEU2); + break; + case 23 : + mMaxStoredEU1 = par2; + break; + case 24 : + mMaxStoredEU2 = par2; + mMaxStoredEU = MathUtils.combineTwoIntegersToLong(mMaxStoredEU1, mMaxStoredEU2); + break; + case 25 : + mAverageEuAdded1 = par2; + break; + case 26 : + mAverageEuAdded2 = par2; + mAverageEuAdded = MathUtils.combineTwoIntegersToLong(mAverageEuAdded1, mAverageEuAdded2); + break; + case 27 : + mAverageEuConsumed1 = par2; + break; + case 28 : + mAverageEuConsumed2 = par2; + mAverageEuConsumed = MathUtils.combineTwoIntegersToLong(mAverageEuConsumed1, mAverageEuConsumed2); + break; + } + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java new file mode 100644 index 0000000000..77cb0d71a2 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_DataHatch.java @@ -0,0 +1,41 @@ +package gtPlusPlus.xmod.gregtech.api.gui; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import net.minecraft.entity.player.InventoryPlayer; + +import static gregtech.api.enums.GT_Values.RES_PATH_GUI; + +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; + +public class GUI_DataHatch extends GT_GUIContainerMetaTile_Machine { + + private final String mName; + + public GUI_DataHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName) { + super(new CONTAINER_DataHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + "HatchDataOrb.png"); + mName = aName; + } + + public GUI_DataHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aName, String aBackground) { + super(new CONTAINER_DataHatch(aInventoryPlayer, aTileEntity), RES_PATH_GUI + aBackground + "HatchDataOrb.png"); + mName = aName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + fontRendererObj.drawString(mName, 8, 4, 4210752); + /*String[] aName = mName.trim().split("\\s+"); + int aY = 4; + for (String s : aName) { + fontRendererObj.drawString(s, 120, (aY += 12), 4210752); + }*/ + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java index c78e7789b8..61cf59f6c9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_MultiMachine.java @@ -112,18 +112,32 @@ public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine { mInfo.add(StatCollector.translateToLocal("GTPP.machines.output")+" "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ EnumChatFormatting.GREEN +GT_Values.VOLTAGE_NAMES[aOutputTier]); } + + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+ EnumChatFormatting.GREEN + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mProgressTime/20) + EnumChatFormatting.RESET +" s / "+ EnumChatFormatting.YELLOW + Integer.toString(((CONTAINER_MultiMachine) this.mContainer).mMaxProgressTime/20) + EnumChatFormatting.RESET +" s"); - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+": "+ - EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" "+EU+" / "+ - EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" "+EU+""); + + + + + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+":"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Long.toString(aStoredEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(aMaxEnergy) + EnumChatFormatting.RESET +" EU")); if (aRecipeEU != 0 && aRecipeDuration > 0) { - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+": "+ - EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " "+EU+"/t"); + if (aRecipeEU > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+":"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.RED + Integer.toString(-aRecipeEU) + EnumChatFormatting.RESET + " EU/t/parallel")); + } + else { + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.generation")+":"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Integer.toString(aRecipeEU) + EnumChatFormatting.RESET + " EU/t/parallel")); + } mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.duration")+": "+ EnumChatFormatting.RED + Integer.toString(aRecipeDuration) + EnumChatFormatting.RESET + " ticks"); if (aRecipeSpecial > 0) { @@ -132,18 +146,16 @@ public class GUI_MultiMachine extends GT_GUIContainerMetaTile_Machine { } } - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+": "+ - EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " "+EU+"/t"+EnumChatFormatting.RESET); - - mInfo.add(StatCollector.translateToLocal(StatCollector.translateToLocal("GTPP.machines.tier")+": "+ - EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET)); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+":"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.YELLOW+Long.toString(aMaxInputVoltage)+EnumChatFormatting.RESET+ " EU/t(*2A) "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ + EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(aMaxInputVoltage)]+ EnumChatFormatting.RESET)); mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ EnumChatFormatting.YELLOW+Float.toString(aEfficiency / 100.0F)+EnumChatFormatting.RESET + " %"); mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + (aPollutionTick*20)+ EnumChatFormatting.RESET+"/sec"); mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + aPollutionReduction + EnumChatFormatting.RESET+" %"); - mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET); + //mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(aMaxParallel)+EnumChatFormatting.RESET); mInfo.add("Total Time Since Built: "); mInfo.add("" + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks,"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java index 65ba8610dd..f8aaa1792d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/GUI_PowerSubStation.java @@ -1,175 +1,126 @@ package gtPlusPlus.xmod.gregtech.api.gui; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; - -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.items.GT_MetaGenerated_Tool; - +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.IIcon; - -import gregtech.api.enums.Textures; -import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; public class GUI_PowerSubStation extends GT_GUIContainerMetaTile_Machine { public String mNEI; String mName; boolean[] mRepairStatus = new boolean[6]; - private static IIcon[] mGregToolIcons = new IIcon[6]; + + public final CONTAINER_PowerSubStation mPowerContainer; public GUI_PowerSubStation(final InventoryPlayer aInventoryPlayer, final IGregTechTileEntity aTileEntity, final String aName, final String aNEI) { super(new CONTAINER_PowerSubStation(aInventoryPlayer, aTileEntity, false), CORE.RES_PATH_GUI + "PowerSubStation.png"); this.mName = aName; this.mNEI = aNEI; + mPowerContainer = (CONTAINER_PowerSubStation) mContainer; /** The X size of the inventory window in pixels. */ this.xSize = 196; /** The Y size of the inventory window in pixels. */ this.ySize = 191; - for (IIcon g : mGregToolIcons) { - if (g == null) { - getToolTextures(); - } - } - } - - private static final boolean getToolTextures() { - mGregToolIcons[0] = Textures.ItemIcons.WRENCH.getIcon(); - mGregToolIcons[1] = Textures.ItemIcons.HANDLE_SCREWDRIVER.getIcon(); - mGregToolIcons[2] = Textures.ItemIcons.MORTAR.getIcon(); - mGregToolIcons[3] = Textures.ItemIcons.JACKHAMMER.getIcon(); - mGregToolIcons[4] = Textures.ItemIcons.HANDLE_SOLDERING.getIcon(); - mGregToolIcons[5] = Textures.ItemIcons.CROWBAR.getIcon(); - return true; } protected void drawGuiContainerForegroundLayer(final int par1, final int par2) { this.fontRendererObj.drawString(this.mName, 8, -10, 16448255); - if (this.mContainer != null) { + if (this.mPowerContainer != null) { + + //this.fontRendererObj.drawString("Error Code: " + mPowerContainer.mDisplayErrorCode, 10, 142, 16448255); - this.fontRendererObj.drawString("Error Code: "+((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode, 10, 142, 16448255); - this.fontRendererObj.drawString("In", 178, 10, 16448255); - this.fontRendererObj.drawString("Out", 176, 28, 16448255); - if (((this.mContainer).mDisplayErrorCode & 1) != 0) { - this.fontRendererObj.drawString("Pipe is loose.", 10, 8, 16448255); mRepairStatus[0] = false; } else { mRepairStatus[0] = true; - } - if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 2) != 0) { - this.fontRendererObj.drawString("Screws are missing.", 10, 16, 16448255); + } + if ((mPowerContainer.mDisplayErrorCode & 2) != 0) { mRepairStatus[1] = false; } else { mRepairStatus[1] = true; - } - if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 4) != 0) { - this.fontRendererObj.drawString("Something is stuck.", 10, 24, 16448255); + } + if ((mPowerContainer.mDisplayErrorCode & 4) != 0) { mRepairStatus[2] = false; } else { mRepairStatus[2] = true; - } - if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 8) != 0) { - this.fontRendererObj.drawString("Platings are dented.", 10, 32, 16448255); + } + if ((mPowerContainer.mDisplayErrorCode & 8) != 0) { mRepairStatus[3] = false; } else { mRepairStatus[3] = true; - } - if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 16) != 0) { - this.fontRendererObj.drawString("Circuitry burned out.", 10, 40, 16448255); + } + if ((mPowerContainer.mDisplayErrorCode & 16) != 0) { mRepairStatus[4] = false; } else { mRepairStatus[4] = true; - } - if ((((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode & 32) != 0) { - this.fontRendererObj.drawString("That doesn't belong there.", 10, 48, 16448255); + } + if ((mPowerContainer.mDisplayErrorCode & 32) != 0) { mRepairStatus[5] = false; } else { mRepairStatus[5] = true; - } - if (((CONTAINER_PowerSubStation) this.mContainer).mDisplayErrorCode == 0) { - if (((CONTAINER_PowerSubStation) this.mContainer).mActive == 0) { - this.fontRendererObj.drawString( - "Hit with Soft Hammer to (re-)start the Machine if it doesn't start.", -70, 8, 16448255); - } else { - this.fontRendererObj.drawString("Running perfectly.", 10, 8, 16448255); - } - } - if (this.mContainer.mEnergy > 160000000 && this.mContainer.mEnergy < 160010000) { - this.fontRendererObj.drawString("160,000,000 EU", 50, 155, 16711680); - } else if (this.mContainer.mEnergy > 320000000 && this.mContainer.mEnergy < 320010000) { - this.fontRendererObj.drawString("320,000,000 EU", 50, 155, 16711680); - } else if (this.mContainer.mEnergy > 640000000 && this.mContainer.mEnergy < 640010000) { - this.fontRendererObj.drawString("640,000,000 EU", 50, 155, 16711680); - } else { - this.fontRendererObj.drawString(GT_Utility.formatNumbers((long) this.mContainer.mEnergy) + " EU", - 50, 155, 16711680); } + if (mPowerContainer.mDisplayErrorCode == 0) { + if (mPowerContainer.mActive == 0) { + this.fontRendererObj.drawString("Turn on with Mallet", 10, 8, 16448255); + } + else { + this.fontRendererObj.drawString("Running perfectly", 10, 8, 16448255); + } + } + + this.fontRendererObj.drawString("In", 178, 10, 16448255); + this.fontRendererObj.drawString("Out", 176, 28, 16448255); + this.fontRendererObj.drawString("Avg In: "+GT_Utility.formatNumbers(this.mPowerContainer.mAverageEuAdded)+" EU", 10, 20, 16448255); + this.fontRendererObj.drawString("Avg Out: "+GT_Utility.formatNumbers(this.mPowerContainer.mAverageEuConsumed)+" EU", 10, 30, 16448255); + + final double tScale2 = MathUtils.findPercentage(this.mPowerContainer.mStoredEU, this.mPowerContainer.mMaxStoredEU); + final int tScale = (int) (tScale2 * 2.55); + this.fontRendererObj.drawString("Stored:", 10, 132, 16448255); + this.fontRendererObj.drawString(GT_Utility.formatNumbers(this.mPowerContainer.mStoredEU) + " EU", 10, 142, Utils.rgbtoHexValue((255 - tScale), (0 + tScale), 0)); + this.fontRendererObj.drawString(GT_Utility.formatNumbers(tScale2)+"%", 70, 155, 16448255); + } } - protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) { + protected void drawGuiContainerBackgroundLayer(final float par1, final int par2, final int par3) { /** The X size of the inventory window in pixels. */ if (this.xSize != 196) this.xSize = 196; /** The Y size of the inventory window in pixels. */ if (this.ySize != 191) - this.ySize = 191; - super.drawGuiContainerBackgroundLayer(par1, par2, par3); + this.ySize = 191; + super.drawGuiContainerBackgroundLayer(par1, par2, par3); final int x = (this.width - this.xSize) / 2; final int y = (this.height - this.ySize) / 2; this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - if (this.mContainer != null) { - final double tScale = this.mContainer.mEnergy / this.mContainer.mStorage; + if (this.mPowerContainer != null) { + final double tScale = MathUtils.findPercentage(this.mPowerContainer.mStoredEU, this.mPowerContainer.mMaxStoredEU) / 100; this.drawTexturedModalRect(x + 5, y + 156, 0, 251, Math.min(147, (int) (tScale * 148.0)), 5); - - //A1 + // A1 this.drawTexturedModalRect(x + 154, y + 76, 238, (!mRepairStatus[0] ? 0 : 18), 18, 18); - //A2 + // A2 this.drawTexturedModalRect(x + 154 + 20, y + 76, 238, (!mRepairStatus[1] ? 0 : 18), 18, 18); - //B1 + // B1 this.drawTexturedModalRect(x + 154, y + 76 + 18, 238, (!mRepairStatus[2] ? 0 : 18), 18, 18); - //B2 + // B2 this.drawTexturedModalRect(x + 154 + 20, y + 76 + 18, 238, (!mRepairStatus[3] ? 0 : 18), 18, 18); - //C1 + // C1 this.drawTexturedModalRect(x + 154, y + 76 + 36, 238, (!mRepairStatus[4] ? 0 : 18), 18, 18); - //C2 + // C2 this.drawTexturedModalRect(x + 154 + 20, y + 76 + 36, 238, (!mRepairStatus[5] ? 0 : 18), 18, 18); - if (mGregToolIcons[0] != null) { - //this.drawTexturedModelRectFromIcon(x + 154, y + 76, mGregToolIcons[0], 18, 18); - } - if (mGregToolIcons[1] != null) { - //this.drawTexturedModelRectFromIcon(x + 154 + 20, y + 76, mGregToolIcons[1], 18, 18); - } - if (mGregToolIcons[2] != null) { - //this.drawTexturedModelRectFromIcon(x + 154, y + 76 + 18, mGregToolIcons[2], 9, 9); - } - if (mGregToolIcons[3] != null) { - //this.drawTexturedModelRectFromIcon(x + 154 + 20, y + 76 + 18, mGregToolIcons[3], 9, 9); - } - if (mGregToolIcons[4] != null) { - //this.drawTexturedModelRectFromIcon(x + 154, y + 76 + 36, mGregToolIcons[4], 9, 9); - } - if (mGregToolIcons[5] != null) { - //this.drawTexturedModelRectFromIcon(x + 154 + 20, y + 76 + 36, mGregToolIcons[5], 9, 9); - } - - /*//Maint Done - this.drawTexturedModalRect(x + 154, y + 76, 238, 0, 18, 18); - //Maint Required - this.drawTexturedModalRect(x + 154 + 20, y + 76, 238, 18, 18, 18);*/ - } } -}
\ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java new file mode 100644 index 0000000000..1af597c05a --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricAutoWorkbench.java @@ -0,0 +1,141 @@ +package gtPlusPlus.xmod.gregtech.api.gui.automation; + +import com.google.gson.JsonObject; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.gui.GT_Slot_Output; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_ElectricAutoWorkbench; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_CropHarvestor; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Container_ElectricAutoWorkbench extends GT_ContainerMetaTile_Machine { + + public int mMode; + public int mThroughPut; + + public GT_Container_ElectricAutoWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 8, 5)); + addSlotToContainer(new Slot(mTileEntity, 1, 26, 5)); + addSlotToContainer(new Slot(mTileEntity, 2, 44, 5)); + addSlotToContainer(new Slot(mTileEntity, 3, 8, 23)); + addSlotToContainer(new Slot(mTileEntity, 4, 26, 23)); + addSlotToContainer(new Slot(mTileEntity, 5, 44, 23)); + addSlotToContainer(new Slot(mTileEntity, 6, 8, 41)); + addSlotToContainer(new Slot(mTileEntity, 7, 26, 41)); + addSlotToContainer(new Slot(mTileEntity, 8, 44, 41)); + + addSlotToContainer(new GT_Slot_Output(mTileEntity, 9, 8, 60)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 10, 26, 60)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 11, 44, 60)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 12, 62, 60)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 13, 80, 60)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 14, 98, 60)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 15, 116, 60)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 16, 134, 60)); + addSlotToContainer(new GT_Slot_Output(mTileEntity, 17, 152, 60)); + + addSlotToContainer(new GT_Slot_Output(mTileEntity, 18, 152, 41)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 19, 64, 6, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 20, 81, 6, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 21, 98, 6, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 22, 64, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 23, 81, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 24, 98, 23, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 25, 64, 40, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 26, 81, 40, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 27, 98, 40, false, false, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 28, 152, 5, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 29, 121, 41, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 29, 121, 5, false, false, 1)); + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex < 18) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + + Slot tSlot = (Slot)inventorySlots.get(aSlotIndex); + if (tSlot != null) { + if (mTileEntity.getMetaTileEntity() == null) return null; + if (aSlotIndex > 18 && aSlotIndex < 28) { + ItemStack tStack = aPlayer.inventory.getItemStack(); + if (tStack != null) { + tStack = GT_Utility.copy(1, tStack); + } + tSlot.putStack(tStack); + return null; + } + if (aSlotIndex == 28) return null; + if (aSlotIndex == 29) { + if (aMouseclick == 0) { + ((GT_MetaTileEntity_ElectricAutoWorkbench)mTileEntity.getMetaTileEntity()).switchModeForward(); + } else { + ((GT_MetaTileEntity_ElectricAutoWorkbench)mTileEntity.getMetaTileEntity()).switchModeBackward(); + } + return null; + } + if (aSlotIndex == 30) { + ((GT_MetaTileEntity_ElectricAutoWorkbench)mTileEntity.getMetaTileEntity()).switchThrough(); + return null; + } + } + + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + public int getSlotCount() { + return 19; + } + + public int getShiftClickSlotCount() { + return 9; + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { + return; + } + mMode = ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).mMode; + mThroughPut = ((GT_MetaTileEntity_ElectricAutoWorkbench) mTileEntity.getMetaTileEntity()).mThroughPut; + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; + var1.sendProgressBarUpdate(this, 103, this.mMode); + var1.sendProgressBarUpdate(this, 104, this.mThroughPut); + } + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 103: + this.mMode = par2; + break; + case 104: + this.mThroughPut = par2; + break; + } + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java new file mode 100644 index 0000000000..3e8f509dfd --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_Container_ElectricInventoryManager.java @@ -0,0 +1,267 @@ +package gtPlusPlus.xmod.gregtech.api.gui.automation; + +import java.util.Iterator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_ElectricInventoryManager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class GT_Container_ElectricInventoryManager extends GT_ContainerMetaTile_Machine { + + public int[] mTargetDirections = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + public int[] mRangeDirections = new int[]{0, 0, 0, 0}; + public int mTargetInOut; + public int mTargetEnergy; + + public GT_Container_ElectricInventoryManager(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 155, 5)); + addSlotToContainer(new Slot(mTileEntity, 1, 155, 23)); + addSlotToContainer(new Slot(mTileEntity, 2, 155, 41)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 3, 5, 5, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 4, 5, 23, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 5, 5, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 6, 61, 5, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 7, 61, 23, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 8, 61, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 9, 80, 5, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 10, 80, 23, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 11, 80, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 12, 136, 5, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 13, 136, 23, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 14, 136, 41, false, true, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 5, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 23, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 5, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 23, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 5, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 23, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 41, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 5, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 23, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 41, false, true, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 24, 60, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 42, 60, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 99, 60, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 117, 60, false, true, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 5, 60, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 61, 60, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 80, 60, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 15, 136, 60, false, true, 1)); + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex < 3 || aSlotIndex >= getAllSlotCount()) + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); + if (tSlot != null) { + if (mTileEntity.getMetaTileEntity() == null) + return null; + if (aSlotIndex < 15) { + ItemStack tStack = aPlayer.inventory.getItemStack(); + if (tStack != null) { + tStack = GT_Utility.copy(tStack); + if (aMouseclick != 0) { + tStack.setItemDamage(OreDictionary.WILDCARD_VALUE); + } + tSlot.putStack(tStack); + } + else { + if (tSlot.getStack() != null) { + if (aMouseclick == 0) { + tSlot.getStack().stackSize -= (aShifthold == 1 ? 8 : 1); + if (tSlot.getStack().stackSize <= 0) { + tSlot.putStack(null); + } + } + else { + tSlot.getStack().stackSize += (aShifthold == 1 ? 8 : 1); + if (tSlot.getStack().stackSize > tSlot.getStack().getMaxStackSize()) { + tSlot.getStack().stackSize = tSlot.getStack().getMaxStackSize(); + } + } + } + } + return null; + } + else if (aSlotIndex >= 27 && aSlotIndex <= 30) { + ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).iterateRangeDirection(aSlotIndex - 27); + } + else if (aSlotIndex >= 31 && aSlotIndex <= 34) { + ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).switchRangeEnergy(aSlotIndex - 31); + } + else if (aSlotIndex % 3 == 0) { + if (aMouseclick != 0) + ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).switchSlot1InOut((aSlotIndex - 15) / 3); + else + ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).iterateSlot1Direction((aSlotIndex - 15) / 3); + } + else if (aSlotIndex % 3 == 1) { + if (aMouseclick != 0) + ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).switchSlot2InOut((aSlotIndex - 16) / 3); + else + ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).iterateSlot2Direction((aSlotIndex - 16) / 3); + } + else if (aSlotIndex % 3 == 2) { + if (aMouseclick != 0) + ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).switchSlot3InOut((aSlotIndex - 17) / 3); + else + ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).iterateSlot3Direction((aSlotIndex - 17) / 3); + } + } + return null; + } + + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { + return; + } + mTargetDirections = new int[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + mRangeDirections = new int[]{0, 0, 0, 0}; + + mRangeDirections[0] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(0); + mRangeDirections[1] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(1); + mRangeDirections[2] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(2); + mRangeDirections[3] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeDirection(3); + + mTargetDirections[0] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(0); + mTargetDirections[1] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(0); + mTargetDirections[2] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(0); + mTargetDirections[3] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(1); + mTargetDirections[4] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(1); + mTargetDirections[5] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(1); + mTargetDirections[6] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(2); + mTargetDirections[7] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(2); + mTargetDirections[8] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(2); + mTargetDirections[9] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1Direction(3); + mTargetDirections[10] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2Direction(3); + mTargetDirections[11] = ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3Direction(3); + + mTargetInOut = 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(0) ? 1 << 0 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(0) ? 1 << 1 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(0) ? 1 << 2 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(1) ? 1 << 3 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(1) ? 1 << 4 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(1) ? 1 << 5 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(2) ? 1 << 6 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(2) ? 1 << 7 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(2) ? 1 << 8 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot1InOut(3) ? 1 << 9 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot2InOut(3) ? 1 << 10 : 0; + mTargetInOut |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getSlot3InOut(3) ? 1 << 11 : 0; + + mTargetEnergy = 0; + mTargetEnergy |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(0) ? 1 << 0 : 0; + mTargetEnergy |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(1) ? 1 << 1 : 0; + mTargetEnergy |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(2) ? 1 << 2 : 0; + mTargetEnergy |= ((GT_MetaTileEntity_ElectricInventoryManager) mTileEntity.getMetaTileEntity()).getRangeEnergy(3) ? 1 << 3 : 0; + + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting) var2.next(); + for (int i = 0; i < 12; i++) + var1.sendProgressBarUpdate(this, 100 + i, mTargetDirections[i]); + var1.sendProgressBarUpdate(this, 113, mTargetInOut); + var1.sendProgressBarUpdate(this, 114, mTargetEnergy); + for (int i = 0; i < 4; i++) + var1.sendProgressBarUpdate(this, 115 + i, mRangeDirections[i]); + } + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100 : + mTargetDirections[0] = par2; + break; + case 101 : + mTargetDirections[1] = par2; + break; + case 102 : + mTargetDirections[2] = par2; + break; + case 103 : + mTargetDirections[3] = par2; + break; + case 104 : + mTargetDirections[4] = par2; + break; + case 105 : + mTargetDirections[5] = par2; + break; + case 106 : + mTargetDirections[6] = par2; + break; + case 107 : + mTargetDirections[7] = par2; + break; + case 108 : + mTargetDirections[8] = par2; + break; + case 109 : + mTargetDirections[9] = par2; + break; + case 110 : + mTargetDirections[10] = par2; + break; + case 111 : + mTargetDirections[11] = par2; + break; + + case 113 : + mTargetInOut = par2; + break; + case 114 : + mTargetEnergy = par2; + break; + case 115 : + mRangeDirections[0] = par2; + break; + case 116 : + mRangeDirections[1] = par2; + break; + case 117 : + mRangeDirections[2] = par2; + break; + case 118 : + mRangeDirections[3] = par2; + break; + } + } + + public int getSlotCount() { + return 3; + } + + public int getShiftClickSlotCount() { + return 3; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java new file mode 100644 index 0000000000..90f8380d14 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricAutoWorkbench.java @@ -0,0 +1,62 @@ +package gtPlusPlus.xmod.gregtech.api.gui.automation; + +import java.util.ArrayList; +import java.util.List; + +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.gui.basic.GT_Container_CropHarvestor; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_ElectricAutoWorkbench extends GT_GUIContainerMetaTile_Machine { + + private static final String[] mModeText = new String[] {"Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", "???", "Hammer?", "Circle"}; + + public GT_GUIContainer_ElectricAutoWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new GT_Container_ElectricAutoWorkbench(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "ElectricAutoWorkbench.png"); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + drawTooltip(par1, par2); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + + if (mContainer != null) { + int tMode = ((GT_Container_ElectricAutoWorkbench)mContainer).mMode; + if (tMode != 0) drawTexturedModalRect(x + 120, y + 40, tMode*18, 166, 18, 18); + tMode = ((GT_Container_ElectricAutoWorkbench)mContainer).mThroughPut; + drawTexturedModalRect(x + 120, y + 4, tMode*18, 184, 18, 18); + } + } + + private void drawTooltip(final int x2, final int y2) { + final int xStart = (this.width - this.xSize) / 2; + final int yStart = (this.height - this.ySize) / 2; + final int x3 = x2 - xStart; + final int y3 = y2 - yStart + 5; + List<String> list = new ArrayList<>(); + String[] mModeText = new String[] {"Normal Crafting Table", "???", "1x1", "2x2", "3x3", "Unifier", "Dust", "???", "Hammer?", "Circle"}; + if (y3 >= 45 && y3 <= 62) { + if (x3 >= 120 && x3 <= 137) { + list.add("Mode: "+mModeText[((GT_Container_ElectricAutoWorkbench) mContainer).mMode]); + /*switch (((GT_Container_ElectricAutoWorkbench) mContainer).mMode) { + case 0: + list.add("Mode: "); + }*/ + } + } + if (!list.isEmpty()) { + drawHoveringText(list, x3, y3, fontRendererObj); + RenderHelper.enableGUIStandardItemLighting(); + } + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java new file mode 100644 index 0000000000..cf57d3faf1 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/automation/GT_GUIContainer_ElectricInventoryManager.java @@ -0,0 +1,58 @@ +package gtPlusPlus.xmod.gregtech.api.gui.automation; + +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_ElectricInventoryManager extends GT_GUIContainerMetaTile_Machine { + + public GT_GUIContainer_ElectricInventoryManager(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new GT_Container_ElectricInventoryManager(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "InventoryManager.png"); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + + if (mContainer != null) { + drawTexturedModalRect(x + 4, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[0]*18, 202, 18, 54); + drawTexturedModalRect(x + 60, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[1]*18, 202, 18, 54); + drawTexturedModalRect(x + 79, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[2]*18, 202, 18, 54); + drawTexturedModalRect(x + 135, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[3]*18, 202, 18, 54); + + drawTexturedModalRect(x + 23, y + 59, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[0]*18+126, 166, 18, 18); + drawTexturedModalRect(x + 41, y + 59, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[1]*18+126, 166, 18, 18); + drawTexturedModalRect(x + 98, y + 59, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[2]*18+126, 166, 18, 18); + drawTexturedModalRect(x + 116, y + 59, ((GT_Container_ElectricInventoryManager)mContainer).mRangeDirections[3]*18+126, 166, 18, 18); + + drawTexturedModalRect(x + 4, y + 59, 108, (((GT_Container_ElectricInventoryManager)mContainer).mTargetEnergy & 1)!=0?184:166, 18, 18); + drawTexturedModalRect(x + 60, y + 59, 108, (((GT_Container_ElectricInventoryManager)mContainer).mTargetEnergy & 2)!=0?184:166, 18, 18); + drawTexturedModalRect(x + 79, y + 59, 108, (((GT_Container_ElectricInventoryManager)mContainer).mTargetEnergy & 4)!=0?184:166, 18, 18); + drawTexturedModalRect(x + 135, y + 59, 108, (((GT_Container_ElectricInventoryManager)mContainer).mTargetEnergy & 8)!=0?184:166, 18, 18); + + int i = -1; + + drawTexturedModalRect(x + 23, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 23, y + 22, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 23, y + 40, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 41, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 41, y + 22, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 41, y + 40, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 98, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 98, y + 22, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 98, y + 40, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 116, y + 4, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 116, y + 22, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + drawTexturedModalRect(x + 116, y + 40, ((GT_Container_ElectricInventoryManager)mContainer).mTargetDirections[++i]*18, (((GT_Container_ElectricInventoryManager)mContainer).mTargetInOut&(1<<i))!=0?184:166, 18, 18); + } + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java new file mode 100644 index 0000000000..9bca97de82 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_Container_CropHarvestor.java @@ -0,0 +1,187 @@ +package gtPlusPlus.xmod.gregtech.api.gui.basic; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.core.slots.SlotNoInput; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_CropHarvestor; +import ic2.core.item.ItemIC2; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Container_CropHarvestor extends GT_ContainerMetaTile_Machine { + + public boolean mModeAlternative = false; + public int mWaterAmount = 0; + public int mWaterRealAmount = 0; + + public GT_Container_CropHarvestor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + + + int aSlot = 1; + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 48, 64, false, true, 1)); + addSlotToContainer(new SlotWeedEx(mTileEntity, aSlot++, 8, 14)); + addSlotToContainer(new SlotWeedEx(mTileEntity, aSlot++, 26, 14)); + addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 8, 32)); + addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 26, 32)); + addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 8, 50)); + addSlotToContainer(new SlotFertilizer(mTileEntity, aSlot++, 26, 50)); + + + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 7)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 7)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 7)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 7)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 7)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 7)); + + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 25)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 25)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 25)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 25)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 25)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 25)); + + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 61, 43)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 79, 43)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 97, 43)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 115, 43)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 133, 43)); + addSlotToContainer(new SlotNoInput(mTileEntity, aSlot++, 151, 43)); + + + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + + GT_MetaTileEntity_CropHarvestor machine = (GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity(); + + if (aSlotIndex == 0) { + machine.mModeAlternative = !machine.mModeAlternative; + return null; + } + + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + @Override + public int getSlotCount() { + return 24; + } + + @Override + public int getSlotStartIndex() { + return 1; + } + + @Override + public int getShiftClickSlotCount() { + return 6; + } + + @Override + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { + return; + } + + // GT_MetaTileEntity_Boiler.getCapacity() is used for both water and steam capacity. + int capacity = ((GT_MetaTileEntity_CropHarvestor) this.mTileEntity.getMetaTileEntity()).getCapacity(); + + mModeAlternative = ((GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity()).mModeAlternative; + mWaterRealAmount = ((GT_MetaTileEntity_CropHarvestor) mTileEntity.getMetaTileEntity()).getFluidAmount(); + this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterRealAmount * 54 / (capacity - 100))); + for (Object crafter : this.crafters) { + ICrafting var1 = (ICrafting) crafter; + var1.sendProgressBarUpdate(this, 102, mModeAlternative ? 1 : 0); + var1.sendProgressBarUpdate(this, 103, this.mWaterAmount); + var1.sendProgressBarUpdate(this, 104, this.mWaterRealAmount); + } + } + + @Override + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + + @Override + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 102: + mModeAlternative = (par2 != 0); + break; + case 103: + this.mWaterAmount = par2; + break; + case 104: + this.mWaterRealAmount = par2; + break; + } + } + + public static class SlotWeedEx extends Slot { + + public SlotWeedEx(final IInventory inventory, final int slot, final int x, final int y) { + super(inventory, slot, x, y); + + } + + @Override + public synchronized boolean isItemValid(final ItemStack itemstack) { + return isWeedEx(itemstack); + } + + @Override + public int getSlotStackLimit() { + return 1; + } + + private static boolean isWeedEx(ItemStack aStack) { + if (aStack != null && aStack.getItem() instanceof ItemIC2) { + if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) { + return true; + } + } + return false; + } + } + + public class SlotFertilizer extends Slot { + + public SlotFertilizer(final IInventory inventory, final int slot, final int x, final int y) { + super(inventory, slot, x, y); + + } + + @Override + public synchronized boolean isItemValid(final ItemStack aStack) { + if (aStack != null && aStack.getItem() instanceof ItemIC2) { + if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) { + return true; + } + } + return false; + } + + @Override + public int getSlotStackLimit() { + return 64; + } + + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java new file mode 100644 index 0000000000..504ae61b4a --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GT_GUIContainer_CropHarvestor.java @@ -0,0 +1,75 @@ +package gtPlusPlus.xmod.gregtech.api.gui.basic; + +import java.util.ArrayList; +import java.util.List; + +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.common.gui.GT_Container_Boiler; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_CropHarvestor extends GT_GUIContainerMetaTile_Machine { + + private final String mLocalName; + + public GT_GUIContainer_CropHarvestor(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) { + super(new GT_Container_CropHarvestor(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "CropHarvestor.png"); + mLocalName = aLocalName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + drawTooltip(par1, par2); + //fontRendererObj.drawString("Crop Manager ("+this.mContainer.mTileEntity.getInputVoltage()+"v)", 8, 4, 4210752); + //fontRendererObj.drawString(mLocalName, 70, 69, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + + if (((GT_Container_CropHarvestor) mContainer).mModeAlternative) { + drawTexturedModalRect(x + 48, y + 64, 177, 37, 16, 16); + } + + int tScale = ((GT_Container_CropHarvestor) this.mContainer).mWaterAmount; + if (tScale > 0) { + drawTexturedModalRect(x + 47, y + 61 - tScale, 204, 54 - tScale, 10, tScale); + }; + + } + + private void drawTooltip(int x2, int y2) { + int xStart = (width - xSize) / 2; + int yStart = (height - ySize) / 2; + int x = x2 - xStart; + int y = y2 - yStart + 5; + List<String> list = new ArrayList<>(); + if (y >= 68 && y <= 85) { + if (x >= 47 && x <= 64) { + if (((GT_Container_CropHarvestor) mContainer).mModeAlternative) { + list.add("Disable Hydration/Fertilizing/Weed-EX"); + } + else { + list.add("Enable Hydration/Fertilizing/Weed-EX"); + } + } + } + if (y >= 12 && y <= 66) { + if (x >= 47 && x <= 56) { + int aWater = ((GT_Container_CropHarvestor) mContainer).mWaterRealAmount; + list.add("Water: "+aWater+"L / "+((GT_Container_CropHarvestor) mContainer).mTileEntity.getMetaTileEntity().getCapacity()+"L"); + } + } + if (!list.isEmpty()) { + drawHoveringText(list, x, y, fontRendererObj); + RenderHelper.enableGUIStandardItemLighting(); + } + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java index 3b96731f00..96e8e362ef 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/basic/GUI_PollutionCleaner.java @@ -6,6 +6,7 @@ import java.util.List; import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.core.lib.CORE; +import net.minecraft.client.renderer.RenderHelper; import net.minecraft.entity.player.InventoryPlayer; public class GUI_PollutionCleaner extends GT_GUIContainerMetaTile_Machine { @@ -52,6 +53,7 @@ public class GUI_PollutionCleaner extends GT_GUIContainerMetaTile_Machine { } if (!list.isEmpty()) { this.drawHoveringText(list, x3, y3, this.fontRendererObj); + RenderHelper.enableGUIStandardItemLighting(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java new file mode 100644 index 0000000000..8abe7bff66 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_ComputerCube.java @@ -0,0 +1,409 @@ +package gtPlusPlus.xmod.gregtech.api.gui.computer; + +import java.util.Iterator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.*; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.slots.SlotDataStick; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube; +import net.minecraft.entity.player.*; +import net.minecraft.inventory.*; +import net.minecraft.item.ItemStack; + +public class GT_Container_ComputerCube extends GT_ContainerMetaTile_Machine { + + public long mEUOut; + public int mEUOut1; + public int mEUOut2; + + public int mHeat; + + public int mMaxHeat; + + public int mHEM; + + public int mExplosionStrength; + + public long mEU; + public int mEU1; + public int mEU2; + + public long mStoredEU; + public int mStoredEU1; + public int mStoredEU2; + public long mMaxStoredEU; + public int mMaxStoredEU1; + public int mMaxStoredEU2; + + public int mProgress; + + public int mID; + + public GT_Container_ComputerCube(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, int aID) { + super(aInventoryPlayer, aTileEntity); + Logger.INFO("1 Container Mode: "+aID); + Logger.INFO("2 Container Mode: "+getMode()); + mID = getMode(); + Logger.INFO("3 Container Mode: "+getMode()); + // addSlotsComputer(aInventoryPlayer); + detectAndSendChanges(); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotsComputer(aInventoryPlayer); + } + + private int getMode() { + return ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode; + } + + public void addSlotsComputer(InventoryPlayer aInventoryPlayer) { + int y; + mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode; + Logger.INFO(""+(Utils.isClient() ? "Client" : "Server")+" Mode: " + mID); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156 + ((this.mID == 5) ? 50 : 0), 4, false, false, 1)); + switch (this.mID) { + case 1 : + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 86, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 70, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 156, 54, false, false, 1)); + for (y = 0; y < 6; y++) { + for (int x = 0; x < 9; x++) + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, x + y * 9, 5 + x * 16, 5 + y * 16, false, false, 64)); + } + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 113, 153, 28, false, false, 64)); + break; + case 2 : + addSlotToContainer(new SlotDataStick(this.mTileEntity, 54, 8, 28)); + addSlotToContainer(new Slot(this.mTileEntity, 55, 26, 28)); + addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 56, 134, 28)); + addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 57, 152, 28)); + break; + case 3 : + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 92, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 122, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 152, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 122, 65, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 92, 35, false, false, 64)); + break; + case 4 : + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 122, 65, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 152, 35, false, false, 64)); + break; + case 5 : + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 190, 146, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 206, 146, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 206, 38, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 206, 56, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 206, 74, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 206, 92, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 206, 110, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 153, 7, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 65, 169, 7, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 66, 185, 7, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 67, 153, 23, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 68, 169, 23, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 69, 185, 23, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 70, 153, 39, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 71, 169, 39, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 72, 185, 39, false, false, 64)); + break; + case 6 : + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 88, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 58, 104, 65, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 59, 122, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 60, 92, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 61, 122, 5, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 62, 152, 35, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 63, 122, 65, false, false, 64)); + addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 64, 92, 35, false, false, 64)); + break; + } + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + //Logger.INFO("Clicked slot " + aSlotIndex); + if (aSlotIndex < 0) { + //Logger.INFO(""); + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + if (this.mID != ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode) { + //Logger.INFO("This ID: " + mID + ", Tile: " + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode); + return null; + } + Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex); + if (tSlot == null) { + //Logger.INFO("Null Slot?"); + } + else { + ItemStack tStack = tSlot.getStack(); + //Logger.INFO("Good Slot!"); + if (aSlotIndex == 0) { + //Logger.INFO("Slot is 0"); + if (aMouseclick == 0) { + Logger.INFO("Forward"); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchModeForward(); + } + else { + Logger.INFO("Backwards"); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchModeBackward(); + } + if (aPlayer instanceof EntityPlayerMP) { + EntityPlayerMP aPlayerMP = (EntityPlayerMP) aPlayer; + changePage(aPlayerMP, ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode); + } + //FMLNetworkHandler.openGui(entityPlayer, mod, modGuiId, world, x, y, z); + //aPlayer.openGui(CORE.MODID, getComputerCubeGUIID(), this.mTileEntity.getWorld(), this.mTileEntity.getXCoord(), this.mTileEntity.getYCoord(), this.mTileEntity.getZCoord()); + } + else if (aSlotIndex <= 2 && this.mID == 3) { + if (aSlotIndex == 1) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchCentrifugePageBackward(); + onCraftMatrixChanged(this.mTileEntity); + } + else if (aSlotIndex == 2) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchCentrifugePageForward(); + onCraftMatrixChanged(this.mTileEntity); + } + } + else if (aSlotIndex <= 2 && this.mID == 6) { + if (aSlotIndex == 1) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchElectrolyzerPageBackward(); + onCraftMatrixChanged(this.mTileEntity); + } + else if (aSlotIndex == 2) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchElectrolyzerPageForward(); + onCraftMatrixChanged(this.mTileEntity); + } + } + else if (aSlotIndex <= 2 && this.mID == 4) { + if (aSlotIndex == 1) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchFusionPageBackward(); + onCraftMatrixChanged(this.mTileEntity); + } + else if (aSlotIndex == 2) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchFusionPageForward(); + onCraftMatrixChanged(this.mTileEntity); + } + } + else if (aSlotIndex <= 2 && this.mID == 5) { + if (aSlotIndex == 1) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchDescriptionPageBackward(); + onCraftMatrixChanged(this.mTileEntity); + } + else if (aSlotIndex == 2) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchDescriptionPageForward(); + onCraftMatrixChanged(this.mTileEntity); + } + } + else if (aSlotIndex <= 58 && this.mID == 1) { + if (aSlotIndex == 1) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).switchNuclearReactor(); + onCraftMatrixChanged(this.mTileEntity); + } + else if (aSlotIndex == 2) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).loadNuclearReactor(); + onCraftMatrixChanged(this.mTileEntity); + } + else if (aSlotIndex == 3) { + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).saveNuclearReactor(); + } + else { + if (aShifthold == 1) { + tSlot.putStack(null); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, null); + return null; + } + + if (aMouseclick == 1) { + tSlot.putStack(null); + } + if (aMouseclick == 0) { + if (tStack == null) { + if (getSlot(58).getStack() != null && aSlotIndex != 58) { + tSlot.putStack(getSlot(58).getStack().copy()); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, new GT_ItemStack(getSlot(58).getStack().copy())); + } + else { + tSlot.putStack(new ItemStack(GT_TileEntity_ComputerCube.sReactorList.get(0).mItem, 1)); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, GT_TileEntity_ComputerCube.sReactorList.get(0)); + } + return null; + } + 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)); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).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 null; + } + } + tSlot.putStack(null); + ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getSimulator().slotClick(aSlotIndex, null); + return null; + } + if (tStack == null) + return null; + if (tStack.stackSize < tStack.getMaxStackSize()) { + tStack.stackSize++; + return null; + } + tStack.stackSize = 1; + return null; + } + } + else { + //Logger.INFO("Super 2"); + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + } + //Logger.INFO("???"); + return null; + } + + + + public void changePage(EntityPlayerMP aPlayerMP, int aMode) { + GT_TileEntity_ComputerCube aCompTile = (GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity(); + aCompTile.onRightclick(mTileEntity, aPlayerMP); + } + + public boolean doesBindPlayerInventory() { + return (this.mID != 1 && this.mID != 5); + } + + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { + return; + } + mStoredEU = mTileEntity.getStoredEU(); + mMaxStoredEU = mTileEntity.getEUCapacity(); + int[] aStored = MathUtils.splitLongIntoTwoIntegers(mStoredEU); + int[] aMaxStorage = MathUtils.splitLongIntoTwoIntegers(mMaxStoredEU); + mStoredEU1 = aStored[0]; + mStoredEU2 = aStored[1]; + mMaxStoredEU1 = aMaxStorage[0]; + mMaxStoredEU2 = aMaxStorage[1]; + + + this.mID = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMode; + this.mEUOut = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEUOut; + int[] aEUSplit1 = MathUtils.splitLongIntoTwoIntegers(mEUOut); + this.mEUOut1 = aEUSplit1[0]; + this.mEUOut2 = aEUSplit1[1]; + this.mHeat = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mHeat; + this.mMaxHeat = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMaxHeat; + this.mHEM = (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mHEM * 10000.0F); + this.mExplosionStrength = (int) (((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mExplosionStrength * 100.0F); + this.mEU = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mEU; + this.mProgress = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mProgress; + this.mMaxProgressTime = ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).mMaxProgress; + this.mProgressTime = (int) ((GT_TileEntity_ComputerCube) mTileEntity.getMetaTileEntity()).getEUVar(); + int[] aEUSplit2 = MathUtils.splitLongIntoTwoIntegers(mEU); + this.mEU1 = aEUSplit2[0]; + this.mEU2 = aEUSplit2[1]; + Iterator<ICrafting> var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = var2.next(); + var1.sendProgressBarUpdate(this, 101, this.mID); + var1.sendProgressBarUpdate(this, 102, this.mHeat & 0xFFFF); + var1.sendProgressBarUpdate(this, 103, this.mMaxHeat & 0xFFFF); + var1.sendProgressBarUpdate(this, 104, this.mHEM); + var1.sendProgressBarUpdate(this, 105, this.mExplosionStrength); + var1.sendProgressBarUpdate(this, 106, this.mHeat >>> 16); + var1.sendProgressBarUpdate(this, 107, this.mMaxHeat >>> 16); + var1.sendProgressBarUpdate(this, 108, this.mEU1); + var1.sendProgressBarUpdate(this, 109, this.mEU2); + var1.sendProgressBarUpdate(this, 110, this.mProgress); + var1.sendProgressBarUpdate(this, 111, this.mEUOut1); + var1.sendProgressBarUpdate(this, 112, this.mEUOut2); + var1.sendProgressBarUpdate(this, 113, mStoredEU1); + var1.sendProgressBarUpdate(this, 114, mStoredEU2); + var1.sendProgressBarUpdate(this, 115, mMaxStoredEU1); + var1.sendProgressBarUpdate(this, 116, mMaxStoredEU2); + } + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 101 : + this.mID = par2; + break; + case 102 : + this.mHeat = this.mHeat & 0xFFFF0000 | par2; + break; + case 103 : + this.mMaxHeat = this.mMaxHeat & 0xFFFF0000 | par2; + break; + case 104 : + this.mHEM = par2; + break; + case 105 : + this.mExplosionStrength = par2; + break; + case 106 : + this.mHeat = this.mHeat & 0xFFFF | par2 << 16; + break; + case 107 : + this.mMaxHeat = this.mMaxHeat & 0xFFFF | par2 << 16; + break; + case 108 : + this.mEU1 = par2; + case 109 : + this.mEU2 = par2; + this.mEU = MathUtils.combineTwoIntegersToLong(mEU1, mEU2); + break; + case 110 : + this.mProgress = par2; + break; + case 111 : + this.mEUOut1 = par2; + case 112 : + this.mEUOut2 = par2; + this.mEUOut = MathUtils.combineTwoIntegersToLong(mEUOut1, mEUOut2); + break; + case 113 : + mStoredEU1 = par2; + break; + case 114 : + mStoredEU2 = par2; + mStoredEU = MathUtils.combineTwoIntegersToLong(mStoredEU1, mStoredEU2); + break; + case 115 : + mMaxStoredEU1 = par2; + break; + case 116 : + mMaxStoredEU2 = par2; + mMaxStoredEU = MathUtils.combineTwoIntegersToLong(mMaxStoredEU1, mMaxStoredEU2); + break; + } + } + + public int getSlotStartIndex() { + return 1; + } + + public int getSlotCount() { + return (this.mID == 2) ? 4 : 0; + } + + public int getShiftClickSlotCount() { + return (this.mID == 2) ? 2 : 0; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java new file mode 100644 index 0000000000..acae0d39c5 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_Container_RedstoneCircuitBlock.java @@ -0,0 +1,176 @@ +package gtPlusPlus.xmod.gregtech.api.gui.computer; + +import java.util.Iterator; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.tileentities.redstone.GT_MetaTileEntity_RedstoneCircuitBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + +public class GT_Container_RedstoneCircuitBlock extends GT_ContainerMetaTile_Machine { + + public GT_Container_RedstoneCircuitBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 6, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 42, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 8, 60, false, true, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 6, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 152, 42, false, true, 1)); + + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 1, 26, 6, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 24, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 3, 26, 42, false, true, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 4, 26, 60, false, true, 1)); + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex < 0 || aSlotIndex > 6) + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + + Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); + if (tSlot != null) { + if (mTileEntity.getMetaTileEntity() == null) + return null; + if (aSlotIndex < 4) { + ItemStack tStack = aPlayer.inventory.getItemStack(); + if (tStack == null) { + ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).changeGateData(aSlotIndex, aMouseclick == 0 ? aShifthold == 0 ? +1 : aShifthold == 1 ? +128 : +16 : aShifthold == 0 ? -1 : aShifthold == 1 ? -128 : -16); + } + else { + tStack = GT_Utility.copy(tStack); + if (aMouseclick != 0) + tStack.setItemDamage(OreDictionary.WILDCARD_VALUE); + ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).stackGateData(aSlotIndex, tStack); + } + return null; + } + else if (aSlotIndex == 4) { + ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).switchOutput(); + } + else if (aSlotIndex == 5) { + mTileEntity.setActive(!mTileEntity.isActive()); + } + else if (aSlotIndex == 6) { + if (aMouseclick == 0) + ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).switchGateForward(aShifthold != 0); + else + ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).switchGateBackward(aShifthold != 0); + } + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + public int mData[] = new int[]{0, 0, 0, 0, 0, 0, 0, 0}, mGate = 0; + + @SuppressWarnings("rawtypes") + public void detectAndSendChanges() { + super.detectAndSendChanges(); + if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) + return; + mGate = ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).mGate; + mData = ((GT_MetaTileEntity_RedstoneCircuitBlock) mTileEntity.getMetaTileEntity()).mGateData; + + Iterator var2 = this.crafters.iterator(); + while (var2.hasNext()) { + ICrafting var1 = (ICrafting) var2.next(); + var1.sendProgressBarUpdate(this, 100, mGate & 65535); + var1.sendProgressBarUpdate(this, 101, mGate >>> 16); + var1.sendProgressBarUpdate(this, 102, mData[0] & 65535); + var1.sendProgressBarUpdate(this, 103, mData[0] >>> 16); + var1.sendProgressBarUpdate(this, 104, mData[1] & 65535); + var1.sendProgressBarUpdate(this, 105, mData[1] >>> 16); + var1.sendProgressBarUpdate(this, 106, mData[2] & 65535); + var1.sendProgressBarUpdate(this, 107, mData[2] >>> 16); + var1.sendProgressBarUpdate(this, 108, mData[3] & 65535); + var1.sendProgressBarUpdate(this, 109, mData[3] >>> 16); + var1.sendProgressBarUpdate(this, 110, mData[4] & 65535); + var1.sendProgressBarUpdate(this, 111, mData[4] >>> 16); + var1.sendProgressBarUpdate(this, 112, mData[5] & 65535); + var1.sendProgressBarUpdate(this, 113, mData[5] >>> 16); + var1.sendProgressBarUpdate(this, 114, mData[6] & 65535); + var1.sendProgressBarUpdate(this, 115, mData[6] >>> 16); + var1.sendProgressBarUpdate(this, 116, mData[7] & 65535); + var1.sendProgressBarUpdate(this, 117, mData[7] >>> 16); + } + } + + public void addCraftingToCrafters(ICrafting par1ICrafting) { + super.addCraftingToCrafters(par1ICrafting); + } + + @SideOnly(Side.CLIENT) + public void updateProgressBar(int par1, int par2) { + super.updateProgressBar(par1, par2); + switch (par1) { + case 100 : + mGate = mGate & -65536 | par2; + break; + case 101 : + mGate = mGate & 65535 | par2 << 16; + break; + case 102 : + mData[0] = mData[0] & -65536 | par2; + break; + case 103 : + mData[0] = mData[0] & 65535 | par2 << 16; + break; + case 104 : + mData[1] = mData[1] & -65536 | par2; + break; + case 105 : + mData[1] = mData[1] & 65535 | par2 << 16; + break; + case 106 : + mData[2] = mData[2] & -65536 | par2; + break; + case 107 : + mData[2] = mData[2] & 65535 | par2 << 16; + break; + case 108 : + mData[3] = mData[3] & -65536 | par2; + break; + case 109 : + mData[3] = mData[3] & 65535 | par2 << 16; + break; + case 110 : + mData[4] = mData[4] & -65536 | par2; + break; + case 111 : + mData[4] = mData[4] & 65535 | par2 << 16; + break; + case 112 : + mData[5] = mData[5] & -65536 | par2; + break; + case 113 : + mData[5] = mData[5] & 65535 | par2 << 16; + break; + case 114 : + mData[6] = mData[6] & -65536 | par2; + break; + case 115 : + mData[6] = mData[6] & 65535 | par2 << 16; + break; + case 116 : + mData[7] = mData[7] & -65536 | par2; + break; + case 117 : + mData[7] = mData[7] & 65535 | par2 << 16; + break; + } + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java new file mode 100644 index 0000000000..71defdc72a --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_ComputerCube.java @@ -0,0 +1,172 @@ +package gtPlusPlus.xmod.gregtech.api.gui.computer; + +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.xmod.gregtech.common.computer.GT_Computercube_Description; +import gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; +import net.minecraft.util.StatCollector; + +public class GT_GUIContainer_ComputerCube extends GT_GUIContainerMetaTile_Machine { + + public final GT_Container_ComputerCube mPowerContainer; + + public GT_GUIContainer_ComputerCube(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aBaseMetaTileEntity, int aID) { + super(new GT_Container_ComputerCube(aInventoryPlayer, aBaseMetaTileEntity, aID), CORE.RES_PATH_GUI + "computer/"+aID+".png"); + mPowerContainer = (GT_Container_ComputerCube) mContainer; + if (mPowerContainer.mID == 5) { + this.xSize += 50; + } + } + + + public static ResourceLocation[] mGUIbackground = new ResourceLocation[8]; + + static { + mGUIbackground[0] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/0.png"); + mGUIbackground[1] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/1.png"); + mGUIbackground[2] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/2.png"); + mGUIbackground[3] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/3.png"); + mGUIbackground[4] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/4.png"); + mGUIbackground[5] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/5.png"); + mGUIbackground[6] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/6.png"); + mGUIbackground[7] = new ResourceLocation(CORE.RES_PATH_GUI + "computer/Redstone.png"); + + } + + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer; + //Logger.INFO("3 GUI Mode: "+xSize); + //GT_TileEntity_ComputerCube tTileEntity = (GT_TileEntity_ComputerCube) tContainer.mTileEntity; + if (tContainer != null) + switch (tContainer.mID) { + case 0 : + this.fontRendererObj.drawString("Solaris 1.7.10", 56, 70, Utils.rgbtoHexValue(100, 190, 255)); + //this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + break; + case 1 : + this.fontRendererObj.drawString("Reactorstats:", 7, 108, 16448255); + this.fontRendererObj.drawString(toNumber(tContainer.mEU) + "EU at " + tContainer.mEUOut + "EU/t", 7, 120, 16448255); + this.fontRendererObj.drawString("HEM: " + (tContainer.mHEM / 10000.0F), 7, 128, 16448255); + this.fontRendererObj.drawString(toNumber(tContainer.mHeat) + "/" + toNumber(tContainer.mMaxHeat) + "Heat", 7, 136, 16448255); + this.fontRendererObj.drawString("Explosionpower: " + (tContainer.mExplosionStrength / 100.0F), 7, 144, 16448255); + this.fontRendererObj.drawString("Runtime: " + ((tContainer.mProgress > 0) ? (/*(tContainer.mEU / tContainer.mEUOut)*/ tContainer.mProgress / 20) : 0) + "secs", 7, 152, 16448255); + break; + case 2 : + this.fontRendererObj.drawString("Scanner", 51, 7, 16448255); + if (tContainer.mProgress == 0) { + this.fontRendererObj.drawString("Can be used to", 51, 24, 16448255); + this.fontRendererObj.drawString("scan things", 51, 32, 16448255); + this.fontRendererObj.drawString("Currently", 51, 48, Utils.rgbtoHexValue(200, 20, 20)); + this.fontRendererObj.drawString("Disabled", 51, 56, Utils.rgbtoHexValue(200, 20, 20)); + } + else { + this.fontRendererObj.drawString("Progress:", 51, 24, 16448255); + this.fontRendererObj.drawString(MathUtils.findPercentage(tContainer.mProgress, tContainer.mMaxProgressTime) + " %", 51, 32, 16448255); + } + this.fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + break; + case 3 : + this.fontRendererObj.drawString("Centrifuge", 7, 7, 16448255); + this.fontRendererObj.drawString("Recipe: " + (tContainer.mMaxHeat + 1) + "/" + GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size(), 7, 23, 16448255); + this.fontRendererObj.drawString("EU: " + toNumber(tContainer.mEU), 7, 31, 16448255); + break; + case 4 : + this.fontRendererObj.drawString("Fusionreactor", 7, 7, 16448255); + this.fontRendererObj.drawString("Recipe: " + (tContainer.mMaxHeat + 1) + "/" + GT_TileEntity_ComputerCube.sFusionReactorRecipes.size(), 7, 15, 16448255); + this.fontRendererObj.drawString("Start: " + toNumber(tContainer.mEU) + "EU", 7, 23, 16448255); + this.fontRendererObj.drawString("EU/t: " + toNumber(tContainer.mEUOut), 7, 31, 16448255); + this.fontRendererObj.drawString(toNumber(tContainer.mHeat) + " Ticks", 7, 39, 16448255); + GT_Recipe tRecipe = GT_TileEntity_ComputerCube.sFusionReactorRecipes.get(tContainer.mMaxHeat); + this.fontRendererObj.drawString(""+tRecipe.mFluidOutputs[0].getLocalizedName(), 7, 55, 16448255); + if (tContainer.mEUOut < 0) { + this.fontRendererObj.drawString("IN: " + toNumber(-tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 47, 16448255); + break; + } + this.fontRendererObj.drawString("OUT: " + toNumber(tContainer.mEUOut * tContainer.mHeat) + "EU", 7, 47, 16448255); + break; + case 5 : + if (tContainer.mID == 5 && this.xSize == 176) { + this.xSize += 50; + } + if (tContainer.mMaxHeat >= 0 && tContainer.mMaxHeat < GT_Computercube_Description.sDescriptions.size()) + for (int i = 0; i < ((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription.length; i++) { + if (i == 0) { + this.fontRendererObj.drawString(((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription[i], 7, 7, 16448255); + } + else { + this.fontRendererObj.drawString(((GT_Computercube_Description) GT_Computercube_Description.sDescriptions.get(tContainer.mMaxHeat)).mDescription[i], 7, 7 + + 8 * i, 16448255); + } + } + break; + case 6 : + this.fontRendererObj.drawString("Electrolyzer", 7, 7, 16448255); + this.fontRendererObj.drawString("Recipe: " + (tContainer.mMaxHeat + 1) + "/" + GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size(), 7, 23, 16448255); + this.fontRendererObj.drawString("EU: " + toNumber(tContainer.mEU), 7, 31, 16448255); + break; + } + } + + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + if (mContainer != null) { + GT_Container_ComputerCube tContainer = (GT_Container_ComputerCube) this.mContainer; + mc.renderEngine.bindTexture(mGUIbackground[((GT_Container_ComputerCube) this.mContainer).mID]); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + switch (tContainer.mID) { + case 0 : + if (this.mPowerContainer.mStoredEU > 0 && this.mPowerContainer.mMaxStoredEU > 0) { + final double tScale = MathUtils.findPercentage(this.mPowerContainer.mStoredEU, this.mPowerContainer.mMaxStoredEU); + this.drawTexturedModalRect(x + 44, y + 8, 0, 166, Math.min(MathUtils.roundToClosestInt(tScale), 95), 5); + } + else { + // + //Logger.INFO("1 No Power? "+tContainer.mProgressTime+" | "+tContainer.mTileEntity.getEUCapacity()); + //Logger.INFO("2 No Power? "+aComp.getEUVar()+" | "+aComp.maxEUStore()); + } + break; + case 5 : + if (tContainer.mExplosionStrength != 0) + drawTexturedModalRect(x + 152, y + 6, 0, 166, 50, 50); + break; + } + } + } + + public String toNumber(long mEU) { + String tString = ""; + boolean temp = true, negative = false; + if (mEU < 0) { + mEU *= -1; + negative = true; + } + int i; + for (i = 1000000000; i > 0; i /= 10) { + long tDigit = mEU / i % 10; + if (temp && tDigit != 0) + temp = false; + if (!temp) { + tString = tString + tDigit; + if (i != 1) { + int j; + for (j = i; j > 0;) { + if (j == 1) + tString = tString + ","; + j /= 1000; + } + } + } + } + if (tString.equals("")) + tString = "0"; + return negative ? ("-" + tString) : tString; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java new file mode 100644 index 0000000000..53d60c3a68 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/computer/GT_GUIContainer_RedstoneCircuitBlock.java @@ -0,0 +1,95 @@ +package gtPlusPlus.xmod.gregtech.api.gui.computer; + +import java.util.ArrayList; +import java.util.List; + +import gregtech.api.GregTech_API; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_CircuitryBehavior; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_RedstoneCircuitBlock extends GT_GUIContainerMetaTile_Machine { + + public GT_GUIContainer_RedstoneCircuitBlock(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(new GT_Container_RedstoneCircuitBlock(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "RedstoneCircuitBlock.png"); + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + GT_CircuitryBehavior tCircuit = GregTech_API.sCircuitryBehaviors.get(((GT_Container_RedstoneCircuitBlock) mContainer).mGate); + if (tCircuit != null) { + this.fontRendererObj.drawString(tCircuit.getName(), 46, 8, 16448255); + this.fontRendererObj.drawString(tCircuit.getDescription(), 46, 19, 16448255); + + this.fontRendererObj.drawString(tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 0), 46, 33, 16448255); + this.fontRendererObj.drawString(tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 1), 46, 44, 16448255); + this.fontRendererObj.drawString(tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 2), 46, 55, 16448255); + this.fontRendererObj.drawString(tCircuit.getDataDescription(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 3), 46, 66, 16448255); + + String tString; + tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 0); + this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[0]) : tString, 99, 33, 16448255); + tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 1); + this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[1]) : tString, 99, 44, 16448255); + tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 2); + this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[2]) : tString, 99, 55, 16448255); + tString = tCircuit.getDataDisplay(((GT_Container_RedstoneCircuitBlock) mContainer).mData, 3); + this.fontRendererObj.drawString(tString == null ? GT_Utility.parseNumberToString(((GT_Container_RedstoneCircuitBlock) mContainer).mData[3]) : tString, 99, 66, 16448255); + } + this.drawTooltip(par1, par2); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + + if (mContainer != null) { + if (((GT_Container_RedstoneCircuitBlock) mContainer).mOutput > 0) + drawTexturedModalRect(x + 151, y + 5, 176, 0, 18, 18); + if ((((GT_Container_RedstoneCircuitBlock) mContainer).mActive & 1) > 0) + drawTexturedModalRect(x + 151, y + 23, 176, 18, 18, 18); + if (((GT_Container_RedstoneCircuitBlock) mContainer).mDisplayErrorCode > 0) + if ((((GT_Container_RedstoneCircuitBlock) mContainer).mTileEntity.getTimer() / 5) % 2 == 0) + drawTexturedModalRect(x + 140, y + 9, 194, 0, 7, 7); + else + ; + else + drawTexturedModalRect(x + 140, y + 9, 201, 0, 7, 7); + } + } + + private void drawTooltip(final int x2, final int y2) { + final int xStart = (this.width - this.xSize) / 2; + final int yStart = (this.height - this.ySize) / 2; + final int x3 = x2 - xStart; + final int y3 = y2 - yStart + 5; + final List<String> list = new ArrayList<String>(); + + int y = 10; + if (x3 >= 151 && x3 <= 168) { + if (y3 >= y && y3 <= (y + 17)) { + list.add("Toggle EU Output"); + } + if (y3 >= (y + 18) && y3 <= (y + 35)) { + list.add("Toggle Active State"); + } + if (y3 >= (y + 36) && y3 <= (y + 53)) { + list.add("Change Redstone Circuit"); + } + } + + if (!list.isEmpty()) { + //RenderHelper.enableGUIStandardItemLighting(); + this.drawHoveringText(list, x3, y3, this.fontRendererObj); + RenderHelper.enableGUIStandardItemLighting(); + } + //RenderHelper.enableStandardItemLighting(); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java index 1be79b40cc..4d35df251c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/fluidreactor/GUI_FluidReactor.java @@ -7,6 +7,8 @@ import gtPlusPlus.core.lib.CORE; import java.util.ArrayList; import java.util.List; + +import net.minecraft.client.renderer.RenderHelper; import net.minecraft.entity.player.InventoryPlayer; public class GUI_FluidReactor extends GT_GUIContainerMetaTile_Machine { @@ -54,6 +56,7 @@ public class GUI_FluidReactor extends GT_GUIContainerMetaTile_Machine { if (!list.isEmpty()) { this.drawHoveringText(list, x, y, this.fontRendererObj); + RenderHelper.enableGUIStandardItemLighting(); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java index e6203823b6..606880d6e9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/hatches/CONTAINER_1by1_Turbine.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.api.gui.hatches; import gregtech.api.gui.GT_Container_1by1; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GregtechMetaTileEntity_LargerTurbineBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; @@ -36,12 +37,7 @@ public class CONTAINER_1by1_Turbine extends GT_Container_1by1 { } @Override public boolean isItemValid(final ItemStack itemstack) { - if (itemstack.getItem() instanceof GT_MetaGenerated_Tool) { - if (itemstack.getItemDamage() >= 170 && itemstack.getItemDamage() <= 176) { - return true; - } - } - return false; + return GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(itemstack); } @Override public int getSlotStackLimit() { @@ -52,9 +48,10 @@ public class CONTAINER_1by1_Turbine extends GT_Container_1by1 { return false; } @Override - public void putStack(ItemStack p_75215_1_) { - // TODO Auto-generated method stub - super.putStack(p_75215_1_); + public void putStack(ItemStack aStack) { + if (isItemValid(aStack)) { + this.inventory.setInventorySlotContents(0, aStack); + } } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java new file mode 100644 index 0000000000..d7ec19a9ac --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_AdvancedWorkbench.java @@ -0,0 +1,124 @@ +package gtPlusPlus.xmod.gregtech.api.gui.workbench; + +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.slots.SlotBlueprint; +import gtPlusPlus.core.slots.SlotElectric; +import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Container_AdvancedWorkbench extends GT_ContainerMetaTile_Machine { + + public GT_Container_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 8, 8)); + addSlotToContainer(new Slot(mTileEntity, 1, 26, 8)); + addSlotToContainer(new Slot(mTileEntity, 2, 44, 8)); + addSlotToContainer(new Slot(mTileEntity, 3, 62, 8)); + addSlotToContainer(new Slot(mTileEntity, 4, 8, 26)); + addSlotToContainer(new Slot(mTileEntity, 5, 26, 26)); + addSlotToContainer(new Slot(mTileEntity, 6, 44, 26)); + addSlotToContainer(new Slot(mTileEntity, 7, 62, 26)); + addSlotToContainer(new Slot(mTileEntity, 8, 8, 44)); + addSlotToContainer(new Slot(mTileEntity, 9, 26, 44)); + addSlotToContainer(new Slot(mTileEntity, 10, 44, 44)); + addSlotToContainer(new Slot(mTileEntity, 11, 62, 44)); + addSlotToContainer(new Slot(mTileEntity, 12, 8, 62)); + addSlotToContainer(new Slot(mTileEntity, 13, 26, 62)); + addSlotToContainer(new Slot(mTileEntity, 14, 44, 62)); + addSlotToContainer(new Slot(mTileEntity, 15, 62, 62)); + + addSlotToContainer(new SlotElectric(mTileEntity, 16, 82, 8)); + addSlotToContainer(new SlotElectric(mTileEntity, 17, 100, 8)); + addSlotToContainer(new SlotElectric(mTileEntity, 18, 118, 8)); + addSlotToContainer(new SlotElectric(mTileEntity, 19, 136, 8)); + addSlotToContainer(new SlotElectric(mTileEntity, 20, 154, 8)); + + addSlotToContainer(new Slot(mTileEntity, 21, 82, 28)); + addSlotToContainer(new Slot(mTileEntity, 22, 100, 28)); + addSlotToContainer(new Slot(mTileEntity, 23, 118, 28)); + addSlotToContainer(new Slot(mTileEntity, 24, 82, 46)); + addSlotToContainer(new Slot(mTileEntity, 25, 100, 46)); + addSlotToContainer(new Slot(mTileEntity, 26, 118, 46)); + addSlotToContainer(new Slot(mTileEntity, 27, 82, 64)); + addSlotToContainer(new Slot(mTileEntity, 28, 100, 64)); + addSlotToContainer(new Slot(mTileEntity, 29, 118, 64)); + + addSlotToContainer(new Slot(mTileEntity, 33, 154, 28)); + addSlotToContainer(new Slot(mTileEntity, 34, 154, 64)); + + addSlotToContainer(new SlotBlueprint(mTileEntity, 30, 136, 28)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 31, 136, 64, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 32, 154, 46, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 32, 136, 46, false, false, 1)); + + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + Logger.INFO("Clicked on slot "+aSlotIndex); + if (aSlotIndex < 21 || aSlotIndex > 35) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + if (mTileEntity == null || mTileEntity.getMetaTileEntity() == null) return null; + try { + ItemStack tStack = ((Slot)inventorySlots.get(aSlotIndex)).getStack(); + if (tStack != null && tStack.stackSize <= 0 && !GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack())) { + return null; + } + if (aSlotIndex == 32) { + if (aMouseclick == 0 && aShifthold == 1) { + ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).setBluePrint(null); + return null; + } + } else if (aSlotIndex == 33) { + ItemStack tStack2, tCraftedStack = ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(); + if (tCraftedStack != null) { + if (aShifthold == 1) { + for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i++) { + for (byte j = 0; j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize && ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput(); j++) { + if (!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack) || tStack.stackSize != tStack2.stackSize) return aPlayer.inventory.getItemStack(); + aPlayer.inventory.mainInventory[i] = (((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i])); + } + } + } else { + if (aMouseclick == 0) { + if (((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput()) aPlayer.inventory.setItemStack(((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack())); + return aPlayer.inventory.getItemStack(); + } else { + for (int i = 0; i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize && ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput(); i++) { + if (!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack) || tStack.stackSize != tStack2.stackSize) return aPlayer.inventory.getItemStack(); + aPlayer.inventory.setItemStack(((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack())); + } + return aPlayer.inventory.getItemStack(); + } + } + } + return null; + } else if (aSlotIndex == 34) { + ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).mFlushMode = true; + return null; + } else if (aSlotIndex == 35) { + ((GT_MetaTileEntity_AdvancedCraftingTable)mTileEntity.getMetaTileEntity()).sortIntoTheInputSlots(); + return null; + } + } catch(Throwable e) { + //GT_Log.log.catching(e); + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + public int getSlotCount() { + return 33; + } + + public int getShiftClickSlotCount() { + return 21; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java new file mode 100644 index 0000000000..d26c4d49fd --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_Container_BronzeWorkbench.java @@ -0,0 +1,121 @@ +package gtPlusPlus.xmod.gregtech.api.gui.workbench; + +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_Slot_Holo; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.slots.SlotBlueprint; +import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_BronzeCraftingTable; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class GT_Container_BronzeWorkbench extends GT_ContainerMetaTile_Machine { + + public GT_Container_BronzeWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { + super(aInventoryPlayer, aTileEntity); + } + + public void addSlots(InventoryPlayer aInventoryPlayer) { + addSlotToContainer(new Slot(mTileEntity, 0, 8, 8)); + addSlotToContainer(new Slot(mTileEntity, 1, 26, 8)); + addSlotToContainer(new Slot(mTileEntity, 2, 44, 8)); + addSlotToContainer(new Slot(mTileEntity, 3, 62, 8)); + addSlotToContainer(new Slot(mTileEntity, 4, 8, 26)); + addSlotToContainer(new Slot(mTileEntity, 5, 26, 26)); + addSlotToContainer(new Slot(mTileEntity, 6, 44, 26)); + addSlotToContainer(new Slot(mTileEntity, 7, 62, 26)); + addSlotToContainer(new Slot(mTileEntity, 8, 8, 44)); + addSlotToContainer(new Slot(mTileEntity, 9, 26, 44)); + addSlotToContainer(new Slot(mTileEntity, 10, 44, 44)); + addSlotToContainer(new Slot(mTileEntity, 11, 62, 44)); + addSlotToContainer(new Slot(mTileEntity, 12, 8, 62)); + addSlotToContainer(new Slot(mTileEntity, 13, 26, 62)); + addSlotToContainer(new Slot(mTileEntity, 14, 44, 62)); + addSlotToContainer(new Slot(mTileEntity, 15, 62, 62)); + + addSlotToContainer(new Slot(mTileEntity, 16, 82, 8)); + addSlotToContainer(new Slot(mTileEntity, 17, 100, 8)); + addSlotToContainer(new Slot(mTileEntity, 18, 118, 8)); + addSlotToContainer(new Slot(mTileEntity, 19, 136, 8)); + addSlotToContainer(new Slot(mTileEntity, 20, 154, 8)); + + addSlotToContainer(new Slot(mTileEntity, 21, 82, 28)); + addSlotToContainer(new Slot(mTileEntity, 22, 100, 28)); + addSlotToContainer(new Slot(mTileEntity, 23, 118, 28)); + addSlotToContainer(new Slot(mTileEntity, 24, 82, 46)); + addSlotToContainer(new Slot(mTileEntity, 25, 100, 46)); + addSlotToContainer(new Slot(mTileEntity, 26, 118, 46)); + addSlotToContainer(new Slot(mTileEntity, 27, 82, 64)); + addSlotToContainer(new Slot(mTileEntity, 28, 100, 64)); + addSlotToContainer(new Slot(mTileEntity, 29, 118, 64)); + + addSlotToContainer(new Slot(mTileEntity, 33, 154, 28)); + addSlotToContainer(new Slot(mTileEntity, 34, 154, 64)); + + addSlotToContainer(new SlotBlueprint(mTileEntity, 30, 136, 28)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 31, 136, 64, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 32, 154, 46, false, false, 1)); + addSlotToContainer(new GT_Slot_Holo(mTileEntity, 32, 136, 46, false, false, 1)); + + } + + public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { + if (aSlotIndex < 21 || aSlotIndex > 35) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + if (mTileEntity == null || mTileEntity.getMetaTileEntity() == null) return null; + try { + ItemStack tStack = ((Slot)inventorySlots.get(aSlotIndex)).getStack(); + if (tStack != null && tStack.stackSize <= 0 && !GT_Utility.areStacksEqual(tStack, aPlayer.inventory.getItemStack())) { + return null; + } + if (aSlotIndex == 32) { + if (aMouseclick == 0 && aShifthold == 1) { + ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).setBluePrint(null); + return null; + } + } else if (aSlotIndex == 33) { + ItemStack tStack2, tCraftedStack = ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(); + if (tCraftedStack != null) { + if (aShifthold == 1) { + for (byte i = 0; i < aPlayer.inventory.mainInventory.length; i++) { + for (byte j = 0; j < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize && ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput(); j++) { + if (!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack) || tStack.stackSize != tStack2.stackSize) return aPlayer.inventory.getItemStack(); + aPlayer.inventory.mainInventory[i] = (((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.mainInventory[i])); + } + } + } else { + if (aMouseclick == 0) { + if (((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput()) aPlayer.inventory.setItemStack(((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack())); + return aPlayer.inventory.getItemStack(); + } else { + for (int i = 0; i < tCraftedStack.getMaxStackSize() / tCraftedStack.stackSize && ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).canDoCraftingOutput(); i++) { + if (!GT_Utility.areStacksEqual(tStack2 = ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).getCraftingOutput(), tCraftedStack) || tStack.stackSize != tStack2.stackSize) return aPlayer.inventory.getItemStack(); + aPlayer.inventory.setItemStack(((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).consumeMaterials(aPlayer, aPlayer.inventory.getItemStack())); + } + return aPlayer.inventory.getItemStack(); + } + } + } + return null; + } else if (aSlotIndex == 34) { + ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).mFlushMode = true; + return null; + } else if (aSlotIndex == 35) { + ((GT_MetaTileEntity_BronzeCraftingTable)mTileEntity.getMetaTileEntity()).sortIntoTheInputSlots(); + return null; + } + } catch(Throwable e) { + //GT_Log.log.catching(e); + } + return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); + } + + public int getSlotCount() { + return 33; + } + + public int getShiftClickSlotCount() { + return 21; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java new file mode 100644 index 0000000000..094a7a7eb9 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_AdvancedWorkbench.java @@ -0,0 +1,86 @@ +package gtPlusPlus.xmod.gregtech.api.gui.workbench; + +import java.util.ArrayList; +import java.util.List; + +import gregtech.api.gui.GT_ContainerMetaTile_Machine; +import gregtech.api.gui.GT_GUIContainerMetaTile_Machine; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.sys.KeyboardUtils; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_AdvancedWorkbench extends GT_GUIContainerMetaTile_Machine { + + private final String mLocalName; + + public GT_GUIContainer_AdvancedWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) { + super(new GT_Container_AdvancedWorkbench(aInventoryPlayer, aTileEntity), CORE.RES_PATH_GUI + "AdvancedCraftingTable.png"); + mLocalName = aLocalName; + } + + public GT_GUIContainer_AdvancedWorkbench(GT_ContainerMetaTile_Machine aContainer, String aLocalName, String aResource) { + super(aContainer, aResource); + mLocalName = aLocalName; + } + + @Override + protected void drawGuiContainerForegroundLayer(int par1, int par2) { + //fontRendererObj.drawString(mLocalName, 8, 4, 4210752); + this.drawTooltip(par1, par2); + } + + private void drawTooltip(final int x2, final int y2) { + final int xStart = (this.width - this.xSize) / 2; + final int yStart = (this.height - this.ySize) / 2; + final int x3 = x2 - xStart; + final int y3 = y2 - yStart + 5; + final List<String> list = new ArrayList<String>(); + //154 - 172 + + if (KeyboardUtils.isShiftKeyDown()) { + if (y3 >= 30 && y3 <= 49) { + if (x3 >= 135 && x3 <= 154) { + list.add("Blueprint Slot"); + list.add("Shift+Lmb Sets to crafting output"); + } + if (x3 >= 153 && x3 <= 170) { + list.add("Extraction Slot"); + list.add("Things can always be pulled from here"); + } + } + if (y3 >= 50 && y3 <= 67) { + if (x3 >= 135 && x3 <= 152) { + list.add("Flush"); + list.add("Empty crafting grid back to storage"); + } + if (x3 >= 153 && x3 <= 170) { + list.add("Automation"); + list.add("Allows output while"); + list.add("crafting grid is full"); + } + } + if (y3 >= 68 && y3 <= 85){ + if (x3 >= 135 && x3 <= 152) { + list.add("Output Slot"); + } + if (x3 >= 153 && x3 <= 170) { + list.add("Free Parking"); + } + } + } + if (!list.isEmpty()) { + this.drawHoveringText(list, x3, y3, this.fontRendererObj); + RenderHelper.enableGUIStandardItemLighting(); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { + super.drawGuiContainerBackgroundLayer(par1, par2, par3); + int x = (width - xSize) / 2; + int y = (height - ySize) / 2; + drawTexturedModalRect(x, y, 0, 0, xSize, ySize); + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java new file mode 100644 index 0000000000..178c9241f1 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/gui/workbench/GT_GUIContainer_BronzeWorkbench.java @@ -0,0 +1,13 @@ +package gtPlusPlus.xmod.gregtech.api.gui.workbench; + +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_GUIContainer_BronzeWorkbench extends GT_GUIContainer_AdvancedWorkbench { + + public GT_GUIContainer_BronzeWorkbench(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity, String aLocalName) { + super(new GT_Container_BronzeWorkbench(aInventoryPlayer, aTileEntity), aLocalName, CORE.RES_PATH_GUI + "BronzeCraftingTable.png"); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IBaseCustomMetaTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IBaseCustomMetaTileEntity.java new file mode 100644 index 0000000000..71d15e6e77 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/IBaseCustomMetaTileEntity.java @@ -0,0 +1,7 @@ +package gtPlusPlus.xmod.gregtech.api.interfaces; + +public interface IBaseCustomMetaTileEntity { + + public boolean doesExplode(); + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java index ce26d14e53..a72c6e98f3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/interfaces/internal/IGregtech_RecipeAdder.java @@ -1,11 +1,8 @@ package gtPlusPlus.xmod.gregtech.api.interfaces.internal; -import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; -import gregtech.api.util.GT_Recipe; import gtPlusPlus.core.material.Material; import net.minecraft.item.ItemStack; - import net.minecraftforge.fluids.FluidStack; public interface IGregtech_RecipeAdder { @@ -341,5 +338,7 @@ public interface IGregtech_RecipeAdder { public boolean addFluidHeaterRecipe(ItemStack aCircuit, FluidStack aInput, FluidStack aOutput, int aDuration, int aEUt); public boolean addVacuumFreezerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU); + + public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEU, int aAmps); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java index 6967c8eb33..5ccbd8cb2d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/BaseCustomTileEntity.java @@ -15,6 +15,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; +import gtPlusPlus.xmod.gregtech.api.interfaces.IBaseCustomMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import gtPlusPlus.xmod.gregtech.common.StaticFields59; import ic2.api.Direction; @@ -22,7 +23,7 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; -public class BaseCustomTileEntity extends BaseMetaTileEntity { +public class BaseCustomTileEntity extends BaseMetaTileEntity implements IBaseCustomMetaTileEntity { protected NBTTagCompound mRecipeStuff2; private static final Field ENTITY_ITEM_HEALTH_FIELD_2; @@ -49,6 +50,10 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { super(); Logger.MACHINE_INFO("Created new BaseCustomTileEntity"); } + + public boolean doesExplode() { + return true; + } public void writeToNBT(NBTTagCompound aNBT) { try { @@ -70,6 +75,10 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { } public void doEnergyExplosion() { + if (!doesExplode()) { + Logger.INFO("Machine tried to explode, let's stop that. xo [doEnergyExplosion]"); + return; + } if (this.getUniversalEnergyCapacity() > 0L && this.getUniversalEnergyStored() >= this.getUniversalEnergyCapacity() / 5L) { this.doExplosion( @@ -83,6 +92,12 @@ public class BaseCustomTileEntity extends BaseMetaTileEntity { } public void doExplosion(long aAmount) { + + if (!doesExplode()) { + Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]"); + return; + } + if (this.canAccessData()) { if (GregTech_API.sMachineWireFire && this.mMetaTileEntity.isElectric()) { try { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java index a4440114e8..d600d0baca 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java @@ -10,34 +10,38 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { public BaseCustomPower_MTE() { super(); - Logger.MACHINE_INFO("Created new BaseCustomPower_MTE"); + Logger.INFO("Created new BaseCustomPower_MTE"); + } + + public boolean doesExplode() { + return false; } public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) { if (mMetaTileEntity == null) { - Logger.MACHINE_INFO("Bad Tile"); + Logger.INFO("Bad Tile"); } if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.inputEnergyFrom(aSide) && aAmperage > 0L && aVoltage > 0L && this.getStoredEU() < this.getEUCapacity() && this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()) { - Logger.MACHINE_INFO("Injecting Energy Units"); + Logger.INFO("Injecting Energy Units"); return super.injectEnergyUnits(aSide, aVoltage, aAmperage); } else { - Logger.MACHINE_INFO("canAccessData(): "+canAccessData()); - Logger.MACHINE_INFO("isElectric(): "+this.mMetaTileEntity.isElectric()); - Logger.MACHINE_INFO("InputEnergyFromSide("+aSide+"): "+this.inputEnergyFrom(aSide)); - Logger.MACHINE_INFO("aAmperage: "+aAmperage); - Logger.MACHINE_INFO("aVoltage: "+aVoltage); - Logger.MACHINE_INFO("this.getStoredEU() < this.getEUCapacity(): "+(this.getStoredEU() < this.getEUCapacity())); - Logger.MACHINE_INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: "+(this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage())); - Logger.MACHINE_INFO("this.mMetaTileEntity.maxAmperesIn(): "+(this.mMetaTileEntity.maxAmperesIn())); - Logger.MACHINE_INFO("this.mAcceptedAmperes: "+(this.getInputAmperage())); + Logger.INFO("canAccessData(): "+canAccessData()); + Logger.INFO("isElectric(): "+this.mMetaTileEntity.isElectric()); + Logger.INFO("InputEnergyFromSide("+aSide+"): "+this.inputEnergyFrom(aSide)); + Logger.INFO("aAmperage: "+aAmperage); + Logger.INFO("aVoltage: "+aVoltage); + Logger.INFO("this.getStoredEU() < this.getEUCapacity(): "+(this.getStoredEU() < this.getEUCapacity())); + Logger.INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: "+(this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage())); + Logger.INFO("this.mMetaTileEntity.maxAmperesIn(): "+(this.mMetaTileEntity.maxAmperesIn())); + Logger.INFO("this.mAcceptedAmperes: "+(this.getInputAmperage())); return 0L; } } public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) { - Logger.MACHINE_INFO("Draining Energy Units 4"); + Logger.INFO("Draining Energy Units 4"); if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.outputsEnergyTo(aSide) && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) { if (this.decreaseStoredEU(aVoltage * aAmperage, false)) { @@ -54,7 +58,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { @Override public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) { - Logger.MACHINE_INFO("Draining Energy Units 3"); + Logger.INFO("Draining Energy Units 3"); // TODO Auto-generated method stub return super.decreaseStoredEnergyUnits(aEnergy, aIgnoreTooLessEnergy); } @@ -73,7 +77,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { @Override public boolean outputsEnergyTo(byte aSide) { - Logger.MACHINE_INFO("Draining Energy Units 2"); + Logger.INFO("Draining Energy Units 2"); // TODO Auto-generated method stub return super.outputsEnergyTo(aSide); } @@ -134,7 +138,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity { @Override public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) { - Logger.MACHINE_INFO("Draining Energy Units 1"); + Logger.INFO("Draining Energy Units 1"); // TODO Auto-generated method stub return super.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java index 785c4698db..8110037c46 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java @@ -79,7 +79,6 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo @Override public String[] getDescription() { - AutoMap<String> aTooltip = new AutoMap<String>(); String []s1 = null; s1 = new String[aTooltip.size()]; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java index 8b7ccc202a..31d24ff343 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java @@ -4,7 +4,6 @@ import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.CustomMetaTileBase; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import net.minecraft.entity.Entity; @@ -16,6 +15,7 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { public MetaTileEntityCustomPower(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { super(aID, aBasicName, aRegionalName, aInvSlotCount); this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower()); + this.getBaseMetaTileEntity().setMetaTileID((short) aID); } public MetaTileEntityCustomPower(String aStack, int aInvSlotCount) { @@ -25,11 +25,17 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { public long getMinimumStoredEU() { return 0L; } + + public boolean doesExplode() { + return this.getBaseCustomMetaTileEntity().doesExplode(); + } + + public void doExplosion(long aExplosionPower) { - if (MathUtils.randInt(1, 10) > 0) { - //Logger.INFO("Machine tried to explode, let's stop that. xo"); + if (!doesExplode()) { + Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]"); return; } @@ -68,12 +74,10 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { @Override public void onExplosion() { - - if (MathUtils.randInt(1, 10) > 0) { - //Logger.INFO("Machine tried to explode, let's stop that. xo"); + if (!doesExplode()) { + Logger.INFO("Machine tried to explode, let's stop that. xo [onExplosion]"); return; } - // TODO Auto-generated method stub super.onExplosion(); } @@ -84,7 +88,6 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase { @Override public long getEUVar() { - // TODO Auto-generated method stub return super.getEUVar(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java index e6bf4b8486..3821b2a95c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java @@ -9,8 +9,6 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaBase_Item; import gregtech.api.util.GT_ModHandler; -import gregtech.api.util.GT_Utility; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power.GTPP_MTE_TieredMachineBlock; import ic2.api.item.ElectricItem; @@ -19,9 +17,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock { - + public boolean mCharge = false; public boolean mDecharge = false; public int mBatteryCount = 0; @@ -30,53 +29,50 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock private long mStored = 0L; private long mMax = 0L; - public GT_MetaTileEntity_BasicBreaker(int aID, String aName, String aNameRegional, int aTier, - String aDescription, int aSlotCount) { + public GT_MetaTileEntity_BasicBreaker(int aID, String aName, String aNameRegional, int aTier, String aDescription, int aSlotCount) { super(aID, aName, aNameRegional, aTier, aSlotCount, aDescription, new ITexture[0]); } - public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, - int aSlotCount) { + public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String aDescription, ITexture[][][] aTextures, int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } - public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String[] aDescription, - ITexture[][][] aTextures, int aSlotCount) { + public GT_MetaTileEntity_BasicBreaker(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, int aSlotCount) { super(aName, aTier, aSlotCount, aDescription, aTextures); } public String[] getDescription() { - String []s1 = super.getDescription(); - s1 = new String[0]; - return s1; + final String[] desc = new String[6]; + int tTier = this.mTier; + desc[0] = "" + EnumChatFormatting.BOLD + "16 Fuse Slots"; + desc[1] = "Per each fuse, you may insert " + EnumChatFormatting.YELLOW + (GT_Values.V[tTier]) + EnumChatFormatting.GRAY + " EU/t"; + desc[2] = "However this " + EnumChatFormatting.ITALIC + EnumChatFormatting.RED + "MUST" + EnumChatFormatting.GRAY + " be in a single Amp"; + desc[3] = "This machine can accept upto a single amp of " + GT_Values.VN[Math.min(tTier + 2, 15)] + " as a result"; + desc[4] = "Breaker Loss: " + EnumChatFormatting.RED + "" + (GT_Values.V[tTier] / 16) + EnumChatFormatting.GRAY + " EU/t"; + desc[5] = CORE.GT_Tooltip; + return desc; } public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[2][17][]; for (byte i = -1; i < 16; ++i) { - rTextures[0][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - this.mInventory.length > 4 - ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)] - : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)]}; - - rTextures[1][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i + 1], - this.mInventory.length > 4 - ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - : BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; + rTextures[0][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i + + 1], this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_IN_MULTI[Math.min(12, mTier)] : BlockIcons.OVERLAYS_ENERGY_IN[Math.min(12, mTier)]}; + + rTextures[1][i + 1] = new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][i + + 1], this.mInventory.length > 4 ? BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] : BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier]}; } return rTextures; } - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, - boolean aActive, boolean aRedstone) { + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1]; } public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_BasicBreaker(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, - this.mInventory.length); + return new GT_MetaTileEntity_BasicBreaker(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mInventory.length); } public boolean isSimpleMachine() { @@ -132,11 +128,11 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock } public long maxAmperesIn() { - return (long) (1); + return 16; } public long maxAmperesOut() { - return (long) 16; + return 16; } public int rechargerSlotStartIndex() { @@ -176,7 +172,8 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { if (aBaseMetaTileEntity.isClientSide()) { return true; - } else { + } + else { aBaseMetaTileEntity.openGUI(aPlayer); return true; } @@ -199,14 +196,14 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock this.mChargeableCount = 0; ItemStack[] arg3 = this.mInventory; int arg4 = arg3.length; - + for (int arg5 = 0; arg5 < arg4; ++arg5) { ItemStack tStack = arg3[arg5]; if (GT_ModHandler.isElectricItem(tStack, this.mTier)) { if (GT_ModHandler.isChargerItem(tStack)) { ++this.mBatteryCount; } - + ++this.mChargeableCount; } }*/ @@ -254,7 +251,8 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock tStored += tStep; } - } else if (aStack.getItem() instanceof IElectricItem) { + } + else if (aStack.getItem() instanceof IElectricItem) { tStored += (long) ElectricItem.manager.getCharge(aStack); tScale += (long) ((IElectricItem) aStack.getItem()).getMaxCharge(aStack); } @@ -273,11 +271,15 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock return new long[]{tStored, tScale}; } - public String[] getInfoData() { - return new String[]{}; + public String[] getInfoData() { + return new String[]{"Tile Type: " + this.getTileEntityBaseType()}; } public boolean isGivingInformation() { return true; } -}
\ No newline at end of file + + public boolean doesExplode() { + return true; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java index a892346463..67a6fc7aeb 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java @@ -2,8 +2,6 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import java.util.ArrayList; -import gregtech.api.gui.GT_Container_4by4; -import gregtech.api.gui.GT_GUIContainer_4by4; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; @@ -11,7 +9,11 @@ import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_LanguageManager; import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.gui.CONTAINER_DataHatch; +import gtPlusPlus.xmod.gregtech.api.gui.GUI_DataHatch; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -22,28 +24,30 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE public GT_Recipe_Map mRecipeMap = null; public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(int aID, String aName, String aNameRegional, int aTier) { - super(aID, aName, aNameRegional, aTier, 16, new String[]{ + super(aID, aName, aNameRegional, aTier, 17, new String[]{ "Holds Data Orbs for the Elemental Duplicator", + "Can insert/extract the circuit slot", + "Use Circuit to select a slot (1-16)", CORE.GT_Tooltip }); } public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 16, aDescription, aTextures); + super(aName, aTier, 17, aDescription, aTextures); } public GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { - super(aName, aTier, 16, aDescription, aTextures); + super(aName, aTier, 17, aDescription, aTextures); } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Cyber_Interface)}; + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb)}; } @Override public ITexture[] getTexturesInactive(ITexture aBaseTexture) { - return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Cyber_Interface)}; + return new ITexture[]{aBaseTexture, new GT_RenderedTexture(TexturesGtBlock.Overlay_Hatch_Data_Orb)}; } @Override @@ -80,12 +84,12 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_4by4(aPlayerInventory, aBaseMetaTileEntity); + return new CONTAINER_DataHatch(aPlayerInventory, aBaseMetaTileEntity); } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_4by4(aPlayerInventory, aBaseMetaTileEntity, "Data Orb Repository"); + return new GUI_DataHatch(aPlayerInventory, aBaseMetaTileEntity, "Data Orb Repository"); } @Override @@ -96,13 +100,13 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE } public void updateSlots() { - for (int i = 0; i < mInventory.length; i++) + for (int i = 0; i < mInventory.length-1; i++) if (mInventory[i] != null && mInventory[i].stackSize <= 0) mInventory[i] = null; fillStacksIntoFirstSlots(); } protected void fillStacksIntoFirstSlots() { - for (int i = 0; i < mInventory.length; i++) { + for (int i = 0; i < mInventory.length-1; i++) { if (mInventory[i] != null && mInventory[i].stackSize <= 0) { mInventory[i] = null; } @@ -130,20 +134,47 @@ public class GT_MetaTileEntity_Hatch_ElementalDataOrbHolder extends GT_MetaTileE @Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return true; + Logger.INFO("Checking if we can pull "+aStack.getDisplayName()+" from slot "+aIndex); + if (aIndex == mInventory.length-1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) { + return true; + } + return false; } @Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aSide == getBaseMetaTileEntity().getFrontFacing() && (mRecipeMap == null || mRecipeMap.containsInput(aStack)); + Logger.INFO("Checking if we can put "+aStack.getDisplayName()+" into slot "+aIndex); + if (aIndex == mInventory.length-1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) { + return true; + } + return false; } public ArrayList<ItemStack> getInventory(){ ArrayList<ItemStack> aContents = new ArrayList<ItemStack>(); - for (int i=0;i<this.getSizeInventory();i++) { - aContents.add(this.getStackInSlot(i)); - } + for (int i = getBaseMetaTileEntity().getSizeInventory() - 2; i >= 0; i--) { + if (getBaseMetaTileEntity().getStackInSlot(i) != null) + aContents.add(getBaseMetaTileEntity().getStackInSlot(i)); + } return aContents; } + @Override + public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide) { + if (aIndex == mInventory.length-1 && ItemUtils.isControlCircuit(aStack) && aSide == getBaseMetaTileEntity().getFrontFacing()) { + Logger.INFO("Putting "+aStack.getDisplayName()+" into slot "+aIndex); + return true; + } + return false; + } + + @Override + public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide) { + if (aIndex == mInventory.length-1 && ItemUtils.isControlCircuit(aStack)) { + Logger.INFO("Pulling "+aStack.getDisplayName()+" from slot "+aIndex); + return true; + } + return false; + } + } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java index a9cd179214..a4040c1c5e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java @@ -1,18 +1,21 @@ -/* package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations; import gregtech.api.GregTech_API; +import gregtech.api.enums.Materials; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.MetaTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicMachine; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.minecraft.BlockPos; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.gui.hatches.CONTAINER_1by1_Turbine; import gtPlusPlus.xmod.gregtech.api.gui.hatches.GUI_1by1_Turbine; @@ -21,15 +24,16 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextu import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GregtechMetaTileEntity_LargerTurbineBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +@SuppressWarnings("deprecation") public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { public boolean mHasController = false; public boolean mUsingAnimation = true; private String mControllerLocation; + public int mEUt = 0; public GT_MetaTileEntity_Hatch_Turbine(int aID, String aName, String aNameRegional, int aTier) { super(aID, aName, aNameRegional, aTier, 16, "Turbine Rotor holder for XL Turbines"); @@ -42,6 +46,18 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { public GT_MetaTileEntity_Hatch_Turbine(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, 1, aDescription[0], aTextures); } + + @Override + public String[] getDescription() { + return new String[]{ + this.mDescription, + "Right Click with a soldering iron to reset controller link", + "Right Click with a wrench to remove turbine", + "Right Click with a screwdriver for technical information", + "Sneak + Right Click with a wrench to rotate", + "Sneak + Right Click with a screwdriver to disable animations", + CORE.GT_Tooltip}; + } @Override public ITexture[] getTexturesActive(ITexture aBaseTexture) { @@ -53,6 +69,14 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { return new ITexture[]{aBaseTexture, getFrontFacingTurbineTexture()}; } + public int getEU() { + return this.mEUt; + } + + public void setEU(int aEU) { + this.mEUt = aEU; + } + @Override public boolean isSimpleMachine() { return true; @@ -73,6 +97,31 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { return false; } + public boolean hasTurbine() { + ItemStack aStack = this.mInventory[0]; + boolean aIsValid = GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(aStack); + return aIsValid; + } + + public ItemStack getTurbine() { + if (hasTurbine()) { + return this.mInventory[0]; + } + return null; + } + + public boolean canWork() { + return hasTurbine(); + } + + public boolean insertTurbine(ItemStack aTurbine) { + if (GregtechMetaTileEntity_LargerTurbineBase.isValidTurbine(aTurbine)) { + this.mInventory[0] = aTurbine; + return true; + } + return false; + } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Hatch_Turbine(mName, mTier, StaticFields59.getDescriptionArray(this), mTextures); @@ -80,32 +129,23 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (aBaseMetaTileEntity.isClientSide()) return true; - //aBaseMetaTileEntity.openGUI(aPlayer); - PlayerUtils.messagePlayer(aPlayer, "[Turbine Assembly Data] Using Animations? "+usingAnimations()); - PlayerUtils.messagePlayer(aPlayer, "[Turbine Assembly Data] Has Controller? "+this.mHasController); - if (mHasController) { - PlayerUtils.messagePlayer(aPlayer, "[Turbine Assembly Data] Controller Location: "+BlockPos.generateBlockPos(mControllerLocation).getLocationString()); - PlayerUtils.messagePlayer(aPlayer, "[Turbine Assembly Data] Controller Active? "+this.isControllerActive()); + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + else { + aBaseMetaTileEntity.openGUI(aPlayer); } - PlayerUtils.messagePlayer(aPlayer, "[Turbine Assembly Data] Is Active? "+this.getBaseMetaTileEntity().isActive()); return true; } @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - switch (mTier) { - default: - return new CONTAINER_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity); - } + return new CONTAINER_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity); } @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - switch (mTier) { - default: - return new GUI_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity, "Turbine Rotor Hatch"); - } + return new GUI_1by1_Turbine(aPlayerInventory, aBaseMetaTileEntity, "Turbine Rotor Hatch"); } @Override @@ -122,6 +162,20 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { public int getInventoryStackLimit() { return 1; } + + public void damageTurbine(int aEUt, int damageFactorLow, float damageFactorHigh) { + if (hasTurbine() && MathUtils.randInt(0, 1) == 0) { + ItemStack aTurbine = getTurbine(); + ((GT_MetaGenerated_Tool) aTurbine.getItem()).doDamage(aTurbine, (long)getDamageToComponent(aTurbine) * (long) Math.min(aEUt / damageFactorLow, Math.pow(aEUt, damageFactorHigh))); + if (aTurbine.stackSize == 0) { + aTurbine = null; + } + } + } + + private final int getDamageToComponent(ItemStack aStack) { + return 1; + } @Override public void saveNBTData(NBTTagCompound aNBT) { @@ -138,22 +192,6 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); - this.mUsingAnimation = Utils.invertBoolean(mUsingAnimation); - if (this.mUsingAnimation) { - PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture."); - } - else { - PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture."); - } - PlayerUtils.messagePlayer(aPlayer, "Has Controller: "+this.mHasController); - if (mHasController) { - PlayerUtils.messagePlayer(aPlayer, "Controller Location: "+this.mControllerLocation); - } - } - - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); if (this.mHasController) { @@ -180,10 +218,10 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { public boolean isControllerActive() { GregtechMetaTileEntity_LargerTurbineBase x = getController(); if (x != null) { - Logger.INFO("Checking Status of Controller."); - return x.isMachineRunning(); + //Logger.INFO("Checking Status of Controller. Running? "+(x.mEUt > 0)); + return x.mEUt > 0; } - Logger.INFO("Status of Controller failed, controller is null."); + //Logger.INFO("Status of Controller failed, controller is null."); return false; } @@ -239,7 +277,7 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { private ITexture getFrontFacingTurbineTexture() { if (!mHasController) { - return this.getBaseMetaTileEntity().isActive() ? new GT_RenderedTexture(LargeTurbineTextureHandler.frontFaceHPActive_4) : new GT_RenderedTexture(LargeTurbineTextureHandler.frontFace_4 ); + return this.getBaseMetaTileEntity().isActive() ? new GT_RenderedTexture(LargeTurbineTextureHandler.OVERLAY_LP_TURBINE_ACTIVE[4] ) : new GT_RenderedTexture(LargeTurbineTextureHandler.OVERLAY_LP_TURBINE[4] ); } else { if (usingAnimations()) { @@ -271,46 +309,98 @@ public class GT_MetaTileEntity_Hatch_Turbine extends GT_MetaTileEntity_Hatch { return false; } + public void setActive(boolean b) { + this.getBaseMetaTileEntity().setActive(b); + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return false; + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (!aPlayer.isSneaking()) { + PlayerUtils.messagePlayer(aPlayer, "Using Animations? "+usingAnimations()); + PlayerUtils.messagePlayer(aPlayer, "Has Controller? "+this.mHasController); + if (mHasController) { + PlayerUtils.messagePlayer(aPlayer, "Controller Location: "+BlockPos.generateBlockPos(mControllerLocation).getLocationString()); + PlayerUtils.messagePlayer(aPlayer, "Controller Active? "+this.isControllerActive()); + } + PlayerUtils.messagePlayer(aPlayer, "Active? "+this.getBaseMetaTileEntity().isActive()); + PlayerUtils.messagePlayer(aPlayer, "Has Turbine inserted? "+this.hasTurbine()); + if (this.hasTurbine()) { + Materials aMat = GT_MetaGenerated_Tool.getPrimaryMaterial(getTurbine()); + String aSize = GregtechMetaTileEntity_LargerTurbineBase.getTurbineSizeString(GregtechMetaTileEntity_LargerTurbineBase.getTurbineSize(getTurbine())); + PlayerUtils.messagePlayer(aPlayer, "Using: "+aMat.mLocalizedName+" "+aSize); + } + } + else { + this.mUsingAnimation = Utils.invertBoolean(mUsingAnimation); + if (this.mUsingAnimation) { + PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture."); + } + else { + PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture."); + } + } + } + @Override - public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, - float aZ) { - // TODO Auto-generated method stub + public boolean onWrenchRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (this.getBaseMetaTileEntity().isServerSide() && !aPlayer.isSneaking()) { + ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); + if (tCurrentItem != null) { + if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) { + return onToolClick(tCurrentItem, aPlayer, aWrenchingSide); + } + } + } return super.onWrenchRightClick(aSide, aWrenchingSide, aPlayer, aX, aY, aZ); } @Override - public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, - float aY, float aZ) { - //Do Super - boolean aSuper = super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); - // Do Things + public boolean onSolderingToolRightClick(byte aSide, byte aWrenchingSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (this.getBaseMetaTileEntity().isServerSide()) { ItemStack tCurrentItem = aPlayer.inventory.getCurrentItem(); - if (tCurrentItem != null) { - if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSoftHammerList)) { - if (mControllerLocation != null && mControllerLocation.length() > 0) { - if (setController(BlockPos.generateBlockPos(mControllerLocation))) { - if (GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { - String tChat = "Trying to Reset linked Controller"; - IGregTechTileEntity g = this.getBaseMetaTileEntity(); - GT_Utility.sendChatToPlayer(aPlayer, tChat); - GT_Utility.sendSoundToPlayers(g.getWorld(), GregTech_API.sSoundList.get(101), 1.0F, -1, - g.getXCoord(), g.getYCoord(), g.getZCoord()); - } - } + if (tCurrentItem != null) { + if (tCurrentItem.getItem() instanceof GT_MetaGenerated_Tool) { + return onToolClick(tCurrentItem, aPlayer, aWrenchingSide); + } + } + } + return false; + } + + public boolean onToolClick(ItemStack tCurrentItem, EntityPlayer aPlayer, byte aSide) { + if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sWrenchList)) { + boolean aHasTurbine = this.hasTurbine(); + if (aPlayer.inventory.getFirstEmptyStack() >= 0 && aHasTurbine) { + if (PlayerUtils.isCreative(aPlayer) || GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + aPlayer.inventory.addItemStackToInventory((this.getTurbine())); + this.mInventory[0] = null; + GT_Utility.sendChatToPlayer(aPlayer, "Removed turbine with wrench."); + return true; + } + } + else { + GT_Utility.sendChatToPlayer(aPlayer, aHasTurbine ? "Cannot remove turbine, no free inventory space." : "No turbine to remove."); + } + } + else if (GT_Utility.isStackInList(tCurrentItem, GregTech_API.sSolderingToolList)) { + if (mControllerLocation != null && mControllerLocation.length() > 0) { + if (setController(BlockPos.generateBlockPos(mControllerLocation))) { + if (PlayerUtils.isCreative(aPlayer) || GT_ModHandler.damageOrDechargeItem(tCurrentItem, 1, 1000, aPlayer)) { + String tChat = "Trying to Reset linked Controller"; + IGregTechTileEntity g = this.getBaseMetaTileEntity(); + GT_Utility.sendChatToPlayer(aPlayer, tChat); + GT_Utility.sendSoundToPlayers(g.getWorld(), GregTech_API.sSoundList.get(101), 1.0F, -1, g.getXCoord(), g.getYCoord(), g.getZCoord()); + return true; } } } } - return aSuper; + return false; } - public void setActive(boolean b) { - this.getBaseMetaTileEntity().setActive(b); - } - - - - - -}*/ +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java index 422837fa46..fdc8a7777b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java @@ -2,20 +2,52 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base; import java.util.Locale; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GT_LanguageManager; -import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.interfaces.IBaseCustomMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.Meta_GT_Proxy; import net.minecraft.item.ItemStack; public abstract class CustomMetaTileBase extends MetaTileEntity { + + private IBaseCustomMetaTileEntity mBaseCustomMetaTileEntity2; + + /** + * accessibility to this Field is no longer given, see below + */ + private IGregTechTileEntity mBaseCustomMetaTileEntity; + public CustomMetaTileBase(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) { super(aID, aBasicName, aRegionalName, aInvSlotCount); GT_LanguageManager.addStringLocalization("gtpp.blockmachines." + aBasicName.replaceAll(" ", "_").toLowerCase(Locale.ENGLISH) + ".name", aRegionalName); this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntity()); - this.getBaseMetaTileEntity().setMetaTileID((short) aID); + this.getBaseMetaTileEntity().setMetaTileID((short) aID); + mBaseCustomMetaTileEntity2 = (IBaseCustomMetaTileEntity) getBaseMetaTileEntity(); } + + @Override + public IGregTechTileEntity getBaseMetaTileEntity() { + return mBaseCustomMetaTileEntity; + } + + public IBaseCustomMetaTileEntity getBaseCustomMetaTileEntity() { + return mBaseCustomMetaTileEntity2; + } + + @Override + public void setBaseMetaTileEntity(IGregTechTileEntity aBaseMetaTileEntity) { + super.setBaseMetaTileEntity(aBaseMetaTileEntity); + if (mBaseCustomMetaTileEntity != null && aBaseMetaTileEntity == null) { + mBaseCustomMetaTileEntity.getMetaTileEntity().inValidate(); + mBaseCustomMetaTileEntity.setMetaTileEntity(null); + } + mBaseCustomMetaTileEntity = aBaseMetaTileEntity; + if (mBaseCustomMetaTileEntity != null) { + mBaseCustomMetaTileEntity.setMetaTileEntity(this); + } + } public CustomMetaTileBase(String aName, int aInvSlotCount) { super(aName, aInvSlotCount); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java index 768a57f8b2..d0021f8358 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java @@ -87,6 +87,7 @@ public class GregtechMetaTransformerHiAmp extends GT_MetaTileEntity_Transformer public String[] getDescription() { return new String[] { this.mDescription, "Accepts 4A and outputs 16A", + "Toggle 2A/8A half-mode with Screwdriver", CORE.GT_Tooltip}; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java index 356f96f7cc..1232166baa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java @@ -40,7 +40,6 @@ import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEn import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBattery; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBattery; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; -import gtPlusPlus.xmod.gregtech.api.objects.MultiblockRequirements; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; @@ -94,7 +93,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En private static final Method findRecipe09; public GT_Recipe mLastRecipe; - private MultiblockRequirements mRequirements; private boolean mInternalCircuit = false; protected long mTotalRunTime = 0; protected boolean mVoidExcess = false; @@ -191,81 +189,102 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En @Override public final String[] getInfoData() { ArrayList<String> mInfo = new ArrayList<String>(); - if (!this.getMetaName().equals("")) { - mInfo.add(this.getMetaName()); - } - - String[] extra = getExtraInfoData(); - - if (extra == null) { - extra = new String[0]; - } - if (extra.length > 0) { - for (String s : extra) { - mInfo.add(s); + try { + if (!this.getMetaName().equals("")) { + mInfo.add(this.getMetaName()); } - } - - long seconds = (this.mTotalRunTime/20); - int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7); - int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks); - long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7*weeks); - long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60); - long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60); - - int mPollutionReduction = getPollutionReductionForAllMufflers(); - long storedEnergy = getStoredEnergyInAllEnergyHatches(); - long maxEnergy = getMaxEnergyStorageOfAllEnergyHatches(); - int tTier = this.getControlCoreTier(); - mInfo.add(getMachineTooltip()); - + String[] extra = getExtraInfoData(); - //Lets borrow the GTNH handling - - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+ - EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ - EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s"); - - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+": "+ - EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU"); - - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+": "+ - EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t"); - - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+": "+ - EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t(*2A) "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ - EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET); - - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.problems")+": "+ - EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ - " "+StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ - EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %"); + if (extra == null) { + extra = new String[0]; + } + if (extra.length > 0) { + for (String s : extra) { + mInfo.add(s); + } + } + long seconds = (this.mTotalRunTime/20); + int weeks = (int) (TimeUnit.SECONDS.toDays(seconds) / 7); + int days = (int) (TimeUnit.SECONDS.toDays(seconds) - 7 * weeks); + long hours = TimeUnit.SECONDS.toHours(seconds) - TimeUnit.DAYS.toHours(days) - TimeUnit.DAYS.toHours(7*weeks); + long minutes = TimeUnit.SECONDS.toMinutes(seconds) - (TimeUnit.SECONDS.toHours(seconds) * 60); + long second = TimeUnit.SECONDS.toSeconds(seconds) - (TimeUnit.SECONDS.toMinutes(seconds) *60); + + mInfo.add(getMachineTooltip()); + + //Lets borrow the GTNH handling + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.progress")+": "+ + EnumChatFormatting.GREEN + Integer.toString(mProgresstime/20) + EnumChatFormatting.RESET +" s / "+ + EnumChatFormatting.YELLOW + Integer.toString(mMaxProgresstime/20) + EnumChatFormatting.RESET +" s"); + + + if (!this.mAllEnergyHatches.isEmpty()) { + long storedEnergy = getStoredEnergyInAllEnergyHatches(); + long maxEnergy = getMaxEnergyStorageOfAllEnergyHatches(); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+":"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU")); + + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.mei")+":"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.YELLOW+Long.toString(getMaxInputVoltage())+EnumChatFormatting.RESET+ " EU/t(*2A) "+StatCollector.translateToLocal("GTPP.machines.tier")+": "+ + EnumChatFormatting.YELLOW+GT_Values.VN[GT_Utility.getTier(getMaxInputVoltage())]+ EnumChatFormatting.RESET)); + ; + } + if (!this.mAllDynamoHatches.isEmpty()) { + long storedEnergy = getStoredEnergyInAllDynamoHatches(); + long maxEnergy = getMaxEnergyStorageOfAllDynamoHatches(); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.energy")+" In Dynamos:"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU")); + } - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + this.getPollutionPerTick(null)*20+ EnumChatFormatting.RESET+"/sec"); - mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"); + if (-mEUt > 0) { + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.usage")+":"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.RED + Integer.toString(-mEUt) + EnumChatFormatting.RESET + " EU/t")); + } + else { + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.generation")+":"); + mInfo.add(StatCollector.translateToLocal(""+EnumChatFormatting.GREEN + Integer.toString(mEUt) + EnumChatFormatting.RESET + " EU/t")); + } + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.problems")+": "+ + EnumChatFormatting.RED+ (getIdealStatus() - getRepairStatus())+EnumChatFormatting.RESET+ + " "+StatCollector.translateToLocal("GTPP.multiblock.efficiency")+": "+ + EnumChatFormatting.YELLOW+Float.toString(mEfficiency / 100.0F)+EnumChatFormatting.RESET + " %"); - mInfo.add(StatCollector.translateToLocal("GTPP.CC.machinetier")+": "+ - EnumChatFormatting.GREEN+tTier+EnumChatFormatting.RESET); + if (this.getPollutionPerSecond(null) > 0) { + int mPollutionReduction = getPollutionReductionForAllMufflers(); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollution")+": "+ EnumChatFormatting.RED + this.getPollutionPerSecond(null)+ EnumChatFormatting.RESET+"/sec"); + mInfo.add(StatCollector.translateToLocal("GTPP.multiblock.pollutionreduced")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %"); + } - mInfo.add(StatCollector.translateToLocal("GTPP.CC.discount")+": "+ - EnumChatFormatting.GREEN+(getEuDiscountForParallelism())+EnumChatFormatting.RESET + "%"); + if (this.mControlCoreBus.size() > 0) { + int tTier = this.getControlCoreTier(); + mInfo.add(StatCollector.translateToLocal("GTPP.CC.machinetier")+": "+ + EnumChatFormatting.GREEN+tTier+EnumChatFormatting.RESET); + } - mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(getMaxParallelRecipes())+EnumChatFormatting.RESET); + mInfo.add(StatCollector.translateToLocal("GTPP.CC.discount")+": "+ + EnumChatFormatting.GREEN+(getEuDiscountForParallelism())+EnumChatFormatting.RESET + "%"); + mInfo.add(StatCollector.translateToLocal("GTPP.CC.parallel")+": "+EnumChatFormatting.GREEN+(getMaxParallelRecipes())+EnumChatFormatting.RESET); - mInfo.add("Total Time Since Built: " + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks, " + EnumChatFormatting.DARK_GREEN+ Integer.toString(days) +EnumChatFormatting.RESET+ " Days, "); - mInfo.add(EnumChatFormatting.DARK_GREEN + Long.toString(hours) +EnumChatFormatting.RESET + " Hours, " + EnumChatFormatting.DARK_GREEN+ Long.toString(minutes) +EnumChatFormatting.RESET+ " Minutes, " + EnumChatFormatting.DARK_GREEN+ Long.toString(second) +EnumChatFormatting.RESET+ " Seconds."); - mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + Long.toString(this.mTotalRunTime)); + mInfo.add("Total Time Since Built: " + EnumChatFormatting.DARK_GREEN + Integer.toString(weeks)+EnumChatFormatting.RESET+" Weeks, " + EnumChatFormatting.DARK_GREEN+ Integer.toString(days) +EnumChatFormatting.RESET+ " Days, "); + mInfo.add(EnumChatFormatting.DARK_GREEN + Long.toString(hours) +EnumChatFormatting.RESET + " Hours, " + EnumChatFormatting.DARK_GREEN+ Long.toString(minutes) +EnumChatFormatting.RESET+ " Minutes, " + EnumChatFormatting.DARK_GREEN+ Long.toString(second) +EnumChatFormatting.RESET+ " Seconds."); + mInfo.add("Total Time in ticks: " + EnumChatFormatting.DARK_GREEN + Long.toString(this.mTotalRunTime)); - String[] mInfo2 = new String[mInfo.size()]; - mInfo.toArray(mInfo2); - return mInfo2; + String[] mInfo2 = mInfo.toArray(new String[mInfo.size()]); + return mInfo2; + } + catch (Throwable t) { + t.printStackTrace(); + } + return new String[] {}; } @@ -282,7 +301,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En public long getStoredEnergyInAllEnergyHatches() { long storedEnergy=0; - for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + for(GT_MetaTileEntity_Hatch tHatch : mAllEnergyHatches) { if (isValidMetaTileEntity(tHatch)) { storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); } @@ -292,7 +311,27 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En public long getMaxEnergyStorageOfAllEnergyHatches() { long maxEnergy=0; - for(GT_MetaTileEntity_Hatch_Energy tHatch : mEnergyHatches) { + for(GT_MetaTileEntity_Hatch tHatch : mAllEnergyHatches) { + if (isValidMetaTileEntity(tHatch)) { + maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); + } + } + return maxEnergy; + } + + public long getStoredEnergyInAllDynamoHatches() { + long storedEnergy=0; + for(GT_MetaTileEntity_Hatch tHatch : mAllDynamoHatches) { + if (isValidMetaTileEntity(tHatch)) { + storedEnergy+=tHatch.getBaseMetaTileEntity().getStoredEU(); + } + } + return storedEnergy; + } + + public long getMaxEnergyStorageOfAllDynamoHatches() { + long maxEnergy=0; + for(GT_MetaTileEntity_Hatch tHatch : mAllDynamoHatches) { if (isValidMetaTileEntity(tHatch)) { maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); } @@ -316,17 +355,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En public final static String TAG_HIDE_POLLUTION = "TAG_HIDE_POLLUTION"; public final static String TAG_HIDE_MACHINE_TYPE = "TAG_HIDE_MACHINE_TYPE"; - public synchronized final MultiblockRequirements getRequirements() { - return mRequirements; - } - - //public abstract MultiblockRequirements setRequirements(); - - public synchronized final void setRequirementsInternal() { - //this.mRequirements = setRequirements(); - this.mRequirements = null; - } - public int getAmountOfOutputs() { return 1; } @@ -725,26 +753,6 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll); } - public boolean checkRecipeGeneric(GT_Recipe aRecipe, - int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, boolean isPerfectOC) { - if (aRecipe == null) { - return false; - } - ArrayList<ItemStack> tItems = getStoredInputs(); - ArrayList<FluidStack> tFluids = getStoredFluids(); - ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); - FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); - return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe, isPerfectOC); - } - - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, FluidStack[] aFluidInputs, - int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll) { - return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null, false); - } - public boolean checkRecipeGeneric(GT_Recipe aRecipe, int aMaxParallelRecipes, int aEUPercent, int aSpeedBonusPercent, int aOutputChanceRoll) { @@ -755,14 +763,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En ArrayList<FluidStack> tFluids = getStoredFluids(); ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); - return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe, false); + return checkRecipeGeneric(tItemInputs, tFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, aRecipe); } public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, boolean isPerfectOC) { - return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null, isPerfectOC); + int aSpeedBonusPercent, int aOutputChanceRoll) { + return checkRecipeGeneric(aItemInputs, aFluidInputs, aMaxParallelRecipes, aEUPercent, aSpeedBonusPercent, aOutputChanceRoll, null); } @@ -913,10 +921,14 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En return rEnergy; } + public boolean hasPerfectOverclock() { + return false; + } + public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) { + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. // Reset outputs and progress stats @@ -931,7 +943,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En log("Running checkRecipeGeneric(0)"); GT_Recipe tRecipe = findRecipe( - getBaseMetaTileEntity(), mLastRecipe, false, + getBaseMetaTileEntity(), mLastRecipe, false, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); log("Running checkRecipeGeneric(1)"); @@ -1041,8 +1053,12 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En } else { while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { this.mEUt *= 4; - if (isPerpectOC) this.mMaxProgresstime /= 4; - else this.mMaxProgresstime /= 2; + if (hasPerfectOverclock()) { + this.mMaxProgresstime /= 4; + } + else { + this.mMaxProgresstime /= 2; + } } } @@ -1284,7 +1300,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En //Bad modify, let's just use the original recipe. if (!mHasBoostedCurrentRecipe || mBoostedRecipe == null) { tRecipe = aRecipe != null ? aRecipe : findRecipe( - getBaseMetaTileEntity(), mLastRecipe, false, + getBaseMetaTileEntity(), mLastRecipe, false, false, gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aItemInputs); } @@ -1452,7 +1468,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En public boolean isMachineRunning() { boolean aRunning = this.getBaseMetaTileEntity().isActive(); - log("Queried Multiblock is currently running: "+aRunning); + //log("Queried Multiblock is currently running: "+aRunning); return aRunning; } @@ -1662,7 +1678,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En } public boolean checkHatch() { - return mMaintenanceHatches.size() <= 1 && !mMufflerHatches.isEmpty(); + return mMaintenanceHatches.size() <= 1 && (this.getPollutionPerSecond(null) > 0 ? !mMufflerHatches.isEmpty() : true); } public <E> boolean addToMachineListInternal(ArrayList<E> aList, final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { @@ -2426,7 +2442,7 @@ public abstract class GregtechMeta_MultiBlockBase<T extends GT_MetaTileEntity_En } else { try { - return (GT_Recipe) findRecipe09.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs); + return (GT_Recipe) findRecipe09.invoke(getRecipeMap(), aTileEntity, aRecipe, aNotUnificated, aDontCheckStackSizes, aVoltage, aFluids, aSpecialSlot, aInputs); } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { e.printStackTrace(); return null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockBlueprint.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockBlueprint.java deleted file mode 100644 index 7af6af2ffd..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockBlueprint.java +++ /dev/null @@ -1,469 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.objects; - -import gregtech.api.interfaces.metatileentity.IMetaTileEntity; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.api.objects.data.Triplet; -import gtPlusPlus.api.objects.minecraft.BlockPos; -import gtPlusPlus.xmod.gregtech.api.objects.MultiblockLayer.LayerBlockData; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.util.ForgeDirection; - -public abstract class MultiblockBlueprint { - - private final MultiblockLayer[] mBlueprintData; - - public final int height; - public final int width; - public final int depth; - public final int mMinimumCasingCount; - public final int mTextureID; - - /** - * Cached Matrix of the Multiblock, which makes future structural checks far quicker. - */ - private final BlockPos[][][] StructureMatrix; - - /** - * Has {@value StructureMatrix} been set yet? - */ - @SuppressWarnings("unused") - private boolean mGeneratedMatrix = false; - - /** - * A detailed class which will contain blueprints for a Multiblock. - * Values are not relative to the controller, but in total. - * @param x - Overall width - * @param y - Overall height - * @param z - Overall depth - * @param aMinimumCasings - The lowest amount of casings required - * @param aTextureID - The texture ID used by hatches. - */ - public MultiblockBlueprint(final int x, final int y, final int z, final int aMinimumCasings, final int aTextureID) { - mBlueprintData = new MultiblockLayer[y]; - height = y; - width = x; - depth = z; - mMinimumCasingCount = aMinimumCasings; - mTextureID = aTextureID; - StructureMatrix = new BlockPos[width][height][depth]; - //Logger.INFO("Created new Blueprint."); - } - - /** - * - * @param aY - The Y level of the layer to return, where 0 is the bottom and N is the top. - * @return - A {@link MultiblockLayer} object. - */ - public MultiblockLayer getLayer(int aY) { - return mBlueprintData[aY]; - } - - /** - * - * @param aLayer - A {@link MultiblockLayer} object. - * @param aY - The Y level of the layer, where 0 is the bottom and N is the top. - * - */ - public void setLayer(MultiblockLayer aLayer, int aY) { - mBlueprintData[aY] = aLayer; - } - - public MultiblockLayer getControllerLayer() { - for (MultiblockLayer u : mBlueprintData) { - if (u.hasController()) { - return u; - } - } - return null; - } - - public int getControllerY() { - int i = 0; - for (MultiblockLayer u : mBlueprintData) { - if (u.hasController()) { - return i; - } - i++; - } - return 0; - } - - @SuppressWarnings({ "unused", "rawtypes" }) - public boolean checkMachine(final IGregTechTileEntity aBaseMetaTileEntity) { - //Check for Nulls - if (aBaseMetaTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aBaseMetaTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - GT_MetaTileEntity_MultiBlockBase aControllerObject = null; - if (aMetaTileEntity instanceof GT_MetaTileEntity_MultiBlockBase) { - aControllerObject = (GT_MetaTileEntity_MultiBlockBase) aMetaTileEntity; - } - if (aControllerObject == null) { - return false; - } - - //Get some Vars - int xOffSetMulti = ((this.getControllerLayer().width-1)/2); - int zOffSetMulti = ((this.getControllerLayer().depth-1)/2); - final int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * xOffSetMulti; - final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * zOffSetMulti; - ForgeDirection aDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()); - int tAmount = 0; - - int contX = aControllerObject.getBaseMetaTileEntity().getXCoord(), contY = aControllerObject.getBaseMetaTileEntity().getYCoord(), contZ = aControllerObject.getBaseMetaTileEntity().getZCoord(); - - Logger.INFO("Controller is located at ["+contX+", "+contY+", "+contZ+"]"); - - boolean debugCacheDataVisually = true; - - - if (/*!mGeneratedMatrix || StructureMatrix == null*/ true) { - //Try Fancy Cache Stuff - BlockPos aPos = getOffsetRelativeToGridPosition(aBaseMetaTileEntity, 0, 0, 0); - for (int Y = 0; Y < height; Y++) { - for (int Z = 0; Z < depth; Z++) { - for (int X = 0; X < width; X++) { - int offsetX, offsetZ; - Pair<Integer, Integer> j = MultiblockLayer.rotateOffsetValues(aDir, X, Z); - offsetX = j.getKey(); - offsetZ = j.getValue(); - - Logger.INFO("Pre-Rotated Offsets ["+X+", "+(aPos.yPos + Y)+", "+Z+"] | "+aDir.name()); - Logger.INFO("Rotated Offsets ["+offsetX+", "+(aPos.yPos + Y)+", "+offsetZ+"]"); - - // Resolve Negatives - int negTestX, negTestZ; - if (aPos.xPos < 0) { - int testA = aPos.xPos; - testA -= -offsetX; - negTestX = testA; - } else { - negTestX = offsetX + aPos.xPos; - } - if (aPos.zPos < 0) { - int testA = aPos.zPos; - testA -= -offsetZ; - negTestZ = testA; - } else { - negTestZ = offsetZ + aPos.zPos; - } - Logger.INFO("Caching With Offset ["+negTestX+", "+(aPos.yPos + Y)+", "+negTestZ+"]"); - StructureMatrix[X][Y][Z] = new BlockPos(negTestX, (aPos.yPos + Y), negTestZ, aPos.world); - - if (debugCacheDataVisually) { - aBaseMetaTileEntity.getWorld().setBlock(negTestX, (aPos.yPos + Y), negTestZ, Blocks.glass); - } - } - } - } - Logger.INFO("Cached blueprint matrix."); - mGeneratedMatrix = true; - } - else { - Logger.INFO("Found cached blueprint matrix."); - } - - if (StructureMatrix == null) { - Logger.INFO("Error caching blueprint matrix."); - return false; - } - - - int a1, a2, a3; - a1 = StructureMatrix.length; - a2 = StructureMatrix[0].length; - a3 = StructureMatrix[0][0].length; - - Logger.INFO("Matrix Size ["+a1+", "+a2+", "+a3+"]"); - - for (int H = 0; H < a2; H++) { - - MultiblockLayer currentLayer = this.getLayer(H); - for (int W = 0; W < a1; W++) { - for (int D = 0; D < a3; D++) { - - BlockPos aToCheck = StructureMatrix[W][H][D]; - if (aToCheck == null) { - Logger.INFO("Found bad data stored at X: "+W+", Y: "+H+", Z: "+D); - continue; - } - else { - //Logger.INFO("Found data stored at X: "+W+", Y: "+H+", Z: "+D); - Logger.INFO("Checking "+aToCheck.getLocationString()); - } - - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntity(aToCheck.xPos, aToCheck.yPos, aToCheck.zPos); - final Block tBlock = aBaseMetaTileEntity.getBlock(aToCheck.xPos, aToCheck.yPos, aToCheck.zPos); - final int tMeta = aBaseMetaTileEntity.getMetaID(aToCheck.xPos, aToCheck.yPos, aToCheck.zPos); - - - LayerBlockData g1 = currentLayer.getDataFromCoordsWithDirection(aDir, W, D); - if (g1 == null) { - Logger.INFO("Failed to find LayerBlockData. Using AIR_FALLBACK"); - //return false;*/ - g1 = LayerBlockData.FALLBACK_AIR_CHECK; - } - else { - if (g1.isController) { - Logger.INFO("Controller is at X: "+W+", Y: "+H+", Z: "+D); - } - } - - boolean isMatch = g1.match(tBlock, tMeta); - - - if (!isMatch) { - Logger.INFO("Checking ["+aToCheck.xPos+", "+ aToCheck.yPos +", "+ aToCheck.zPos+"]"); - Logger.INFO("Checking Position relative to Grid. X: "+W+", Y: "+H+", Z: "+D); - Logger.INFO("Found "+tBlock.getLocalizedName()+" : "+tMeta + " | Bad ["+W+", "+D+"]"); - - LayerBlockData g = currentLayer.getDataFromCoordsWithDirection(aDir, W, D); - - if (g == null) { - Logger.INFO("Expected "+" BAD DATA - Possibly Unset Area in Blueprint."); - - } - else { - Logger.INFO("Expected "+g.mBlock.getLocalizedName()+" : "+g.mMeta + ""); - } - aBaseMetaTileEntity.getWorld().setBlock(aToCheck.xPos, aToCheck.yPos, aToCheck.zPos, g.mBlock); - aBaseMetaTileEntity.getWorld().setBlockMetadataWithNotify(aToCheck.xPos, aToCheck.yPos, aToCheck.zPos, g.mMeta, 4); - //return false; - } - else { - - LayerBlockData g = currentLayer.getDataFromCoordsWithDirection(aDir, W, D); - - - - - - - - - - - - - - - - - - - - boolean isHatchValidType = false; - if (g != null) { - if (g.canBeHatch && !g.isController && tTileEntity != null) { - IMetaTileEntity aMetaTileEntity2 = tTileEntity.getMetaTileEntity(); - if (aMetaTileEntity2 != null) { - if (aMetaTileEntity2 instanceof GT_MetaTileEntity_MultiBlockBase) { - isHatchValidType = true; - break; - } - else { - for (Class c : g.mHatchClass) { - if (c != null) { - if (c.isInstance(aMetaTileEntity2)) { - isHatchValidType = true; - break; - } - } - } - } - } - } - } - - if (!isHatchValidType && !g.isController && tTileEntity != null) { - Logger.INFO("Checking ["+aToCheck.xPos+", "+ aToCheck.yPos +", "+ aToCheck.zPos+"]"); - Logger.INFO("Hatch Type did not match allowed types. "+tTileEntity.getClass().getSimpleName()); - return false; - } - if (!aControllerObject.addToMachineList(tTileEntity, mTextureID)) { - tAmount++; - } - - - } - } - } - } - - boolean hasCorrectHatches = ( - aControllerObject.mInputBusses.size() >= this.getMinimumInputBus() && - aControllerObject.mOutputBusses.size() >= this.getMinimumOutputBus() && - aControllerObject.mInputHatches.size() >= this.getMinimumInputHatch() && - aControllerObject.mOutputHatches.size() >= this.getMinimumOutputHatch() && - aControllerObject.mDynamoHatches.size() >= this.getMinimumOutputEnergy() && - aControllerObject.mEnergyHatches.size() >= this.getMinimumInputEnergy() && - aControllerObject.mMaintenanceHatches.size() >= this.getMinimumMaintHatch() && - aControllerObject.mMufflerHatches.size() >= this.getMinimumMufflers()); - - - Logger.INFO("mInputBusses: "+aControllerObject.mInputBusses.size()); - Logger.INFO("mOutputBusses: "+aControllerObject.mOutputBusses.size()); - Logger.INFO("mInputHatches: "+aControllerObject.mInputHatches.size()); - Logger.INFO("mOutputHatches: "+aControllerObject.mOutputHatches.size()); - Logger.INFO("mEnergyHatches: "+aControllerObject.mEnergyHatches.size()); - Logger.INFO("mDynamoHatches: "+aControllerObject.mDynamoHatches.size()); - Logger.INFO("mMaintenanceHatches: "+aControllerObject.mMaintenanceHatches.size()); - Logger.INFO("mMufflerHatches: "+aControllerObject.mMufflerHatches.size()); - - boolean built = hasCorrectHatches && tAmount >= mMinimumCasingCount; - Logger.INFO("Built? "+built); - Logger.INFO("hasCorrectHatches? "+hasCorrectHatches); - Logger.INFO("tAmount? "+tAmount); - return built; - } - - public BlockPos getOffsetRelativeToGridPosition(final IGregTechTileEntity aBaseMetaTileEntity, final int x, final int y, final int z) { - - if (aBaseMetaTileEntity == null) { - return null; - } - - int controllerX, controllerY, controllerZ; - MultiblockLayer layerController = this.getControllerLayer(); - - if (layerController == null) { - return null; - } - - int controllerYRelative = this.getControllerY(); - Pair<Integer, Integer> controllerLocationRelativeToGrid = layerController.getControllerLocation(); - - if (controllerLocationRelativeToGrid == null) { - return null; - } - - controllerX = aBaseMetaTileEntity.getXCoord(); - controllerY = aBaseMetaTileEntity.getYCoord(); - controllerZ = aBaseMetaTileEntity.getZCoord(); - - Logger.INFO("Controller is at ["+controllerX+", "+controllerY+", "+controllerZ+"]"); - - ForgeDirection aDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()); - Logger.INFO("Controller is facing "+aDir.name()); - - //Find Bottom Left corner of Structure - // 0, 0, 0 - - int offsetX, offsetY, offsetZ; - int X = controllerLocationRelativeToGrid.getKey(), Z = controllerLocationRelativeToGrid.getValue(); - Logger.INFO("Attempting to translate offsets ["+X+", "+Z+"]"); - if (aDir == ForgeDirection.NORTH) { - offsetX = -X; - offsetZ = -Z; - } - - else if (aDir == ForgeDirection.EAST) { - offsetX = Z; - offsetZ = -X; - } - - else if (aDir == ForgeDirection.SOUTH) { - offsetX = X; - offsetZ = Z; - } - - else if (aDir == ForgeDirection.WEST) { - offsetX = -Z; - offsetZ = X; - } - else { - offsetX = -X; - offsetZ = -Z; - } - - offsetY = -controllerYRelative; - - Logger.INFO("Attempting to use offsets ["+offsetX+", "+offsetY+", "+offsetZ+"]"); - - //Resolve Negatives - int negTestX, negTestZ; - if (controllerX < 0) { - Logger.INFO("Found Negative X Pos."); - int testA = controllerX; - testA -= offsetX; - Logger.INFO("Adding Inverted Offset of "+offsetX+", making "+testA); - negTestX = testA; - } - else { - negTestX = offsetX + controllerX; - } - if (controllerZ < 0) { - Logger.INFO("Found Negative Z Pos."); - int testA = controllerZ; - testA -= -offsetZ; - Logger.INFO("Adding Inverted Offset of "+offsetZ+", making "+testA); - negTestZ = testA; - } - else { - negTestZ = offsetZ + controllerZ; - } - - - //} - //Bottom left Corner position - BlockPos p = new BlockPos(negTestX, offsetY+controllerY, negTestZ, aBaseMetaTileEntity.getWorld()); - - Logger.INFO("World XYZ for Bottom left Corner Block of structure ["+p.xPos+", "+p.yPos+", "+p.zPos+"]"); - - //Add the xyz relative to the grid. - BlockPos offsetPos = new BlockPos(p.xPos+x, p.yPos+y, p.zPos+z, aBaseMetaTileEntity.getWorld()); - Logger.INFO("World XYZ for Target Check Block in structure ["+offsetPos.xPos+", "+offsetPos.yPos+", "+offsetPos.zPos+"]"); - - return p; - } - - - public IGregTechTileEntity getTileAtOffset(final IGregTechTileEntity aBaseMetaTileEntity, int x, int y, int z){ - BlockPos aPos = getOffsetRelativeToGridPosition(aBaseMetaTileEntity, x, y, z); - final IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(aPos.xPos, aPos.yPos, aPos.zPos); - //aBaseMetaTileEntity.getWorld().setBlock(xh, yh, zh, Blocks.gold_ore); - return tTileEntity; - } - - public Pair<Block, Integer> getBlockAtOffset(final IGregTechTileEntity aBaseMetaTileEntity, int x, int y, int z){ - BlockPos aPos = getOffsetRelativeToGridPosition(aBaseMetaTileEntity, x, y, z); - final Block tBlock = aBaseMetaTileEntity.getBlockOffset(aPos.xPos, aPos.yPos, aPos.zPos); - final int tMeta = aBaseMetaTileEntity.getMetaIDOffset(aPos.xPos, aPos.yPos, aPos.zPos); - return new Pair<Block, Integer>(tBlock, tMeta); - } - - public Triplet<Integer, Integer, Integer> getOffsetFromControllerTo00(){ - MultiblockLayer l = this.getControllerLayer(); - if (l == null) { - return null; - } - int yOffset = this.getControllerY(); - Pair<Integer, Integer> cl = l.getControllerLocation(); - - if (cl == null) { - return null; - } - - return new Triplet<Integer, Integer, Integer> (cl.getKey(), yOffset, cl.getValue()); - //return new Triplet<Integer, Integer, Integer> (cl.getKey(), yOffset, cl.getValue()); - - } - - public abstract int getMinimumInputBus(); - public abstract int getMinimumInputHatch(); - public abstract int getMinimumOutputBus(); - public abstract int getMinimumOutputHatch(); - public abstract int getMinimumInputEnergy(); - public abstract int getMinimumOutputEnergy(); - public abstract int getMinimumMaintHatch(); - public abstract int getMinimumMufflers(); - -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java deleted file mode 100644 index c5554a6679..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockLayer.java +++ /dev/null @@ -1,643 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.objects; - -import java.util.HashMap; - -import gregtech.api.GregTech_API; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.util.reflect.ReflectionUtils; -import net.minecraft.block.Block; -import net.minecraft.block.BlockAir; -import net.minecraft.init.Blocks; -import net.minecraftforge.common.util.ForgeDirection; - -public class MultiblockLayer { - - public final int width; - public final int depth; - - private boolean mFinalised; - - - /** - * WARNING!! May be {@link null}. - */ - private Pair<Integer, Integer> mControllerLocation; - - /** - * Holds the North facing Orientation data. - */ - public final LayerBlockData[][] mLayerData; - public final AutoMap<LayerBlockData[][]> mVariantOrientations = new AutoMap<LayerBlockData[][]>(); - - /** - * A detailed class which will contain a single x/z Layer for a {@link MultiblockBlueprint}. - * Values are not relative, but in total. - * @param x - Overall width - * @param z - Overall depth - */ - public MultiblockLayer(final int x, final int z) { - width = x; - depth = z; - mLayerData = new LayerBlockData[x][z]; - //Logger.INFO("Created new Blueprint Layer."); - } - - /** - * A detailed class which will contain a single x/z Layer for a {@link MultiblockBlueprint}. - * Values are not relative, but in total. - */ - public MultiblockLayer(final LayerBlockData[][] aData) { - width = aData.length; - depth = aData[0].length; - mLayerData = aData; - } - - /** - * - * @param aBlock - The block expected as this location. - * @param aMeta - The meta for the block above. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @param canBeHatch - is this location able to be substituted for any hatch? - * @return - Is this data added to the layer data map? - */ - public boolean addBlockForPos(Block aBlock, int aMeta, int x, int z, boolean canBeHatch) { - return addBlockForPos(aBlock, aMeta, x, z, canBeHatch, new Class[] {}); - } - - /** - * - * @param aBlock - The block expected as this location. - * @param aMeta - The meta for the block above. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @param canBeHatch - is this location able to be substituted for a hatch? - * @param aHatchTypeClass - Specify the class for the hatch if you want it explicit. Use base classes to allow custom hatches which extend. - * @return - Is this data added to the layer data map? - */ - public boolean addBlockForPos(Block aBlock, int aMeta, int x, int z, boolean canBeHatch, Class aHatchTypeClass) { - return addBlockForPos(aBlock, aMeta, x, z, canBeHatch, new Class[] {aHatchTypeClass}); - } - - /** - * - * @param aBlock - The block expected as this location. - * @param aMeta - The meta for the block above. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @param canBeHatch - is this location able to be substituted for a hatch? - * @param aHatchTypeClass - Specify the class for the hatch if you want it explicit. Use base classes to allow custom hatches which extend. - * @return - Is this data added to the layer data map? - */ - public boolean addBlockForPos(Block aBlock, int aMeta, int x, int z, boolean canBeHatch, Class[] aHatchTypeClass) { - if (x > width -1) { - return false; - } - if (z > depth - 1) { - return false; - } - - if (canBeHatch && (aHatchTypeClass == null || aHatchTypeClass.length <= 0)){ - - if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { - aHatchTypeClass = new Class[] { - GT_MetaTileEntity_Hatch_Dynamo.class, - GT_MetaTileEntity_Hatch_Energy.class, - GT_MetaTileEntity_Hatch_Input.class, - GT_MetaTileEntity_Hatch_InputBus.class, - GT_MetaTileEntity_Hatch_Maintenance.class, - GT_MetaTileEntity_Hatch_Muffler.class, - GT_MetaTileEntity_Hatch_Output.class, - GT_MetaTileEntity_Hatch_OutputBus.class, - GT_MetaTileEntity_Hatch.class - }; - } - else { - Class aDataHatch = ReflectionUtils.getClass("gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess"); - if (aDataHatch != null) { - aHatchTypeClass = new Class[] { - aDataHatch, - GT_MetaTileEntity_Hatch_Dynamo.class, - GT_MetaTileEntity_Hatch_Energy.class, - GT_MetaTileEntity_Hatch_Input.class, - GT_MetaTileEntity_Hatch_InputBus.class, - GT_MetaTileEntity_Hatch_Maintenance.class, - GT_MetaTileEntity_Hatch_Muffler.class, - GT_MetaTileEntity_Hatch_Output.class, - GT_MetaTileEntity_Hatch_OutputBus.class, - GT_MetaTileEntity_Hatch.class - }; - } else { - aHatchTypeClass = new Class[] { - GT_MetaTileEntity_Hatch_Dynamo.class, - GT_MetaTileEntity_Hatch_Energy.class, - GT_MetaTileEntity_Hatch_Input.class, - GT_MetaTileEntity_Hatch_InputBus.class, - GT_MetaTileEntity_Hatch_Maintenance.class, - GT_MetaTileEntity_Hatch_Muffler.class, - GT_MetaTileEntity_Hatch_Output.class, - GT_MetaTileEntity_Hatch_OutputBus.class, - GT_MetaTileEntity_Hatch.class - }; - } - } - } - - - - mLayerData[x][z] = new LayerBlockData(aBlock, aMeta, canBeHatch, aHatchTypeClass); - return true; - } - - /** - * Adds a controller to the layer at the designated location, Details about the controller do not need to be specified. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addController(int x, int z) { - setControllerLocation(new Pair<Integer, Integer>(x, z)); - return addBlockForPos(GregTech_API.sBlockMachines, 0, x, z, true, GT_MetaTileEntity_MultiBlockBase.class); - } - - - /** - * Adds a Muffler to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addMuffler(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, GT_MetaTileEntity_Hatch_Muffler.class); - } - - - /** - * Adds a Maint Hatch to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addMaintHatch(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, GT_MetaTileEntity_Hatch_Maintenance.class); - } - - - /** - * Adds ah Input to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addInputBus(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, GT_MetaTileEntity_Hatch_InputBus.class); - } - - - /** - * Adds an Output to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addOutputBus(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, GT_MetaTileEntity_Hatch_OutputBus.class); - } - - /** - * Adds ah Input to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addInputHatch(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, GT_MetaTileEntity_Hatch_Input.class); - } - - - /** - * Adds an Output to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addOutputHatch(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, GT_MetaTileEntity_Hatch_Output.class); - } - - /** - * Adds ah Input to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addInput(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, new Class[] {GT_MetaTileEntity_Hatch_Input.class, GT_MetaTileEntity_Hatch_InputBus.class}); - } - - - /** - * Adds an Output to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addOutput(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, new Class[] {GT_MetaTileEntity_Hatch_Output.class, GT_MetaTileEntity_Hatch_OutputBus.class}); - } - - /** - * Adds ah Input to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addEnergyInput(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, GT_MetaTileEntity_Hatch_Energy.class); - } - - - /** - * Adds an Output to the layer at the designated location. - * @param x - The X location, where 0 is the top left corner & counts upwards, moving right. - * @param z - The Z location, where 0 is the top left corner & counts upwards, moving down. - * @return - Is this controller added to the layer data map? - */ - public boolean addEnergyOutput(Block aBlock, int aMeta, int x, int z) { - return addBlockForPos(aBlock, aMeta, x, z, true, GT_MetaTileEntity_Hatch_Dynamo.class); - } - - /** - * - * @param aBlock - The block you expect. - * @param aMeta - The meta you expect. - * @param x - the non-relative x location you expect it. - * @param z - the non-relative z location you expect it. - * @param aDir - The direction the controller is facing. - * @return - True if the correct Block was found. May also return true if a hatch is found when allowed or it's the controller. - */ - public boolean getBlockForPos(Block aBlock, int aMeta, int x, int z, ForgeDirection aDir) { - //Logger.INFO("Grid Index X: "+x+" | Z: "+z + " | "+aDir.name()); - LayerBlockData g; - if (aDir == ForgeDirection.SOUTH) { - g = mVariantOrientations.get(2)[x][z]; - } - else if (aDir == ForgeDirection.WEST) { - g = mVariantOrientations.get(3)[x][z]; - } - else if (aDir == ForgeDirection.NORTH) { - LayerBlockData[][] aData = mVariantOrientations.get(0); - if (aData != null) { - //Logger.INFO("Found Valid Orientation Data. "+aData.length + ", "+aData[0].length); - g = aData[x][z]; - } - else { - //Logger.INFO("Did not find valid orientation data."); - g = null; - } - } - else if (aDir == ForgeDirection.EAST) { - g = mVariantOrientations.get(1)[x][z]; - } - else { - g = mLayerData[x][z]; - } - if (g == null) { - Logger.INFO("Failed to find LayerBlockData. Using AIR_FALLBACK"); - //return false;*/ - g = LayerBlockData.FALLBACK_AIR_CHECK; - } - - return g.match(aBlock, aMeta); - } - - - - /** - * Is this layer final? - * @return - If true, layer data cannot be edited. - */ - public final boolean isLocked() { - return mFinalised; - } - - /** - * Used to finalize the layer, after which all four Orientations are then generated. - * Cannot be set to false, useful for not locking the layer if an error occurs. - * @param lockData - */ - public final void lock(boolean lockData) { - if (!lockData) { - Logger.INFO("Failed to lock layer"); - return; - } - //Logger.INFO("Trying to lock layer"); - this.mFinalised = true; - generateOrientations(); - //Logger.INFO("Trying to Build Blueprint Layer [Constructed orietations & finalized]"); - } - - private void generateOrientations() { - try { - - //Logger.INFO("Trying to gen orients for layer"); - //North - mVariantOrientations.put(mLayerData); - LayerBlockData[][] val; - //Logger.INFO("1 done"); - //East - val = rotateArrayClockwise(mLayerData); - mVariantOrientations.put((LayerBlockData[][]) val); - //Logger.INFO("2 done"); - //South - val = rotateArrayClockwise(mLayerData); - mVariantOrientations.put((LayerBlockData[][]) val); - //Logger.INFO("3 done"); - //West - val = rotateArrayClockwise(mLayerData); - mVariantOrientations.put((LayerBlockData[][]) val); - //Logger.INFO("4 done"); - - } - catch (Throwable t) { - t.printStackTrace(); - } - } - - public static LayerBlockData[][] rotateArrayClockwise(LayerBlockData[][] mat) { - //Logger.INFO("Rotating Layer 90' Clockwise"); - try { - final int M = mat.length; - final int N = mat[0].length; - //Logger.INFO("Dimension X: "+M); - //Logger.INFO("Dimension Z: "+N); - LayerBlockData[][] ret = new LayerBlockData[N][M]; - for (int r = 0; r < M; r++) { - for (int c = 0; c < N; c++) { - ret[c][M-1-r] = mat[r][c]; - } - } - //Logger.INFO("Returning Rotated Layer"); - return ret; - } - catch (Throwable t) { - t.printStackTrace(); - return null; - } - } - - public boolean hasController() { - if (getControllerLocation() == null) { - return false; - } - return true; - } - - public Pair<Integer, Integer> getControllerLocation() { - return mControllerLocation; - } - - public void setControllerLocation(Pair<Integer, Integer> mControllerLocation) { - if (hasController()) { - return; - } - this.mControllerLocation = mControllerLocation; - } - - public LayerBlockData getDataFromCoordsWithDirection(ForgeDirection aDir, int W, int D) { - LayerBlockData g; - if (aDir == ForgeDirection.SOUTH) { - g = this.mVariantOrientations.get(2)[W][D]; - } - else if (aDir == ForgeDirection.WEST) { - g = this.mVariantOrientations.get(3)[W][D]; - } - else if (aDir == ForgeDirection.NORTH) { - g = this.mVariantOrientations.get(0)[W][D]; - } - else if (aDir == ForgeDirection.EAST) { - g = this.mVariantOrientations.get(1)[W][D]; - } - else { - g = this.mLayerData[W][D]; - } - return g; - } - - public static Pair<Integer, Integer> rotateOffsetValues(ForgeDirection aDir, int X, int Z) { - int offsetX, offsetZ; - - if (aDir == ForgeDirection.NORTH) { - offsetX = X; - offsetZ = Z; - } - - else if (aDir == ForgeDirection.EAST) { - offsetX = -X; - offsetZ = Z; - } - - else if (aDir == ForgeDirection.SOUTH) { - offsetX = -X; - offsetZ = -Z; - } - - else if (aDir == ForgeDirection.WEST) { - offsetX = X; - offsetZ = -Z; - } - else { - offsetX = X; - offsetZ = Z; - } - - return new Pair<Integer, Integer>(offsetX, offsetZ); - } - - - - - - - - - - - - - - - - /** - * Generates a complete {@link MultiblockLayer} from String data. - * @param aDataMap - A {@link HashMap} containing single character {@link String}s, which map to {@link Pair}<{@link Block}, {@link Integer}>s contains pairs of Blocks & Meta. - * @param aHorizontalStringRows - The horizontal rows used to map blocks to a grid. Each array slot is one vertical row going downwards as the index increases. - * @return - */ - public static MultiblockLayer generateLayerFromData(HashMap<String, Pair<Block, Integer>> aDataMap, String[] aHorizontalStringRows) { - AutoMap<Pair<String, Pair<Block, Integer>>> x = new AutoMap<Pair<String, Pair<Block, Integer>>>(); - - for (String u : aDataMap.keySet()) { - Pair<Block, Integer> r = aDataMap.get(u); - if (r != null) { - x.put(new Pair<String, Pair<Block, Integer>>(u, r)); - } - } - - //String aFreeLetters = "abdefgijklmnopqrstuvwxyz"; - /*for (Pair<Block, Integer> h : aDataMap.values()) { - String y = aFreeLetters.substring(0, 0); - aFreeLetters = aFreeLetters.replace(y.toLowerCase(), ""); - Pair<String, Pair<Block, Integer>> t = new Pair<String, Pair<Block, Integer>>(y, h); - x.put(t); - }*/ - return generateLayerFromData(x, aHorizontalStringRows); - } - - - /** - * Generates a complete {@link MultiblockLayer} from String data. - * @param aDataMap - An {@link AutoMap} which contains {@link Pair}s. These Pairs hold a single character {@link String} and another Pair. This inner pair holds a {@link Block} and an {@link Integer}. - * @param aHorizontalStringRows - An array which holds the horizontal (X/Width) string data for the layer. - * @return A complete Multiblock Layer. - */ - public static MultiblockLayer generateLayerFromData(AutoMap<Pair<String, Pair<Block, Integer>>> aDataMap, String[] aHorizontalStringRows) { - int width = aHorizontalStringRows[0].length(); - int depth = aHorizontalStringRows.length; - MultiblockLayer L = new MultiblockLayer(width, depth); - HashMap<String, Pair<Block, Integer>> K = new HashMap<String, Pair<Block, Integer>>(); - - //24 Free Letters - //C = Controller - //H = Hatch - String aFreeLetters = "abdefgijklmnopqrstuvwxyz"; - AutoMap<Pair<String, Pair<Block, Integer>>> j = new AutoMap<Pair<String, Pair<Block, Integer>>>(); - - //Map the keys to a Hashmap - for (Pair<String, Pair<Block, Integer>> t : aDataMap) { - String aKeyTemp = t.getKey(); - if (aKeyTemp.toUpperCase().equals("C")){ - j.put(t); - } - else if (aKeyTemp.toUpperCase().equals("H")){ - j.put(t); - } - else { - K.put(aKeyTemp.toLowerCase(), t.getValue()); - aFreeLetters.replace(aKeyTemp.toLowerCase(), ""); - } - } - - //Map any Invalid Characters to new ones, in case someone uses C/H. - if (j.size() > 0) { - for (Pair<String, Pair<Block, Integer>> h : j) { - String newKey = aFreeLetters.substring(0, 0); - K.put(newKey.toLowerCase(), h.getValue()); - aFreeLetters.replace(newKey.toLowerCase(), ""); - } - } - - int xPos = 0; - int zPos = 0; - - //Vertical Iterator - for (String s : aHorizontalStringRows) { - //Horizontal Iterator - for (int q = 0; q < s.length(); q++) { - //Get char as a String at index q. - String c = s.substring(q, q); - //if the character at c matches the character in this row, we add it to the map. - if (c.toLowerCase().equals(s.toLowerCase())) { - Pair<Block, Integer> p = K.get(c); - if (c.toLowerCase().equals("c")) { - L.addController(xPos, zPos); - } - else if (c.toLowerCase().equals("h")) { - L.addBlockForPos(p.getKey(), p.getValue(), xPos, zPos, true); - } - else { - L.addBlockForPos(p.getKey(), p.getValue(), xPos, zPos, false); - } - } - xPos++; - } - xPos = 0; - zPos++; - } - L.lock(true); - return L; - } - - - - - public static class LayerBlockData{ - - public static final LayerBlockData FALLBACK_AIR_CHECK = new LayerBlockData(Blocks.air, 0, false); - - public final Block mBlock; - public final int mMeta; - public final boolean canBeHatch; - public final Class[] mHatchClass; - - public final boolean isController; - - - public LayerBlockData(Block aBlock, int aMeta, boolean aHatch) { - this(aBlock, aMeta, aHatch, new Class[] {}); - } - - public LayerBlockData(Block aBlock, int aMeta, boolean aHatch, Class clazz) { - this(aBlock, aMeta, aHatch, new Class[] {clazz}); - } - - public LayerBlockData(Block aBlock, int aMeta, boolean aHatch, Class[] clazz) { - mBlock = aBlock; - mMeta = aMeta; - canBeHatch = aHatch; - mHatchClass = clazz; - if (clazz != null && clazz.length > 0 && clazz[0].equals(GT_MetaTileEntity_MultiBlockBase.class)) { - isController = true; - } - else { - isController = false; - } - } - - public boolean match(Block blockToTest, int metaToTest) { - - //If Both are some kind of Air Block, good enough. - if (blockToTest instanceof BlockAir && mBlock instanceof BlockAir) { - return true; - } - - if (isController && blockToTest == GregTech_API.sBlockMachines) { - return true; - } - - if (canBeHatch && blockToTest == GregTech_API.sBlockMachines) { - return true; - } - - if (blockToTest == mBlock && metaToTest == mMeta) { - return true; - } - - return false; - } - } - -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockRequirements.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockRequirements.java deleted file mode 100644 index 10909081d1..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/api/objects/MultiblockRequirements.java +++ /dev/null @@ -1,108 +0,0 @@ -package gtPlusPlus.xmod.gregtech.api.objects; - -public class MultiblockRequirements { - - public int mInputBusMinimum = 0; - public int mInputHatchMinimum = 0; - - public int mOutputBusMinimum = 0; - public int mOutputHatchMinimum = 0; - - public int mMaintMinimum = 1; - - public int mEnergyHatchMinimum = 1; - public int mDynamoHatchMinimum = 0; - - public final int mMinimumCasingCount; - - public final MultiblockBlueprint mBlueprint; - - //public static final int mControlCoreMinimum = 1; - /** - * - * @param aInputBusses - * @param aOutputBusses - * @param aInputHatches - * @param aOutputHatches - * @param aEnergyHatches - * @param aDynamoHatches - * @param aMaintHatches - * @param aBlueprint - A data object containing the structural data for this Multiblock - */ - public MultiblockRequirements(int aCasingCount, MultiblockBlueprint aBlueprint) { - mMinimumCasingCount = aCasingCount; - mBlueprint = aBlueprint; - } - - public final int getInputBusMinimum() { - return this.mInputBusMinimum; - } - - public final MultiblockRequirements setInputBusMinimum(int mInputBusMinimum) { - this.mInputBusMinimum = mInputBusMinimum; - return this; - } - - public final int getInputHatchMinimum() { - return this.mInputHatchMinimum; - } - - public final MultiblockRequirements setInputHatchMinimum(int mInputHatchMinimum) { - this.mInputHatchMinimum = mInputHatchMinimum; - return this; - } - - public final int getOutputBusMinimum() { - return this.mOutputBusMinimum; - } - - public final MultiblockRequirements setOutputBusMinimum(int mOutputBusMinimum) { - this.mOutputBusMinimum = mOutputBusMinimum; - return this; - } - - public final int getOutputHatchMinimum() { - return this.mOutputHatchMinimum; - } - - public final MultiblockRequirements setOutputHatchMinimum(int mOutputHatchMinimum) { - this.mOutputHatchMinimum = mOutputHatchMinimum; - return this; - } - - public final int getMaintMinimum() { - return this.mMaintMinimum; - } - - public final MultiblockRequirements setMaintMinimum(int mMaintMinimum) { - this.mMaintMinimum = mMaintMinimum; - return this; - } - - public final int getEnergyHatchMinimum() { - return this.mEnergyHatchMinimum; - } - - public final MultiblockRequirements setEnergyHatchMinimum(int mEnergyHatchMinimum) { - this.mEnergyHatchMinimum = mEnergyHatchMinimum; - return this; - } - - public final int getDynamoHatchMinimum() { - return this.mDynamoHatchMinimum; - } - - public final MultiblockRequirements setDynamoHatchMinimum(int mDynamoHatchMinimum) { - this.mDynamoHatchMinimum = mDynamoHatchMinimum; - return this; - } - - public final MultiblockBlueprint getBlueprint() { - return this.mBlueprint; - } - - public final int getMinimumCasingCount() { - return this.mMinimumCasingCount; - } - -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java index 091ee734e6..fe0be2f126 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/Meta_GT_Proxy.java @@ -90,8 +90,8 @@ public class Meta_GT_Proxy { GT_Log.out.println("GT++ Mod: Testing BaseMetaTileEntity."); if (tBaseMetaTileEntity == null || tBaseMetaTileEntity2 == null) { - GT_Log.out.println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); - throw new RuntimeException(""); + GT_Log.err.println("GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft."); + CORE.crash("GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft."); } //Gotta set it here so that we don't try call gregtech too early. @@ -104,7 +104,7 @@ public class Meta_GT_Proxy { StaticFields59.mGT6StylePipes = false; } - GT_Log.out.println("GT++ Mod: Registering the BaseMetaTileEntity."); + GT_Log.out.println("GT++ Mod: Registering custom BaseMetaTileEntities."); GameRegistry.registerTileEntity(tBaseMetaTileEntity.getClass(), "BaseMetaTileEntity_GTPP"); GameRegistry.registerTileEntity(tBaseMetaTileEntity2.getClass(), "BaseMetaTileEntity_GTPP2"); CoverManager.generateCustomCovers(); @@ -361,6 +361,7 @@ public class Meta_GT_Proxy { GT_Log.err .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GT_Log.err); + CORE.crash("GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft."); throw new RuntimeException(e); } } @@ -396,6 +397,7 @@ public class Meta_GT_Proxy { GT_Log.err .println("GT++ Mod: Fatal Error ocurred while initializing TileEntities, crashing Minecraft."); e.printStackTrace(GT_Log.err); + CORE.crash("GT++ Mod: Fatal Error ocurred while initializing custom BaseMetaTileEntities, crashing Minecraft."); throw new RuntimeException(e); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java index 419b5f3d30..13eb045748 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks4.java @@ -21,7 +21,7 @@ extends GregtechMetaCasingBlocksAbstract { public GregtechMetaCasingBlocks4() { super(GregtechMetaCasingItems.class, "gtplusplus.blockcasings.4", GT_Material_Casings.INSTANCE); for (byte i = 0; i < 16; i = (byte) (i + 1)) { - if (i == 2 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 9 || i == 12 || i == 13 || i == 14 || i == 15) { + if (i == 2 || i == 4 || i == 5 || i == 6 || i == 7 || i == 8 || i == 12 || i == 13 || i == 14 || i == 15) { continue; } TAE.registerTexture(3, i, new GT_CopiedBlockTexture(this, 6, i)); @@ -87,7 +87,7 @@ extends GregtechMetaCasingBlocksAbstract { case 8: return Textures.BlockIcons.RENDERING_ERROR.getIcon(); case 9: - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); case 10: if (aSide <2) { return TexturesGtBlock.TEXTURE_STONE_RED_B.getIcon(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java index 3d15e5cf58..fe247e24a4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaCasingBlocks5.java @@ -34,7 +34,8 @@ extends GregtechMetaCasingBlocksAbstract { TAE.registerTexture(0, 4, new GT_CopiedBlockTexture(this, 6, 4)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Sturdy Printer Casing"); // Unused TAE.registerTexture(1, 10, new GT_CopiedBlockTexture(this, 6, 5)); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Forge Casing"); // Forge Hammer Casing + TAE.registerTexture(1, 11, new GT_CopiedBlockTexture(this, 6, 6)); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); // Unused @@ -51,6 +52,7 @@ extends GregtechMetaCasingBlocksAbstract { GregtechItemList.Casing_ElementalDuplicator.set(new ItemStack(this, 1, 3)); GregtechItemList.Casing_Sparge_Tower_Exterior.set(new ItemStack(this, 1, 4)); GregtechItemList.Casing_IndustrialAutoChisel.set(new ItemStack(this, 1, 5)); + GregtechItemList.Casing_IndustrialForgeHammer.set(new ItemStack(this, 1, 6)); } @Override @@ -74,6 +76,8 @@ extends GregtechMetaCasingBlocksAbstract { return TexturesGtBlock.Casing_Machine_Metal_Sheet_H.getIcon(); case 5: return TexturesGtBlock.Casing_Machine_Metal_Sheet_I.getIcon(); + case 6: + return TexturesGtBlock.TEXTURE_TECH_PANEL_H.getIcon(); } } return Textures.BlockIcons.RENDERING_ERROR.getIcon(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java index 5a5c923d10..a9c8a1e9bc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings.java @@ -2,21 +2,24 @@ package gtPlusPlus.xmod.gregtech.common.blocks; import java.util.List; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.enums.Textures; import gregtech.api.util.GT_LanguageManager; import gregtech.common.blocks.GT_Material_Casings; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbstract { - - - public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { + + public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { public SpecialCasingItemBlock(Block par1) { super(par1); @@ -49,9 +52,9 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", "Thermally Insulated Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", "Flotation Cell Casings"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", "Reinforced Engine Casing"); - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused - GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", "Molecular Containment Casing"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", "High Voltage Current Capacitor"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", "Particle Containment Casing"); GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused @@ -66,37 +69,53 @@ public class GregtechMetaSpecialMultiCasings extends GregtechMetaCasingBlocksAbs GregtechItemList.Casing_SolarTower_HeatContainment.set(new ItemStack(this, 1, 8)); GregtechItemList.Casing_Flotation_Cell.set(new ItemStack(this, 1, 9)); GregtechItemList.Casing_Reinforced_Engine_Casing.set(new ItemStack(this, 1, 10)); + GregtechItemList.Casing_Molecular_Transformer_1.set(new ItemStack(this, 1, 11)); + GregtechItemList.Casing_Molecular_Transformer_2.set(new ItemStack(this, 1, 12)); + GregtechItemList.Casing_Molecular_Transformer_3.set(new ItemStack(this, 1, 13)); } - - public IIcon getIcon(int aSide, int aMeta) { - + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + return LargeTurbineTextureHandler.handleCasingsGT(aWorld, xCoord, yCoord, zCoord, aSide, this); + } + @Override + public IIcon getIcon(final int aSide, final int aMeta) { + return getStaticIcon((byte) aSide, (byte) aMeta); + } + + public static IIcon getStaticIcon(final byte aSide, final byte aMeta) { switch (aMeta) { + case 0: + return TexturesGtBlock.Casing_Redox_1.getIcon(); + case 1: + return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); + case 2: + return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); + case 3: + return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); + case 4: + return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); + case 5: + return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); + case 6: + return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); + case 7: + return TexturesGtBlock.Casing_Material_Stellite.getIcon(); + case 8: + return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); + case 9: + return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon(); + case 10: + return TexturesGtBlock.Casing_Material_Talonite.getIcon(); + case 11: + return Textures.BlockIcons.MACHINE_CASING_RADIATIONPROOF.getIcon(); + case 12: + return TexturesGtBlock.Casing_Redox_5.getIcon(); + case 13: + return TexturesGtBlock.TEXTURE_MAGIC_PANEL_B.getIcon(); - case 0: - return TexturesGtBlock.Casing_Redox_1.getIcon(); - case 1: - return Textures.BlockIcons.MACHINE_CASING_TURBINE.getIcon(); - case 2: - return Textures.BlockIcons.MACHINE_CASING_CLEAN_STAINLESSSTEEL.getIcon(); - case 3: - return Textures.BlockIcons.MACHINE_CASING_STABLE_TITANIUM.getIcon(); - case 4: - return Textures.BlockIcons.MACHINE_CASING_ROBUST_TUNGSTENSTEEL.getIcon(); - case 5: - return TexturesGtBlock.Casing_Material_RedSteel.getIcon(); - case 6: - return TexturesGtBlock.Casing_Material_MaragingSteel.getIcon(); - case 7: - return TexturesGtBlock.Casing_Material_Stellite.getIcon(); - case 8: - return TexturesGtBlock.Casing_Machine_Simple_Top.getIcon(); - case 9: - return TexturesGtBlock.TEXTURE_CASING_FLOTATION.getIcon(); - case 10: - return TexturesGtBlock.Casing_Material_Talonite.getIcon(); - } - return Textures.BlockIcons.RENDERING_ERROR.getIcon(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java new file mode 100644 index 0000000000..a80b788aa1 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/GregtechMetaSpecialMultiCasings2.java @@ -0,0 +1,107 @@ +package gtPlusPlus.xmod.gregtech.common.blocks; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.util.GT_LanguageManager; +import gregtech.common.blocks.GT_Material_Casings; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + + +public class GregtechMetaSpecialMultiCasings2 extends GregtechMetaCasingBlocksAbstract { + + public static class SpecialCasingItemBlock extends GregtechMetaCasingItems { + + public SpecialCasingItemBlock(Block par1) { + super(par1); + } + + @Override + public void addInformation(ItemStack aStack, EntityPlayer aPlayer, List aList, boolean aF3_H) { + int aMeta = aStack.getItemDamage(); + if (aMeta < 4) { + aList.add("Provides quantum stability"); + } + if (aMeta >= 4 && aMeta < 8) { + aList.add("Provides quantum modulation"); + } + super.addInformation(aStack, aPlayer, aList, aF3_H); + } + } + + public GregtechMetaSpecialMultiCasings2() { + super(SpecialCasingItemBlock.class, "gtplusplus.blockspecialcasings.3", GT_Material_Casings.INSTANCE); + for (byte i = 0; i < 16; i = (byte) (i + 1)) { + //TAE.registerTextures(new GT_CopiedBlockTexture(this, 6, i)); + // Don't register these Textures, They already exist within vanilla GT. (May not exist in 5.08) + } + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".0.name", "Resonance Chamber I"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".1.name", "Resonance Chamber II"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".2.name", "Resonance Chamber III"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".3.name", "Resonance Chamber IV"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".4.name", "Modulator I"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".5.name", "Modulator II"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".6.name", "Modulator III"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".7.name", "Modulator IV"); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".8.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".9.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".10.name", ""); + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".11.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".12.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".13.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".14.name", ""); // Unused + GT_LanguageManager.addStringLocalization(this.getUnlocalizedName() + ".15.name", ""); // Unused + + GregtechItemList.ResonanceChamber_I.set(new ItemStack(this, 1, 0)); + GregtechItemList.ResonanceChamber_II.set(new ItemStack(this, 1, 1)); + GregtechItemList.ResonanceChamber_III.set(new ItemStack(this, 1, 2)); + GregtechItemList.ResonanceChamber_IV.set(new ItemStack(this, 1, 3)); + GregtechItemList.Modulator_I.set(new ItemStack(this, 1, 4)); + GregtechItemList.Modulator_II.set(new ItemStack(this, 1, 5)); + GregtechItemList.Modulator_III.set(new ItemStack(this, 1, 6)); + GregtechItemList.Modulator_IV.set(new ItemStack(this, 1, 7)); + } + + @Override + @SideOnly(Side.CLIENT) + public IIcon getIcon(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide) { + return getStaticIcon((byte) aSide, (byte) aWorld.getBlockMetadata(xCoord, yCoord, zCoord)); + } + + @Override + public IIcon getIcon(final int aSide, final int aMeta) { + return getStaticIcon((byte) aSide, (byte) aMeta); + } + + public static IIcon getStaticIcon(final byte aSide, final byte aMeta) { + switch (aMeta) { + case 0: + return TexturesGtBlock.Casing_Resonance_1.getIcon(); + case 1: + return TexturesGtBlock.Casing_Resonance_2.getIcon(); + case 2: + return TexturesGtBlock.Casing_Resonance_3.getIcon(); + case 3: + return TexturesGtBlock.Casing_Resonance_4.getIcon(); + case 4: + return TexturesGtBlock.Casing_Modulator_1.getIcon(); + case 5: + return TexturesGtBlock.Casing_Modulator_2.getIcon(); + case 6: + return TexturesGtBlock.Casing_Modulator_3.getIcon(); + case 7: + return TexturesGtBlock.Casing_Modulator_4.getIcon(); + + } + return Textures.BlockIcons.RENDERING_ERROR.getIcon(); + } + +} 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 8b372dff0c..e6ccc419e0 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 @@ -247,6 +247,16 @@ public class TexturesGtBlock { public static final CustomIcon Casing_Redox_6 = new CustomIcon("redox/redox6"); //public static final CustomIcon Casing_Redox_7 = new CustomIcon("redox/redox7"); //public static final CustomIcon Casing_Redox_8 = new CustomIcon("redox/redox8"); + + // Special Block 2 + public static final CustomIcon Casing_Resonance_1 = new CustomIcon("special/block_1"); + public static final CustomIcon Casing_Resonance_2 = new CustomIcon("special/block_2"); + public static final CustomIcon Casing_Resonance_3 = new CustomIcon("special/block_3"); + public static final CustomIcon Casing_Resonance_4 = new CustomIcon("special/block_4"); + public static final CustomIcon Casing_Modulator_1 = new CustomIcon("special/block_5"); + public static final CustomIcon Casing_Modulator_2 = new CustomIcon("special/block_6"); + public static final CustomIcon Casing_Modulator_3 = new CustomIcon("special/block_7"); + public static final CustomIcon Casing_Modulator_4 = new CustomIcon("special/block_8"); //Centrifuge Casing private static final CustomIcon Internal_Casing_Centrifuge = new CustomIcon("TileEntities/MACHINE_CASING_CENTRIFUGE"); @@ -392,10 +402,79 @@ public class TexturesGtBlock { public static final CustomIcon Overlay_FluidReactor_Top_Active = new CustomIcon("TileEntities/FluidReactor/OVERLAY_TOP_ACTIVE"); //Crafting Overlays - private static final CustomIcon Internal_Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting"); - public static final CustomIcon Overlay_Crafting_Bronze = Internal_Overlay_Crafting_Bronze; - private static final CustomIcon Internal_Overlay_Crafting_Steel = new CustomIcon("TileEntities/cover_crafting"); - public static final CustomIcon Overlay_Crafting_Steel = Internal_Overlay_Crafting_Steel; + public static final CustomIcon Overlay_Crafting_Bronze = new CustomIcon("TileEntities/bronze_top_crafting"); + public static final CustomIcon Overlay_Crafting_Steel = new CustomIcon("TileEntities/cover_crafting"); + + public static final CustomIcon Casing_Workbench_Crafting_Overlay = new CustomIcon("TileEntities/gt4/bronze_top_crafting"); + public static final CustomIcon Casing_Workbench_Top = new CustomIcon("TileEntities/gt4/bronze_top"); + public static final CustomIcon Casing_Workbench_Side = new CustomIcon("TileEntities/gt4/bronze_side"); + public static final CustomIcon Casing_Workbench_Bottom = new CustomIcon("TileEntities/gt4/bronze_bottom"); + public static final CustomIcon Casing_Adv_Workbench_Crafting_Overlay = new CustomIcon("TileEntities/gt4/machine_top_crafting"); + public static final CustomIcon Casing_Adv_Workbench_Top = new CustomIcon("TileEntities/gt4/machine_top"); + public static final CustomIcon Casing_Adv_Workbench_Side = new CustomIcon("TileEntities/gt4/machine_side"); + public static final CustomIcon Casing_Adv_Workbench_Bottom = new CustomIcon("TileEntities/gt4/machine_bottom"); + + + public static final CustomIcon Casing_Redstone_Top_Off = new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_off"); + public static final CustomIcon Casing_Redstone_Top_Main_Off = new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_main_off"); + public static final CustomIcon Casing_Redstone_Top_On = new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_on"); + public static final CustomIcon Casing_Redstone_Top_Main_On = new CustomIcon("TileEntities/gt4/redstone/machine_top_redstone_main_on"); + + public static final CustomIcon Casing_Redstone_Side_Off = new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_off"); + public static final CustomIcon Casing_Redstone_Side_Main_Off = new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_main_off"); + public static final CustomIcon Casing_Redstone_Side_On = new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_on"); + public static final CustomIcon Casing_Redstone_Side_Main_On = new CustomIcon("TileEntities/gt4/redstone/machine_side_redstone_main_on"); + + public static final CustomIcon Casing_Redstone_Bottom_Off = new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_off"); + public static final CustomIcon Casing_Redstone_Bottom_Main_Off = new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_main_off"); + public static final CustomIcon Casing_Redstone_Bottom_On = new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_on"); + public static final CustomIcon Casing_Redstone_Bottom_Main_On = new CustomIcon("TileEntities/gt4/redstone/machine_bottom_redstone_main_on"); + + + 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"); + + public static final CustomIcon Casing_InventoryManagaer_Cyan = new CustomIcon("TileEntities/gt4/OVERLAY_CYAN"); + public static final CustomIcon Casing_InventoryManagaer_Green = new CustomIcon("TileEntities/gt4/OVERLAY_GREEN"); + public static final CustomIcon Casing_InventoryManagaer_Purple = new CustomIcon("TileEntities/gt4/OVERLAY_PURPLE"); + public static final CustomIcon Casing_InventoryManagaer_Red = new CustomIcon("TileEntities/gt4/OVERLAY_RED"); + public static final CustomIcon Casing_InventoryManagaer_Yellow = new CustomIcon("TileEntities/gt4/OVERLAY_YELLOW"); + public static final CustomIcon Casing_InventoryManagaer_Blue = new CustomIcon("TileEntities/gt4/OVERLAY_BLUE"); + + public static final CustomIcon Casing_InventoryManagaer_Cyan_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_CYAN_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Green_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_GREEN_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Purple_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_PURPLE_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Red_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_RED_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Yellow_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_YELLOW_REDSTONE"); + public static final CustomIcon Casing_InventoryManagaer_Blue_Redstone = new CustomIcon("TileEntities/gt4/OVERLAY_BLUE_REDSTONE"); + + private static final CustomIcon Casing_Test_1 = new CustomIcon("number/1"); + private static final CustomIcon Casing_Test_2 = new CustomIcon("number/2"); + private static final CustomIcon Casing_Test_3 = new CustomIcon("number/3"); + private static final CustomIcon Casing_Test_4 = new CustomIcon("number/4"); + private static final CustomIcon Casing_Test_5 = new CustomIcon("number/5"); + private static final CustomIcon Casing_Test_6 = new CustomIcon("number/6"); + private static final CustomIcon Casing_Test_7 = new CustomIcon("number/7"); + private static final CustomIcon Casing_Test_8 = new CustomIcon("number/8"); + private static final CustomIcon Casing_Test_9 = new CustomIcon("number/9"); + private static final CustomIcon Casing_Test_10 = new CustomIcon("number/10"); + private static final CustomIcon Casing_Test_11 = new CustomIcon("number/11"); + private static final CustomIcon Casing_Test_12 = new CustomIcon("number/12"); + private static final CustomIcon Casing_Test_13 = new CustomIcon("number/13"); + private static final CustomIcon Casing_Test_14 = new CustomIcon("number/14"); + private static final CustomIcon Casing_Test_15 = new CustomIcon("number/15"); + private static final CustomIcon Casing_Test_16 = new CustomIcon("number/16"); + + public static final CustomIcon[] TEST_NUMBER = new CustomIcon[] { + Casing_Test_1, Casing_Test_2, Casing_Test_3, Casing_Test_4, + Casing_Test_5, Casing_Test_6, Casing_Test_7, Casing_Test_8, + Casing_Test_9, Casing_Test_10, Casing_Test_11, Casing_Test_12, + Casing_Test_13, Casing_Test_14, Casing_Test_15, Casing_Test_16 + + }; //Covers private static final CustomIcon Internal_Overlay_Overflow_Valve = new CustomIcon("iconsets/OVERLAY_OVERFLOW_VALVE"); @@ -421,6 +500,20 @@ public class TexturesGtBlock { // Catalyst Bus private static final CustomIcon Internal_Overlay_Bus_Catalyst = new CustomIcon("iconsets/OVERLAY_CATALYSTS"); public static final CustomIcon Overlay_Bus_Catalyst = Internal_Overlay_Bus_Catalyst; + + + public static final CustomIcon Overlay_Cobble = new CustomIcon("iconsets/OVERLAY_COBBLE"); + public static final CustomIcon Overlay_Connector = new CustomIcon("iconsets/OVERLAY_CONNECTOR"); + public static final CustomIcon Overlay_Fire = new CustomIcon("iconsets/OVERLAY_FIRE"); + public static final CustomIcon Overlay_Grinder = new CustomIcon("iconsets/OVERLAY_GRINDER"); + public static final CustomIcon Overlay_GT_Logo = new CustomIcon("iconsets/OVERLAY_GT"); + public static final CustomIcon Overlay_Ice = new CustomIcon("iconsets/OVERLAY_ICE"); + public static final CustomIcon Overlay_Implosion = new CustomIcon("iconsets/OVERLAY_IMPLOSION"); + // Lapo Orb Hatch + public static final CustomIcon Overlay_Hatch_Lapo_Orb = new CustomIcon("iconsets/OVERLAY_LAPO"); + // Data Orb Hatch + public static final CustomIcon Overlay_Hatch_Data_Orb = new CustomIcon("iconsets/OVERLAY_DATA_ORB"); + // RTG Hatch private static final CustomIcon Internal_Overlay_Hatch_RTG_Off = new CustomIcon("iconsets/OVERLAY_ENERGY_RTG_OFF"); public static final CustomIcon Overlay_Hatch_RTG_Off = Internal_Overlay_Hatch_RTG_Off; @@ -472,8 +565,9 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_METAL_PANEL_G = new CustomIcon("metro/TEXTURE_METAL_PANEL_G"); public static final CustomIcon TEXTURE_METAL_PANEL_H = new CustomIcon("metro/TEXTURE_METAL_PANEL_H"); public static final CustomIcon TEXTURE_METAL_PANEL_I = new CustomIcon("metro/TEXTURE_METAL_PANEL_I"); - + public static final CustomIcon TEXTURE_MAGIC_PANEL_A = new CustomIcon("metro/TEXTURE_MAGIC_A"); + public static final CustomIcon TEXTURE_MAGIC_PANEL_B = new CustomIcon("metro/TEXTURE_MAGIC_B"); public static final CustomIcon TEXTURE_ORGANIC_PANEL_A = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A"); public static final CustomIcon TEXTURE_ORGANIC_PANEL_A_GLOWING = new CustomIcon("metro/TEXTURE_ORGANIC_PANEL_A_GLOWING"); @@ -496,6 +590,11 @@ public class TexturesGtBlock { public static final CustomIcon TEXTURE_TECH_PANEL_B = new CustomIcon("metro/TEXTURE_TECH_PANEL_B"); public static final CustomIcon TEXTURE_TECH_PANEL_C = new CustomIcon("metro/TEXTURE_TECH_PANEL_C"); public static final CustomIcon TEXTURE_TECH_PANEL_D = new CustomIcon("metro/TEXTURE_TECH_PANEL_D"); + public static final CustomIcon TEXTURE_TECH_PANEL_E = new CustomIcon("metro/TEXTURE_TECH_PANEL_E"); + public static final CustomIcon TEXTURE_TECH_PANEL_F = new CustomIcon("metro/TEXTURE_TECH_PANEL_F"); + public static final CustomIcon TEXTURE_TECH_PANEL_G = new CustomIcon("metro/TEXTURE_TECH_PANEL_G"); + public static final CustomIcon TEXTURE_TECH_PANEL_H = new CustomIcon("metro/TEXTURE_TECH_PANEL_H"); + public static final CustomIcon TEXTURE_TECH_PANEL_I = new CustomIcon("metro/TEXTURE_TECH_PANEL_I"); public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE = new CustomIcon("TileEntities/DecayablesChest_bottom"); public static final CustomIcon TEXTURE_TECH_PANEL_RADIOACTIVE_ALT = new CustomIcon("TileEntities/DecayablesChest_top"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java index c3d6a655c3..7169861340 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/blocks/textures/turbine/LargeTurbineTextureHandler.java @@ -1,180 +1,237 @@ -/* package gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU9; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE1; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE2; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE3; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE4; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE6; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE7; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE8; +import static gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE9; +import gregtech.api.enums.Textures.BlockIcons; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; -import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaCasingBlocks4; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; +import gtPlusPlus.xmod.gregtech.common.blocks.GregtechMetaSpecialMultiCasings; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; public class LargeTurbineTextureHandler { - */ -/** + /** * LP Turbines - *//* - - private static CustomIcon aTex1_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_1"); - private static CustomIcon aTex1 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_1"); - private static CustomIcon aTex2_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_2"); - private static CustomIcon aTex2 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_2"); - private static CustomIcon aTex3_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_3"); - private static CustomIcon aTex3 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_3"); - private static CustomIcon aTex4_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_4"); - private static CustomIcon aTex4 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_4"); - private static CustomIcon aTex5_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_5"); - private static CustomIcon aTex5 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_5"); - private static CustomIcon aTex6_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_6"); - private static CustomIcon aTex6 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_6"); - private static CustomIcon aTex7_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_7"); - private static CustomIcon aTex7 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_7"); - private static CustomIcon aTex8_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_8"); - private static CustomIcon aTex8 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_8"); - private static CustomIcon aTex9_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_ACTIVE_9"); - private static CustomIcon aTex9 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_LP_9"); - - private static CustomIcon frontFace_0 = (aTex1); - private static CustomIcon frontFaceActive_0 = (aTex1_Active); - private static CustomIcon frontFace_1 = (aTex2); - private static CustomIcon frontFaceActive_1 = (aTex2_Active); - private static CustomIcon frontFace_2 = (aTex3); - private static CustomIcon frontFaceActive_2 = (aTex3_Active); - private static CustomIcon frontFace_3 = (aTex4); - private static CustomIcon frontFaceActive_3 = (aTex4_Active); - public static CustomIcon frontFace_4 = (aTex5); - public static CustomIcon frontFaceActive_4 = (aTex5_Active); - private static CustomIcon frontFace_5 = (aTex6); - private static CustomIcon frontFaceActive_5 = (aTex6_Active); - private static CustomIcon frontFace_6 = (aTex7); - private static CustomIcon frontFaceActive_6 = (aTex7_Active); - private static CustomIcon frontFace_7 = (aTex8); - private static CustomIcon frontFaceActive_7 = (aTex8_Active); - private static CustomIcon frontFace_8 = (aTex9); - private static CustomIcon frontFaceActive_8 = (aTex9_Active); + */ - CustomIcon[] OVERLAY_LP_TURBINE = new CustomIcon[]{ - frontFace_0, - frontFace_1, - frontFace_2, - frontFace_3, - frontFace_4, - frontFace_5, - frontFace_6, - frontFace_7, - frontFace_8 + public static BlockIcons[] OVERLAY_LP_TURBINE = new BlockIcons[]{ + LARGETURBINE_ST1, + LARGETURBINE_ST2, + LARGETURBINE_ST3, + LARGETURBINE_ST4, + LARGETURBINE_ST5, + LARGETURBINE_ST6, + LARGETURBINE_ST7, + LARGETURBINE_ST8, + LARGETURBINE_ST9, }; - CustomIcon[] OVERLAY_LP_TURBINE_ACTIVE = new CustomIcon[]{ - frontFaceActive_0, - frontFaceActive_1, - frontFaceActive_2, - frontFaceActive_3, - frontFaceActive_4, - frontFaceActive_5, - frontFaceActive_6, - frontFaceActive_7, - frontFaceActive_8 + public static BlockIcons[] OVERLAY_LP_TURBINE_ACTIVE = new BlockIcons[]{ + LARGETURBINE_ST_ACTIVE1, + LARGETURBINE_ST_ACTIVE2, + LARGETURBINE_ST_ACTIVE3, + LARGETURBINE_ST_ACTIVE4, + LARGETURBINE_ST_ACTIVE5, + LARGETURBINE_ST_ACTIVE6, + LARGETURBINE_ST_ACTIVE7, + LARGETURBINE_ST_ACTIVE8, + LARGETURBINE_ST_ACTIVE9, }; - - */ -/** + /** * HP Turbines - *//* - - private static CustomIcon aTexHP1_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_1"); - private static CustomIcon aTexHP1 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_1"); - private static CustomIcon aTexHP2_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_2"); - private static CustomIcon aTexHP2 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_2"); - private static CustomIcon aTexHP3_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_3"); - private static CustomIcon aTexHP3 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_3"); - private static CustomIcon aTexHP4_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_4"); - private static CustomIcon aTexHP4 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_4"); - private static CustomIcon aTexHP5_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_5"); - private static CustomIcon aTexHP5 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_5"); - private static CustomIcon aTexHP6_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_6"); - private static CustomIcon aTexHP6 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_6"); - private static CustomIcon aTexHP7_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_7"); - private static CustomIcon aTexHP7 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_7"); - private static CustomIcon aTexHP8_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_8"); - private static CustomIcon aTexHP8 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_8"); - private static CustomIcon aTexHP9_Active = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_ACTIVE_9"); - private static CustomIcon aTexHP9 = new CustomIcon("iconsets/BigTurbine/LARGE_TURBINE_HP_9"); + */ - private static CustomIcon frontFaceHP_0 = (aTexHP1); - private static CustomIcon frontFaceHPActive_0 = (aTexHP1_Active); - private static CustomIcon frontFaceHP_1 = (aTexHP2); - private static CustomIcon frontFaceHPActive_1 = (aTexHP2_Active); - private static CustomIcon frontFaceHP_2 = (aTexHP3); - private static CustomIcon frontFaceHPActive_2 = (aTexHP3_Active); - private static CustomIcon frontFaceHP_3 = (aTexHP4); - private static CustomIcon frontFaceHPActive_3 = (aTexHP4_Active); - public static CustomIcon frontFaceHP_4 = (aTexHP5); - public static CustomIcon frontFaceHPActive_4 = (aTexHP5_Active); - private static CustomIcon frontFaceHP_5 = (aTexHP6); - private static CustomIcon frontFaceHPActive_5 = (aTexHP6_Active); - private static CustomIcon frontFaceHP_6 = (aTexHP7); - private static CustomIcon frontFaceHPActive_6 = (aTexHP7_Active); - private static CustomIcon frontFaceHP_7 = (aTexHP8); - private static CustomIcon frontFaceHPActive_7 = (aTexHP8_Active); - private static CustomIcon frontFaceHP_8 = (aTexHP9); - private static CustomIcon frontFaceHPActive_8 = (aTexHP9_Active); - - CustomIcon[] OVERLAY_HP_TURBINE = new CustomIcon[]{ - frontFaceHP_0, - frontFaceHP_1, - frontFaceHP_2, - frontFaceHP_3, - frontFaceHP_4, - frontFaceHP_5, - frontFaceHP_6, - frontFaceHP_7, - frontFaceHP_8 + public static BlockIcons[] OVERLAY_HP_TURBINE = new BlockIcons[]{ + LARGETURBINE_TI1, + LARGETURBINE_TI2, + LARGETURBINE_TI3, + LARGETURBINE_TI4, + LARGETURBINE_TI5, + LARGETURBINE_TI6, + LARGETURBINE_TI7, + LARGETURBINE_TI8, + LARGETURBINE_TI9, }; - CustomIcon[] OVERLAY_HP_TURBINE_ACTIVE = new CustomIcon[]{ - frontFaceHPActive_0, - frontFaceHPActive_1, - frontFaceHPActive_2, - frontFaceHPActive_3, - frontFaceHPActive_4, - frontFaceHPActive_5, - frontFaceHPActive_6, - frontFaceHPActive_7, - frontFaceHPActive_8 + public static BlockIcons[] OVERLAY_HP_TURBINE_ACTIVE = new BlockIcons[]{ + LARGETURBINE_TI_ACTIVE1, + LARGETURBINE_TI_ACTIVE2, + LARGETURBINE_TI_ACTIVE3, + LARGETURBINE_TI_ACTIVE4, + LARGETURBINE_TI_ACTIVE5, + LARGETURBINE_TI_ACTIVE6, + LARGETURBINE_TI_ACTIVE7, + LARGETURBINE_TI_ACTIVE8, + LARGETURBINE_TI_ACTIVE9, + }; + + /** + * Gas Turbines + */ + + public static BlockIcons[] OVERLAY_GAS_TURBINE = new BlockIcons[]{ + LARGETURBINE_SS1, + LARGETURBINE_SS2, + LARGETURBINE_SS3, + LARGETURBINE_SS4, + LARGETURBINE_SS5, + LARGETURBINE_SS6, + LARGETURBINE_SS7, + LARGETURBINE_SS8, + LARGETURBINE_SS9, }; + public static BlockIcons[] OVERLAY_GAS_TURBINE_ACTIVE = new BlockIcons[]{ + LARGETURBINE_SS_ACTIVE1, + LARGETURBINE_SS_ACTIVE2, + LARGETURBINE_SS_ACTIVE3, + LARGETURBINE_SS_ACTIVE4, + LARGETURBINE_SS_ACTIVE5, + LARGETURBINE_SS_ACTIVE6, + LARGETURBINE_SS_ACTIVE7, + LARGETURBINE_SS_ACTIVE8, + LARGETURBINE_SS_ACTIVE9, + }; + + /** + * Plasma Turbines + */ + + public static BlockIcons[] OVERLAY_PLASMA_TURBINE = new BlockIcons[]{ + LARGETURBINE_TU1, + LARGETURBINE_TU2, + LARGETURBINE_TU3, + LARGETURBINE_TU4, + LARGETURBINE_TU5, + LARGETURBINE_TU6, + LARGETURBINE_TU7, + LARGETURBINE_TU8, + LARGETURBINE_TU9, + }; + public static BlockIcons[] OVERLAY_PLASMA_TURBINE_ACTIVE = new BlockIcons[]{ + LARGETURBINE_TU_ACTIVE1, + LARGETURBINE_TU_ACTIVE2, + LARGETURBINE_TU_ACTIVE3, + LARGETURBINE_TU_ACTIVE4, + LARGETURBINE_TU_ACTIVE5, + LARGETURBINE_TU_ACTIVE6, + LARGETURBINE_TU_ACTIVE7, + LARGETURBINE_TU_ACTIVE8, + LARGETURBINE_TU_ACTIVE9, + }; - public IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaCasingBlocks4 thisBlock) { + public static IIcon handleCasingsGT(final IBlockAccess aWorld, final int xCoord, final int yCoord, final int zCoord, final int aSide, final GregtechMetaSpecialMultiCasings i) { final int tMeta = aWorld.getBlockMetadata(xCoord, yCoord, zCoord); - //7 - shaft - //8 LP - //9 HP + //0 shaft + //1 LP + //2 HP + //3 Gas + //4 Plasma - CustomIcon[] mGetCurrentTextureSet = null, mGetCurrentTextureSet_ACTIVE = null; + BlockIcons[] mGetCurrentTextureSet = null; + BlockIcons[] mGetCurrentTextureSet_ACTIVE = null; - if (tMeta <= 6 || tMeta >= 10) { - return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + if (tMeta <= 0 || tMeta >= 5) { + return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta); } else { - if (tMeta == 8) { + if (tMeta == 1) { mGetCurrentTextureSet = OVERLAY_LP_TURBINE; mGetCurrentTextureSet_ACTIVE = OVERLAY_LP_TURBINE_ACTIVE; } - else if (tMeta == 9) { + else if (tMeta == 2) { mGetCurrentTextureSet = OVERLAY_HP_TURBINE; mGetCurrentTextureSet_ACTIVE = OVERLAY_HP_TURBINE_ACTIVE; } + else if (tMeta == 3) { + mGetCurrentTextureSet = OVERLAY_GAS_TURBINE; + mGetCurrentTextureSet_ACTIVE = OVERLAY_GAS_TURBINE_ACTIVE; + } + else if (tMeta == 4) { + mGetCurrentTextureSet = OVERLAY_PLASMA_TURBINE; + mGetCurrentTextureSet_ACTIVE = OVERLAY_PLASMA_TURBINE_ACTIVE; + } if (mGetCurrentTextureSet == null || mGetCurrentTextureSet_ACTIVE == null) { - return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta); } @@ -283,28 +340,26 @@ public class LargeTurbineTextureHandler { } } } - return GregtechMetaCasingBlocks4.getStaticIcon((byte) aSide, (byte) tMeta); + return GregtechMetaSpecialMultiCasings.getStaticIcon((byte) aSide, (byte) tMeta); } - public boolean isUsingAnimatedTexture(TileEntity tTileEntity) { + public static boolean isUsingAnimatedTexture(TileEntity tTileEntity) { boolean aVal = true; - */ -/*IGregTechTileEntity aTile; + IGregTechTileEntity aTile; if (tTileEntity instanceof IGregTechTileEntity) { aTile = (IGregTechTileEntity) tTileEntity; if (aTile != null) { final IMetaTileEntity aMetaTileEntity = aTile.getMetaTileEntity(); if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { - aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).isControllerActive(); - Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status"); + aVal = ((GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity).getBaseMetaTileEntity().isActive(); + //Logger.INFO("Returning "+aVal+" as Rotor Assembly controller status"); } } - } *//* - + } return aVal; } - public GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) { + public static GT_MetaTileEntity_Hatch_Turbine isTurbineHatch(final IGregTechTileEntity aTileEntity) { if (aTileEntity != null) { final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity != null && aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { @@ -315,4 +370,3 @@ public class LargeTurbineTextureHandler { } } -*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_Generic_3x3.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_Generic_3x3.java deleted file mode 100644 index ca7cbca5f8..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_Generic_3x3.java +++ /dev/null @@ -1,87 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.blueprint; - -import gtPlusPlus.api.objects.data.Pair; -import gtPlusPlus.xmod.gregtech.api.objects.MultiblockBlueprint; -import gtPlusPlus.xmod.gregtech.api.objects.MultiblockLayer; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; - -public class Blueprint_Generic_3x3 extends MultiblockBlueprint { - - public Blueprint_Generic_3x3(Pair<Block, Integer> aCasing, int aTextureID) { - super(3, 3, 3, 10, aTextureID); - - // Top/Bottom - MultiblockLayer a0 = new MultiblockLayer(3, 3); - Block aCasingBlock_1 = aCasing.getKey(); - int aMeta = aCasing.getValue(); - a0.addBlockForPos(aCasingBlock_1, aMeta, 0, 0, true); - a0.addBlockForPos(aCasingBlock_1, aMeta, 0, 1, true); - a0.addBlockForPos(aCasingBlock_1, aMeta, 0, 2, true); - a0.addBlockForPos(aCasingBlock_1, aMeta, 1, 0, true); - a0.addBlockForPos(aCasingBlock_1, aMeta, 1, 1, true); - a0.addBlockForPos(aCasingBlock_1, aMeta, 1, 2, true); - a0.addBlockForPos(aCasingBlock_1, aMeta, 2, 0, true); - a0.addBlockForPos(aCasingBlock_1, aMeta, 2, 1, true); - a0.addBlockForPos(aCasingBlock_1, aMeta, 2, 2, true); - a0.lock(true); - - //Layer one - MultiblockLayer a1 = new MultiblockLayer(3, 3); - a1.addBlockForPos(aCasingBlock_1, aMeta, 0, 0, true); - a1.addBlockForPos(aCasingBlock_1, aMeta, 0, 1, true); - a1.addBlockForPos(aCasingBlock_1, aMeta, 0, 2, true); - a1.addBlockForPos(aCasingBlock_1, aMeta, 1, 0, true); - a1.addBlockForPos(Blocks.air, 0, 1, 1, true); - a1.addController(1, 2); - a1.addBlockForPos(aCasingBlock_1, aMeta, 2, 0, true); - a1.addBlockForPos(aCasingBlock_1, aMeta, 2, 1, true); - a1.addBlockForPos(aCasingBlock_1, aMeta, 2, 2, true); - a1.lock(true); - - this.setLayer(a0, 0); - this.setLayer(a1, 1); - this.setLayer(a0, 2); - } - - @Override - public int getMinimumInputBus() { - return 0; - } - - @Override - public int getMinimumInputHatch() { - return 0; - } - - @Override - public int getMinimumOutputBus() { - return 0; - } - - @Override - public int getMinimumOutputHatch() { - return 0; - } - - @Override - public int getMinimumInputEnergy() { - return 1; - } - - @Override - public int getMinimumOutputEnergy() { - return 0; - } - - @Override - public int getMinimumMaintHatch() { - return 1; - } - - @Override - public int getMinimumMufflers() { - return 1; - } - -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_LFTR.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_LFTR.java deleted file mode 100644 index 3551172904..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/blueprint/Blueprint_LFTR.java +++ /dev/null @@ -1,137 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.blueprint; - -import gregtech.api.enums.TAE; -import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.xmod.gregtech.api.objects.MultiblockBlueprint; -import gtPlusPlus.xmod.gregtech.api.objects.MultiblockLayer; -import net.minecraft.block.Block; - -public class Blueprint_LFTR extends MultiblockBlueprint { - - public Blueprint_LFTR() { - super(7, 4, 7, 10, TAE.GTPP_INDEX(12)); - - - Block aCasingMain = ModBlocks.blockCasingsMisc; - int aMetaCasingMain = 12; - int aMetaCasingSecondary = 13; - - - - /** - * First Layer (All edges can be Hatches, controller is centered in the front) - */ - - MultiblockLayer a0 = new MultiblockLayer(7, 7); - for (int i = 0; i < 7; i++) { - a0.addBlockForPos(aCasingMain, aMetaCasingMain, i, 0, true); - } - for (int i = 0; i < 7; i++) { - for (int u = 1; u < 6; u++) { - a0.addBlockForPos(aCasingMain, aMetaCasingMain, i, u, i == 0 ? true : i == 6 ? true : false); - } - } - for (int i = 0; i < 7; i++) { - if (i != 3) { - a0.addBlockForPos(aCasingMain, aMetaCasingMain, i, 6, true); - } - else { - a0.addController(i, 6); - } - } - a0.lock(true); - - - - - /** - * Middle Layer(s) - */ - - MultiblockLayer a1 = new MultiblockLayer(7, 7); - for (int i = 0; i < 7; i++) { - a1.addBlockForPos(aCasingMain, aMetaCasingSecondary, i, 0, false); - } - for (int i = 0; i < 7; i++) { - for (int u = 1; u < 6; u++) { - if (i == 0 || i == 6) - a1.addBlockForPos(aCasingMain, aMetaCasingSecondary, i, u, false); - } - } - for (int i = 0; i < 7; i++) { - a1.addBlockForPos(aCasingMain, aMetaCasingSecondary, i, 6, false); - - } - a1.lock(true); - - - /** - * Top Layer (All edges can be Hatches, Mufflers required in inner 3x3) - */ - - MultiblockLayer a2 = new MultiblockLayer(7, 7); - for (int i = 0; i < 7; i++) { - a2.addBlockForPos(aCasingMain, aMetaCasingMain, i, 0, true); - } - for (int i = 0; i < 7; i++) { - for (int u = 1; u < 6; u++) { - if ((i == 2 || i == 3 || i == 4) && (u == 2 || u ==3 || u == 4)) { - a2.addMuffler(aCasingMain, aMetaCasingMain, i, u); - } - else { - a2.addBlockForPos(aCasingMain, aMetaCasingMain, i, u, true); - } - } - } - for (int i = 0; i < 7; i++) { - a2.addBlockForPos(aCasingMain, aMetaCasingMain, i, 6, true); - } - a2.lock(true); - - this.setLayer(a0, 0); - this.setLayer(a1, 1); - this.setLayer(a1, 2); - this.setLayer(a2, 3); - } - - @Override - public int getMinimumInputBus() { - return 0; - } - - @Override - public int getMinimumInputHatch() { - return 4; - } - - @Override - public int getMinimumOutputBus() { - return 0; - } - - @Override - public int getMinimumOutputHatch() { - return 4; - } - - @Override - public int getMinimumInputEnergy() { - return 0; - } - - @Override - public int getMinimumOutputEnergy() { - return 4; - } - - @Override - public int getMinimumMaintHatch() { - return 1; - } - - @Override - public int getMinimumMufflers() { - return 4; - } - -} 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 new file mode 100644 index 0000000000..bd2df1b8ff --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_ComputerCube_Setup.java @@ -0,0 +1,74 @@ +package gtPlusPlus.xmod.gregtech.common.computer; + +import static gtPlusPlus.xmod.gregtech.common.tileentities.misc.GT_TileEntity_ComputerCube.sReactorList; + +import java.util.ArrayList; + +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.lib.LoadedMods; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.bartworks.BW_Utils; +import gtPlusPlus.xmod.goodgenerator.GG_Utils; +import net.minecraft.item.ItemStack; + +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 (LoadedMods.BartWorks) { + ArrayList<ItemStack> aBartReactorItems = BW_Utils.getAll(1); + for (ItemStack aReactorItem : aBartReactorItems) { + sReactorList.add(new GT_ItemStack(aReactorItem)); + } + } + + if (LoadedMods.GoodGenerator) { + 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 new file mode 100644 index 0000000000..fedb4e6028 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Description.java @@ -0,0 +1,194 @@ +package gtPlusPlus.xmod.gregtech.common.computer; + +import java.util.ArrayList; + +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; +import net.minecraft.item.ItemStack; + +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 new file mode 100644 index 0000000000..e0bedb5d18 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/computer/GT_Computercube_Simulator.java @@ -0,0 +1,149 @@ +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/helpers/ChargingHelper.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java index 70c7b2da23..be9db74eef 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/helpers/ChargingHelper.java @@ -6,17 +6,11 @@ import java.util.UUID; import cpw.mods.fml.common.eventhandler.EventPriority; import cpw.mods.fml.common.eventhandler.SubscribeEvent; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; - import gregtech.api.enums.GT_Values; import gregtech.api.util.GT_ModHandler; import gregtech.common.items.GT_MetaGenerated_Item_01; import gregtech.common.items.GT_MetaGenerated_Item_02; import gregtech.common.items.GT_MetaGenerated_Tool_01; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.api.objects.minecraft.BlockPos; @@ -25,14 +19,16 @@ import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.NBTUtils; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic.GregtechMetaWirelessCharger; -import ic2.api.info.Info; import ic2.api.item.ElectricItem; import ic2.api.item.IElectricItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent; public class ChargingHelper { - private static Map<EntityPlayer, Pair<GregtechMetaWirelessCharger, Byte>> mValidPlayers = new HashMap<EntityPlayer, Pair<GregtechMetaWirelessCharger, Byte>>(); + private static Map<String, Pair<GregtechMetaWirelessCharger, Byte>> mValidPlayers = new HashMap<String, Pair<GregtechMetaWirelessCharger, Byte>>(); protected static Map<BlockPos, GregtechMetaWirelessCharger> mChargerMap = new HashMap<BlockPos, GregtechMetaWirelessCharger>(); private int mTickTimer = 0; private final int mTickMultiplier = 20; @@ -58,7 +54,7 @@ public class ChargingHelper { long mVoltage = 0; long mEuStored = 0; - if (!mChargerMap.isEmpty() && mValidPlayers.containsKey(mPlayerMan)){ + if (!mChargerMap.isEmpty() && mValidPlayers.containsKey(mPlayerMan.getDisplayName())){ InventoryPlayer mPlayerInventory = mPlayerMan.inventory; ItemStack[] mArmourContents = mPlayerInventory.armorInventory.clone(); ItemStack[] mInventoryContents = mPlayerInventory.mainInventory.clone(); @@ -70,30 +66,30 @@ public class ChargingHelper { mEuStored = mEntityTemp.getEUVar(); if (mVoltage > 0 && mEuStored >= mVoltage){ - Map<EntityPlayer, UUID> LR = mEntityTemp.getLongRangeMap(); - Map<UUID, EntityPlayer> LO = mEntityTemp.getLocalMap(); + Map<String, UUID> LR = mEntityTemp.getLongRangeMap(); + Map<String, UUID> LO = mEntityTemp.getLocalMap(); long mStartingEu = mEntityTemp.getEUVar(); long mCurrentEu = mEntityTemp.getEUVar(); long mEuUsed = 0; if (mEntityTemp.getMode() == 0){ - if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){ + if (!LR.isEmpty() && LR.containsKey(mPlayerMan.getDisplayName())){ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan); mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan); } } else if (mEntityTemp.getMode() == 1){ - if (!LO.isEmpty() && LO.containsValue(mPlayerMan)){ + if (!LO.isEmpty() && LO.containsKey(mPlayerMan.getDisplayName())){ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan); mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan); } } else { - if (!LR.isEmpty() && LR.containsKey(mPlayerMan)){ + if (!LR.isEmpty() && LR.containsKey(mPlayerMan.getDisplayName())){ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan); mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan); } - if (!LO.isEmpty() && LO.containsValue(mPlayerMan)){ + if (!LO.isEmpty() && LO.containsKey(mPlayerMan.getDisplayName())){ mCurrentEu = chargeItems(mEntityTemp, mArmourContents, mPlayerMan); mCurrentEu = chargeItems(mEntityTemp, mInventoryContents, mPlayerMan); } @@ -136,13 +132,13 @@ public class ChargingHelper { catch (Throwable t){ //Utils.LOG_WARNING("State of Wireless Charger changed in an invalid way, this prevented a crash."); - - if (!mChargerMap.isEmpty()){ - for (GregtechMetaWirelessCharger r : mChargerMap.values()){ - if (r == null){ - mChargerMap.remove(r); + if (!mChargerMap.isEmpty()){ + for (BlockPos aPos : mChargerMap.keySet()) { + GregtechMetaWirelessCharger r = mChargerMap.get(aPos); + if (r == null || r.getBaseMetaTileEntity().isInvalidTileEntity()){ + mChargerMap.remove(aPos); } - } + } } //t.printStackTrace(); } @@ -163,7 +159,7 @@ public class ChargingHelper { } } else { - return false; + return true; } } @@ -189,14 +185,14 @@ public class ChargingHelper { return false; } Logger.WARNING("trying to map new player"); - if (mValidPlayers.containsKey(mPlayer)){ + if (mValidPlayers.containsKey(mPlayer.getDisplayName())){ Logger.WARNING("Key contains player already?"); return false; } else { Logger.WARNING("key not found, adding"); Pair<GregtechMetaWirelessCharger, Byte> mEntry = new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode()); - if (mValidPlayers.put(mPlayer, mEntry) == null){ + if (mValidPlayers.put(mPlayer.getDisplayName(), mEntry) == null){ Logger.WARNING("Added a Player to the Tick Map."); return true; } @@ -212,7 +208,7 @@ public class ChargingHelper { return false; } Logger.WARNING("trying to remove player from map"); - if (mValidPlayers.containsKey(mPlayer)){ + if (mValidPlayers.containsKey(mPlayer.getDisplayName())){ Logger.WARNING("key found, removing"); Pair<GregtechMetaWirelessCharger, Byte> mEntry = new Pair<GregtechMetaWirelessCharger, Byte>(mEntity, (byte) mEntity.getMode()); if (mValidPlayers.remove(mPlayer, mEntry)){ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/requirements/RequirementsBasicCubic.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/requirements/RequirementsBasicCubic.java deleted file mode 100644 index e53a7e4738..0000000000 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/requirements/RequirementsBasicCubic.java +++ /dev/null @@ -1,11 +0,0 @@ -package gtPlusPlus.xmod.gregtech.common.requirements; - -import gtPlusPlus.xmod.gregtech.api.objects.MultiblockRequirements; - -public class RequirementsBasicCubic extends MultiblockRequirements { - - public RequirementsBasicCubic( ) { - super(0, null); - } - -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java new file mode 100644 index 0000000000..7b223f8245 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricAutoWorkbench.java @@ -0,0 +1,772 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.automation; + +import java.util.ArrayList; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +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.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.gui.automation.GT_Container_ElectricAutoWorkbench; +import gtPlusPlus.xmod.gregtech.api.gui.automation.GT_GUIContainer_ElectricAutoWorkbench; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.oredict.OreDictionary; + +public class GT_MetaTileEntity_ElectricAutoWorkbench extends GT_MetaTileEntity_BasicTank { + + public int mMode = 0, mCurrentSlot = 0, mThroughPut = 0, mTicksUntilNextUpdate = 20; + public boolean mLastCraftSuccessful = false; + protected String mLocalName; + + public GT_MetaTileEntity_ElectricAutoWorkbench(final int aID, final int aTier, final String aDescription) { + super(aID, "basicmachine.automation.autoworkbench.0"+aTier, "Auto Workbench ("+GT_Values.VN[aTier]+")", aTier, 30, aDescription); + mLocalName = "Auto Workbench ("+GT_Values.VN[aTier]+")"; + } + + public GT_MetaTileEntity_ElectricAutoWorkbench(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, 30, aDescription, aTextures); + } + + @Override + public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_ElectricAutoWorkbench(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_ElectricAutoWorkbench(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public boolean isTransformerUpgradable() { + return true; + } + + @Override + public boolean isOverclockerUpgradable() { + return false; + } + + @Override + public boolean isSimpleMachine() { + return false; + } + + @Override + public boolean isValidSlot(int aIndex) { + return aIndex < 19; + } + + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isEnetInput() { + return true; + } + + @Override + public boolean isEnetOutput() { + return true; + } + + @Override + public boolean isInputFacing(byte aSide) { + return !isOutputFacing(aSide); + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == getBaseMetaTileEntity().getBackFacing(); + } + + @Override + public boolean isTeleporterCompatible() { + return false; + } + + @Override + public long maxEUInput() { + return GT_Values.V[mTier]; + } + + @Override + public long maxEUOutput() { + return mThroughPut % 2 == 0 ? GT_Values.V[mTier] : 0; + } + + @Override + public long getMinimumStoredEU() { + return GT_Values.V[this.mTier]; + } + + @Override + public long maxEUStore() { + return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]); + } + + @Override + public int getSizeInventory() { + return 30; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_ElectricAutoWorkbench(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("mMode", mMode); + aNBT.setInteger("mThroughPut", mThroughPut); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mMode = aNBT.getInteger("mMode"); + mThroughPut = aNBT.getInteger("mThroughPut"); + } + + @Override + public boolean doesFillContainers() { + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean canTankBeFilled() { + return true; + } + + @Override + public boolean canTankBeEmptied() { + return true; + } + + @Override + public boolean displaysItemStack() { + return false; + } + + @Override + public boolean displaysStackSize() { + return false; + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return aSide != getBaseMetaTileEntity().getFrontFacing() && aSide != getBaseMetaTileEntity().getBackFacing(); + } + + private static final int MAX_MODES = 10; + + public void switchModeForward() { + mMode = (mMode + 1) % MAX_MODES; + switchMode(); + } + + public void switchModeBackward() { + mMode--; + if (mMode < 0) mMode = MAX_MODES-1; + switchMode(); + } + + private void switchMode() { + mInventory[28] = null; + } + + public void switchThrough() { + mThroughPut = (mThroughPut + 1) % 4; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().getUniversalEnergyStored() >= (mMode==5||mMode==6?128:2048) && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || --mTicksUntilNextUpdate<1)) { + mTicksUntilNextUpdate = 32; + + for (byte i = 19; i < 28; i++) { + if (mInventory[i] != null && mInventory[i].isItemStackDamageable() && mInventory[i].getItem().hasContainerItem()) { + mInventory[i].setItemDamage(OreDictionary.WILDCARD_VALUE); + } + } + + if (mInventory[18] == null) { + for (byte i = 0; i < 18 && mFluid != null; i++) { + ItemStack tOutput = GT_Utility.fillFluidContainer(mFluid, mInventory[i], false, true); + if (tOutput != null) { + for (byte j = 0; j < 9; j++) { + if (mInventory[j] == null || (GT_Utility.areStacksEqual(tOutput, mInventory[j]) && mInventory[j].stackSize + tOutput.stackSize <= tOutput.getMaxStackSize())) { + mFluid.amount -= GT_Utility.getFluidForFilledItem(tOutput, true).amount * tOutput.stackSize; + getBaseMetaTileEntity().decrStackSize(i, 1); + if (mInventory[j] == null) { + mInventory[j] = tOutput; + } else { + mInventory[j].stackSize++; + } + if (mFluid.amount <= 0) mFluid = null; + break; + } + } + } + } + + ItemStack[] tRecipe = new ItemStack[9]; + ItemStack tTempStack = null, tOutput = null; + + if (mInventory[17] != null && mThroughPut < 2 && mMode != 0) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[17]; + mInventory[17] = null; + } + } else { + if (!mLastCraftSuccessful) { + mCurrentSlot = (mCurrentSlot+1)%18; + for (int i = 0; i < 17 && mInventory[mCurrentSlot] == null; i++) + mCurrentSlot = (mCurrentSlot+1)%18; + } + switch (mMode) { + case 0: + if (mInventory[mCurrentSlot] != null && !isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2 && mCurrentSlot < 8) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + for (int i = 0; i < 9; i++) { + tRecipe[i] = mInventory[i+19]; + if (tRecipe[i] != null) { + tRecipe[i] = GT_Utility.copy(tRecipe[i]); + tRecipe[i].stackSize = 1; + } + } + break; + case 1: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + tRecipe[0] = tTempStack; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + tRecipe[1] = tTempStack; + tRecipe[3] = tTempStack; + tRecipe[4] = tTempStack; + } else break; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + tRecipe[2] = tTempStack; + tRecipe[5] = tTempStack; + tRecipe[6] = tTempStack; + tRecipe[7] = tTempStack; + tRecipe[8] = tTempStack; + } else break; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + break; + case 2: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + tRecipe[0] = tTempStack; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + break; + case 3: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + tRecipe[0] = tTempStack; + tRecipe[1] = tTempStack; + tRecipe[3] = tTempStack; + tRecipe[4] = tTempStack; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + break; + case 4: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + tRecipe[0] = tTempStack; + tRecipe[1] = tTempStack; + tRecipe[2] = tTempStack; + tRecipe[3] = tTempStack; + tRecipe[4] = tTempStack; + tRecipe[5] = tTempStack; + tRecipe[6] = tTempStack; + tRecipe[7] = tTempStack; + tRecipe[8] = tTempStack; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + break; + case 5: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + tRecipe[0] = tTempStack; + + tOutput = GT_OreDictUnificator.get(true, tTempStack); + + if (tOutput != null && GT_Utility.areStacksEqual(tOutput, tTempStack)) tOutput = null; + + if (tOutput == null) { + tRecipe[0] = null; + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + } + break; + case 6: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } else if (OrePrefixes.dustSmall.contains(mInventory[mCurrentSlot])) { + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + tRecipe[0] = tTempStack; + tRecipe[1] = tTempStack; + tRecipe[3] = tTempStack; + tRecipe[4] = tTempStack; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + } else if (OrePrefixes.dustTiny.contains(mInventory[mCurrentSlot])) { + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + tRecipe[0] = tTempStack; + tRecipe[1] = tTempStack; + tRecipe[2] = tTempStack; + tRecipe[3] = tTempStack; + tRecipe[4] = tTempStack; + tRecipe[5] = tTempStack; + tRecipe[6] = tTempStack; + tRecipe[7] = tTempStack; + tRecipe[8] = tTempStack; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + } else { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + break; + case 7: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot]) || !OrePrefixes.nugget.contains(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + tRecipe[0] = tTempStack; + tRecipe[1] = tTempStack; + tRecipe[2] = tTempStack; + tRecipe[3] = tTempStack; + tRecipe[4] = tTempStack; + tRecipe[5] = tTempStack; + tRecipe[6] = tTempStack; + tRecipe[7] = tTempStack; + tRecipe[8] = tTempStack; + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + break; + case 8: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot]) || mInventory[mCurrentSlot].getItemDamage() <= 0 || !mInventory[mCurrentSlot].getItem().isRepairable()) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + tTempStack = GT_Utility.copy(mInventory[mCurrentSlot]); + tTempStack.stackSize = 1; + for (int i = mCurrentSlot + 1; i < 18; i++) { + if (mInventory[i] != null && mInventory[i].getItem() == tTempStack.getItem() && mInventory[mCurrentSlot].getItemDamage()+mInventory[i].getItemDamage()>tTempStack.getMaxDamage()) { + tRecipe[0] = tTempStack; + tRecipe[1] = GT_Utility.copy(mInventory[i]); + if (GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null) { + if (mInventory[18] == null) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + } + break; + } + } + break; + case 9: + if (isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(mInventory[mCurrentSlot])) { + if (mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mCurrentSlot]; + mInventory[mCurrentSlot] = null; + mTicksUntilNextUpdate = 1; + } + break; + } + for (byte i = 0, j = 0; i < 18 && j < 9 && (j < 2 || GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe) == null); i++) { + tRecipe[j] = mInventory[(mCurrentSlot+i)%18]; + if (tRecipe[j] != null) { + tRecipe[j] = GT_Utility.copy(tRecipe[j]); + tRecipe[j].stackSize = 1; + j++; + } + } + if (tRecipe[1] == null) tRecipe[0] = null; + break; + } + } + + if (tOutput == null) tOutput = GT_ModHandler.getAllRecipeOutput(getBaseMetaTileEntity().getWorld(), tRecipe); + + if (tOutput != null || mMode == 0) mInventory[28] = tOutput; + + if (tOutput == null) { + mLastCraftSuccessful = false; + } else { + if ((tTempStack = GT_OreDictUnificator.get(true, tOutput)) != null) { + tTempStack.stackSize = tOutput.stackSize; + tOutput = tTempStack; + } + + mInventory[28] = GT_Utility.copy(tOutput); + ArrayList<ItemStack> tList = recipeContent(tRecipe), tContent = benchContent(); + if (tList.size() > 0 && tContent.size() > 0) { + + boolean success = (mMode==6||mMode==7||mInventory[17]==null); + for (byte i = 0; i < tList.size() && success; i++) { + success = false; + for (byte j = 0; j < tContent.size() && !success; j++) { + if (GT_Utility.areStacksEqual(tList.get(i), tContent.get(j))) { + if (tList.get(i).stackSize <= tContent.get(j).stackSize) { + success = true; + } + } + } + } + + if (success) { + mLastCraftSuccessful = true; + + for (byte i = 8; i > -1; i--) { + for (byte j = 17; j > -1; j--) { + if (tRecipe[i] != null && mInventory[j] != null) { + if (GT_Utility.areStacksEqual(tRecipe[i], mInventory[j])) { + ItemStack tStack = GT_Utility.getContainerItem(mInventory[j], true); + if (tStack != null) { + getBaseMetaTileEntity().decrStackSize(j, 1); + if (!tStack.isItemStackDamageable() || tStack.getItemDamage() < tStack.getMaxDamage()) { + for (byte k = 9; k < 18; k++) { + if (mInventory[k] == null) { + mInventory[k] = GT_Utility.copy(tStack); + break; + } else if (GT_Utility.areStacksEqual(mInventory[k], tStack) && mInventory[k].stackSize + tStack.stackSize <= tStack.getMaxStackSize()) { + mInventory[k].stackSize += tStack.stackSize; + break; + } + } + } + } else { + getBaseMetaTileEntity().decrStackSize(j, 1); + } + break; + } + } + } + } + + mInventory[18] = GT_Utility.copy(tOutput); + getBaseMetaTileEntity().decreaseStoredEnergyUnits(mMode==5||mMode==6||mMode==7?128:2048, true); + mTicksUntilNextUpdate = 1; + } else { + mLastCraftSuccessful = false; + if (mInventory[mMode==0?8:17] != null && mInventory[18] == null && mThroughPut < 2) { + mInventory[18] = mInventory[mMode==0?8:17]; + mInventory[mMode==0?8:17] = null; + mTicksUntilNextUpdate = 1; + } + } + } + + if (mInventory[18] == null && mThroughPut < 2) { + for (byte i = 0; i < 8; i++) { + for (byte j = i; ++j < 9;) { + if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j]) && mInventory[i].getMaxStackSize() > 8) { + mInventory[18] = mInventory[j]; + mInventory[j] = null; + mTicksUntilNextUpdate = 1; + break; + } + } + } + } + } + } + + if (mThroughPut < 2) { + getBaseMetaTileEntity().decreaseStoredEnergyUnits(GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing()), getBaseMetaTileEntity().getBackFacing(), getBaseMetaTileEntity().getFrontFacing(), null, false, (byte)64, (byte)1, (byte)64, (byte)1)*10, true); + } + } + } + + private boolean isItemTypeOrItsEmptyLiquidContainerInCraftingGrid(ItemStack aStack) { + if (aStack == null) return true; + for (byte i = 19; i < 28; i++) { + if (mInventory[i] != null) { + if (GT_Utility.areStacksEqual(mInventory[i], aStack)) return true; + if (GT_Utility.areStacksEqual(GT_Utility.getContainerForFilledItem(mInventory[i], true), aStack)) return true; + } + } + return false; + } + + private ArrayList<ItemStack> recipeContent(ItemStack[] tRecipe) { + ArrayList<ItemStack> tList = new ArrayList<ItemStack>(); + for (byte i = 0; i < 9; i++) { + if (tRecipe[i] != null) { + boolean temp = false; + for (byte j = 0; j < tList.size(); j++) { + if (GT_Utility.areStacksEqual(tRecipe[i], tList.get(j))) { + tList.get(j).stackSize++; + temp = true; + break; + } + } + if (!temp) tList.add(GT_Utility.copy(1, tRecipe[i])); + } + } + return tList; + } + + private ArrayList<ItemStack> benchContent() { + ArrayList<ItemStack> tList = new ArrayList<ItemStack>(); + for (byte i = 0; i < 18; i++) { + if (mInventory[i] != null) { + boolean temp = false; + for (byte j = 0; j < tList.size(); j++) { + if (GT_Utility.areStacksEqual(mInventory[i], mInventory[j])) { + tList.get(j).stackSize += mInventory[i].stackSize; + temp = true; + break; + } + } + if (!temp) tList.add(GT_Utility.copy(mInventory[i])); + } + } + return tList; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return mMode==0?aIndex>=10:aIndex>=18; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return mMode==0?aIndex<9:aIndex<18; + } + + /*@Override + public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) + return 112; + if (GT_Utility.getOppositeSide(aSide) == aFacing) + return 113; + return 114; + }*/ + + @Override + public int getCapacity() { + return 16000; + } + + @Override + public int getTankPressure() { + return -100; + } + + @Override + public String[] getDescription() { + return new String[] { + "Automatic Crafting Table Mk III", + //this.mDescription, + CORE.GT_Tooltip }; + } + + @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.getBack(i); + rTextures[2][i + 1] = this.getBottom(i); + rTextures[3][i + 1] = this.getTop(i); + rTextures[4][i + 1] = this.getSides(i); + rTextures[5][i + 1] = this.getFront(i); + rTextures[6][i + 1] = this.getBack(i); + rTextures[7][i + 1] = this.getBottom(i); + rTextures[8][i + 1] = this.getTop(i); + rTextures[9][i + 1] = this.getSides(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return this.mTextures[0][aColorIndex + 1]; + } + else if (GT_Utility.getOppositeSide(aSide) == aFacing) { + return this.mTextures[1][aColorIndex + 1]; + } + else { + return this.mTextures[4][aColorIndex + 1]; + } + /*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1];*/ + } + + public ITexture[] getFront(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay)}; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE)}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], }; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay)}; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java new file mode 100644 index 0000000000..732996de71 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_ElectricInventoryManager.java @@ -0,0 +1,451 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.automation; + +import java.util.ArrayList; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.gui.automation.GT_Container_ElectricInventoryManager; +import gtPlusPlus.xmod.gregtech.api.gui.automation.GT_GUIContainer_ElectricInventoryManager; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + +public class GT_MetaTileEntity_ElectricInventoryManager extends GT_MetaTileEntity_TieredMachineBlock { + + public int[] mSlotRange = new int[4]; + public boolean mWorkedLastTick = false; + protected String mLocalName; + + public GT_MetaTileEntity_ElectricInventoryManager(final int aID, final int aTier, final String aDescription) { + super(aID, "basicmachine.automation.inventorymanager.0" + aTier, "Electric Inventory Manager (" + GT_Values.VN[aTier] + ")", aTier, 16, aDescription); + mLocalName = "Auto Workbench (" + GT_Values.VN[aTier] + ")"; + } + + public GT_MetaTileEntity_ElectricInventoryManager(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, 16, aDescription, aTextures); + } + + @Override + public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_ElectricInventoryManager(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_ElectricInventoryManager(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public boolean isTransformerUpgradable() { + return true; + } + + @Override + public boolean isOverclockerUpgradable() { + return false; + } + + @Override + public boolean isSimpleMachine() { + return false; + } + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public boolean isEnetInput() { + return true; + } + + @Override + public boolean isEnetOutput() { + return true; + } + + @Override + public long maxEUInput() { + return GT_Values.V[mTier]; + } + + @Override + public long maxEUOutput() { + return GT_Values.V[mTier]; + } + + @Override + public long getMinimumStoredEU() { + return GT_Values.V[this.mTier]; + } + + @Override + public long maxEUStore() { + return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]); + } + + @Override + public long maxAmperesIn() { + return 4; + } + + @Override + public long maxAmperesOut() { + return 4; + } + + @Override + public boolean isValidSlot(int aIndex) { + return aIndex < 3; + } + + @Override + public boolean isInputFacing(byte aSide) { + return !isOutputFacing(aSide); + } + + @Override + public boolean isOutputFacing(byte aSide) { + for (int i = 0; i < mSlotRange.length; i++) { + if (aSide == getRangeDirection(i) && getRangeEnergy(i)) { + return true; + } + } + return false; + } + + @Override + public int getSizeInventory() { + return 16; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_ElectricInventoryManager(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mSlotRange0", mSlotRange[0]); + aNBT.setInteger("mSlotRange1", mSlotRange[1]); + aNBT.setInteger("mSlotRange2", mSlotRange[2]); + aNBT.setInteger("mSlotRange3", mSlotRange[3]); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mSlotRange[0] = aNBT.getInteger("mSlotRange0"); + mSlotRange[1] = aNBT.getInteger("mSlotRange1"); + mSlotRange[2] = aNBT.getInteger("mSlotRange2"); + mSlotRange[3] = aNBT.getInteger("mSlotRange3"); + } + + public void iterateRangeDirection(int aIndex) { + mSlotRange[aIndex] = (mSlotRange[aIndex] & ~7) | (((mSlotRange[aIndex] & 7) + 1) % 6); + } + + public void switchRangeEnergy(int aIndex) { + mSlotRange[aIndex] = (mSlotRange[aIndex] & ~8) | ((mSlotRange[aIndex] & 8) > 0 ? 0 : 8); + } + + public void iterateSlot1Direction(int aIndex) { + mSlotRange[aIndex] = (mSlotRange[aIndex] & ~112) | (((((mSlotRange[aIndex] & 112) >> 4) + 1) % 6) << 4); + } + + public void iterateSlot2Direction(int aIndex) { + mSlotRange[aIndex] = (mSlotRange[aIndex] & ~896) | (((((mSlotRange[aIndex] & 896) >> 7) + 1) % 6) << 7); + } + + public void iterateSlot3Direction(int aIndex) { + mSlotRange[aIndex] = (mSlotRange[aIndex] & ~7168) | (((((mSlotRange[aIndex] & 7168) >> 10) + 1) % 6) << 10); + } + + public void switchSlot1InOut(int aIndex) { + mSlotRange[aIndex] = (mSlotRange[aIndex] & ~8192) | ((mSlotRange[aIndex] & 8192) > 0 ? 0 : 8192); + } + + public void switchSlot2InOut(int aIndex) { + mSlotRange[aIndex] = (mSlotRange[aIndex] & ~16384) | ((mSlotRange[aIndex] & 16384) > 0 ? 0 : 16384); + } + + public void switchSlot3InOut(int aIndex) { + mSlotRange[aIndex] = (mSlotRange[aIndex] & ~32768) | ((mSlotRange[aIndex] & 32768) > 0 ? 0 : 32768); + } + + public byte getRangeDirection(int aIndex) { + return (byte) (mSlotRange[aIndex] & 7); + } + + public byte getSlot1Direction(int aIndex) { + return (byte) ((mSlotRange[aIndex] & 112) >> 4); + } + + public byte getSlot2Direction(int aIndex) { + return (byte) ((mSlotRange[aIndex] & 896) >> 7); + } + + public byte getSlot3Direction(int aIndex) { + return (byte) ((mSlotRange[aIndex] & 7168) >> 10); + } + + public boolean getRangeEnergy(int aIndex) { + return (mSlotRange[aIndex] & 8) > 0; + } + + public boolean getSlot1InOut(int aIndex) { + return (mSlotRange[aIndex] & 8192) > 0; + } + + public boolean getSlot2InOut(int aIndex) { + return (mSlotRange[aIndex] & 16384) > 0; + } + + public boolean getSlot3InOut(int aIndex) { + return (mSlotRange[aIndex] & 32768) > 0; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().getUniversalEnergyStored() >= 5000 + && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || getBaseMetaTileEntity().getTimer() % 100 == 0 || mWorkedLastTick || getBaseMetaTileEntity().hasInventoryBeenModified())) { + mWorkedLastTick = false; + + IInventory[] tTileEntities = new IInventory[]{ + getBaseMetaTileEntity().getIInventoryAtSide((byte) 0), getBaseMetaTileEntity().getIInventoryAtSide((byte) 1), getBaseMetaTileEntity().getIInventoryAtSide((byte) 2), + getBaseMetaTileEntity().getIInventoryAtSide((byte) 3), getBaseMetaTileEntity().getIInventoryAtSide((byte) 4), getBaseMetaTileEntity().getIInventoryAtSide((byte) 5), null, null + }; + + int tCost = 0; + + for (int i = 0; i < 4; i++) { + if (tTileEntities[getRangeDirection(i)] != null) { + ArrayList<ItemStack> tList = new ArrayList<ItemStack>(); + ItemStack tStack; + tList.add(null); + + tStack = mInventory[3 + i * 3 + 0]; + if (tStack == null) { + if (getSlot1InOut(i)) + tCost += 5 + * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot1Direction(i), getSlot1Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + else + tCost += 5 + * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot1Direction(i), getSlot1Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + } + else { + tList.set(0, tStack); + if (getSlot1InOut(i)) + tCost += 5 + * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot1Direction(i), getSlot1Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1); + else + tCost += 5 + * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot1Direction(i), getSlot1Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1); + } + + tStack = mInventory[3 + i * 3 + 1]; + if (tStack == null) { + if (getSlot2InOut(i)) + tCost += 5 + * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot2Direction(i), getSlot2Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + else + tCost += 5 + * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot2Direction(i), getSlot2Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + } + else { + tList.set(0, tStack); + if (getSlot2InOut(i)) + tCost += 5 + * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot2Direction(i), getSlot2Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1); + else + tCost += 5 + * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot2Direction(i), getSlot2Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1); + } + + tStack = mInventory[3 + i * 3 + 2]; + if (tStack == null) { + if (getSlot3InOut(i)) + tCost += 5 + * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot3Direction(i), getSlot3Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + else + tCost += 5 + * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot3Direction(i), getSlot3Direction(i), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1); + } + else { + tList.set(0, tStack); + if (getSlot3InOut(i)) + tCost += 5 + * GT_Utility.moveOneItemStack(getBaseMetaTileEntity(), tTileEntities[getRangeDirection(i)], getSlot3Direction(i), getSlot3Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1); + else + tCost += 5 + * GT_Utility.moveOneItemStack(tTileEntities[getRangeDirection(i)], getBaseMetaTileEntity(), getSlot3Direction(i), getSlot3Direction(i), tList, false, (byte) tStack.stackSize, (byte) 1, (byte) 64, (byte) 1); + } + } + } + + if (tCost > 0) { + mWorkedLastTick = true; + getBaseMetaTileEntity().decreaseStoredEnergyUnits(tCost, true); + } + } + } + + @Override + public String[] getDescription() { + return new String[]{ + "It's simpler than you think. I promise.", this.mDescription, CORE.GT_Tooltip + }; + } + + /*@Override + public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { + switch (aSide) { + case 0: return 113 + (aRedstone?8:0); + case 1: return 112 + (aRedstone?8:0); + case 2: return 116 + (aRedstone?8:0); + case 3: return 213 + (aRedstone?8:0); + case 4: return 212 + (aRedstone?8:0); + case 5: return 117 + (aRedstone?8:0); + } + return 0; + }*/ + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return true; + } + + @Override + public ITexture[][][] getTextureSet(final ITexture[] aTextures) { + final ITexture[][][] rTextures = new ITexture[16][17][]; + for (byte i = -1; i < 16; i++) { + rTextures[0][i + 1] = this.getBottom(i); + rTextures[1][i + 1] = this.getTop(i); + rTextures[2][i + 1] = this.getNegativeZ(i); + rTextures[3][i + 1] = this.getPositiveZ(i); + rTextures[4][i + 1] = this.getNegativeX(i); + rTextures[5][i + 1] = this.getPositiveX(i); + rTextures[6][i + 1] = this.getBottomRedstone(i); + rTextures[7][i + 1] = this.getTopRedstone(i); + rTextures[8][i + 1] = this.getNegativeZRedstone(i); + rTextures[9][i + 1] = this.getPositiveZRedstone(i); + rTextures[10][i + 1] = this.getNegativeXRedstone(i); + rTextures[11][i + 1] = this.getPositiveXRedstone(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[!aRedstone ? aSide : aSide + 6][aColorIndex < 0 ? 0 : aColorIndex]; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red) + }; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green) + }; + } + + public ITexture[] getNegativeZ(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue) + }; + } + + public ITexture[] getPositiveZ(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan) + }; + } + + public ITexture[] getNegativeX(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple) + }; + } + + public ITexture[] getPositiveX(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow) + }; + } + + public ITexture[] getBottomRedstone(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone) + }; + } + + public ITexture[] getTopRedstone(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Green_Redstone) + }; + } + + public ITexture[] getNegativeZRedstone(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Blue_Redstone) + }; + } + + public ITexture[] getPositiveZRedstone(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Cyan_Redstone) + }; + } + + public ITexture[] getNegativeXRedstone(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Purple_Redstone) + }; + } + + public ITexture[] getPositiveXRedstone(final byte aColor) { + return new ITexture[]{ + Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Yellow_Redstone) + }; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java index a62a5d16c8..087da7465d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/creative/GregtechMetaCreativeEnergyBuffer.java @@ -5,18 +5,13 @@ import static gregtech.api.enums.GT_Values.V; import java.lang.reflect.Field; import java.lang.reflect.Modifier; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_RenderedTexture; - +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; @@ -26,34 +21,36 @@ import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GregtechMetaEnergyBuffer; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! * - * This is the main construct for my Basic Machines such as the Automatic Extractor - * Extend this class to make a simple Machine + * This is the main construct for my Basic Machines such as the Automatic + * Extractor Extend this class to make a simple Machine */ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { - - public GregtechMetaCreativeEnergyBuffer(final String aName, final int aTier, - final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) { + private int mVoltageTier = 3; + + public GregtechMetaCreativeEnergyBuffer(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures, final int aSlotCount) { super(aName, aTier, aDescription, aTextures, aSlotCount); // TODO Auto-generated constructor stub } - public GregtechMetaCreativeEnergyBuffer(final int aID, final String aName, - final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) { + public GregtechMetaCreativeEnergyBuffer(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription, final int aSlotCount) { super(aID, aName, aNameRegional, aTier, aDescription, aSlotCount); } @Override public String[] getDescription() { - return new String[] {this.mDescription, - "Use Screwdriver to change voltage", - "Hold Shift while using Screwdriver to change amperage", - EnumChatFormatting.GREEN+"CREATIVE MACHINE", - CORE.GT_Tooltip}; + return new String[]{this.mDescription, "Use Screwdriver to change voltage", "Hold Shift while using Screwdriver to change amperage", EnumChatFormatting.GREEN + + "CREATIVE MACHINE", CORE.GT_Tooltip}; } /* @@ -64,29 +61,35 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { CustomIcon h = TexturesGtBlock.Casing_Material_RedSteel; CustomIcon g = TexturesGtBlock.Casing_Material_Grisium; CustomIcon k; - boolean j = MathUtils.isNumberEven(this.mTier); + boolean j = MathUtils.isNumberEven(this.mVoltageTier); final ITexture[][][] rTextures = new ITexture[2][17][]; - k = j ? g : h; + k = j ? g : h; for (byte i = -1; i < 16; i++) { - rTextures[0][i + 1] = new ITexture[] { new GT_RenderedTexture(k) }; - rTextures[1][i + 1] = new ITexture[] { - new GT_RenderedTexture(k), this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mTier] - : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mTier] }; + rTextures[0][i + 1] = new ITexture[]{new GT_RenderedTexture(k)}; + rTextures[1][i + + 1] = new ITexture[]{new GT_RenderedTexture(k), this.mInventory.length > 4 ? Textures.BlockIcons.OVERLAYS_ENERGY_OUT_MULTI[this.mVoltageTier] : Textures.BlockIcons.OVERLAYS_ENERGY_OUT[this.mVoltageTier]}; } return rTextures; } @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, - final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, - final boolean aRedstone) { + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1]; } @Override + protected void showEnergy(final World worldIn, final EntityPlayer playerIn){ + final long tempStorage = this.getBaseMetaTileEntity().getStoredEU(); + final double c = ((double) tempStorage / this.maxEUStore()) * 100; + final double roundOff = Math.round(c * 100.00) / 100.00; + PlayerUtils.messagePlayer(playerIn, "Energy: " + GT_Utility.formatNumbers(tempStorage) + " EU at "+V[this.mVoltageTier]+"v ("+roundOff+"%)"); + PlayerUtils.messagePlayer(playerIn, "Amperage: " + GT_Utility.formatNumbers(maxAmperesOut())+"A"); + + } + + @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { - return new GregtechMetaCreativeEnergyBuffer(this.mName, this.mTier, this.mDescription, - this.mTextures, this.mInventory.length); + return new GregtechMetaCreativeEnergyBuffer(this.mName, this.mTier, this.mDescription, this.mTextures, this.mInventory.length); } @Override @@ -101,43 +104,49 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { @Override public long maxEUInput() { - return V[this.mTier]; + return V[mVoltageTier]; } @Override public long maxEUOutput() { - return V[this.mTier]; + return V[mVoltageTier]; } @Override public long maxAmperesIn() { - return 16; + return aCurrentOutputAmperage; } @Override public long maxAmperesOut() { - return 16; + return aCurrentOutputAmperage; } - @Override public int getProgresstime() {return Integer.MAX_VALUE;} - @Override public int maxProgresstime() {return Integer.MAX_VALUE;} - @Override public boolean isAccessAllowed(final EntityPlayer aPlayer) {return true;} + @Override + public int getProgresstime() { + return Integer.MAX_VALUE; + } + @Override + public int maxProgresstime() { + return Integer.MAX_VALUE; + } + @Override + public boolean isAccessAllowed(final EntityPlayer aPlayer) { + return true; + } @Override - public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, - final IGregTechTileEntity aBaseMetaTileEntity) { + public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { return null; } @Override - public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, - final IGregTechTileEntity aBaseMetaTileEntity) { + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { return null; } @Override public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { - this.getBaseMetaTileEntity().increaseStoredEnergyUnits(Integer.MAX_VALUE, true); if (aBaseMetaTileEntity.isServerSide()) { aBaseMetaTileEntity.increaseStoredEnergyUnits(Integer.MAX_VALUE, true); } @@ -156,12 +165,7 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { @Override public String[] getInfoData() { String[] infoData = super.getInfoData(); - return new String[] { - infoData[0], - "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: "+this.mTier, - infoData[1], - infoData[2] - }; + return new String[]{infoData[0], "THIS IS A CREATIVE ITEM - FOR TESTING | Tier: " + this.mVoltageTier, infoData[1], infoData[2]}; } @Override @@ -171,59 +175,59 @@ public class GregtechMetaCreativeEnergyBuffer extends GregtechMetaEnergyBuffer { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setByte("mTier", this.mTier); + aNBT.setInteger("mVoltageTier", this.mVoltageTier); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { + this.mVoltageTier = aNBT.getInteger("mVoltageTier"); super.loadNBTData(aNBT); - this.mTier = aNBT.getByte("mTier"); } @Override - public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { if (KeyboardUtils.isShiftKeyDown()) { - super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); + super.onScrewdriverRightClick(aSide, aPlayer, aX, aY, aZ); } else { - if (this.mTier < (CORE.GTNH ? GT_Values.V.length-1 : 9)) { - this.mTier++; + if (this.mVoltageTier < (GT_Values.VN[9].equals("UHV") ? GT_Values.V.length - 1 : 9)) { + this.mVoltageTier++; } else { - this.mTier = 0; + this.mVoltageTier = 0; } this.markDirty(); try { - Field field = ReflectionUtils.getField(this.getClass(), "mTextures"); + Field field = ReflectionUtils.getField(this.getClass(), "mTextures"); field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); ITexture[][][] V = getTextureSet(null); if (V != null) { - Logger.REFLECTION("Got Valid Textures."); + Logger.REFLECTION("Got Valid Textures."); if (this.getBaseMetaTileEntity().isClientSide()) { - Logger.REFLECTION("Clientside Call."); + Logger.REFLECTION("Clientside Call."); Logger.REFLECTION("Refreshing Textures on buffer."); field.set(this, V); Logger.REFLECTION("Refreshed Textures on buffer."); } else { - Logger.REFLECTION("Serverside Call."); + Logger.REFLECTION("Serverside Call."); } } else { - Logger.REFLECTION("Bad mTextures setter."); - } + Logger.REFLECTION("Bad mTextures setter."); + } } catch (Throwable t) { - //Bad refresh. + // Bad refresh. t.printStackTrace(); Logger.REFLECTION("Bad mTextures setter."); } - PlayerUtils.messagePlayer(aPlayer, "Now running at "+GT_Values.VOLTAGE_NAMES[this.mTier]+"."); - } - + PlayerUtils.messagePlayer(aPlayer, "Now running at " + GT_Values.VOLTAGE_NAMES[this.mVoltageTier] + "."); + } + } -}
\ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java new file mode 100644 index 0000000000..01d5ef88c8 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GT_MetaTileEntity_CropHarvestor.java @@ -0,0 +1,669 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Iterator; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +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.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.xmod.gregtech.api.gui.basic.GT_Container_CropHarvestor; +import gtPlusPlus.xmod.gregtech.api.gui.basic.GT_GUIContainer_CropHarvestor; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import ic2.api.crops.CropCard; +import ic2.api.crops.ICropTile; +import ic2.core.item.DamageHandler; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class GT_MetaTileEntity_CropHarvestor extends GT_MetaTileEntity_BasicTank { + + protected String mLocalName; + + private static final int SLOT_WEEDEX_1 = 1; + private static final int SLOT_WEEDEX_2 = 2; + private static final int SLOT_FERT_1 = 3; + private static final int SLOT_FERT_4 = 6; + private static final int SLOT_OUTPUT_START = 7; + + public boolean mModeAlternative = false; + + public GT_MetaTileEntity_CropHarvestor(final int aID, final int aTier, final String aDescription) { + super(aID, "basicmachine.cropharvester.0"+aTier, "Crop Manager ("+GT_Values.VN[aTier]+")", aTier, 21, aDescription); + mLocalName = "Crop Manager ("+GT_Values.VN[aTier]+")"; + } + + public GT_MetaTileEntity_CropHarvestor(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, 21, aDescription, aTextures); + mLocalName = "Crop Manager ("+GT_Values.VN[aTier]+")"; + } + + @Override + public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_CropHarvestor(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_CropHarvestor(aPlayerInventory, aBaseMetaTileEntity, mLocalName); + } + + @Override + public boolean isTransformerUpgradable() { + return true; + } + + @Override + public boolean isOverclockerUpgradable() { + return true; + } + + @Override + public boolean isSimpleMachine() { + return true; + } + + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public boolean isInputFacing(byte aSide) { + return true; + } + + @Override + public boolean isEnetInput() { + return true; + } + + @Override + public boolean isElectric() { + return true; + } + + @Override + public long maxAmperesIn() { + return 8; + } + + @Override + public long getMinimumStoredEU() { + return GT_Values.V[this.mTier]; + } + + @Override + public long maxEUStore() { + return GT_Values.V[this.mTier] * (this.mTier * GT_Values.V[this.mTier]); + } + + @Override + public long maxEUInput() { + return GT_Values.V[mTier]; + } + + @Override + public int getCapacity() { + return 32000 * mTier; + } + + @Override + public int getTankPressure() { + return -100; + } + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_CropHarvestor(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public int getSizeInventory() { + return 21; + } + + private static final int getRange(int aTier) { + switch(aTier) { + case 1: + return 1; + case 2: + return 5; + case 3: + return 9; + case 4: + return 13; + case 5: + return 17; + case 6: + return 21; + case 7: + return 25; + case 8: + return 29; + case 9: + return 33; + default: + return 0; + } + } + + private HashSet<ICropTile> mCropCache = new HashSet<ICropTile>(); + private boolean mInvalidCache = false; + + public boolean doesInventoryHaveSpace() { + for (int i = SLOT_OUTPUT_START; i < this.getSizeInventory(); i++) { + if (this.mInventory[i] == null || this.mInventory[i].stackSize < 64) { + return true; + } + } + return false; + } + + public long powerUsage() { + return this.maxEUInput() / 8; + } + + public long powerUsageSecondary() { + return this.maxEUInput() / 32; + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (getBaseMetaTileEntity().isServerSide() && getBaseMetaTileEntity().isAllowedToWork() && (getBaseMetaTileEntity().hasWorkJustBeenEnabled() || aTick % 100 == 0)) { + if (this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()) { + + int aTileX = this.getBaseMetaTileEntity().getXCoord(); + int aTileY = this.getBaseMetaTileEntity().getXCoord(); + int aTileZ = this.getBaseMetaTileEntity().getXCoord(); + + int aRadius = 10 + getRange(mTier); + int aSide = (aRadius-1)/2; + ArrayList<ItemStack> aAllDrops = new ArrayList<ItemStack>(); + + if (mCropCache.isEmpty() || aTick % 1200 == 0 || mInvalidCache) { + if (!mCropCache.isEmpty()) { + mCropCache.clear(); + } + //Logger.INFO("Looking for crops."); + for (int y = 0; y <= 2; y++) { + for (int x = (-aSide); x <= aSide; x++) { + for (int z = (-aSide); z <= aSide; z++) { + TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityOffset(x, y, z); + if (tTileEntity != null && tTileEntity instanceof ICropTile) { + ICropTile tCrop = (ICropTile) tTileEntity; + mCropCache.add(tCrop); + } + } + } + } + } + + //Process Cache + if (doesInventoryHaveSpace()) { + for (ICropTile tCrop : mCropCache) { + if (tCrop == null) { + mInvalidCache = true; + break; + } + CropCard aCrop = tCrop.getCrop(); + if (aCrop != null) { + //Logger.INFO("Found "+aCrop.displayName()+" at offset "+x+", "+y+", "+z); + if (!aCrop.canGrow(tCrop) && aCrop.canBeHarvested(tCrop)) { + if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsage(), true)) { + ItemStack[] aHarvest = tCrop.harvest_automated(true); + if (aHarvest != null && aHarvest.length > 0) { + for (ItemStack aStack : aHarvest) { + if (aStack.stackSize > 0) { + if (mTier * 5 > MathUtils.randInt(1, 100)) { + aStack.stackSize += Math.floor(tCrop.getGain()/10); + Logger.INFO("Bonus output given for "+aCrop.displayName()); + } + Logger.INFO("Harvested "+aCrop.displayName()); + aAllDrops.add(aStack); + } + } + } + } + } + if (this.mModeAlternative) { + processSecondaryFunctions(tCrop); + } + } + } + + if (!aAllDrops.isEmpty()) { + Logger.INFO("Handling "+aAllDrops.size()+" Harvests"); + Iterator<ItemStack> iter = aAllDrops.iterator(); + while (iter.hasNext()) { + ItemStack aDrop = iter.next(); + if (ItemUtils.checkForInvalidItems(aDrop)) { + + for (int i = SLOT_OUTPUT_START; i < this.getSizeInventory(); i++) { + if (this.mInventory[i] != null) { + //Logger.INFO("Slot "+i+" contains "+this.mInventory[i].getDisplayName()); + if (GT_Utility.areStacksEqual(aDrop, mInventory[i], false)) { + //Same + if (mInventory[i].stackSize < 64 && (mInventory[i].stackSize + aDrop.stackSize <= 64)) { + //can merge + //Logger.INFO("Slot "+i+" size: "+mInventory[i].stackSize+" + Drop Size: "+aDrop.stackSize+" = "+(mInventory[i].stackSize + aDrop.stackSize)); + mInventory[i].stackSize += aDrop.stackSize; + break; + } + else if (mInventory[i].stackSize < 64 && (mInventory[i].stackSize + aDrop.stackSize > 64)) { + //can merge + //Logger.INFO("Slot "+i+" size: "+mInventory[i].stackSize+" + Drop Size: "+aDrop.stackSize+" = "+(mInventory[i].stackSize + aDrop.stackSize)); + int aRemainder = mInventory[i].stackSize + aDrop.stackSize - 64; + Logger.INFO("Remainder: "+aRemainder+", Continuing."); + mInventory[i].stackSize = 64; + aDrop.stackSize = aRemainder; + continue; + } + else { + //Logger.INFO("Slot "+i+" size: 64, Continuing."); + continue; + } + } + } + else { + //Logger.INFO("Slot "+i+" is empty, setting to "+aDrop.getDisplayName()+" x"+aDrop.stackSize); + this.mInventory[i] = aDrop; + break; + } + } + } + + } + } + } + } + } + } + + public boolean hasFertilizer() { + for (int i = SLOT_FERT_1; i <= SLOT_FERT_4; i++) { + if (this.mInventory[i] != null) { + return true; + } + } + return false; + } + + public boolean consumeFertilizer(boolean aSimulate) { + if (hasFertilizer()) { + for (int i = SLOT_FERT_1; i <= SLOT_FERT_4; i++) { + if (this.mInventory[i] != null) { + consume(i, 1, aSimulate); + return true; + } + } + } + return false; + } + + public boolean hasWeedEX() { + for (int i = SLOT_WEEDEX_1; i <= SLOT_WEEDEX_2; i++) { + if (this.mInventory[i] != null) { + return true; + } + } + return false; + } + + public boolean consumeWeedEX(boolean aSimulate) { + if (hasWeedEX()) { + for (int i = SLOT_WEEDEX_1; i <= SLOT_WEEDEX_2; i++) { + if (this.mInventory[i] != null) { + damage(i, 1, aSimulate); + return true; + } + } + } + return false; + } + + public void processSecondaryFunctions(ICropTile aCrop) { + if (!mModeAlternative) { + return; + } + if (hasFertilizer() && consumeFertilizer(true) && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyFertilizer(aCrop)) { + if (consumeFertilizer(false)) { + //Logger.INFO("Consumed Fert."); + } + } + if (this.getFluidAmount() > 0 && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyHydration(aCrop)) { + //Logger.INFO("Consumed Water."); + } + if (hasWeedEX() && consumeWeedEX(true) && this.getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU() && getBaseMetaTileEntity().decreaseStoredEnergyUnits(powerUsageSecondary(), true) && applyWeedEx(aCrop)) { + if (consumeWeedEX(false)) { + //Logger.INFO("Consumed Weed-EX."); + } + } + } + + + public boolean applyWeedEx(ICropTile aCrop) { + if (aCrop.getWeedExStorage() < 150) { + aCrop.setWeedExStorage(aCrop.getWeedExStorage() + 50); + boolean triggerDecline; + triggerDecline = aCrop.getWorld().rand.nextInt(3) == 0; + if (aCrop.getCrop() != null && aCrop.getCrop().isWeed(aCrop) && aCrop.getWeedExStorage() >= 75 && triggerDecline) { + switch (aCrop.getWorld().rand.nextInt(5)) { + case 0 : + if (aCrop.getGrowth() > 0) { + aCrop.setGrowth((byte) (aCrop.getGrowth() - 1)); + } + case 1 : + if (aCrop.getGain() > 0) { + aCrop.setGain((byte) (aCrop.getGain() - 1)); + } + default : + if (aCrop.getResistance() > 0) { + aCrop.setResistance((byte) (aCrop.getResistance() - 1)); + } + } + } + return true; + } else { + return false; + } + } + + public boolean applyFertilizer(ICropTile aCrop) { + if (aCrop.getNutrientStorage() >= 100) { + return false; + } else { + //Logger.INFO("Current Nutrient: "+aCrop.getNutrientStorage()+" for "+aCrop.getCrop().displayName()); + aCrop.setNutrientStorage(100); + return true; + } + } + + public boolean applyHydration(ICropTile aCrop) { + if (aCrop.getHydrationStorage() >= 200 || this.getFluidAmount() == 0) { + //Logger.INFO("Hydration Max"); + return false; + } else { + int apply = 200 - aCrop.getHydrationStorage(); + if (this.getFluidAmount() >= 0) { + int drain = 0; + if (this.getFluidAmount() >= apply) { + drain = apply; + } + else { + drain = this.getFluidAmount(); + } + this.mFluid.amount -= drain; + if (this.mFluid.amount <= 0) { + this.mFluid = null; + } + //Logger.INFO("Did Hydrate"); + aCrop.setHydrationStorage(aCrop.getHydrationStorage() + drain); + return true; + } + else { + //Logger.INFO("No water?"); + return false; + } + } + } + + public boolean consume(int aSlot, int amount, boolean simulate) { + ItemStack stack = this.mInventory[aSlot]; + if (stack != null && stack.stackSize >= amount) { + int currentAmount = Math.min(amount, stack.stackSize); + amount -= currentAmount; + if (!simulate) { + if (stack.stackSize == currentAmount) { + this.mInventory[aSlot] = null; + } else { + stack.stackSize -= currentAmount; + } + } + else { + return amount >= 0; + } + return true; + } + return false; + } + + public ItemStack damage(int aSlot, int amount, boolean simulate) { + ItemStack ret = null; + int damageApplied = 0; + ItemStack stack = this.mInventory[aSlot]; + Item item = stack.getItem(); + if (stack != null && item.isDamageable() && (ret == null + || stack.getItem() == ret.getItem() && ItemStack.areItemStackTagsEqual(stack, ret))) { + if (simulate) { + stack = stack.copy(); + } + int maxDamage = DamageHandler.getMaxDamage(stack); + while (amount > 0 && stack.stackSize > 0) { + int currentAmount = Math.min(amount, maxDamage - DamageHandler.getDamage(stack)); + DamageHandler.damage(stack, currentAmount, null); + damageApplied += currentAmount; + amount -= currentAmount; + if (DamageHandler.getDamage(stack) >= maxDamage) { + --stack.stackSize; + DamageHandler.setDamage(stack, 0); + } + + if (ret == null) { + ret = stack.copy(); + } + } + if (stack.stackSize == 0 && !simulate) { + this.mInventory[aSlot] = null; + } + } + + if (ret != null) { + int i = DamageHandler.getMaxDamage(ret); + ret.stackSize = damageApplied / i; + DamageHandler.setDamage(ret, damageApplied % i); + } + return ret; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aStack != null && aIndex >= SLOT_OUTPUT_START && aIndex < this.getSizeInventory(); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + if (aStack != null) { + if (aStack.getItem().getUnlocalizedName().equals("ic2.itemFertilizer")) { + return aIndex >= SLOT_FERT_1 && aIndex <= SLOT_FERT_4; + } + else if (aStack.getItem().getUnlocalizedName().equals("ic2.itemWeedEx")) { + return aIndex >= SLOT_WEEDEX_1 && aIndex <= SLOT_WEEDEX_2; + } + } + return false; + } + + @Override + public String[] getDescription() { + int aRadius = 10 + getRange(mTier); + int aSide = (aRadius-1)/2; + return new String[] { + this.mDescription, + "Secondary mode can Hydrate/Fertilize/Weed-EX", + "Consumes "+powerUsage()+"eu per harvest", + "Consumes "+powerUsageSecondary()+"eu per secondary operation", + "Can harvest 2 blocks above", + "Radius: "+aSide+" each side ("+aRadius+"x3x"+aRadius+")", + "Has "+(mTier * 5)+"% chance for extra drops", + "Holds "+this.getCapacity()+"L of Water", + CORE.GT_Tooltip + }; + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return true; + } + + /*@Override + public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) + return 118+(aRedstone?8:0); + if (GT_Utility.getOppositeSide(aSide) == aFacing) + return 113+(aRedstone?8:0); + + int tIndex = 128+(aRedstone?8:0); + + switch (aFacing) { + case 0: + return tIndex+64; + case 1: + return tIndex+32; + case 2: switch (aSide) { + case 0: return tIndex+32; + case 1: return tIndex+32; + case 4: return tIndex+16; + case 5: return tIndex+48; + } + case 3: switch (aSide) { + case 0: return tIndex+64; + case 1: return tIndex+64; + case 4: return tIndex+48; + case 5: return tIndex+16; + } + case 4: switch (aSide) { + case 0: return tIndex+16; + case 1: return tIndex+16; + case 2: return tIndex+48; + case 3: return tIndex+16; + } + case 5: switch (aSide) { + case 0: return tIndex+48; + case 1: return tIndex+48; + case 2: return tIndex+16; + case 3: return tIndex+48; + } + } + return tIndex; + } */ + + @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.getBack(i); + rTextures[2][i + 1] = this.getBottom(i); + rTextures[3][i + 1] = this.getTop(i); + rTextures[4][i + 1] = this.getSides(i); + rTextures[5][i + 1] = this.getFront(i); + rTextures[6][i + 1] = this.getBack(i); + rTextures[7][i + 1] = this.getBottom(i); + rTextures[8][i + 1] = this.getTop(i); + rTextures[9][i + 1] = this.getSides(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == 0 || aSide == 1) { + return this.mTextures[3][aColorIndex + 1]; + } + else { + return this.mTextures[4][aColorIndex + 1]; + } + /*return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1];*/ + } + + public ITexture[] getFront(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)}; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)}; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Boxes)}; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_CropHarvester_Cutter)}; + } + + @Override + public boolean doesFillContainers() { + return false; + } + + @Override + public boolean doesEmptyContainers() { + return false; + } + + @Override + public boolean canTankBeFilled() { + return true; + } + + @Override + public boolean canTankBeEmptied() { + return false; + } + + @Override + public boolean displaysItemStack() { + return false; + } + + @Override + public boolean displaysStackSize() { + return false; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setBoolean("mModeAlternative", mModeAlternative); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mModeAlternative = aNBT.getBoolean("mModeAlternative"); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java index c5e33c088d..92cbddfdba 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaWirelessCharger.java @@ -66,11 +66,11 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { return this.mCurrentDimension; } - public Map<UUID, EntityPlayer> getLocalMap(){ + public Map<String, UUID> getLocalMap(){ return this.mLocalChargingMap; } - public Map<EntityPlayer, UUID> getLongRangeMap(){ + public Map<String, UUID> getLongRangeMap(){ return this.mWirelessChargingMap; } @@ -372,9 +372,8 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { super.onFirstTick(aBaseMetaTileEntity); } - - private Map<EntityPlayer, UUID> mWirelessChargingMap = new HashMap<EntityPlayer, UUID>(); - private Map<UUID, EntityPlayer> mLocalChargingMap = new HashMap<UUID, EntityPlayer>(); + private Map<String, UUID> mWirelessChargingMap = new HashMap<String, UUID>(); + private Map<String, UUID> mLocalChargingMap = new HashMap<String, UUID>(); private boolean isValidPlayer(EntityPlayer aPlayer) { BaseMetaTileEntity aTile = (BaseMetaTileEntity) this.getBaseMetaTileEntity(); @@ -412,7 +411,7 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { int tempRange = (this.mMode == 1 ? this.mTier*20 : this.mTier*10); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) < tempRange){ if (isValidPlayer(mTemp) && !mLocalChargingMap.containsKey(mTemp.getPersistentID())){ - mLocalChargingMap.put(mTemp.getPersistentID(), mTemp); + mLocalChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID()); ChargingHelper.addValidPlayer(mTemp, this); //PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m - Local]."); } @@ -430,8 +429,8 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { int tempRange = (int) (this.mMode == 0 ? 4*GT_Values.V[this.mTier] : 2*GT_Values.V[this.mTier]); if (getDistanceBetweenTwoPositions(getTileEntityPosition(), getPositionOfEntity(mTemp)) <= tempRange){ if (!mWirelessChargingMap.containsKey(mTemp)){ - if (mTemp.getDisplayName().equalsIgnoreCase(this.getBaseMetaTileEntity().getOwnerName())) { - mWirelessChargingMap.put(mTemp, mTemp.getPersistentID()); + if (isValidPlayer(mTemp)) { + mWirelessChargingMap.put(mTemp.getDisplayName(), mTemp.getPersistentID()); ChargingHelper.addValidPlayer(mTemp, this); PlayerUtils.messagePlayer(mTemp, "You have entered charging range. ["+tempRange+"m - Long-Range]."); } @@ -538,15 +537,29 @@ public class GregtechMetaWirelessCharger extends GregtechMetaTileEntity { } if (this.mMode == 2){ - PlayerUtils.messagePlayer(aPlayer, "Mixed Mode | Local: "+this.mTier*10+"m | Long: "+tempRange+"m"); + PlayerUtils.messagePlayer(aPlayer, "Mixed Mode | Local: "+this.mTier*10+"m | Long: "+tempRange+"m"); + PlayerUtils.messagePlayer(aPlayer, "Players with access:"); + for (String name : this.getLocalMap().keySet()) { + PlayerUtils.messagePlayer(aPlayer, "Local: "+name); + } + for (String name : this.getLongRangeMap().keySet()) { + PlayerUtils.messagePlayer(aPlayer, "Long: "+name); + } } else if (this.mMode == 1){ PlayerUtils.messagePlayer(aPlayer, "Local Mode: "+this.mTier*20+"m"); + PlayerUtils.messagePlayer(aPlayer, "Players with access:"); + for (String name : this.getLocalMap().keySet()) { + PlayerUtils.messagePlayer(aPlayer, ""+name); + } } else { PlayerUtils.messagePlayer(aPlayer, "Long-range Mode: "+tempRange+"m"); - + PlayerUtils.messagePlayer(aPlayer, "Players with access:"); + for (String name : this.getLongRangeMap().keySet()) { + PlayerUtils.messagePlayer(aPlayer, ""+name); + } } return super.onRightclick(aBaseMetaTileEntity, aPlayer, aSide, aX, aY, aZ); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java index b8f24d6c5e..7e7ecfa390 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GMTE_AmazonPackager.java @@ -1,16 +1,36 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.misc; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; + import java.util.ArrayList; +import java.util.List; + +import org.apache.commons.lang3.ArrayUtils; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.enums.*; + +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; @@ -19,19 +39,23 @@ import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemStackData; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { +public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase<GMTE_AmazonPackager> { private long mVoltage; private byte mTier; private int mCasing; + + private ItemStack mSchematicCache;; + private ItemStack mInputCache; + private ItemStack mOutputCache; + private GT_Recipe mCachedRecipe; + private IStructureDefinition<GMTE_AmazonPackager> STRUCTURE_DEFINITION = null; @Override @@ -67,24 +91,24 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GMTE_AmazonPackager>builder() .addShape(mName, transpose(new String[][]{ - {"CCC", "CCC", "CCC"}, - {"C~C", "C-C", "CCC"}, - {"CCC", "CCC", "CCC"}, + {"CCC", "CCC", "CCC"}, + {"C~C", "C-C", "CCC"}, + {"CCC", "CCC", "CCC"}, })) .addElement( 'C', ofChain( ofHatchAdder( GMTE_AmazonPackager::addAmazonPackagerList, TAE.getIndexFromPage(2, 9), 1 - ), + ), onElementPass( x -> ++x.mCasing, ofBlock( ModBlocks.blockCasings3Misc, 9 + ) ) ) ) - ) .build(); } return STRUCTURE_DEFINITION; @@ -116,25 +140,25 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Amazon Warehouse") - .addInfo("This Multiblock is used for EXTREME packaging requirements") - .addInfo("Dust Schematics are inserted into the input busses") - .addInfo("If inserted into the controller, it is shared across all busses") - .addInfo("1x, 2x, 3x & Other Schematics are to be placed into the controller GUI slot") - .addInfo("Uncomparably fast compared to a single packager of the same tier") - .addInfo("Only uses 75% of the eu/t normally required") - .addInfo("Processes five items per voltage tier") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .beginStructureBlock(3, 3, 3, true) - .addController("Front center") - .addCasingInfo("Supply Depot Casings", 10) - .addInputBus("Any casing", 1) - .addOutputBus("Any casing", 1) - .addEnergyHatch("Any casing", 1) - .addMaintenanceHatch("Any casing", 1) - .addMufflerHatch("Any casing", 1) - .toolTipFinisher("GT++"); + .addInfo("Controller Block for the Amazon Warehouse") + .addInfo("This Multiblock is used for EXTREME packaging requirements") + .addInfo("Dust Schematics are inserted into the input busses") + .addInfo("If inserted into the controller, it is shared across all busses") + .addInfo("1x, 2x, 3x & Other Schematics are to be placed into the controller GUI slot") + .addInfo("Uncomparably fast compared to a single packager of the same tier") + .addInfo("Only uses 75% of the eu/t normally required") + .addInfo("Processes 16 items per voltage tier") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo("Supply Depot Casings", 10) + .addInputBus("Any casing", 1) + .addOutputBus("Any casing", 1) + .addEnergyHatch("Any casing", 1) + .addMaintenanceHatch("Any casing", 1) + .addMufflerHatch("Any casing", 1) + .toolTipFinisher("GT++"); return tt; } @@ -146,9 +170,9 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(2, 1)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(2, 9)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(2, 1))}; + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(2, 9))}; } @@ -164,20 +188,20 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { } } + private static final FluidStack[] sNoFluids = new FluidStack[] {}; + @Override public boolean checkRecipe(ItemStack aStack) { - + //Just the best place to check this~ initFields(); - + ArrayList<ItemStack> tItems = getStoredInputs(); if (this.getGUIItemStack() != null) { tItems.add(this.getGUIItemStack()); } - ArrayList<FluidStack> tFluids = getStoredFluids(); ItemStack[] tItemInputs = tItems.toArray(new ItemStack[tItems.size()]); - FluidStack[] tFluidInputs = tFluids.toArray(new FluidStack[tFluids.size()]); - boolean state = checkRecipeGeneric(tItemInputs, tFluidInputs, 5 * GT_Utility.getTier(this.getMaxInputVoltage()), 75, 500, 10000); + boolean state = checkRecipeGeneric(tItemInputs, sNoFluids, 16 * GT_Utility.getTier(this.getMaxInputVoltage()), 75, 500, 10000); if (state) { @@ -204,7 +228,7 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { } } } - + return mCompleted != null && mCompleted.size() > 0; } } @@ -262,6 +286,282 @@ public class GMTE_AmazonPackager extends GregtechMeta_MultiBlockBase { return false; } + private ItemStack getSchematic(ItemStack[] aInputs) { + for (ItemStack aStack : aInputs) { + if (ItemList.Schematic_Dust.isStackEqual(aStack) || ItemList.Schematic_1by1.isStackEqual(aStack) || ItemList.Schematic_2by2.isStackEqual(aStack) || ItemList.Schematic_3by3.isStackEqual(aStack)) { + return aStack; + } + } + return null; + } + + private ItemStack getRecipeInput(ItemStack[] aInputs) { + for (ItemStack aStack : aInputs) { + if (!ItemList.Schematic_Dust.isStackEqual(aStack) && !ItemList.Schematic_1by1.isStackEqual(aStack) && !ItemList.Schematic_2by2.isStackEqual(aStack) && !ItemList.Schematic_3by3.isStackEqual(aStack)) { + return aStack; + } + } + return null; + } + + private boolean hasValidCache(ItemStack aStack, ItemStack aSchematic, boolean aClearOnFailure) { + if (mSchematicCache != null && mInputCache != null && mOutputCache != null && mCachedRecipe != null) { + if (GT_Utility.areStacksEqual(aStack, mInputCache) && GT_Utility.areStacksEqual(aSchematic, mSchematicCache)) { + return true; + } + } + // clear cache if it was invalid + if (aClearOnFailure) { + mSchematicCache = null; + mInputCache = null; + mOutputCache = null; + mCachedRecipe = null; + } + return false; + } + + private void cacheItem(ItemStack aSchematic, ItemStack aInputItem, ItemStack aOutputItem, GT_Recipe aRecipe) { + mSchematicCache = aSchematic.copy(); + mInputCache = aInputItem.copy(); + mOutputCache = aOutputItem.copy(); + mCachedRecipe = aRecipe; + } + + private GT_Recipe generatePackageRecipe(ItemStack aSchematic, ItemStack aInput) { + boolean tIsCached = hasValidCache(aInput, aSchematic, true); + if (tIsCached) { + ItemStack tOutput = mOutputCache.copy(); + if (tOutput != null) { + if (mCachedRecipe != null && GT_Utility.areStacksEqual(aInput, mInputCache) && GT_Utility.areStacksEqual(tOutput, mOutputCache)) { + int aRequiredInputSize = 0; + if (ItemList.Schematic_Dust.isStackEqual(aSchematic)) { + if (OrePrefixes.dustTiny.contains(aInput)) { + aRequiredInputSize = 9; + } + if (OrePrefixes.dustSmall.contains(aInput)) { + aRequiredInputSize = 4; + } + if (OrePrefixes.dust.contains(aInput)) { + aRequiredInputSize = 1; + } + } + if (ItemList.Schematic_1by1.isStackEqual(aSchematic)) { + aRequiredInputSize = 1; + } + if (ItemList.Schematic_2by2.isStackEqual(aSchematic)) { + aRequiredInputSize = 4; + } + if (ItemList.Schematic_3by3.isStackEqual(aSchematic)) { + aRequiredInputSize = 9; + } + if (aInput.stackSize >= aRequiredInputSize) { + log("Using Cached Recipe. Require: "+aRequiredInputSize+", Found: "+aInput.stackSize); + return mCachedRecipe; + } + else { + log("Not enough input"); + } + } + } + } + // We can package this + GT_Recipe aRecipe = lookupRecipe(); + log("Looking up new recipe"); + if (aRecipe != null) { + // Cache it + aInput = aInput != null ? aInput : getRecipeInput(aRecipe.mInputs); + cacheItem(aSchematic, aInput, aRecipe.mOutputs[0], aRecipe); + if (hasValidCache(aInput, aSchematic, false)) { + log("Caching Recipe"); + return aRecipe; + } + } + return null; + } + + private GT_Recipe lookupRecipe() { + ArrayList<ItemStack> aItems = getStoredInputs(); + if (this.getGUIItemStack() != null) { + aItems.add(this.getGUIItemStack()); + } + ItemStack[] aItemInputs = aItems.toArray(new ItemStack[aItems.size()]); + GT_Recipe tRecipe = findRecipe( + getBaseMetaTileEntity(), mLastRecipe, false, false, + gregtech.api.enums.GT_Values.V[mTier], sNoFluids, aItemInputs); + + if (tRecipe != null) { + return tRecipe; + } + return null; + } + + + + + + public boolean checkRecipeGeneric( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) { + // Based on the Processing Array. A bit overkill, but very flexible. + + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); + log("Running checkRecipeGeneric(0)"); + + ItemStack aInput = getRecipeInput(aItemInputs); + ItemStack aSchematic = getSchematic(aItemInputs); + GT_Recipe tRecipe = generatePackageRecipe(aSchematic, aInput); + + ItemStack[] aRealInputs = new ItemStack[] {aSchematic, aInput}; + log("Running checkRecipeGeneric(1)"); + // Remember last recipe - an optimization for findRecipe() + this.mLastRecipe = tRecipe; + + if (tRecipe == null) { + log("BAD RETURN - 1"); + return false; + } + + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { + log("BAD RETURN - 2"); + return false; + } + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + + int parallelRecipes = 0; + + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, sNoFluids, aItemInputs)) { + log("Broke at "+parallelRecipes+"."); + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + + if (parallelRecipes == 0) { + mCachedRecipe = null; + log("BAD RETURN - 3 - Reset Cached Recipe"); + return false; + } + + // -- Try not to fail after this point - inputs have already been consumed! -- + + + + // Convert speed bonus to duration multiplier + // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. + aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); + float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); + this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor); + + this.mEUt = (int)Math.ceil(tTotalEUt); + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + // Overclock + if (this.mEUt <= 16) { + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); + } else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + if (isPerpectOC) this.mMaxProgresstime /= 4; + else this.mMaxProgresstime /= 2; + } + } + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + // Collect fluid outputs + FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { + if (tRecipe.getFluidOutput(h) != null) { + tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); + tOutputFluids[h].amount *= parallelRecipes; + } + } + + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOutputItems[h] = tRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + + // Set output item stack sizes (taking output chance into account) + for (int f = 0; f < tOutputItems.length; f++) { + if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + for (int g = 0; g < parallelRecipes; g++) { + if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) + tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + + tOutputItems = removeNulls(tOutputItems); + + // Sanitize item stack size, splitting any stacks greater than max stack size + List<ItemStack> splitStacks = new ArrayList<ItemStack>(); + for (ItemStack tItem : tOutputItems) { + while (tItem.getMaxStackSize() < tItem.stackSize) { + ItemStack tmp = tItem.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + splitStacks.add(tmp); + } + } + + if (splitStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[splitStacks.size()]; + tmp = splitStacks.toArray(tmp); + tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); + } + + // Strip empty stacks + List<ItemStack> tSList = new ArrayList<ItemStack>(); + for (ItemStack tS : tOutputItems) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + + // Commit outputs + this.mOutputItems = tOutputItems; + this.mOutputFluids = tOutputFluids; + updateSlots(); + + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + log("GOOD RETURN - 1"); + return true; + } + public boolean allowPutStack(final ItemStack aStack, ItemStack schematicStack) { //If Schematic Static is not 1x1, 2x2, 3x3 if (!ItemList.Schematic_1by1.isStackEqual((Object) schematicStack) && !ItemList.Schematic_2by2.isStackEqual((Object) schematicStack) && !ItemList.Schematic_3by3.isStackEqual((Object) schematicStack)) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java index 7ddf16b36f..b5c07ecd95 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/misc/GregtechMTE_TeslaTower.java @@ -1,18 +1,13 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.misc; -import static gregtech.api.enums.GT_Values.*; +import static gregtech.api.enums.GT_Values.W; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import gregtech.api.GregTech_API; import gregtech.api.enums.Materials; @@ -23,21 +18,28 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Utility; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.entity.EntityTeslaTowerLightning; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.Utils; -import gtPlusPlus.core.util.minecraft.MaterialUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import net.minecraft.block.Block; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase { +public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase<GregtechMTE_TeslaTower> { private Block casingBlock; private int casingMeta; @@ -49,12 +51,12 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase { private int xLoc, yLoc, zLoc; protected int mRange; - */ -/** + + /** * Machine Mode, * {@value false} Attacks all entities, * {@value true} Only attacks players. - *//* + */ protected volatile boolean mMode = false; @@ -88,7 +90,7 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase { return null; } - @Override + /*@Override public String[] getTooltip() { String casings = getCasingBlockItem().get(0).getDisplayName(); return new String[]{ @@ -102,13 +104,33 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase { "1x3x1 " + MaterialUtils.getMaterialName(getFrameMaterial()) + " Frame Boxes (Each pillar side and on top)", "1x Maintenance Hatch (One of base casings)", "1x " + VN[getMinTier()] + "+ Energy Hatch (Any bottom layer casing)"}; + }*/ + + @Override + protected final GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Tesla Defence Tower Mk3200") + .addInfo("Enemies within "+this.mRange+"m are blasted with a high energy plasma.") + .addInfo("This uses 5,000,000EU per blast.") + .addInfo("Can screwdriver to toggle mode between Players and all Entities.") + .addSeparator() + .beginStructureBlock(1, 7, 1, false) + .addController("Top Middle") + .addCasingInfo("Casing", 360) + .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1) + .addInputBus("Any 4 dot hint (min 1)", 4) + .addInputHatch("Any 4 dot hint(min 1)", 4) + .addOutputHatch("Any 4 dot hint(min 1)", 4) + .addEnergyHatch("Any 4 dot hint(min 1)", 4) + .addMaintenanceHatch("Any 4 dot hint(min 1)", 4) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; } private final void initFields() { casingBlock = ModBlocks.blockCasings2Misc; casingMeta = getCasingBlockItem().get(0).getItemDamage(); - int frameId = 4096 + getFrameMaterial().mMetaItemSubID; - frameMeta = GregTech_API.METATILEENTITIES[frameId] != null ? GregTech_API.METATILEENTITIES[frameId].getTileEntityBaseType() : W; casingTextureIndex = getCasingTextureIndex(); mRange = 50; } @@ -144,26 +166,24 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase { @Override public boolean checkRecipe(ItemStack aStack) { - */ -/*if (!isEnergyEnough()) { + + if (!isEnergyEnough()) { this.mProgresstime = 0; this.mMaxProgresstime = 20; this.getBaseMetaTileEntity().setActive(false); stopMachine(); } - else {*//* -*/ -/* + else { this.mProgresstime = 1; this.mMaxProgresstime = 100; - this.getBaseMetaTileEntity().setActive(true);*//* + this.getBaseMetaTileEntity().setActive(true); - //} + } return false; } @Override - public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { updateCoordinates(); //check base layer for (int xOff = -1 + back.offsetX; xOff <= 1 + back.offsetX; xOff++) { @@ -414,16 +434,6 @@ public class GregtechMTE_TeslaTower extends GregtechMeta_MultiBlockBase { return GregtechItemList.Casing_TeslaTower; } - protected Materials getFrameMaterial() { - */ -/*casingBlock = getCasingBlockItem().getBlock(); - casingMeta = getCasingBlockItem().get(0).getItemDamage(); - int frameId = 4096 + getFrameMaterial().mMetaItemSubID; - frameMeta = GregTech_API.METATILEENTITIES[frameId] != null ? GregTech_API.METATILEENTITIES[frameId].getTileEntityBaseType() : W; - *//* -return Materials.get("TungstenCarbide"); - } - protected int getCasingTextureIndex() { return TAE.GTPP_INDEX(30); } @@ -474,6 +484,17 @@ return Materials.get("TungstenCarbide"); return 0; } + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + // TODO Auto-generated method stub + + } + + @Override + public IStructureDefinition getStructureDefinition() { + // TODO Auto-generated method stub + return null; + } + } -*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java index df01d01679..36139bcdec 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialAlloySmelter.java @@ -34,7 +34,7 @@ import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialAlloySmelter extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialAlloySmelter extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialAlloySmelter> { public static int CASING_TEXTURE_ID; private HeatingCoilLevel mHeatingCapacity; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java index eae867d11d..5fa68d5129 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialArcFurnace.java @@ -50,12 +50,10 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace extends GregtechMeta_Mu public GregtechMetaTileEntity_IndustrialArcFurnace(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 3); } public GregtechMetaTileEntity_IndustrialArcFurnace(final String aName) { super(aName); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 3); } @Override @@ -70,9 +68,6 @@ public class GregtechMetaTileEntity_IndustrialArcFurnace extends GregtechMeta_Mu @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 3); - } GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Controller Block for Industrial Arc Furnace") diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java index 8802a7148b..12c4dbd5d5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCentrifuge.java @@ -28,8 +28,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialCentrifuge -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialCentrifuge extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCentrifuge> { private boolean mIsAnimated; private static ITexture frontFace; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java index 63dd3d62dc..982b054d34 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCokeOven.java @@ -24,8 +24,8 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialCokeOven -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialCokeOven extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCokeOven> { + private int mLevel = 0; private int mCasing; private int mCasing1; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java index bf5f8aaeaf..7532f67bf8 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialCuttingMachine.java @@ -27,8 +27,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialCuttingMachine -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialCuttingMachine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialCuttingMachine> { private boolean mCuttingMode = true; private int mCasing; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java index 44552ea2f7..4147f58e36 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialDehydrator.java @@ -39,7 +39,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialDehydrator> { private static int CASING_TEXTURE_ID; private static String mCasingName = "Vacuum Casing"; @@ -51,13 +51,11 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu public GregtechMetaTileEntity_IndustrialDehydrator(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10); } public GregtechMetaTileEntity_IndustrialDehydrator(String aName) { super(aName); CASING_TEXTURE_ID = TAE.getIndexFromPage(3, 10); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10); } public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @@ -66,9 +64,6 @@ public class GregtechMetaTileEntity_IndustrialDehydrator extends GregtechMeta_Mu @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 10); - } GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Factory Grade Vacuum Furnace") diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java index f6613980ca..d233c00cc7 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialElectrolyzer.java @@ -22,8 +22,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialElectrolyzer -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialElectrolyzer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialElectrolyzer> { private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_IndustrialElectrolyzer> STRUCTURE_DEFINITION = null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java index a5c7f62578..a9105a27cc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialExtruder.java @@ -27,8 +27,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialExtruder -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialExtruder extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialExtruder> { private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_IndustrialExtruder> STRUCTURE_DEFINITION = null; @@ -82,7 +81,7 @@ extends GregtechMeta_MultiBlockBase { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialExtruder>builder() .addShape(mName, transpose(new String[][]{ {"CCC", "CCC", "CCC", "CCC", "CCC"}, - {"C~C", "C-C", "C-C", "C-C", "CMC"}, + {"C~C", "C-C", "C-C", "C-C", "CCC"}, {"CCC", "CCC", "CCC", "CCC", "CCC"}, })) .addElement( @@ -99,12 +98,6 @@ extends GregtechMeta_MultiBlockBase { ) ) ) - .addElement( - 'M', - ofHatchAdder( - GregtechMetaTileEntity_IndustrialExtruder::addIndustrialExtruderMufflerList, getCasingTextureIndex(), 2 - ) - ) .build(); } return STRUCTURE_DEFINITION; @@ -141,19 +134,6 @@ extends GregtechMeta_MultiBlockBase { return false; } - public final boolean addIndustrialExtruderMufflerList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } else { - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return this.mMufflerHatches.add((GT_MetaTileEntity_Hatch_Muffler) aMetaTileEntity); - } - } - return false; - } - @Override public String getSound() { return GregTech_API.sSoundList.get(Integer.valueOf(203)); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java new file mode 100644 index 0000000000..2b0345af78 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialForgeHammer.java @@ -0,0 +1,319 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import java.util.*; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.TAE; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.*; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.lib.LoadedMods; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +public class GregtechMetaTileEntity_IndustrialForgeHammer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialForgeHammer> { + + private int mCasing; + private int mAnvil; + private IStructureDefinition<GregtechMetaTileEntity_IndustrialForgeHammer> STRUCTURE_DEFINITION = null; + + public GregtechMetaTileEntity_IndustrialForgeHammer(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialForgeHammer(final String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + setAnvilBlocks(); + return new GregtechMetaTileEntity_IndustrialForgeHammer(this.mName); + } + + @Override + public String getMachineType() { + return "Forge Hammer"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Industrial Forge Hammer") + .addInfo("Speed: 100% x Anvil Tier | Eu Usage: 100% | Parallel: Tier x 8") + .addInfo("T1 - Vanilla Anvil"); + if (LoadedMods.Railcraft) { + tt.addInfo("T2 - Steel Anvil"); + } + if (LoadedMods.EnderIO) { + tt.addInfo("T3 - Dark Steel Anvil"); + } + if (LoadedMods.ThaumicBases) { + tt.addInfo("T3 - Thaumic Anvil"); + tt.addInfo("T4 - Void Anvil"); + } + tt.addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front Center") + .addCasingInfo("Forge Casing", 10) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addEnergyHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public IStructureDefinition<GregtechMetaTileEntity_IndustrialForgeHammer> getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + Map<Block, Integer> aBlockMap = new HashMap<Block, Integer>(); + aBlockMap.put(sAnvil, 0); + if (LoadedMods.Railcraft) { + aBlockMap.put(sSteelAnvil, 0); + } + if (LoadedMods.EnderIO) { + aBlockMap.put(sDarkSteelAnvil, 0); + } + if (LoadedMods.ThaumicBases) { + aBlockMap.put(sThaumiumAnvil, 0); + aBlockMap.put(sVoidAnvil, 0); + } + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialForgeHammer>builder() + .addShape(mName, transpose(new String[][]{ + {"CCC", "CCC", "CCC"}, + {"C~C", "CAC", "CCC"}, + {"CCC", "CCC", "CCC"}, + })) + .addElement('C', ofChain( + ofHatchAdder(GregtechMetaTileEntity_IndustrialForgeHammer::addIndustrialForgeHammerList, TAE.getIndexFromPage(1, 11), 1 ), + onElementPass(x -> ++x.mCasing, ofBlock(ModBlocks.blockCasings5Misc, 6) + ) + ) + ) + .addElement('A', onElementPass(x -> ++x.mAnvil, ofBlocksFlat(aBlockMap, sAnvil, 0))) + .build(); + } + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + setAnvilBlocks(); + buildPiece(mName , stackSize, hintsOnly, 1, 1, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + setAnvilBlocks(); + mCasing = 0; + return checkPiece(mName, 1, 1, 0) && mCasing >= 10 && checkHatch(); + } + + public final boolean addIndustrialForgeHammerList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + @Override + public String getSound() { + return GregTech_API.sSoundList.get(1); + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(1, 11)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(1, 11))}; + } + + @Override + public boolean hasSlotInGUI() { + return false; + } + + @Override + public String getCustomGUIResourceName() { + return "MaterialPress"; + } + + @Override + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sHammerRecipes; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + Block aAnvil = this.getBaseMetaTileEntity().getBlockAtSide(this.getBaseMetaTileEntity().getBackFacing()); + if (aAnvil != null) { + int aAnvilTier = getAnvilTier(aAnvil); + if (aAnvilTier > 0) { + for (GT_MetaTileEntity_Hatch_InputBus tBus : mInputBusses) { + ArrayList<ItemStack> tBusItems = new ArrayList<ItemStack>(); + tBus.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tBus)) { + for (int i = tBus.getBaseMetaTileEntity().getSizeInventory() - 1; i >= 0; i--) { + if (tBus.getBaseMetaTileEntity().getStackInSlot(i) != null) + tBusItems.add(tBus.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + if (checkRecipeGeneric(tBusItems.toArray(new ItemStack[]{}), new FluidStack[]{}, getMaxParallelRecipes() * aAnvilTier, 100, 100, 10000)) { + return true; + } + } + } + } + return false; + } + + @Override + public int getMaxParallelRecipes() { + return (8 * GT_Utility.getTier(this.getMaxInputVoltage())); + } + + @Override + public int getEuDiscountForParallelism() { + return 100; + } + + @Override + public void startProcess() { + this.sendLoopStart((byte) 1); + } + + @Override + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + @Override + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialForgeHammer; + } + + @Override + public int getAmountOfOutputs() { + return 1; + } + + @Override + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + private static Block sAnvil; + private static Block sSteelAnvil; + private static Block sDarkSteelAnvil; + private static Block sThaumiumAnvil; + private static Block sVoidAnvil; + + private static void setAnvilBlocks() { + if (sAnvil == null) { + sAnvil = Blocks.anvil; + if (LoadedMods.Railcraft) { + sSteelAnvil = GameRegistry.findBlock("Railcraft", "anvil"); + } + if (LoadedMods.EnderIO) { + sDarkSteelAnvil = GameRegistry.findBlock("EnderIO", "blockDarkSteelAnvil"); + } + if (LoadedMods.ThaumicBases) { + sThaumiumAnvil = GameRegistry.findBlock("thaumicbases", "thaumicAnvil"); + sVoidAnvil = GameRegistry.findBlock("thaumicbases", "voidAnvil"); + } + } + } + + public static boolean isBlockAnvil(Block aBlock) { + setAnvilBlocks(); + if (sAnvil == aBlock) { + return true; + } + if (LoadedMods.Railcraft) { + if (sSteelAnvil == aBlock) { + return true; + } + } + if (LoadedMods.EnderIO) { + if (sDarkSteelAnvil == aBlock) { + return true; + } + } + if (LoadedMods.ThaumicBases) { + if (sThaumiumAnvil == aBlock || sVoidAnvil == aBlock) { + return true; + } + } + return false; + } + + public static int getAnvilTier(Block aBlock) { + if (isBlockAnvil(aBlock)) { + if (sAnvil == aBlock) { + return 1; + } + if (LoadedMods.Railcraft) { + if (sSteelAnvil == aBlock) { + return 2; + } + } + if (LoadedMods.EnderIO) { + if (sDarkSteelAnvil == aBlock) { + return 3; + } + } + if (LoadedMods.ThaumicBases) { + if (sThaumiumAnvil == aBlock) { + return 3; + } + if (sVoidAnvil == aBlock) { + return 4; + } + } + } + return 0; + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + setAnvilBlocks(); + super.onFirstTick(aBaseMetaTileEntity); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java index b6e072b653..743714319d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMacerator.java @@ -25,8 +25,8 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialMacerator -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialMacerator extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMacerator> { + private int mCasing; private int mPerLayer; private IStructureDefinition<GregtechMetaTileEntity_IndustrialMacerator> STRUCTURE_DEFINITION = null; @@ -145,13 +145,16 @@ extends GregtechMeta_MultiBlockBase { public final boolean addIndustrialMaceratorBottomList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; - } else { + } + else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { return addToMachineList(aTileEntity, aBaseCasingIndex); } } @@ -161,11 +164,19 @@ extends GregtechMeta_MultiBlockBase { public final boolean addIndustrialMaceratorMidList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; - } else { + } + else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { return addToMachineList(aTileEntity, aBaseCasingIndex); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java index 5e405d426d..0aceed47be 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMixer.java @@ -27,12 +27,11 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialMixer -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialMixer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMixer> { public static int CASING_TEXTURE_ID; - public static String mCasingName = "Advanced Blast Furnace Casing"; - public static String mCasingName2 = "Advanced Blast Furnace Casing"; + public static String mCasingName = "Multi-Use Casing"; + public static String mCasingName2 = "Titanium Turbine Casing"; private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_IndustrialMixer> STRUCTURE_DEFINITION = null; @@ -40,15 +39,11 @@ extends GregtechMeta_MultiBlockBase { public GregtechMetaTileEntity_IndustrialMixer(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 2); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 2); - mCasingName2 = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockCasings4, 11); } public GregtechMetaTileEntity_IndustrialMixer(final String aName) { super(aName); CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 2); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 2); - mCasingName2 = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockCasings4, 11); } @Override @@ -63,14 +58,6 @@ extends GregtechMeta_MultiBlockBase { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 2); - } - if (mCasingName2.toLowerCase().contains(".name")) { - mCasingName2 = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockCasings4, 11); - } - GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Controller Block for the Industrial Mixer") diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java new file mode 100644 index 0000000000..df1cc14658 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMolecularTransformer.java @@ -0,0 +1,269 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +public class GregtechMetaTileEntity_IndustrialMolecularTransformer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMolecularTransformer> { + + private static final int CASING_TEXTURE_ID = 48; + private int mCasing = 0; + + public GregtechMetaTileEntity_IndustrialMolecularTransformer(final int aID, final String aName, final String aNameRegional) { + super(aID, aName, aNameRegional); + } + + public GregtechMetaTileEntity_IndustrialMolecularTransformer(final String aName) { + super(aName); + } + + public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_IndustrialMolecularTransformer(this.mName); + } + + @Override + public String getMachineType() { + return "Molecular Transformer"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Changes the structure of items to produce new ones") + .addInfo("Speed: 100% | Eu Usage: 100%") + .addInfo("This multiblock cannot be overclocked") + .addInfo("Maximum 1x of each bus/hatch.") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(7, 7, 7, false) + .addController("Top Center") + .addCasingInfo("Robust Tungstensteel Machine Casing", 40) + .addCasingInfo("Tungstensteel Coils", 16) + .addCasingInfo("Molecular Containment Casing", 52) + .addCasingInfo("High Voltage Current Capacitor", 32) + .addCasingInfo("Particle Containment Casing", 4) + .addCasingInfo("Resonance Chamber I", 5) + .addCasingInfo("Modulator I", 4) + .addInputBus("Any Robust Tungstensteel Machine Casing", 1) + .addOutputBus("Any Robust Tungstensteel Machine Casing", 1) + .addEnergyHatch("Any Robust Tungstensteel Machine Casing", 1) + .addMaintenanceHatch("Any Robust Tungstensteel Machine Casing", 1) + .addMufflerHatch("Any Robust Tungstensteel Machine Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + + private static final String STRUCTURE_PIECE_MAIN = "main"; + private IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> STRUCTURE_DEFINITION = null; + + @Override + public IStructureDefinition<GregtechMetaTileEntity_IndustrialMolecularTransformer> getStructureDefinition() { + STRUCTURE_DEFINITION = null; + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_IndustrialMolecularTransformer>builder() + .addShape(STRUCTURE_PIECE_MAIN, (new String[][]{ + {" ", " ", " xxx ", " x~x ", " xxx ", " ", " "}, + {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "}, + {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "}, + {" ", " xxx ", " xyyyx ", " xyzyx ", " xyyyx ", " xxx ", " "}, + {" t ", " ttxtt ", " tyyyt ", "txyzyxt", " tyyyt ", " ttxtt ", " t "}, + {" c ", " ccecc ", " cxfxc ", "cefefec", " cxfxc ", " ccecc ", " c "}, + {" h ", " hhhhh ", " hhhhh ", "hhhhhhh", " hhhhh ", " hhhhh ", " h "}, + })) + + .addElement('x', ofBlock(getCasingBlock(), getCasingMeta())) + .addElement('y', ofBlock(getCasingBlock(), getCasingMeta2())) + .addElement('z', ofBlock(getCasingBlock(), getCasingMeta3())) + .addElement('e', ofBlock(getCasingBlock2(), 0)) + .addElement('f', ofBlock(getCasingBlock2(), 4)) + .addElement('c', ofBlock(getCoilBlock(), 3)) + .addElement('t', lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock3(), getTungstenCasingMeta())))) + .addElement('h', lazy(t -> ofChain( + ofHatchAdder(GregtechMetaTileEntity_IndustrialMolecularTransformer::addGenericHatch, getCasingTextureIndex(), 1), + onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock3(), getTungstenCasingMeta())) + ))) + .build(); + } + return STRUCTURE_DEFINITION; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN , stackSize, hintsOnly, 3, 3, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0); + if (this.mInputBusses.size() != 1 || this.mOutputBusses.size() != 1 || this.mEnergyHatches.size() != 1) { + return false; + } + return aDidBuild && mCasing >= 40 && checkHatch(); + } + + protected static int getCasingTextureIndex() { + return CASING_TEXTURE_ID; + } + + protected static Block getCasingBlock() { + return ModBlocks.blockSpecialMultiCasings; + } + + protected static Block getCasingBlock2() { + return ModBlocks.blockSpecialMultiCasings2; + } + + protected static Block getCasingBlock3() { + return GregTech_API.sBlockCasings4; + } + + protected static Block getCoilBlock() { + return GregTech_API.sBlockCasings5; + } + + protected static int getCasingMeta() { + return 11; + } + + protected static int getCasingMeta2() { + return 12; + } + + protected static int getCasingMeta3() { + return 13; + } + + protected static int getTungstenCasingMeta() { + return 0; + } + + public final boolean addGenericHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + log("Bad Hatch"); + return false; + } + + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(44), + new GT_RenderedTexture((IIconContainer) (aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced))}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(44)}; + } + + @Override + public boolean hasSlotInGUI() { + return true; + } + + @Override + public boolean requiresVanillaGtGUI() { + return true; + } + + @Override + public String getCustomGUIResourceName() { + return "VacuumFreezer"; + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GTPP_Recipe_Map.sMolecularTransformerRecipes; + } + + public boolean isCorrectMachinePart(final ItemStack aStack) { + return true; + } + + @Override + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric(1, 100, 100); + } + + @Override + public int getMaxParallelRecipes() { + return 1; + } + + @Override + public int getEuDiscountForParallelism() { + return 100; + } + + public int getMaxEfficiency(final ItemStack aStack) { + return 10000; + } + + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiMolecularTransformer; + } + + public int getDamageToComponent(final ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(final ItemStack aStack) { + return false; + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + // Fix GT bug + if (this.getBaseMetaTileEntity().getFrontFacing() != 1) { + this.getBaseMetaTileEntity().setFrontFacing((byte) 1); + } + } + +}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java index 76fc51b413..8f5d3bf5e4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialMultiMachine.java @@ -35,8 +35,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialMultiMachine -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialMultiMachine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialMultiMachine> { protected int mInternalMode = 0; protected GT_Recipe[] mLastRecipeExtended = new GT_Recipe[9]; @@ -56,7 +55,7 @@ extends GregtechMeta_MultiBlockBase { static { for (int id = 0; id < 9; id++) { - String aNEI = GT_LanguageManager.getTranslation(getRecipeMap(id).mUnlocalizedName); + String aNEI = getRecipeMap(id).mNEIName; aToolTipNames[id] = aNEI != null ? aNEI : "BAD NEI NAME (Report to Github)"; } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java index 007d1a0d0f..069e00f55c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialPlatePress.java @@ -29,7 +29,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialPlatePress extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialPlatePress extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialPlatePress> { private boolean mFormingMode = false; private int mCasing; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java index c5450fec5b..b3219f661b 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialSifter.java @@ -1,9 +1,13 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import java.util.Random; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -11,9 +15,7 @@ import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.*; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -21,12 +23,8 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GregtechMetaTileEntity_IndustrialSifter -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialSifter extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialSifter> { + private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_IndustrialSifter> STRUCTURE_DEFINITION = null; @@ -63,7 +61,7 @@ extends GregtechMeta_MultiBlockBase { .addCasingInfo("Sieve Grate", 18) .addCasingInfo("Sieve Casings", 35) .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) + .addOutputBus("Any Casing (x4)", 1) .addEnergyHatch("Any Casing", 1) .addMaintenanceHatch("Any Casing", 1) .addMufflerHatch("Any Casing", 1) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java index 01b887694a..a473196c43 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialThermalCentrifuge.java @@ -24,8 +24,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialThermalCentrifuge -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialThermalCentrifuge extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialThermalCentrifuge> { private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_IndustrialThermalCentrifuge> STRUCTURE_DEFINITION = null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java index 1f63995651..e59b6d3207 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialVacuumFreezer.java @@ -28,7 +28,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialVacuumFreezer> { public static int CASING_TEXTURE_ID; public static String mCryoFuelName = "Gelid Cryotheum"; @@ -44,18 +44,12 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta super(aID, aName, aNameRegional); mFuelStack = FluidUtils.getFluidStack("cryotheum", 1); CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); - mCryoFuelName = mFuelStack.getLocalizedName(); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 10); - mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 967); } public GregtechMetaTileEntity_IndustrialVacuumFreezer(final String aName) { super(aName); mFuelStack = FluidUtils.getFluidStack("cryotheum", 1); CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 10); - mCryoFuelName = mFuelStack.getLocalizedName(); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 10); - mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 967); } public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @@ -69,17 +63,6 @@ public class GregtechMetaTileEntity_IndustrialVacuumFreezer extends GregtechMeta @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 10); - } - if (mCryoFuelName.toLowerCase().contains(".")) { - mCryoFuelName = FluidUtils.getFluidStack("cryotheum", 1).getLocalizedName(); - } - if (mHatchName.toLowerCase().contains(".name")) { - mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 967); - } - GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Factory Grade Advanced Vacuum Freezer") diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java index 168d4ff6d6..616459dd1f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWashPlant.java @@ -1,15 +1,28 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.gtnewhorizon.structurelib.alignment.IAlignmentLimits; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.*; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; @@ -31,14 +44,9 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - -public class GregtechMetaTileEntity_IndustrialWashPlant -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialWashPlant extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWashPlant> { - private boolean mChemicalMode = false; + private int mMode = 0; private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_IndustrialWashPlant> STRUCTURE_DEFINITION = null; @@ -57,15 +65,15 @@ extends GregtechMeta_MultiBlockBase { @Override public String getMachineType() { - return "Ore Washer, Chemical Bath"; + return "Ore Washer, Simple Washer, Chemical Bath"; } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Ore Washing Plant") - .addInfo("Can be configured with a screwdriver to also process Chemical Bathing") + .addInfo("Controller Block for the Industrial Wash Plant") + .addInfo("Can be configured with a screwdriver to also do Simple Washer and process Chemical Bathing") .addInfo("400% faster than using single block machines of the same voltage") .addInfo("Processes four item per voltage tier") .addInfo("Always requires an Input Hatch full of water to refill structure") @@ -171,7 +179,7 @@ extends GregtechMeta_MultiBlockBase { @Override public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return mChemicalMode ? GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes : GT_Recipe.GT_Recipe_Map.sOreWasherRecipes; + return mMode == 0 ? GT_Recipe.GT_Recipe_Map.sOreWasherRecipes : mMode == 1 ? GTPP_Recipe_Map.sSimpleWasherRecipes : GT_Recipe.GT_Recipe_Map.sChemicalBathRecipes; } @Override @@ -199,7 +207,7 @@ extends GregtechMeta_MultiBlockBase { @Override public int getPollutionPerSecond(final ItemStack aStack) { - if (this.mChemicalMode) return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath; + if (mMode == 2) return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeChemBath; return CORE.ConfigSwitches.pollutionPerSecondMultiIndustrialWashPlant_ModeWasher; } @@ -311,24 +319,42 @@ extends GregtechMeta_MultiBlockBase { @Override public void saveNBTData(NBTTagCompound aNBT) { - aNBT.setBoolean("mChemicalMode", mChemicalMode); + aNBT.setInteger("mMode", mMode); super.saveNBTData(aNBT); } @Override public void loadNBTData(NBTTagCompound aNBT) { - mChemicalMode = aNBT.getBoolean("mChemicalMode"); + if (aNBT.hasKey("mChemicalMode")) { + boolean aTempMode = aNBT.getBoolean("mChemicalMode"); + if (aTempMode) { + mMode = 2; + } + else { + mMode = 0; + } + aNBT.removeTag("mChemicalMode"); + } + if (aNBT.hasKey("mMode")) { + mMode = aNBT.getInteger("mMode"); + } super.loadNBTData(aNBT); } @Override public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - mChemicalMode = Utils.invertBoolean(mChemicalMode); - if (mChemicalMode){ - PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Chemical Bath Mode."); + mMode++; + if (mMode > 2) { + mMode = 0; } - else { + if (mMode == 0){ PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Ore Washer Mode."); + } + else if (mMode == 1){ + PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Simple Washer Mode."); + } + else { + PlayerUtils.messagePlayer(aPlayer, "Wash Plant is now running in Chemical Bath Mode."); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java index ccce25d925..9ea113ec01 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IndustrialWireMill.java @@ -24,8 +24,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_IndustrialWireMill -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialWireMill extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialWireMill> { private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_IndustrialWireMill> STRUCTURE_DEFINITION = null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java index ecd6616855..e86f98ef66 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/GregtechMetaTileEntity_IsaMill.java @@ -50,7 +50,7 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IsaMill> { protected boolean boostEu = false; private int mCasing; @@ -486,7 +486,7 @@ public class GregtechMetaTileEntity_IsaMill extends GregtechMeta_MultiBlockBase public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isOC) { + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java index 8c9e886e94..43f4b337c6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_AssemblyLine.java @@ -1,7 +1,9 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; import java.util.ArrayList; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; @@ -14,12 +16,13 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_DataAccess; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.LangUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; -import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Naquadah; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; @@ -29,12 +32,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_Adv_AssemblyLine - extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_Adv_AssemblyLine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_AssemblyLine> { - public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>(); - - public static String[] mCasingName = new String[5]; + public ArrayList<GT_MetaTileEntity_Hatch_DataAccess> mDataAccessHatches = new ArrayList<GT_MetaTileEntity_Hatch_DataAccess>(); + + public static String[] mCasingName = new String[5]; private final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 13); private final int META_BaseCasing = 0; //4 private final int META_ContainmentCasing = 15; //3 @@ -42,46 +44,54 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine private final int META_PipeCasing = 1; //4 private final int META_IntegralCasing = 6; //0 private final int META_ContainmentChamberCasing = 2; //4 - - - public GregtechMetaTileEntity_Adv_AssemblyLine(int aID, String aName, String aNameRegional) { - super(aID, aName, aNameRegional); + + + public GregtechMetaTileEntity_Adv_AssemblyLine(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); - } + } - public GregtechMetaTileEntity_Adv_AssemblyLine(String aName) { - super(aName); - } + public GregtechMetaTileEntity_Adv_AssemblyLine(String aName) { + super(aName); + } - public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GregtechMetaTileEntity_Adv_AssemblyLine(this.mName); - } + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GregtechMetaTileEntity_Adv_AssemblyLine(this.mName); + } + + /* public String[] getTooltip() { + if (mCasingName[0].toLowerCase().contains(".name")) { + mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); + } + if (mCasingName[1].toLowerCase().contains(".name")) { + mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); + } + if (mCasingName[2].toLowerCase().contains(".name")) { + mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); + } + if (mCasingName[3].toLowerCase().contains(".name")) { + mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); + } + if (mCasingName[4].toLowerCase().contains(".name")) { + mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); + } + return new String[]{ + "Advanced Integrated Assembly Line" + }; + }*/ + + @Override + protected final GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } - public String[] getTooltip() { - if (mCasingName[0].toLowerCase().contains(".name")) { - mCasingName[0] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 0); - } - if (mCasingName[1].toLowerCase().contains(".name")) { - mCasingName[1] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 1); - } - if (mCasingName[2].toLowerCase().contains(".name")) { - mCasingName[2] = LangUtils.getLocalizedNameOfBlock(getCasing(4), 2); - } - if (mCasingName[3].toLowerCase().contains(".name")) { - mCasingName[3] = LangUtils.getLocalizedNameOfBlock(getCasing(3), 15); - } - if (mCasingName[4].toLowerCase().contains(".name")) { - mCasingName[4] = LangUtils.getLocalizedNameOfBlock(getCasing(1), 13); - } - return new String[]{ - "Advanced Integrated Assembly Line" - }; - } - private Block getCasing(int casingID) { if (casingID == 1) { return ModBlocks.blockCasingsMisc; @@ -100,155 +110,151 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine } } - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - if (aSide == aFacing) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)}; - } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; - } - - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png"); - } - - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - return null; - } - - public boolean isCorrectMachinePart(ItemStack aStack) { - return true; - } - - public boolean isFacingValid(byte aFacing) { - return aFacing > 1; - } - - public boolean checkRecipe(ItemStack aStack) { - if(GT_Values.D1)System.out.println("Start ALine recipe check"); - ArrayList<ItemStack> tDataStickList = getDataItems(2); - if (tDataStickList.size() == 0) return false; - if(GT_Values.D1)System.out.println("Stick accepted, " + tDataStickList.size() + " Data Sticks found"); - - ItemStack tStack[] = new ItemStack[15]; - FluidStack[] tFluids = new FluidStack[4]; - boolean findRecipe = false; - nextDS:for (ItemStack tDataStick : tDataStickList){ - NBTTagCompound tTag = tDataStick.getTagCompound(); - if (tTag == null) continue; - for (int i = 0; i < 15; i++) { - int count = tTag.getInteger("a"+i); - if (!tTag.hasKey("" + i) && count <= 0) continue; - if (mInputBusses.get(i) == null) { - continue nextDS; - } - - ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); - boolean flag = true; - if (count > 0) { - for (int j = 0; j < count; j++) { - tStack[i] = GT_Utility.loadItem(tTag, "a" + i + ":" + j); - if (tStack[i] == null) continue; - if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName()); - if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { - flag = false; - break; - } - } - } - if (flag) { - tStack[i] = GT_Utility.loadItem(tTag, "" + i); - if (tStack[i] == null) { - flag = false; - continue; - } - if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName()); - if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { - flag = false; - } - } - if(GT_Values.D1) System.out.println(i + (flag ? " not accepted" : " accepted")); - if (flag) continue nextDS; - } - - if(GT_Values.D1)System.out.println("All Items done, start fluid check"); - for (int i = 0; i < 4; i++) { - if (!tTag.hasKey("f" + i)) continue; - tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i); - if (tFluids[i] == null) continue; - if(GT_Values.D1)System.out.println("Fluid "+i+" "+tFluids[i].getUnlocalizedName()); - if (mInputHatches.get(i) == null) { - continue nextDS; - } - FluidStack fluidInHatch = mInputHatches.get(i).mFluid; - if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) { - if(GT_Values.D1)System.out.println(i+" not accepted"); - continue nextDS; - } - if(GT_Values.D1)System.out.println(i+" accepted"); - } - - if(GT_Values.D1)System.out.println("Input accepted, check other values"); - if (!tTag.hasKey("output")) continue; - mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")}; - if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0])) - continue; - - if (!tTag.hasKey("time")) continue; - mMaxProgresstime = tTag.getInteger("time"); - if (mMaxProgresstime <= 0) continue; - - if (!tTag.hasKey("eu")) continue; - mEUt = tTag.getInteger("eu"); - - if(GT_Values.D1)System.out.println("Find avaiable recipe"); - findRecipe = true; - break; - } - if (!findRecipe) return false; - - if(GT_Values.D1)System.out.println("All checked start consuming inputs"); - for (int i = 0; i < 15; i++) { - if (tStack[i] == null) continue; - ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); - stackInSlot.stackSize -= tStack[i].stackSize; - } - - for (int i = 0; i < 4; i++) { - if (tFluids[i] == null) continue; - mInputHatches.get(i).mFluid.amount -= tFluids[i].amount; - if (mInputHatches.get(i).mFluid.amount <= 0) { - mInputHatches.get(i).mFluid = null; - } - } - if(GT_Values.D1)System.out.println("Check overclock"); - - byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); - this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); - this.mEfficiencyIncrease = 10000; - if (mEUt <= 16) { - this.mEUt = (mEUt * (1 << tTier - 1) * (1 << tTier - 1)); - this.mMaxProgresstime = (mMaxProgresstime / (1 << tTier - 1)); - } else { - while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { - this.mEUt *= 4; - this.mMaxProgresstime /= 2; - } - } - if (this.mEUt > 0) { - this.mEUt = -this.mEUt; - } - this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); - updateSlots(); - if(GT_Values.D1)System.out.println("Recipe sucessfull"); - return true; - } - - public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { - super.startSoundLoop(aIndex, aX, aY, aZ); - if (aIndex == 20) { - GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); - } - } + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE_ACTIVE : Textures.BlockIcons.OVERLAY_FRONT_ASSEMBLY_LINE)}; + } + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(16)}; + } + + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "AssemblyLine.png"); + } + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return null; + } + + public boolean isCorrectMachinePart(ItemStack aStack) { + return true; + } + + public boolean checkRecipe(ItemStack aStack) { + if(GT_Values.D1)System.out.println("Start ALine recipe check"); + ArrayList<ItemStack> tDataStickList = getDataItems(2); + if (tDataStickList.size() == 0) return false; + if(GT_Values.D1)System.out.println("Stick accepted, " + tDataStickList.size() + " Data Sticks found"); + + ItemStack tStack[] = new ItemStack[15]; + FluidStack[] tFluids = new FluidStack[4]; + boolean findRecipe = false; + nextDS:for (ItemStack tDataStick : tDataStickList){ + NBTTagCompound tTag = tDataStick.getTagCompound(); + if (tTag == null) continue; + for (int i = 0; i < 15; i++) { + int count = tTag.getInteger("a"+i); + if (!tTag.hasKey("" + i) && count <= 0) continue; + if (mInputBusses.get(i) == null) { + continue nextDS; + } + + ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); + boolean flag = true; + if (count > 0) { + for (int j = 0; j < count; j++) { + tStack[i] = GT_Utility.loadItem(tTag, "a" + i + ":" + j); + if (tStack[i] == null) continue; + if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName()); + if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { + flag = false; + break; + } + } + } + if (flag) { + tStack[i] = GT_Utility.loadItem(tTag, "" + i); + if (tStack[i] == null) { + flag = false; + continue; + } + if(GT_Values.D1)System.out.println("Item "+i+" : "+tStack[i].getUnlocalizedName()); + if (GT_Utility.areStacksEqual(tStack[i], stackInSlot, true) && tStack[i].stackSize <= stackInSlot.stackSize) { + flag = false; + } + } + if(GT_Values.D1) System.out.println(i + (flag ? " not accepted" : " accepted")); + if (flag) continue nextDS; + } + + if(GT_Values.D1)System.out.println("All Items done, start fluid check"); + for (int i = 0; i < 4; i++) { + if (!tTag.hasKey("f" + i)) continue; + tFluids[i] = GT_Utility.loadFluid(tTag, "f" + i); + if (tFluids[i] == null) continue; + if(GT_Values.D1)System.out.println("Fluid "+i+" "+tFluids[i].getUnlocalizedName()); + if (mInputHatches.get(i) == null) { + continue nextDS; + } + FluidStack fluidInHatch = mInputHatches.get(i).mFluid; + if (fluidInHatch == null || !GT_Utility.areFluidsEqual(fluidInHatch, tFluids[i], true) || fluidInHatch.amount < tFluids[i].amount) { + if(GT_Values.D1)System.out.println(i+" not accepted"); + continue nextDS; + } + if(GT_Values.D1)System.out.println(i+" accepted"); + } + + if(GT_Values.D1)System.out.println("Input accepted, check other values"); + if (!tTag.hasKey("output")) continue; + mOutputItems = new ItemStack[]{GT_Utility.loadItem(tTag, "output")}; + if (mOutputItems[0] == null || !GT_Utility.isStackValid(mOutputItems[0])) + continue; + + if (!tTag.hasKey("time")) continue; + mMaxProgresstime = tTag.getInteger("time"); + if (mMaxProgresstime <= 0) continue; + + if (!tTag.hasKey("eu")) continue; + mEUt = tTag.getInteger("eu"); + + if(GT_Values.D1)System.out.println("Find avaiable recipe"); + findRecipe = true; + break; + } + if (!findRecipe) return false; + + if(GT_Values.D1)System.out.println("All checked start consuming inputs"); + for (int i = 0; i < 15; i++) { + if (tStack[i] == null) continue; + ItemStack stackInSlot = mInputBusses.get(i).getBaseMetaTileEntity().getStackInSlot(0); + stackInSlot.stackSize -= tStack[i].stackSize; + } + + for (int i = 0; i < 4; i++) { + if (tFluids[i] == null) continue; + mInputHatches.get(i).mFluid.amount -= tFluids[i].amount; + if (mInputHatches.get(i).mFluid.amount <= 0) { + mInputHatches.get(i).mFluid = null; + } + } + if(GT_Values.D1)System.out.println("Check overclock"); + + byte tTier = (byte) Math.max(1, GT_Utility.getTier(getMaxInputVoltage())); + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + if (mEUt <= 16) { + this.mEUt = (mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (mMaxProgresstime / (1 << tTier - 1)); + } else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 2; + } + } + if (this.mEUt > 0) { + this.mEUt = -this.mEUt; + } + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + updateSlots(); + if(GT_Values.D1)System.out.println("Recipe sucessfull"); + return true; + } + + public void startSoundLoop(byte aIndex, double aX, double aY, double aZ) { + super.startSoundLoop(aIndex, aX, aY, aZ); + if (aIndex == 20) { + GT_Utility.doSoundAtClient(GregTech_API.sSoundList.get(212), 10, 1.0F, aX, aY, aZ); + } + } public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { int xDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetX * 4; @@ -314,7 +320,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine if (aOwnerName != null && aOwnerName.length() > 0) { aOwner = PlayerUtils.getPlayer(aOwnerName); } - + if (aShieldingCount != 128) { log("Not enough "+mCasingName[4]+"s, require 128."); if (aOwner != null) { @@ -365,18 +371,18 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine } public boolean addNaquadahHatchToMachineInput(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity); - } - return false; + if (aTileEntity == null) { + return false; + } + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity); + } + return false; } public int checkEntireLayer(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { @@ -394,7 +400,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine if (aY == 0 && x == 0 && z == 0) { continue; } - + Block aCurrentBlock = aBaseMetaTileEntity.getBlockOffset(xDir + x, aY, zDir + z); int aCurrentMeta = (int) aBaseMetaTileEntity.getMetaIDOffset(xDir + x, aY, zDir + z); if (aCurrentBlock == aBlock && aCurrentMeta == aMeta) { @@ -485,7 +491,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine } return aCasingCount; } - + public int checkPipes(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -1; x < 2; x++) { @@ -511,7 +517,7 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine } return aCasingCount; } - + public int checkContainmentRing(IGregTechTileEntity aBaseMetaTileEntity, Block aBlock, int aMeta, int aY, int xDir, int zDir) { int aCasingCount = 0; for (int x = -2; x < 3; x++) { @@ -539,67 +545,65 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine } return aCasingCount; } - - */ -/** - * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb - *//* - - private boolean isCorrectDataItem(ItemStack aStack, int state){ - if ((state & 1) != 0 && ItemList.Circuit_Integrated.isStackEqual(aStack, true, true)) return true; - if ((state & 2) != 0 && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) return true; - if ((state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) return true; - return false; - } - - */ -/** - * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb - *//* - - public ArrayList<ItemStack> getDataItems(int state) { - ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); - if (GT_Utility.isStackValid(mInventory[1]) && isCorrectDataItem(mInventory[1], state)) { - rList.add(mInventory[1]); - } - for (GT_MetaTileEntity_Hatch_DataAccess tHatch : mDataAccessHatches) { - if (isValidMetaTileEntity(tHatch)) { - for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { - if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null - && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state)) - rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); - } - } - } - return rList; - } - - public boolean addDataAccessToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - if (aTileEntity == null) return false; - IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) return false; - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) { - ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); - return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity); - } - return false; - } - - public int getMaxEfficiency(ItemStack aStack) { - return 10000; - } - - public int getPollutionPerTick(ItemStack aStack) { - return 0; - } - - public int getDamageToComponent(ItemStack aStack) { - return 0; - } - - public boolean explodesOnComponentBreak(ItemStack aStack) { - return false; - } + + /** + * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb + */ + + private boolean isCorrectDataItem(ItemStack aStack, int state){ + if ((state & 1) != 0 && ItemList.Circuit_Integrated.isStackEqual(aStack, true, true)) return true; + if ((state & 2) != 0 && ItemList.Tool_DataStick.isStackEqual(aStack, false, true)) return true; + if ((state & 4) != 0 && ItemList.Tool_DataOrb.isStackEqual(aStack, false, true)) return true; + return false; + } + + /** + * @param state using bitmask, 1 for IntegratedCircuit, 2 for DataStick, 4 for DataOrb + */ + + public ArrayList<ItemStack> getDataItems(int state) { + ArrayList<ItemStack> rList = new ArrayList<ItemStack>(); + if (GT_Utility.isStackValid(mInventory[1]) && isCorrectDataItem(mInventory[1], state)) { + rList.add(mInventory[1]); + } + for (GT_MetaTileEntity_Hatch_DataAccess tHatch : mDataAccessHatches) { + if (isValidMetaTileEntity(tHatch)) { + for (int i = 0; i < tHatch.getBaseMetaTileEntity().getSizeInventory(); i++) { + if (tHatch.getBaseMetaTileEntity().getStackInSlot(i) != null + && isCorrectDataItem(tHatch.getBaseMetaTileEntity().getStackInSlot(i), state)) + rList.add(tHatch.getBaseMetaTileEntity().getStackInSlot(i)); + } + } + } + return rList; + } + + public boolean addDataAccessToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) return false; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) return false; + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_DataAccess) { + ((GT_MetaTileEntity_Hatch) aMetaTileEntity).updateTexture(aBaseCasingIndex); + return mDataAccessHatches.add((GT_MetaTileEntity_Hatch_DataAccess) aMetaTileEntity); + } + return false; + } + + public int getMaxEfficiency(ItemStack aStack) { + return 10000; + } + + public int getPollutionPerTick(ItemStack aStack) { + return 0; + } + + public int getDamageToComponent(ItemStack aStack) { + return 0; + } + + public boolean explodesOnComponentBreak(ItemStack aStack) { + return false; + } @Override public boolean hasSlotInGUI() { @@ -625,5 +629,35 @@ public class GregtechMetaTileEntity_Adv_AssemblyLine public int getEuDiscountForParallelism() { return 0; } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + // Fix GT bug + if (this.getBaseMetaTileEntity().getFrontFacing() != 1) { + log("Fixing Bad Facing. (GT Bug)"); + this.getBaseMetaTileEntity().setFrontFacing((byte) 1); + } + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + // TODO Auto-generated method stub + + } + + @Override + public IStructureDefinition getStructureDefinition() { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean checkMachine( + IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack + ) { + // TODO Auto-generated method stub + return false; + } } -*/ + diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java index 1ebe328e6d..055c591047 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_DistillationTower.java @@ -34,7 +34,7 @@ import net.minecraftforge.fluids.FluidStack; import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; -public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_Adv_DistillationTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_DistillationTower> { private byte mMode = 0; private boolean mUpgraded = false; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java index ce54aef282..e00bbbf730 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_EBF.java @@ -40,7 +40,7 @@ import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_EBF> { public static int CASING_TEXTURE_ID; public static String mHotFuelName = "Blazing Pyrotheum"; @@ -56,17 +56,11 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase public GregtechMetaTileEntity_Adv_EBF(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 11); - mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName(); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 11); - mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 968); } public GregtechMetaTileEntity_Adv_EBF(String aName) { super(aName); CASING_TEXTURE_ID = TAE.getIndexFromPage(2, 11); - mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName(); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 11); - mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 968); } @Override @@ -80,34 +74,25 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 11); - } - if (mHotFuelName.toLowerCase().contains(".")) { - mHotFuelName = FluidUtils.getFluidStack("pyrotheum", 1).getLocalizedName(); - } - if (mHatchName.toLowerCase().contains(".name")) { - mHatchName = ItemUtils.getLocalizedNameOfBlock(GregTech_API.sBlockMachines, 968); - } GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) - .addInfo("Factory Grade Advanced Blast Furnace") - .addInfo("Speed: 120% | Eu Usage: 90% | Parallel: 8") - .addInfo("Consumes 10L of " + mHotFuelName + " per second during operation") - .addInfo("Constructed exactly the same as a normal EBF") - .addPollutionAmount(getPollutionPerSecond(null)) - .addSeparator() - .addController("Bottom center") - .addCasingInfo(mCasingName, 9) - .addInputHatch("Any Casing", 1) - .addInputBus("Any Casing", 1) - .addOutputBus("Any Casing", 1) - .addOutputHatch("Any Casing", 1) - .addStructureHint(mHatchName, 1) - .addEnergyHatch("Any Casing", 1) - .addMufflerHatch("Any Casing", 1) - .addMaintenanceHatch("Any Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInfo("Factory Grade Advanced Blast Furnace") + .addInfo("Speed: 120% | Eu Usage: 90% | Parallel: 8") + .addInfo("Consumes 10L of " + mHotFuelName + " per second during operation") + .addInfo("Constructed exactly the same as a normal EBF") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .addController("Bottom center") + .addCasingInfo(mCasingName, 9) + .addInputHatch("Any Casing", 1) + .addInputBus("Any Casing", 1) + .addOutputBus("Any Casing", 1) + .addOutputHatch("Any Casing", 1) + .addStructureHint(mHatchName, 1) + .addEnergyHatch("Any Casing", 1) + .addMufflerHatch("Any Casing", 1) + .addMaintenanceHatch("Any Casing", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } @@ -116,31 +101,31 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_Adv_EBF>builder() .addShape(mName, transpose(new String[][]{ - {"CCC", "CCC", "CCC"}, - {"HHH", "H-H", "HHH"}, - {"HHH", "H-H", "HHH"}, - {"C~C", "CCC", "CCC"}, + {"CCC", "CCC", "CCC"}, + {"HHH", "H-H", "HHH"}, + {"HHH", "H-H", "HHH"}, + {"C~C", "CCC", "CCC"}, })) .addElement( 'C', ofChain( ofHatchAdder( GregtechMetaTileEntity_Adv_EBF::addAdvEBFList, CASING_TEXTURE_ID, 1 - ), + ), onElementPass( x -> ++x.mCasing, ofBlock( ModBlocks.blockCasings3Misc, 11 + ) ) ) ) - ) .addElement( 'H', ofCoil( GregtechMetaTileEntity_Adv_EBF::setCoilLevel, GregtechMetaTileEntity_Adv_EBF::getCoilLevel + ) ) - ) .build(); } return STRUCTURE_DEFINITION; @@ -298,7 +283,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; int tHeatCapacityDivTiers = (int) (mHeatingCapacity.getHeat() - tRecipe.mSpecialValue) / 900; if (tHeatCapacityDivTiers > 0) - tRecipeEUt = (int) (tRecipeEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); + tRecipeEUt = (int) (tRecipeEUt * (Math.pow(0.95, tHeatCapacityDivTiers))); float tTotalEUt = 0.0f; int parallelRecipes = 0; @@ -443,7 +428,7 @@ public class GregtechMetaTileEntity_Adv_EBF extends GregtechMeta_MultiBlockBase } } } - + } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java index 56206f8178..e5f42ffdca 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Fusion_MK4.java @@ -98,6 +98,11 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus } @Override + public int overclock(int mStartEnergy) { + return (mStartEnergy < 160000000) ? 16 : ((mStartEnergy < 320000000) ? 8 : (mStartEnergy < 640000000) ? 4 : 1); + } + + @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { ITexture[] sTexture; @@ -150,4 +155,24 @@ public class GregtechMetaTileEntity_Adv_Fusion_MK4 extends GT_MetaTileEntity_Fus } return true; } + + @Override + public String[] getInfoData() { + String tier = "IV"; + float plasmaOut = 0; + int powerRequired = 0; + if (this.mLastRecipe != null) { + powerRequired = this.mLastRecipe.mEUt; + if (this.mLastRecipe.getFluidOutput(0) != null) { + plasmaOut = (float)this.mLastRecipe.getFluidOutput(0).amount / (float)this.mLastRecipe.mDuration; + } + } + + return new String[]{ + "Fusion Reactor MK "+tier, + "EU Required: "+powerRequired+"EU/t", + "Stored EU: "+mEUStore+" / "+maxEUStore(), + "Plasma Output: "+plasmaOut+"L/t"}; + } + } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java index aff614184a..e2dfd8d3c3 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/advanced/GregtechMetaTileEntity_Adv_Implosion.java @@ -1,43 +1,36 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.GregTech_API.sBlockCasings4; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; + import gregtech.api.GregTech_API; -import gregtech.api.enums.ItemList; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Utility; +import gregtech.api.util.*; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.item.ItemStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.GregTech_API.sBlockCasings4; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; +public class GregtechMetaTileEntity_Adv_Implosion extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Adv_Implosion> { -public class GregtechMetaTileEntity_Adv_Implosion -extends GregtechMeta_MultiBlockBase { - - private String mCasingName; private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_Adv_Implosion> STRUCTURE_DEFINITION = null; public GregtechMetaTileEntity_Adv_Implosion(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mCasingName = ItemList.Casing_RobustTungstenSteel.get(1).getDisplayName(); } public GregtechMetaTileEntity_Adv_Implosion(String aName) { super(aName); - mCasingName = ItemList.Casing_RobustTungstenSteel.get(1).getDisplayName(); } public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { @@ -51,9 +44,6 @@ extends GregtechMeta_MultiBlockBase { @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - if (mCasingName.contains("gt.blockcasings")) { - mCasingName = ItemList.Casing_RobustTungstenSteel.get(1).getDisplayName(); - } GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Factory Grade Advanced Implosion Compressor") @@ -63,7 +53,7 @@ extends GregtechMeta_MultiBlockBase { .addSeparator() .beginStructureBlock(3, 3, 3, true) .addController("Front center") - .addCasingInfo(mCasingName, 10) + .addCasingInfo("Robust TungstenSteel Casing", 10) .addInputBus("Any casing", 1) .addOutputBus("Any casing", 1) .addEnergyHatch("Any casing", 1) diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java new file mode 100644 index 0000000000..92190521cd --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/processing/steam/GregtechMetaTileEntity_SteamCompressor.java @@ -0,0 +1,163 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.steam; + +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.GregTech_API.sBlockCasings1; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusInput; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Steam_BusOutput; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GT_MetaTileEntity_Hatch_CustomFluidBase; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_SteamMultiBase; +import net.minecraft.item.ItemStack; + +public class GregtechMetaTileEntity_SteamCompressor extends GregtechMeta_SteamMultiBase { + + private String mCasingName = "Bronze Plated Bricks"; + private IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> STRUCTURE_DEFINITION = null; + private int mCasing; + + public GregtechMetaTileEntity_SteamCompressor(String aName) { + super(aName); + } + + public GregtechMetaTileEntity_SteamCompressor(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity arg0) { + return new GregtechMetaTileEntity_SteamCompressor(this.mName); + } + + @Override + protected GT_RenderedTexture getFrontOverlay() { + return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR); + } + + @Override + protected GT_RenderedTexture getFrontOverlayActive() { + return new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_TOP_STEAM_MACERATOR_ACTIVE); + } + + @Override + public String getMachineType() { + return "Compressor"; + } + + @Override + protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the Steam Macerator") + .addInfo("Macerates " + getMaxParallelRecipes() + " ores at a time") + .addSeparator() + .beginStructureBlock(3, 3, 3, true) + .addController("Front center") + .addCasingInfo(mCasingName, 14) + .addStructureHint("Input Bus (Steam)", 1) + .addStructureHint("Output Bus (Steam)", 1) + .addStructureHint("Steam Hatch", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + @Override + public IStructureDefinition<GregtechMetaTileEntity_SteamCompressor> getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_SteamCompressor>builder() + .addShape(mName, transpose(new String[][]{ + {"CCC", "CCC", "CCC", "CCC"}, + {"C~C", "C-C", "C-C", "CCC"}, + {"CCC", "CCC", "CCC", "CCC"}, + })) + .addElement( + 'C', + ofChain( + ofHatchAdder( + GregtechMetaTileEntity_SteamCompressor::addSteamMultiList, 10, 1 + ), + onElementPass( + x -> ++x.mCasing, + ofBlock( + sBlockCasings1, 10 + ) + ) + ) + ) + .build(); + } + return STRUCTURE_DEFINITION; + } + + public final boolean addSteamMultiList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_CustomFluidBase && aMetaTileEntity.getBaseMetaTileEntity().getMetaTileID() == 31040){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusInput){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Steam_BusOutput){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + } + return false; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(mName, stackSize, hintsOnly, 1, 1, 0); + } + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + fixAllMaintenanceIssue(); + return checkPiece(mName, 1, 1, 0) && mCasing >= 14; + } + + @Override + public int getMaxParallelRecipes() { + return 8; + } + + + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GT_Recipe.GT_Recipe_Map.sCompressorRecipes; + } + + @Override + public ItemStack[] getOutputItems(GT_Recipe aRecipe) { + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[1]; + for (int h = 0; h < 1; h++) { + if (aRecipe.getOutput(h) != null) { + tOutputItems[h] = aRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + return tOutputItems; + } + + @Override + public int getOutputCount(ItemStack[] aOutputs) { + return 1; + } + + + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java index eae51e5c1d..6ee78b0a95 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_AutoCrafter.java @@ -36,7 +36,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase { +public class GT4Entity_AutoCrafter extends GregtechMeta_MultiBlockBase<GT4Entity_AutoCrafter> { private MODE mMachineMode = MODE.ASSEMBLY; private byte mTier = 1; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java index 65474d38ed..fdf6b4be91 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GT4Entity_ThermalBoiler.java @@ -16,20 +16,23 @@ import gregtech.api.util.*; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.general.ItemLavaFilter; import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.MISC_MATERIALS; +import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GT4Entity_ThermalBoiler -extends GregtechMeta_MultiBlockBase -{ +public class GT4Entity_ThermalBoiler extends GregtechMeta_MultiBlockBase<GT4Entity_ThermalBoiler> { + private int mCasing; private IStructureDefinition<GT4Entity_ThermalBoiler> STRUCTURE_DEFINITION = null; private int mSuperEfficencyIncrease = 0; @@ -72,6 +75,9 @@ extends GregtechMeta_MultiBlockBase } private static Item mLavaFilter; + private static Fluid mLava = null; + private static Fluid mPahoehoe = null; + private static Fluid mSolarSaltHot = null; @Override public boolean checkRecipe(ItemStack aStack) { @@ -80,6 +86,17 @@ extends GregtechMeta_MultiBlockBase if (mLavaFilter == null) { mLavaFilter = ItemList.Component_LavaFilter.getItem(); } + if (mLava == null) { + mLava = FluidRegistry.LAVA; + } + if (mPahoehoe == null) { + mPahoehoe = FluidUtils.getPahoehoeLava(1).getFluid(); + } + if (mSolarSaltHot == null) { + mSolarSaltHot = MISC_MATERIALS.SOLAR_SALT_HOT.getFluid(); + } + + //Try reload new Lava Filter if (aStack == null) { @@ -94,43 +111,51 @@ extends GregtechMeta_MultiBlockBase for (GT_Recipe tRecipe : GTPP_Recipe.GTPP_Recipe_Map.sThermalFuels.mRecipeList) { FluidStack tFluid = tRecipe.mFluidInputs[0]; if (tFluid != null) { - if (depleteInput(tFluid)) { - this.mMaxProgresstime = Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2)); - this.mEUt = getEUt(); - this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease()); - - int loot_MAXCHANCE = 100000; - if (mLavaFilter.getClass().isInstance(aStack.getItem())) { - - if ((tRecipe.getOutput(0) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(0))) { - this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(0) }) }; - } - if ((tRecipe.getOutput(1) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(1))) { - this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(1) }) }; - } - if ((tRecipe.getOutput(2) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(2))) { - this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(2) }) }; - } - if ((tRecipe.getOutput(3) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(3))) { - this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(3) }) }; - } - if ((tRecipe.getOutput(4) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(4))) { - this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(4) }) }; - } - if ((tRecipe.getOutput(5) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(5))) { - this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(5) }) }; - } - + + if (tFluid.getFluid() == mLava || tFluid.getFluid() == mPahoehoe) { + if (depleteInput(tFluid)) { + this.mMaxProgresstime = Math.max(1, runtimeBoost(tRecipe.mSpecialValue * 2)); + this.mEfficiencyIncrease = (this.mMaxProgresstime * getEfficiencyIncrease()); + + int loot_MAXCHANCE = 100000; + if (mLavaFilter.getClass().isInstance(aStack.getItem())) { + if ((tRecipe.getOutput(0) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(0))) { + this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(0) }) }; + } + if ((tRecipe.getOutput(1) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(1))) { + this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(1) }) }; + } + if ((tRecipe.getOutput(2) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(2))) { + this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(2) }) }; + } + if ((tRecipe.getOutput(3) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(3))) { + this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(3) }) }; + } + if ((tRecipe.getOutput(4) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(4))) { + this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(4) }) }; + } + if ((tRecipe.getOutput(5) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(5))) { + this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(5) }) }; + } + } + //Give Obsidian without Lava Filter + if (tFluid.getFluid() == mLava){ + if ((tRecipe.getOutput(6) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(6))) { + this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(6) }) }; + } + } + return true; } - //Give Obsidian without Lava Filter - if (tFluid.isFluidEqual(GT_ModHandler.getLava(86))){ - if ((tRecipe.getOutput(6) != null) && (getBaseMetaTileEntity().getRandomNumber(loot_MAXCHANCE) < tRecipe.getOutputChance(6))) { - this.mOutputItems = new ItemStack[] { GT_Utility.copy(new Object[] { tRecipe.getOutput(6) }) }; + } + else if (tFluid.getFluid() == mSolarSaltHot) { + if (depleteInput(tFluid)) { + this.mMaxProgresstime = tRecipe.mDuration; + this.mEfficiency = 10000; + for (FluidStack aOutput : tRecipe.mFluidOutputs) { + this.addOutput(FluidUtils.getFluidStack(aOutput, aOutput.amount)); } + return true; } - - - return true; } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java index 326cc01de7..1e3e84328e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_ElementalDuplicator.java @@ -1,77 +1,61 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; import java.util.ArrayList; -import java.util.HashMap; +import java.util.Collection; +import java.util.Collections; import java.util.List; import org.apache.commons.lang3.ArrayUtils; -import com.gtnewhorizon.structurelib.StructureLibAPI; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; -import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import gregtech.api.GregTech_API; +import gregtech.api.enums.Element; +import gregtech.api.enums.Materials; +import gregtech.api.enums.TAE; import gregtech.api.enums.Textures; +import gregtech.api.interfaces.IIconContainer; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; +import gregtech.api.interfaces.tileentity.IHasWorldObjectAndCoords; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_OutputBus; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GTPP_Recipe.GTPP_Recipe_Map; import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +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 gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; -import gtPlusPlus.api.objects.data.Triplet; -import gtPlusPlus.core.item.chemistry.general.ItemGenericChemBase; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; -import gtPlusPlus.core.recipe.common.CI; -import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_ElementalDataOrbHolder; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase { - - private int mSolidCasingTier = 0; - private int mMachineCasingTier = 0; - private int mPipeCasingTier = 0; - private int mCoilTier = 0; - private int checkCoil; - private int[] checkCasing = new int[8]; - private int checkMachine; - private int checkPipe; - private int maxTierOfHatch; - private int mCasing; - private IStructureDefinition<GregtechMTE_ElementalDuplicator> STRUCTURE_DEFINITION = null; +public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase<GregtechMTE_ElementalDuplicator> { private ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder> mReplicatorDataOrbHatches = new ArrayList<GT_MetaTileEntity_Hatch_ElementalDataOrbHolder>(); - - private static final HashMap<Integer, Triplet<Block, Integer, Integer>> mTieredBlockRegistry = new HashMap<Integer, Triplet<Block, Integer, Integer>>(); + private static final int CASING_TEXTURE_ID = TAE.getIndexFromPage(0, 3); + private int mCasing = 0; public GregtechMTE_ElementalDuplicator(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); @@ -81,28 +65,6 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase super(aName); } - public static boolean registerMachineCasingForTier(int aTier, Block aBlock, int aMeta, int aCasingTextureID) { - int aSize = mTieredBlockRegistry.size(); - int aSize2 = aSize; - Triplet<Block, Integer, Integer> aCasingData = new Triplet<Block, Integer, Integer>(aBlock, aMeta, aCasingTextureID); - if (mTieredBlockRegistry.containsKey(aTier)) { - CORE.crash("Tried to register a Machine casing for tier "+aTier+" to the Chemical Plant, however this tier already contains one."); - } - mTieredBlockRegistry.put(aTier, aCasingData); - aSize = mTieredBlockRegistry.size(); - return aSize > aSize2; - } - - private static int getCasingTextureIdForTier(int aTier) { - if (!mTieredBlockRegistry.containsKey(aTier)) { - return 10; - } - int aCasingID = mTieredBlockRegistry.get(aTier).getValue_3(); - //Logger.INFO("Found casing texture ID "+aCasingID+" for tier "+aTier); - return aCasingID; - } - - @Override public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { return new GregtechMTE_ElementalDuplicator(this.mName); } @@ -114,433 +76,467 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) - .addInfo("Controller Block for the Industrial Replication Machine") - .addInfo("Now replication is less painful") - .addInfo("Please read to user manual for more information on construction & usage") - .addSeparator() - .addController("Bottom Center") - .addStructureHint("Catalyst Housing", 1) - .addInputBus("Bottom Casing", 1) - .addOutputBus("Bottom Casing", 1) - .addInputHatch("Bottom Casing", 1) - .addOutputHatch("Bottom Casing", 1) - .addEnergyHatch("Bottom Casing", 1) - .addMaintenanceHatch("Bottom Casing", 1) - .toolTipFinisher(CORE.GT_Tooltip_Builder); + .addInfo("Produces Elemental Material from UU Matter") + .addInfo("Speed: 100% | Eu Usage: 100% | Parallel: 8 * Tier") + .addInfo("This multiblock cannot be overclocked") + .addInfo("Maximum 1x of each bus/hatch.") + .addInfo("Does not require both Output Hatch & Bus") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(9, 6, 9, true) + .addController("Top Center") + .addCasingInfo("Elemental Confinement Shell", 138) + .addCasingInfo("Matter Fabricator Casing", 24) + .addCasingInfo("Containment Casing", 24) + .addCasingInfo("Matter Generation Coil", 24) + .addCasingInfo("High Voltage Current Capacitor", 20) + .addCasingInfo("Resonance Chamber III", 24) + .addCasingInfo("Modulator III", 16) + .addOtherStructurePart("Data Orb Repository", "1x", 1) + .addInputHatch("Any 1 dot hint", 1) + .addOutputBus("Any 1 dot hint", 1) + .addOutputHatch("Any 1 dot hint", 1) + .addEnergyHatch("Any 1 dot hint", 1) + .addMaintenanceHatch("Any 1 dot hint", 1) + .addMufflerHatch("Any 1 dot hint", 1) + .toolTipFinisher(CORE.GT_Tooltip_Builder); return tt; } - public void setMachineMeta(int meta) { - checkMachine = meta; - } - public int getMachineMeta() { - return checkMachine; + private static final String STRUCTURE_PIECE_MAIN = "main"; + private IStructureDefinition<GregtechMTE_ElementalDuplicator> STRUCTURE_DEFINITION = null; + + @Override + public IStructureDefinition<GregtechMTE_ElementalDuplicator> getStructureDefinition() { + if (STRUCTURE_DEFINITION == null) { + STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ElementalDuplicator>builder() + + // h = Hatch + // c = Casing + + // a = MF Casing 1 + // b = Matter Gen Coil + + // d = Current Capacitor + // e = Particle + + // f = Resonance III + // g = Modulator III + + .addShape(STRUCTURE_PIECE_MAIN, (new String[][]{ + {" ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccch~hccc", "ccchhhccc", " ccccccc ", " ccccc ", " ccc "}, + {" cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", " abfgfba ", " abfba ", " cac "}, + {" cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", " e e ", " e e ", " cec "}, + {" cec ", " e e ", " e e ", "c d c", "e ddd e", "c d c", " e e ", " e e ", " cec "}, + {" cac ", " abfba ", " abfgfba ", "cbfgdgfbc", "afgdddgfa", "cbfgdgfbc", " abfgfba ", " abfba ", " cac "}, + {" ccc ", " ccccc ", " ccccccc ", "ccchhhccc", "ccchhhccc", "ccchhhccc", " ccccccc ", " ccccc ", " ccc "}, + })) + + + .addElement('a', ofBlock(getCasingBlock4(), getCasingMeta6())) + .addElement('b', ofBlock(getCasingBlock4(), getCasingMeta7())) + + .addElement('d', ofBlock(getCasingBlock2(), getCasingMeta2())) + .addElement('e', ofBlock(getCasingBlock2(), getCasingMeta3())) + + .addElement('f', ofBlock(getCasingBlock3(), getCasingMeta4())) + .addElement('g', ofBlock(getCasingBlock3(), getCasingMeta5())) + .addElement('c', lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())))) + .addElement('h', lazy(t -> ofChain( + ofHatchAdder(GregtechMTE_ElementalDuplicator::addGenericHatch, getCasingTextureIndex(), 1), + onElementPass(x -> ++x.mCasing, ofBlock(getCasingBlock(), getCasingMeta())) + ))) + .build(); + } + return STRUCTURE_DEFINITION; } - public void setPipeMeta(int meta) { - checkPipe = meta; + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN , stackSize, hintsOnly, 4, 4, 0); } - public int getPipeMeta() { - return checkPipe; + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + mCasing = 0; + boolean aDidBuild = checkPiece(STRUCTURE_PIECE_MAIN, 4, 4, 0); + if (this.mInputHatches.size() != 1 || (this.mOutputBusses.size() != 1 && this.mOutputHatches.size() !=0) || this.mEnergyHatches.size() != 1 || this.mReplicatorDataOrbHatches.size() != 1) { + return false; + } + log("Casings: "+mCasing); + return aDidBuild && mCasing >= 138 && checkHatch(); + } + + protected static int getCasingTextureIndex() { + return CASING_TEXTURE_ID; } - public void setCoilMeta(int meta) { - checkCoil = meta; + protected static Block getCasingBlock() { + return ModBlocks.blockCasings5Misc; } - public int getCoilMeta() { - return checkCoil; + protected static Block getCasingBlock2() { + return ModBlocks.blockSpecialMultiCasings; } - public int coilTier(int meta) { - switch (meta) { - case 0: return 1; - case 1: return 2; - case 2: return 3; - case 3: return 4; - case 4: return 5; - case 5: return 7; - case 6: return 8; - case 7: return 10; - case 8: return 11; - case 9: return 6; - case 10: return 9; - } - return 0; + protected static Block getCasingBlock3() { + return ModBlocks.blockSpecialMultiCasings2; } - @Override - public IStructureDefinition<GregtechMTE_ElementalDuplicator> getStructureDefinition() { - if (STRUCTURE_DEFINITION == null) { - STRUCTURE_DEFINITION = StructureDefinition.<GregtechMTE_ElementalDuplicator>builder() - .addShape(mName, transpose(new String[][]{ - {"XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX", "XXXXXXX"}, - {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"}, - {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"}, - {"X X", " ", " HHH ", " HHH ", " HHH ", " ", "X X"}, - {"X X", " ", " PPP ", " PPP ", " PPP ", " ", "X X"}, - {"X X", " MMMMM ", " MHHHM ", " MHHHM ", " MHHHM ", " MMMMM ", "X X"}, - {"CCC~CCC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CMMMMMC", "CCCCCCC"}, - })) - .addElement( - 'C', - ofChain( - ofHatchAdder( - GregtechMTE_ElementalDuplicator::addChemicalPlantList, getCasingTextureID(), 1 - ), - onElementPass( - x -> {++x.checkCasing[0]; ++x.mCasing;}, - ofSolidCasing(0) - ), - onElementPass( - x -> {++x.checkCasing[1]; ++x.mCasing;}, - ofSolidCasing(1) - ), - onElementPass( - x -> {++x.checkCasing[2]; ++x.mCasing;}, - ofSolidCasing(2) - ), - onElementPass( - x -> {++x.checkCasing[3]; ++x.mCasing;}, - ofSolidCasing(3) - ), - onElementPass( - x -> {++x.checkCasing[4]; ++x.mCasing;}, - ofSolidCasing(4) - ), - onElementPass( - x -> {++x.checkCasing[5]; ++x.mCasing;}, - ofSolidCasing(5) - ), - onElementPass( - x -> {++x.checkCasing[6]; ++x.mCasing;}, - ofSolidCasing(6) - ), - onElementPass( - x -> {++x.checkCasing[7]; ++x.mCasing;}, - ofSolidCasing(7) - ) - ) - ) - .addElement( - 'X', - ofChain( - onElementPass( - x -> {++x.checkCasing[0]; ++x.mCasing;}, - ofSolidCasing(0) - ), - onElementPass( - x -> {++x.checkCasing[1]; ++x.mCasing;}, - ofSolidCasing(1) - ), - onElementPass( - x -> {++x.checkCasing[2]; ++x.mCasing;}, - ofSolidCasing(2) - ), - onElementPass( - x -> {++x.checkCasing[3]; ++x.mCasing;}, - ofSolidCasing(3) - ), - onElementPass( - x -> {++x.checkCasing[4]; ++x.mCasing;}, - ofSolidCasing(4) - ), - onElementPass( - x -> {++x.checkCasing[5]; ++x.mCasing;}, - ofSolidCasing(5) - ), - onElementPass( - x -> {++x.checkCasing[6]; ++x.mCasing;}, - ofSolidCasing(6) - ), - onElementPass( - x -> {++x.checkCasing[7]; ++x.mCasing;}, - ofSolidCasing(7) - ) - ) - ) - .addElement( - 'M', - addTieredBlock( - GregTech_API.sBlockCasings1, GregtechMTE_ElementalDuplicator::setMachineMeta, GregtechMTE_ElementalDuplicator::getMachineMeta, 10 - ) - ) - .addElement( - 'H', - addTieredBlock( - GregTech_API.sBlockCasings5, GregtechMTE_ElementalDuplicator::setCoilMeta, GregtechMTE_ElementalDuplicator::getCoilMeta, 11 - ) - ) - .addElement( - 'P', - addTieredBlock( - GregTech_API.sBlockCasings2, GregtechMTE_ElementalDuplicator::setPipeMeta, GregtechMTE_ElementalDuplicator::getPipeMeta, 12, 16 - ) - ) - .build(); - } - return STRUCTURE_DEFINITION; + protected static Block getCasingBlock4() { + return ModBlocks.blockCasingsMisc; } - public static <T> IStructureElement<T> ofSolidCasing(int aIndex) { - return new IStructureElement<T>() { - @Override - public boolean check(T t, World world, int x, int y, int z) { - Block block = world.getBlock(x, y, z); - int meta = world.getBlockMetadata(x, y, z); - Block target = mTieredBlockRegistry.get(aIndex).getValue_1(); - int targetMeta = mTieredBlockRegistry.get(aIndex).getValue_2(); - return target.equals(block) && meta == targetMeta; - } + protected static int getCasingMeta() { + return 3; + } - int getIndex(int size) { - if (size > 8) size = 8; - return size - 1; - } + protected static int getCasingMeta2() { + return 12; + } - @Override - public boolean spawnHint(T t, World world, int x, int y, int z, ItemStack trigger) { - StructureLibAPI.hintParticle(world, x, y, z, mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2()); - return true; - } + protected static int getCasingMeta3() { + return 13; + } - @Override - public boolean placeBlock(T t, World world, int x, int y, int z, ItemStack trigger) { - return world.setBlock(x, y, z, mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_1(), mTieredBlockRegistry.get(getIndex(trigger.stackSize)).getValue_2(), 3); - } - }; + protected static int getCasingMeta4() { + return 2; } - @Override - public void construct(ItemStack stackSize, boolean hintsOnly) { - buildPiece(mName , stackSize, hintsOnly, 3, 6, 0); + protected static int getCasingMeta5() { + return 6; } - @Override - public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - mCasing = 0; - for (int i = 0; i < 8; i++) { - checkCasing[i] = 0; - } - checkCoil = 0; - checkPipe = 0; - checkMachine = 0; - mSolidCasingTier = 0; - mMachineCasingTier = 0; - mPipeCasingTier = 0; - mCoilTier = 0; - mReplicatorDataOrbHatches.clear(); - if (checkPiece(mName, 3, 6, 0) && mCasing >= 80) { - for (int i = 0; i < 8; i++) { - if (checkCasing[i] == mCasing) { - mSolidCasingTier = i; - } - else if (checkCasing[i] > 0) - return false; - } - mMachineCasingTier = checkMachine - 1; - mPipeCasingTier = checkPipe - 12; - mCoilTier = coilTier(checkCoil - 1); - updateHatchTexture(); - return mMachineCasingTier >= maxTierOfHatch; - } - return false; + protected static int getCasingMeta6() { + return 9; } - public void updateHatchTexture() { - for (GT_MetaTileEntity_Hatch h : mReplicatorDataOrbHatches) h.updateTexture(getCasingTextureID()); - for (GT_MetaTileEntity_Hatch h : mInputBusses) h.updateTexture(getCasingTextureID()); - for (GT_MetaTileEntity_Hatch h : mMaintenanceHatches) h.updateTexture(getCasingTextureID()); - for (GT_MetaTileEntity_Hatch h : mEnergyHatches) h.updateTexture(getCasingTextureID()); - for (GT_MetaTileEntity_Hatch h : mOutputBusses) h.updateTexture(getCasingTextureID()); - for (GT_MetaTileEntity_Hatch h : mInputHatches) h.updateTexture(getCasingTextureID()); - for (GT_MetaTileEntity_Hatch h : mOutputHatches) h.updateTexture(getCasingTextureID()); + protected static int getCasingMeta7() { + return 8; } - public final boolean addChemicalPlantList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + public final boolean addGenericHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; - } else { + } + else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder){ - return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus){ - maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy){ - maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { - maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_OutputBus) aMetaTileEntity).mTier); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { - maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Input) aMetaTileEntity).mTier); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_OutputBus) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { - maxTierOfHatch = Math.max(maxTierOfHatch, ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy) { return addToMachineList(aTileEntity, aBaseCasingIndex); } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) { + try { + ((GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) aMetaTileEntity).mRecipeMap = getRecipeMap(); + return addToMachineListInternal(mReplicatorDataOrbHatches, aMetaTileEntity, aBaseCasingIndex); + } + catch (Throwable t) { + t.printStackTrace(); + } + } } return false; } - @Override - public String getSound() { - return GregTech_API.sSoundList.get(Integer.valueOf(207)); - } - - @Override - public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { - - ITexture aOriginalTexture; - - // Check things exist client side (The worst code ever) - if (aBaseMetaTileEntity.getWorld() != null) { - - } - int aCasingID = getCasingTextureID(); - aOriginalTexture = Textures.BlockIcons.getCasingTextureForId(aCasingID); - + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == aFacing) { - return new ITexture[]{aOriginalTexture, new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced)}; + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID), + new GT_RenderedTexture((IIconContainer) (aActive ? TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active : TexturesGtBlock.Overlay_Machine_Controller_Advanced))}; } - return new ITexture[]{aOriginalTexture}; + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(CASING_TEXTURE_ID)}; } @Override public boolean hasSlotInGUI() { - return true; + return false; } @Override - public GT_Recipe.GT_Recipe_Map getRecipeMap() { - if (GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList.size() == 0) { - generateRecipes(); - } - return GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT; - } - - public static void generateRecipes() { - for (GT_Recipe i : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlantRecipes.mRecipeList) { - GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.add(i); - } + public boolean requiresVanillaGtGUI() { + return false; } @Override - public int getMaxParallelRecipes() { - return 2 * getPipeCasingTier(); + public String getCustomGUIResourceName() { + return null; } - @Override - public int getEuDiscountForParallelism() { - return 100; + public GT_Recipe.GT_Recipe_Map getRecipeMap() { + return GTPP_Recipe_Map.sElementalDuplicatorRecipes; } - private int getSolidCasingTier() { - return this.mSolidCasingTier; + public boolean isCorrectMachinePart(final ItemStack aStack) { + return true; } - private int getMachineCasingTier() { - return mMachineCasingTier; + @Override + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric(getMaxParallelRecipes(), 100, 100); } - private int getPipeCasingTier() { - return mPipeCasingTier; - } - private int getCasingTextureID() { - // Check the Tier Client Side - int aTier = mSolidCasingTier; - int aCasingID = getCasingTextureIdForTier(aTier); - return aCasingID; - } + @Override + public boolean checkRecipeGeneric( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { + // Based on the Processing Array. A bit overkill, but very flexible. - public boolean addToMachineList(IGregTechTileEntity aTileEntity) { - int aMaxTier = getMachineCasingTier(); - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_TieredMachineBlock) { - GT_MetaTileEntity_TieredMachineBlock aMachineBlock = (GT_MetaTileEntity_TieredMachineBlock) aMetaTileEntity; - int aTileTier = aMachineBlock.mTier; - if (aTileTier > aMaxTier) { - log("Hatch tier too high."); - return false; + // Reset outputs and progress stats + this.mEUt = 0; + this.mMaxProgresstime = 0; + this.mOutputItems = new ItemStack[]{}; + this.mOutputFluids = new FluidStack[]{}; + + long tVoltage = getMaxInputVoltage(); + byte tTier = (byte) Math.max(1, GT_Utility.getTier(tVoltage)); + long tEnergy = getMaxInputEnergy(); + log("Running checkRecipeGeneric(0)"); + + GT_Recipe tRecipe = null; + + try { + log("Checking "+aItemInputs.length+" Data Orbs"); + + for (int i=0;i<aItemInputs.length;i++) { + ItemStack aItem = aItemInputs[i]; + log("Found: "+aItem.getDisplayName()); + } + ItemStack aDataOrbStack = null; + recipe : for (GT_Recipe nRecipe : this.getRecipeMap().mRecipeList) { + log("Checking Recipe for: "+(nRecipe.mOutputs.length > 0 && nRecipe.mOutputs[0] != null ? nRecipe.mOutputs[0].getDisplayName() : nRecipe.mFluidOutputs[0].getLocalizedName())); + ItemStack aTempStack = getSpecialSlotStack(nRecipe); + if (aTempStack != null) { + for (ItemStack aItem : aItemInputs) { + if (nRecipe.mSpecialItems != null) { + if (GT_Utility.areStacksEqual(aTempStack, aItem, false)) { + Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(aTempStack)).mLinkedMaterials.get(0); + log("Found: "+aTempStack.getDisplayName()+" for "+tMaterial.name()); + aDataOrbStack = aTempStack; + break recipe; + } + } + } + } + } + if (aDataOrbStack != null) { + tRecipe = findRecipe( + getBaseMetaTileEntity(), mLastRecipe, false, false, + gregtech.api.enums.GT_Values.V[tTier], aFluidInputs, aDataOrbStack, aItemInputs); + if (tRecipe != null) { + Materials tMaterial = Element.get(Behaviour_DataOrb.getDataName(aDataOrbStack)).mLinkedMaterials.get(0); + log("Found recipe for "+tMaterial.name()); + } + else { + log("No Recipe Found"); + } } else { - return addToMachineList(aTileEntity, getCasingTextureID()); + log("Null DO"); } + } - else { - log("Bad Tile Entity being added to hatch map."); // Shouldn't ever happen, but.. ya know.. + catch (Throwable t) { + t.printStackTrace(); + } + + + + log("Running checkRecipeGeneric(1)"); + // Remember last recipe - an optimization for findRecipe() + this.mLastRecipe = tRecipe; + + if (tRecipe == null) { + log("BAD RETURN - 1"); return false; - } - } + } - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("mSolidCasingTier", this.mSolidCasingTier); - aNBT.setInteger("mMachineCasingTier", this.mMachineCasingTier); - aNBT.setInteger("mPipeCasingTier", this.mPipeCasingTier); - aNBT.setInteger("mCoilTier", this.mCoilTier); + aMaxParallelRecipes = this.canBufferOutputs(tRecipe, aMaxParallelRecipes); + if (aMaxParallelRecipes == 0) { + log("BAD RETURN - 2"); + return false; + } + + // EU discount + float tRecipeEUt = (tRecipe.mEUt * aEUPercent) / 100.0f; + float tTotalEUt = 0.0f; + + int parallelRecipes = 0; + + log("parallelRecipes: "+parallelRecipes); + log("aMaxParallelRecipes: "+aMaxParallelRecipes); + log("tTotalEUt: "+tTotalEUt); + log("tVoltage: "+tVoltage); + log("tRecipeEUt: "+tRecipeEUt); + // Count recipes to do in parallel, consuming input items and fluids and considering input voltage limits + for (; parallelRecipes < aMaxParallelRecipes && tTotalEUt < (tEnergy - tRecipeEUt); parallelRecipes++) { + if (!tRecipe.isRecipeInputEqual(true, aFluidInputs, aItemInputs)) { + log("Broke at "+parallelRecipes+"."); + break; + } + log("Bumped EU from "+tTotalEUt+" to "+(tTotalEUt+tRecipeEUt)+"."); + tTotalEUt += tRecipeEUt; + } + + if (parallelRecipes == 0) { + log("BAD RETURN - 3"); + return false; + } + + // -- Try not to fail after this point - inputs have already been consumed! -- + + + + // Convert speed bonus to duration multiplier + // e.g. 100% speed bonus = 200% speed = 100%/200% = 50% recipe duration. + aSpeedBonusPercent = Math.max(-99, aSpeedBonusPercent); + float tTimeFactor = 100.0f / (100.0f + aSpeedBonusPercent); + this.mMaxProgresstime = (int)(tRecipe.mDuration * tTimeFactor); + + this.mEUt = (int)Math.ceil(tTotalEUt); + + this.mEfficiency = (10000 - (getIdealStatus() - getRepairStatus()) * 1000); + this.mEfficiencyIncrease = 10000; + + // Overclock + if (this.mEUt <= 16) { + this.mEUt = (this.mEUt * (1 << tTier - 1) * (1 << tTier - 1)); + this.mMaxProgresstime = (this.mMaxProgresstime / (1 << tTier - 1)); + } else { + while (this.mEUt <= gregtech.api.enums.GT_Values.V[(tTier - 1)]) { + this.mEUt *= 4; + this.mMaxProgresstime /= 4; + } + } + + if (this.mEUt > 0) { + this.mEUt = (-this.mEUt); + } + + this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime); + + // Collect fluid outputs + FluidStack[] tOutputFluids = new FluidStack[tRecipe.mFluidOutputs.length]; + for (int h = 0; h < tRecipe.mFluidOutputs.length; h++) { + if (tRecipe.getFluidOutput(h) != null) { + tOutputFluids[h] = tRecipe.getFluidOutput(h).copy(); + tOutputFluids[h].amount *= parallelRecipes; + } + } + + // Collect output item types + ItemStack[] tOutputItems = new ItemStack[tRecipe.mOutputs.length]; + for (int h = 0; h < tRecipe.mOutputs.length; h++) { + if (tRecipe.getOutput(h) != null) { + tOutputItems[h] = tRecipe.getOutput(h).copy(); + tOutputItems[h].stackSize = 0; + } + } + + // Set output item stack sizes (taking output chance into account) + for (int f = 0; f < tOutputItems.length; f++) { + if (tRecipe.mOutputs[f] != null && tOutputItems[f] != null) { + for (int g = 0; g < parallelRecipes; g++) { + if (getBaseMetaTileEntity().getRandomNumber(aOutputChanceRoll) < tRecipe.getOutputChance(f)) + tOutputItems[f].stackSize += tRecipe.mOutputs[f].stackSize; + } + } + } + + tOutputItems = removeNulls(tOutputItems); + + // Sanitize item stack size, splitting any stacks greater than max stack size + List<ItemStack> splitStacks = new ArrayList<ItemStack>(); + for (ItemStack tItem : tOutputItems) { + while (tItem.getMaxStackSize() < tItem.stackSize) { + ItemStack tmp = tItem.copy(); + tmp.stackSize = tmp.getMaxStackSize(); + tItem.stackSize = tItem.stackSize - tItem.getMaxStackSize(); + splitStacks.add(tmp); + } + } + + if (splitStacks.size() > 0) { + ItemStack[] tmp = new ItemStack[splitStacks.size()]; + tmp = splitStacks.toArray(tmp); + tOutputItems = ArrayUtils.addAll(tOutputItems, tmp); + } + + // Strip empty stacks + List<ItemStack> tSList = new ArrayList<ItemStack>(); + for (ItemStack tS : tOutputItems) { + if (tS.stackSize > 0) tSList.add(tS); + } + tOutputItems = tSList.toArray(new ItemStack[tSList.size()]); + + // Commit outputs + this.mOutputItems = tOutputItems; + this.mOutputFluids = tOutputFluids; + updateSlots(); + + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + + log("GOOD RETURN - 1"); + return true; } + @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - mSolidCasingTier = aNBT.getInteger("mSolidCasingTier"); - mMachineCasingTier = aNBT.getInteger("mMachineCasingTier"); - mPipeCasingTier = aNBT.getInteger("mPipeCasingTier"); - mCoilTier = aNBT.getInteger("mCoilTier"); + public int getMaxParallelRecipes() { + return (8 * GT_Utility.getTier(this.getMaxInputVoltage())); } @Override - public boolean addToMachineList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) { - log("Found GT_MetaTileEntity_Hatch_ElementalDataOrbHolder"); - ((GT_MetaTileEntity_Hatch_ElementalDataOrbHolder) aTileEntity).mRecipeMap = getRecipeMap(); - return addToMachineListInternal(mReplicatorDataOrbHatches, aMetaTileEntity, aBaseCasingIndex); - } - return super.addToMachineList(aTileEntity, aBaseCasingIndex); + public int getEuDiscountForParallelism() { + return 100; } - @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; } - @Override - public int getPollutionPerTick(final ItemStack aStack) { - return 100; + public int getPollutionPerSecond(final ItemStack aStack) { + return CORE.ConfigSwitches.pollutionPerSecondMultiMolecularTransformer; } - @Override - public int getAmountOfOutputs() { - return 1; + public int getDamageToComponent(final ItemStack aStack) { + return 0; } - @Override public boolean explodesOnComponentBreak(final ItemStack aStack) { return false; } @Override - public String getCustomGUIResourceName() { - return null; - } - - // Same speed bonus as pyro oven - public int getSpeedBonus() { - return 50 * (this.mCoilTier - 2); + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + // Fix GT bug + if (this.getBaseMetaTileEntity().getFrontFacing() != 1) { + this.getBaseMetaTileEntity().setFrontFacing((byte) 1); + } } @Override @@ -554,191 +550,136 @@ public class GregtechMTE_ElementalDuplicator extends GregtechMeta_MultiBlockBase } @Override - public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPreTick(aBaseMetaTileEntity, aTick); - } - - @Override - public boolean checkRecipe(final ItemStack aStack) { - return checkRecipeGeneric(getMaxParallelRecipes(), getEuDiscountForParallelism(), getSpeedBonus()); + public ArrayList<ItemStack> getStoredInputs() { + ArrayList<ItemStack> tItems = super.getStoredInputs(); + for (GT_MetaTileEntity_Hatch_ElementalDataOrbHolder tHatch : mReplicatorDataOrbHatches) { + tHatch.mRecipeMap = getRecipeMap(); + if (isValidMetaTileEntity(tHatch)) { + tItems.addAll(tHatch.getInventory()); + } + } + tItems.removeAll(Collections.singleton(null)); + return tItems; } + /** + * finds a Recipe matching the aFluid and ItemStack Inputs. + * + * @param aTileEntity an Object representing the current coordinates of the executing Block/Entity/Whatever. This may be null, especially during Startup. + * @param aRecipe in case this is != null it will try to use this Recipe first when looking things up. + * @param aNotUnificated if this is T the Recipe searcher will unificate the ItemStack Inputs + * @param aDontCheckStackSizes if set to false will only return recipes that can be executed at least once with the provided input + * @param aVoltage Voltage of the Machine or Long.MAX_VALUE if it has no Voltage + * @param aFluids the Fluid Inputs + * @param aSpecialSlot the content of the Special Slot, the regular Manager doesn't do anything with this, but some custom ones do. + * @param aInputs the Item Inputs + * @return the Recipe it has found or null for no matching Recipe + */ + public GT_Recipe findRecipe(IHasWorldObjectAndCoords aTileEntity, GT_Recipe aRecipe, boolean aNotUnificated, boolean aDontCheckStackSizes, long aVoltage, FluidStack[] aFluids, ItemStack aSpecialSlot, ItemStack... aInputs) { - @Override - public boolean checkRecipeGeneric( - ItemStack[] aItemInputs, FluidStack[] aFluidInputs, - int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isOC) { - return false; - } - - private static final HashMap<Long, AutoMap<GT_Recipe>> mTieredRecipeMap = new HashMap<Long, AutoMap<GT_Recipe>>(); - private static final AutoMap<GT_Recipe> aTier0Recipes = new AutoMap<GT_Recipe>(); - private static final AutoMap<GT_Recipe> aTier1Recipes = new AutoMap<GT_Recipe>(); - private static final AutoMap<GT_Recipe> aTier2Recipes = new AutoMap<GT_Recipe>(); - private static final AutoMap<GT_Recipe> aTier3Recipes = new AutoMap<GT_Recipe>(); - private static final AutoMap<GT_Recipe> aTier4Recipes = new AutoMap<GT_Recipe>(); - private static final AutoMap<GT_Recipe> aTier5Recipes = new AutoMap<GT_Recipe>(); - private static final AutoMap<GT_Recipe> aTier6Recipes = new AutoMap<GT_Recipe>(); - private static final AutoMap<GT_Recipe> aTier7Recipes = new AutoMap<GT_Recipe>(); - private static boolean mInitRecipeCache = false; - - private static void initRecipeCaches() { - if (!mInitRecipeCache) { - mTieredRecipeMap.put((long) 0, aTier0Recipes); - mTieredRecipeMap.put((long) 1, aTier1Recipes); - mTieredRecipeMap.put((long) 2, aTier2Recipes); - mTieredRecipeMap.put((long) 3, aTier3Recipes); - mTieredRecipeMap.put((long) 4, aTier4Recipes); - mTieredRecipeMap.put((long) 5, aTier5Recipes); - mTieredRecipeMap.put((long) 6, aTier6Recipes); - mTieredRecipeMap.put((long) 7, aTier7Recipes); - for (GT_Recipe aRecipe : GTPP_Recipe.GTPP_Recipe_Map.sChemicalPlant_GT.mRecipeList) { - if (aRecipe != null) { - switch (aRecipe.mSpecialValue) { - case 0: - aTier0Recipes.add(aRecipe); - continue; - case 1: - aTier1Recipes.add(aRecipe); - continue; - case 2: - aTier2Recipes.add(aRecipe); - continue; - case 3: - aTier3Recipes.add(aRecipe); - continue; - case 4: - aTier4Recipes.add(aRecipe); - continue; - case 5: - aTier5Recipes.add(aRecipe); - continue; - case 6: - aTier6Recipes.add(aRecipe); - continue; - case 7: - aTier7Recipes.add(aRecipe); - continue; - } - } - } - mInitRecipeCache = true; + GT_Recipe_Map mRecipeMap = this.getRecipeMap(); + // No Recipes? Well, nothing to be found then. + if (mRecipeMap.mRecipeList.isEmpty()) { + return null; } - } - private static boolean areInputsEqual(GT_Recipe aComparator, ItemStack[] aInputs, FluidStack[] aFluids) { - int aInputCount = aComparator.mInputs.length; - if (aInputCount > 0) { - //Logger.INFO("Looking for recipe with "+aInputCount+" Items"); - int aMatchingInputs = 0; - recipe : for (ItemStack a : aComparator.mInputs) { - for (ItemStack b : aInputs) { - if (a.getItem() == b.getItem()) { - if (a.getItemDamage() == b.getItemDamage()) { - //Logger.INFO("Found matching Item Input - "+b.getUnlocalizedName()); - aMatchingInputs++; - continue recipe; - } - } - } - } - if (aMatchingInputs != aInputCount) { - return false; - } - } - int aFluidInputCount = aComparator.mFluidInputs.length; - if (aFluidInputCount > 0) { - //Logger.INFO("Looking for recipe with "+aFluidInputCount+" Fluids"); - int aMatchingFluidInputs = 0; - recipe : for (FluidStack b : aComparator.mFluidInputs) { - //Logger.INFO("Checking for fluid "+b.getLocalizedName()); - for (FluidStack a : aFluids) { - if (GT_Utility.areFluidsEqual(a, b)) { - //Logger.INFO("Found matching Fluid Input - "+b.getLocalizedName()); - aMatchingFluidInputs++; - continue recipe; - } - else { - //Logger.INFO("Found fluid which did not match - "+a.getLocalizedName()); - } - } + // Some Recipe Classes require a certain amount of Inputs of certain kinds. Like "at least 1 Fluid + 1 Stack" or "at least 2 Stacks" before they start searching for Recipes. + // This improves Performance massively, especially if people leave things like Circuits, Molds or Shapes in their Machines to select Sub Recipes. + if (GregTech_API.sPostloadFinished) { + if (mRecipeMap.mMinimalInputFluids > 0) { + if (aFluids == null) return null; + int tAmount = 0; + for (FluidStack aFluid : aFluids) if (aFluid != null) tAmount++; + if (tAmount < mRecipeMap.mMinimalInputFluids) return null; } - if (aMatchingFluidInputs != aFluidInputCount) { - return false; + if (mRecipeMap.mMinimalInputItems > 0) { + if (aInputs == null) return null; + int tAmount = 0; + for (ItemStack aInput : aInputs) if (aInput != null) tAmount++; + if (tAmount < mRecipeMap.mMinimalInputItems) return null; } } - Logger.INFO("Recipes Match!"); - return true; - } - public GT_Recipe findRecipe(final GT_Recipe aRecipe, final long aVoltage, final long aSpecialValue, ItemStack[] aInputs, final FluidStack[] aFluids) { - if (!mInitRecipeCache) { - initRecipeCaches(); + // Unification happens here in case the Input isn't already unificated. + if (aNotUnificated) { + aInputs = GT_OreDictUnificator.getStackArray(true, (Object[]) aInputs); } - if (this.getRecipeMap().mRecipeList.isEmpty()) { - log("No Recipes in Map to search through."); - return null; + + // Check the Recipe which has been used last time in order to not have to search for it again, if possible. + if (aRecipe != null) { + ItemStack aRecipeSpecial = getSpecialSlotStack(aRecipe); + if (!aRecipe.mFakeRecipe && aRecipe.mCanBeBuffered && aRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs) && GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { + return aRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= aRecipe.mEUt ? aRecipe : null; + } } - else { - log("Checking tier "+aSpecialValue+" recipes and below. Using Input Voltage of "+aVoltage+"V."); - log("We have "+aInputs.length+" Items and "+aFluids.length+" Fluids."); - // Try check the cached recipe first - if (aRecipe != null) { - if (areInputsEqual(aRecipe, aInputs, aFluids)) { - if (aRecipe.mEUt <= aVoltage) { - Logger.INFO("Using cached recipe."); - return aRecipe; + + // Now look for the Recipes inside the Item HashMaps, but only when the Recipes usually have Items. + if (mRecipeMap.mUsualInputCount > 0 && aInputs != null) for (ItemStack tStack : aInputs) + if (tStack != null) { + Collection<GT_Recipe> tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack)); + if (tRecipes != null) { + for (GT_Recipe tRecipe : tRecipes) { + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); + if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { + return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt ? tRecipe : null; + } + } + tRecipes = mRecipeMap.mRecipeItemMap.get(new GT_ItemStack(tStack, true)); } } - } - - // Get all recipes for the tier - AutoMap<AutoMap<GT_Recipe>> aMasterMap = new AutoMap<AutoMap<GT_Recipe>>(); - for (long i=0;i<=aSpecialValue;i++) { - aMasterMap.add(mTieredRecipeMap.get(i)); - } - GT_Recipe aFoundRecipe = null; - - // Iterate the tiers recipes until we find the one with all inputs matching - master : for (AutoMap<GT_Recipe> aTieredMap : aMasterMap) { - for (GT_Recipe aRecipeToCheck : aTieredMap) { - if (areInputsEqual(aRecipeToCheck, aInputs, aFluids)) { - log("Found recipe with matching inputs!"); - if (aRecipeToCheck.mSpecialValue <= aSpecialValue) { - if (aRecipeToCheck.mEUt <= aVoltage) { - aFoundRecipe = aRecipeToCheck; - break master; + if (tRecipes != null) { + for (GT_Recipe tRecipe : tRecipes) { + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); + if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { + return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt ? tRecipe : null; } - } + } } } } - // If we found a recipe, return it - if (aFoundRecipe != null) { - log("Found valid recipe."); - return aFoundRecipe; + // If the minimal Amount of Items for the Recipe is 0, then it could be a Fluid-Only Recipe, so check that Map too. + if (mRecipeMap.mMinimalInputItems == 0 && aFluids != null) for (FluidStack aFluid : aFluids) + if (aFluid != null) { + Collection<GT_Recipe> + tRecipes = mRecipeMap.mRecipeFluidMap.get(aFluid.getFluid()); + if (tRecipes != null) for (GT_Recipe tRecipe : tRecipes) { + if (!tRecipe.mFakeRecipe && tRecipe.isRecipeInputEqual(false, aDontCheckStackSizes, aFluids, aInputs)) { + ItemStack aRecipeSpecial = getSpecialSlotStack(tRecipe); + if (GT_Utility.areStacksEqual(aRecipeSpecial, aSpecialSlot, false) && areDataOrbsEqual(aRecipeSpecial, aSpecialSlot)) { + return tRecipe.mEnabled && aVoltage * mRecipeMap.mAmperage >= tRecipe.mEUt ? tRecipe : null; + } + } + } } - } - log("Did not find valid recipe."); + + // And nothing has been found. return null; } - /* - * Catalyst Handling - */ + public static ItemStack getSpecialSlotStack(GT_Recipe aRecipe) { + ItemStack aStack = null; + if (aRecipe.mSpecialItems != null) { + if (aRecipe.mSpecialItems instanceof ItemStack[]) { + ItemStack[] aTempStackArray = (ItemStack[]) aRecipe.mSpecialItems; + aStack = aTempStackArray[0]; + } + } + return aStack; + } - @Override - public ArrayList<ItemStack> getStoredInputs() { - ArrayList<ItemStack> tItems = super.getStoredInputs(); - for (GT_MetaTileEntity_Hatch_ElementalDataOrbHolder tHatch : mReplicatorDataOrbHatches) { - tHatch.mRecipeMap = getRecipeMap(); - if (isValidMetaTileEntity(tHatch)) { - tItems.addAll(tHatch.getInventory()); + private static boolean areDataOrbsEqual(ItemStack aOrb1, ItemStack aOrb2) { + if (aOrb1 != null && aOrb2 != null) { + Materials tMaterial1 = Element.get(Behaviour_DataOrb.getDataName(aOrb1)).mLinkedMaterials.get(0); + Materials tMaterial2 = Element.get(Behaviour_DataOrb.getDataName(aOrb2)).mLinkedMaterials.get(0); + if (tMaterial1.equals(tMaterial2)) { + return true; } - } - return tItems; + } + + return false; } -} +}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java index 25b8865f55..715ef30697 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMTE_FrothFlotationCell.java @@ -1,19 +1,18 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; import static gtPlusPlus.core.util.data.ArrayUtils.removeNulls; import java.util.ArrayList; import java.util.List; +import org.apache.commons.lang3.ArrayUtils; + import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.metatileentity.implementations.*; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gtPlusPlus.core.lib.CORE; -import org.apache.commons.lang3.ArrayUtils; import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; @@ -21,10 +20,16 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Energy; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -34,7 +39,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; -public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase { +public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase<GregtechMTE_FrothFlotationCell> { private int mCasing; private IStructureDefinition<GregtechMTE_FrothFlotationCell> STRUCTURE_DEFINITION = null; @@ -67,7 +72,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase .beginStructureBlock(3, 3, 3, true) .addController("Front Center") .addCasingInfo("Inconel Reinforced Casing", 68) - .addCasingInfo("Flotation Casings", 52) + .addCasingInfo("Flotation Casing", 52) .addInputBus("Bottom Casing", 1) .addInputHatch("Bottom Casing", 1) .addOutputHatch("Bottom Casing", 1) @@ -222,7 +227,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPreTick(aBaseMetaTileEntity, aTick); // Fix GT bug - if (this.getBaseMetaTileEntity().getFrontFacing() == 0 && this.getBaseMetaTileEntity().getBackFacing() == 1) { + if (this.getBaseMetaTileEntity().getFrontFacing() != 1) { log("Fixing Bad Facing. (GT Bug)"); this.getBaseMetaTileEntity().setFrontFacing((byte) 1); } @@ -233,6 +238,7 @@ public class GregtechMTE_FrothFlotationCell extends GregtechMeta_MultiBlockBase return super.checkRecipeGeneric(); } + @Override public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java index cccee84c99..fabbd42924 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityGeneratorArray.java @@ -33,7 +33,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntityGeneratorArray extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityGeneratorArray> { private int mCasing; private IStructureDefinition<GregtechMetaTileEntityGeneratorArray> STRUCTURE_DEFINITION = null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java index 83b8eae458..2b5320de20 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntityTreeFarm.java @@ -29,10 +29,10 @@ import net.minecraft.item.ItemStack; import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntityTreeFarm> { public static int CASING_TEXTURE_ID; - public static String mCasingName = "Advanced Cryogenic Casing"; + public static String mCasingName = "Sterile Farm Casing"; public static TreeGenerator mTreeData; private int mCasing; private IStructureDefinition<GregtechMetaTileEntityTreeFarm> STRUCTURE_DEFINITION = null; @@ -51,13 +51,11 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase public GregtechMetaTileEntityTreeFarm(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); CASING_TEXTURE_ID = TAE.getIndexFromPage(1, 15); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings2Misc, 15); } public GregtechMetaTileEntityTreeFarm(final String aName) { super(aName); CASING_TEXTURE_ID = TAE.getIndexFromPage(1, 15); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings2Misc, 15); } public IMetaTileEntity newMetaEntity(final IGregTechTileEntity aTileEntity) { @@ -71,9 +69,6 @@ public class GregtechMetaTileEntityTreeFarm extends GregtechMeta_MultiBlockBase @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings2Misc, 15); - } GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Converts EU to Oak Logs") diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java index 323efa2193..06983572af 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_AlloyBlastSmelter.java @@ -33,8 +33,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_AlloyBlastSmelter -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_AlloyBlastSmelter extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_AlloyBlastSmelter> { private int mMode = 0; private boolean isUsingControllerCircuit = false; @@ -68,6 +67,7 @@ extends GregtechMeta_MultiBlockBase { .addInfo("Controller Block for the Alloy Blast Smelter") .addInfo("20% Faster than the Electric Blast Furnace") .addInfo("Allows Complex GT++ alloys to be created") + .addInfo("This multiblock cannot be overclocked") .addInfo("Circuit for recipe goes in the Input Bus or GUI slot") .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java index 7514a3dea6..1b24b8f264 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Cyclotron.java @@ -34,7 +34,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Cyclotron> { private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_Cyclotron> STRUCTURE_DEFINITION = null; @@ -203,6 +203,8 @@ public class GregtechMetaTileEntity_Cyclotron extends GregtechMeta_MultiBlockBas IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus && ((GT_MetaTileEntity_Hatch_InputBus) aMetaTileEntity).mTier >= 5){ return addToMachineList(aTileEntity, aBaseCasingIndex); + } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output && ((GT_MetaTileEntity_Hatch_Output) aMetaTileEntity).mTier >= 5) { + return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ return addToMachineList(aTileEntity, aBaseCasingIndex); } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Energy && ((GT_MetaTileEntity_Hatch_Energy) aMetaTileEntity).mTier >= 5){ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java index 80eb09640d..26a744612a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_IndustrialFishingPond.java @@ -39,7 +39,7 @@ import net.minecraft.util.WeightedRandomFishable; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_IndustrialFishingPond extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_IndustrialFishingPond> { private boolean isUsingControllerCircuit = false; private static final Item circuit = CI.getNumberedCircuit(0).getItem(); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java index d9162cea89..28d82bc492 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeRocketEngine.java @@ -1,28 +1,28 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import java.util.ArrayList; import java.util.Collection; import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.TAE; -import gregtech.api.enums.Textures; + +import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; -import gregtech.api.util.GT_Multiblock_Tooltip_Builder; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GTPP_Recipe; +import gregtech.api.util.*; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.item.chemistry.RocketFuels; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.util.minecraft.FluidUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_AirIntake; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler_Adv; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; @@ -31,12 +31,9 @@ import net.minecraft.block.Block; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; -import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; -import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; - public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeRocketEngine> { protected int fuelConsumption; @@ -52,6 +49,9 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi public static String mCasingName = "Turbodyne Casing"; public static String mIntakeHatchName = "Tungstensteel Turbine Casing"; public static String mGearboxName = "Inconel Reinforced Casing"; + + private static Fluid sAirFluid = null; + private static FluidStack sAirFluidStack = null; private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_LargeRocketEngine> STRUCTURE_DEFINITION = null; @@ -64,6 +64,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi this.fuelValue = 0; this.fuelRemaining = 0; this.boostEu = false; + setAir(); } public GregtechMetaTileEntity_LargeRocketEngine(final String aName) { @@ -72,26 +73,11 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi this.fuelValue = 0; this.fuelRemaining = 0; this.boostEu = false; + setAir(); } @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 11); - } - if (mIntakeHatchName.toLowerCase().contains(".name")) { - mIntakeHatchName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 11); - } - if (mGearboxName.toLowerCase().contains(".name")) { - mGearboxName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 1); - } - if (mLubricantName.toLowerCase().contains(".")) { - mLubricantName = FluidUtils.getFluidStack("carbondioxide", 1).getLocalizedName(); - } - if (mCoolantName.toLowerCase().contains(".")) { - mCoolantName = FluidUtils.getFluidStack("liquidhydrogen", 1).getLocalizedName(); - } - GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Controller Block for the Large Rocket Engine") @@ -111,7 +97,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi .addStructureHint("Air Intake Hatch", 1) .addInputBus("Side center line", 1) .addInputHatch("Side center line", 1) - .addMaintenanceHatch("Side center line", 1) + .addMaintenanceHatch("Any Block Touching Inconel Reinforced Casing", 1) .addDynamoHatch("Top center line", 2) .addMufflerHatch("Back Center", 3) .toolTipFinisher(CORE.GT_Tooltip_Builder); @@ -123,7 +109,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi if (STRUCTURE_DEFINITION == null) { STRUCTURE_DEFINITION = StructureDefinition.<GregtechMetaTileEntity_LargeRocketEngine>builder() .addShape(mName, transpose(new String[][]{ - {"CCC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CCC"}, + {"CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC", "CTC"}, {"C~C", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "SIS", "CMC"}, {"CCC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CSC", "CCC"}, })) @@ -195,13 +181,19 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi public final boolean addLargeRocketEngineTopList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; - } else { + } + else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } if (LoadedMods.TecTech) { + } + if (LoadedMods.TecTech) { if (isThisHatchMultiDynamo(aMetaTileEntity)) { return addToMachineList(aTileEntity, aBaseCasingIndex); } @@ -213,15 +205,19 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi public final boolean addLargeRocketEngineSideList(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { if (aTileEntity == null) { return false; - } else { + } + else { IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_AirIntake) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { return addToMachineList(aTileEntity, aBaseCasingIndex); - } else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { return addToMachineList(aTileEntity, aBaseCasingIndex); } } @@ -257,19 +253,28 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { return super.getClientGUI(aID, aPlayerInventory, aBaseMetaTileEntity); } + + public static void setAir() { + if (sAirFluidStack == null) { + sAirFluidStack = FluidUtils.getFluidStack("air", 1); + } + if (sAirFluid == null && sAirFluidStack != null) { + sAirFluid = sAirFluidStack.getFluid(); + } + } public int getAir() { + setAir(); if (this.mAirIntakes.isEmpty() || this.mAirIntakes.size() <= 0) { return 0; } else { int totalAir = 0; - FluidStack airstack = FluidUtils.getFluidStack("air", 1); for (GT_MetaTileEntity_Hatch_AirIntake u : this.mAirIntakes) { if (u != null && u.mFluid != null) { // had this trow errors cousing the machine to stop probebly fixed FluidStack f = u.mFluid; - if (f.isFluidEqual(airstack)) { + if (f.isFluidEqual(sAirFluidStack)) { totalAir += f.amount; } } @@ -279,9 +284,13 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi } @Override + public GT_Recipe_Map getRecipeMap() { + return GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels; + } + + @Override public boolean checkRecipe(final ItemStack aStack) { final ArrayList<FluidStack> tFluids = this.getStoredFluids(); - FluidStack air = FluidUtils.getFluidStack("air", 1); int aircount = getAir() ; if (aircount < euProduction/100) { @@ -289,7 +298,7 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi return false; } else { - boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(air, euProduction/100)); + boolean hasIntakeAir = this.depleteInput(FluidUtils.getFluidStack(sAirFluid, euProduction/100)); if (!hasIntakeAir) { //log("Could not consume Air to run "+aircount); freeFuelTicks = 0; @@ -302,10 +311,9 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi //log("Running "+aircount); log("looking at hatch"); - final Collection<GT_Recipe> tRecipeList = GTPP_Recipe.GTPP_Recipe_Map.sRocketFuels.mRecipeList; - if (tFluids.size() > 0 && tRecipeList != null) { + if (tFluids.size() > 0 && getRecipeMap() != null) { if (tFluids.contains(MISC_MATERIALS.CARBON_DIOXIDE.getFluidStack(this.boostEu ? 3 : 1)) || tFluids.contains(FluidUtils.getFluidStack("carbondioxide", (this.boostEu ? 3 : 1)))) { if (this.mRuntime % 72 == 0 || this.mRuntime == 0) { @@ -324,12 +332,12 @@ public class GregtechMetaTileEntity_LargeRocketEngine extends GregtechMeta_Multi this.boostEu = consumeLOH(); for (final FluidStack hatchFluid1 : tFluids) { - if (hatchFluid1.isFluidEqual(air)) { + if (hatchFluid1.isFluidEqual(sAirFluidStack)) { continue; } if (freeFuelTicks == 0) { - for (final GT_Recipe aFuel : tRecipeList) { + for (final GT_Recipe aFuel : getRecipeMap().mRecipeList) { final FluidStack tLiquid; tLiquid = aFuel.mFluidInputs[0]; if (hatchFluid1.isFluidEqual(tLiquid)) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java index 9be787e922..5135a7eeed 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_LargeSemifluidGenerator.java @@ -28,7 +28,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_LargeSemifluidGenerator extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargeSemifluidGenerator> { private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_LargeSemifluidGenerator> STRUCTURE_DEFINITION = null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java index 31fcc41cf4..177d1690cf 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_MassFabricator.java @@ -1,5 +1,8 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; +import java.util.ArrayList; +import java.util.Collection; + import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.enums.ConfigCategories; @@ -82,16 +85,10 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo public GregtechMetaTileEntity_MassFabricator(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); - mCasingName1 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 9); - mCasingName2 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 15); - mCasingName3 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 8); } public GregtechMetaTileEntity_MassFabricator(final String aName) { super(aName); - mCasingName1 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 9); - mCasingName2 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 15); - mCasingName3 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 8); } @Override @@ -101,21 +98,13 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo @Override protected GT_Multiblock_Tooltip_Builder createTooltip() { - - if (mCasingName1.toLowerCase().contains(".name")) { - mCasingName1 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 9); - } - if (mCasingName2.toLowerCase().contains(".name")) { - mCasingName2 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings3Misc, 15); - } - if (mCasingName3.toLowerCase().contains(".name")) { - mCasingName3 = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasingsMisc, 8); - } - GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) .addInfo("Controller Block for the Matter Fabricator") + .addInfo("Speed: 100% | Eu Usage: 80%") + .addInfo("Parallel: Scrap = 64 | UU = 8 * Tier") .addInfo("Produces UU-A, UU-M & Scrap") + .addInfo("Change mode with screwdriver") .addPollutionAmount(getPollutionPerSecond(null)) .addSeparator() .beginStructureBlock(5, 4, 5, true) @@ -445,7 +434,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo public boolean checkRecipeUU( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll) { + int aSpeedBonusPercent, int aOutputChanceRoll) { // Based on the Processing Array. A bit overkill, but very flexible. @@ -645,7 +634,7 @@ public class GregtechMetaTileEntity_MassFabricator extends GregtechMeta_MultiBlo @Override public int getMaxParallelRecipes() { - return this.mMode == MODE_SCRAP ? 32 : 2 * (Math.max(1, GT_Utility.getTier(getMaxInputVoltage()))); + return this.mMode == MODE_SCRAP ? 64 : 8 * (Math.max(1, GT_Utility.getTier(getMaxInputVoltage()))); } @Override diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java index f86ecf3196..ca33c31f8c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_Refinery.java @@ -21,7 +21,7 @@ import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; -public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_Refinery extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_Refinery> { private int mCasing; private IStructureDefinition<GregtechMetaTileEntity_Refinery> STRUCTURE_DEFINITION = null; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java index d42b33a403..4ad4c76be4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/GregtechMetaTileEntity_SolarTower.java @@ -1,10 +1,12 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.*; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + +import java.util.ArrayList; + +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTech_API; import gregtech.api.enums.TAE; @@ -12,13 +14,15 @@ import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.*; import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; import gregtech.api.util.GT_Recipe; -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.block.ModBlocks; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; +import gtPlusPlus.core.util.minecraft.FluidUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.misc.TileEntitySolarHeater; @@ -27,24 +31,29 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; -public class GregtechMetaTileEntity_SolarTower -extends GregtechMeta_MultiBlockBase { +public class GregtechMetaTileEntity_SolarTower extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_SolarTower> { //862 - private static final int mCasingTextureID = TAE.getIndexFromPage(3, 4); - public static String mCasingName = ""; - private int mHeight = 0; + private static final int mCasingTextureID = TAE.getIndexFromPage(3, 9); private int mHeatLevel = 0; + private int mCasing1; + private int mCasing2; + private int mCasing3; + private int mCasing4; + + + public ArrayList<TileEntitySolarHeater> mSolarHeaters = new ArrayList<TileEntitySolarHeater>(); + public GregtechMetaTileEntity_SolarTower(final int aID, final String aName, final String aNameRegional) { super(aID, aName, aNameRegional); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 4); } public GregtechMetaTileEntity_SolarTower(final String aName) { super(aName); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 4); } @Override @@ -58,14 +67,326 @@ extends GregtechMeta_MultiBlockBase { } @Override - public String[] getTooltip() { - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 4); + protected final GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Contributing Green Energy towards the future") + .addInfo("Input: "+MISC_MATERIALS.SOLAR_SALT_COLD.getLocalizedName()) + .addInfo("Output: "+MISC_MATERIALS.SOLAR_SALT_HOT.getLocalizedName()) + .addInfo("Surround with rings of Solar Heaters") + .addInfo("Each ring increases tier") + .addInfo("1 = 1, 2 = 2, 3 = 4, 4 = 8, 5 = 16") + .addInfo("Tier decreases heating time and allows more salt to be processed") + .addSeparator() + .beginStructureBlock(6, 27, 6, false) + .addController("Top Middle") + .addCasingInfo("Structural Solar Casing", 229) + .addCasingInfo("Thermally Insulated Casing", 60) + .addCasingInfo("Salt Containment Casing", 66) + .addCasingInfo("Thermal Containment Casing", 60) + .addInputHatch("Any 2 dot hint(min 1)", 2) + .addOutputHatch("Any 2 dot hint(min 1)", 2) + .addMaintenanceHatch("Any 2 dot hint", 2) + .toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + private static final String STRUCTURE_PIECE_BASE = "base"; + private static final String STRUCTURE_PIECE_TOWER = "tower"; + private static final String STRUCTURE_PIECE_TOP = "top"; + + private static final String SOLAR_HEATER_RING_1 = "ring1"; + private static final String SOLAR_HEATER_RING_2 = "ring2"; + private static final String SOLAR_HEATER_RING_3 = "ring3"; + private static final String SOLAR_HEATER_RING_4 = "ring4"; + private static final String SOLAR_HEATER_RING_5 = "ring5"; + + private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_SolarTower>>() { + @Override + protected IStructureDefinition<GregtechMetaTileEntity_SolarTower> computeValue(Class<?> type) { + return StructureDefinition.<GregtechMetaTileEntity_SolarTower>builder() + + // s = salt + // c = thermal containment + // i = thermal insulated + // t = solar structural + // h = hatch + // g = solar heater + + .addShape(STRUCTURE_PIECE_TOP, (new String[][]{ + {" ", " ", " ~ ", " ", " "}, + {" ", " s ", " sss ", " s ", " "}, + {" c ", " ccc ", "ccscc", " ccc ", " c "}, + {" c ", " ccc ", "ccscc", " ccc ", " c "}, + {" c ", " ccc ", "ccscc", " ccc ", " c "}, + {" c ", " ccc ", "ccscc", " ccc ", " c "}, + {" c ", " ccc ", "ccscc", " ccc ", " c "}, + })) + .addShape(STRUCTURE_PIECE_TOWER, (new String[][]{ + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + {" i ", "isi", " i "}, + })) + .addShape(STRUCTURE_PIECE_BASE, (new String[][]{ + {" ", " ", " t ", " ttt ", " ttstt ", " ttssstt ", " ttstt ", " ttt ", " t ", " ", " "}, + {" ", " ", " t ", " ttt ", " tssst ", " ttssstt ", " tssst ", " ttt ", " t ", " ", " "}, + {" ", " t ", " ttt ", " ttttt ", " ttssstt ", " tttsssttt ", " ttssstt ", " ttttt ", " ttt ", " t ", " "}, + {" ", " t ", " ttt ", " ttttt ", " ttssstt ", " tttsssttt ", " ttssstt ", " ttttt ", " ttt ", " t ", " "}, + {" hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "htttsssttth", "htttsssttth", "htttsssttth", " ttttttttt ", " ttttttt ", " ttttt ", " hhh "}, + {" hhh ", " ttttt ", " ttttttt ", " ttttttttt ", "httttttttth", "httttttttth", "httttttttth", " ttttttttt ", " ttttttt ", " ttttt ", " hhh "}, + })) + + + .addShape(SOLAR_HEATER_RING_1, (new String[][]{ + { + " ggggg ", + " g g ", + " g g ", + " g g ", + " g g ", + "g g", + "g g", + "g g", + "g g", + "g g", + " g g ", + " g g ", + " g g ", + " g g ", + " ggggg ", + }})) + .addShape(SOLAR_HEATER_RING_2, (new String[][]{ + { + " ggggggggg ", + " g g ", + " g g ", + " g g ", + " g g ", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + " g g ", + " g g ", + " g g ", + " g g ", + " ggggggggg ", + }})) + .addShape(SOLAR_HEATER_RING_3, (new String[][]{ + { + " ggggggggggggg ", + " g g ", + " g g ", + " g g ", + " g g ", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + " g g ", + " g g ", + " g g ", + " g g ", + " ggggggggggggg ", + }})) + .addShape(SOLAR_HEATER_RING_4, (new String[][]{ + { + " ggggggggggggggggg ", + " g g ", + " g g ", + " g g ", + " g g ", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + " g g ", + " g g ", + " g g ", + " g g ", + " ggggggggggggggggg ", + }})) + .addShape(SOLAR_HEATER_RING_5, (new String[][]{ + { + " ggggggggggggggggggggg ", + " g g ", + " g g ", + " g g ", + " g g ", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + "g g", + " g g ", + " g g ", + " g g ", + " g g ", + " ggggggggggggggggggggg ", + }})) + + .addElement('g', lazy(t -> ofHatchAdder(GregtechMetaTileEntity_SolarTower::addSolarHeater, 0, 1))) + .addElement('t', lazy(t -> onElementPass(x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta())))) + .addElement('i', lazy(t -> onElementPass(x -> ++x.mCasing2, ofBlock(t.getCasingBlock(), t.getCasingMeta2())))) + .addElement('s', lazy(t -> onElementPass(x -> ++x.mCasing3, ofBlock(t.getCasingBlock(), t.getCasingMeta3())))) + .addElement('c', lazy(t -> onElementPass(x -> ++x.mCasing4, ofBlock(t.getCasingBlock2(), t.getCasingMeta4())))) + .addElement('h', lazy(t -> ofChain( + ofHatchAdder(GregtechMetaTileEntity_SolarTower::addGenericHatch, t.getCasingTextureIndex(), 2), + onElementPass(x -> ++x.mCasing1, ofBlock(t.getCasingBlock(), t.getCasingMeta()))))) + + + .build(); + } + }; + + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { + resetSolarHeaters(); + this.mMaintenanceHatches.clear(); + this.mInputHatches.clear(); + this.mOutputHatches.clear(); + mCasing1 = 0; + mCasing2 = 0; + mCasing3 = 0; + mCasing4 = 0; + + boolean aStructureTop = checkPiece(STRUCTURE_PIECE_TOP, 2, 2, 0); + log("Top Check: "+aStructureTop); + boolean aStructureTower = checkPiece(STRUCTURE_PIECE_TOWER, 1, 1, -7); + log("Tower Check: "+aStructureTower); + boolean aStructureBase = checkPiece(STRUCTURE_PIECE_BASE, 5, 5, -22); + log("Base Check: "+aStructureBase); + boolean aCasingCount1 = mCasing1 >= 229; + boolean aCasingCount2 = mCasing2 == 60; + boolean aCasingCount3 = mCasing3 == 66; + boolean aCasingCount4 = mCasing4 == 60; + boolean aAllStructure = aStructureTop && aStructureTower && aStructureBase; + boolean aAllCasings = aCasingCount1 && aCasingCount2 && aCasingCount3 && aCasingCount4; + if (!aAllCasings || !aAllStructure || + mMaintenanceHatches.size() != 1 || + mInputHatches.size() < 1 || + mOutputHatches.size() < 1 + ) { + log("Bad Hatches - Solar Heaters: "+mSolarHeaters.size()+ + ", Maint: "+mMaintenanceHatches.size()+ + ", Input Hatches: "+mInputHatches.size()+ + ", Output Hatches: "+mOutputHatches.size()+ + ", Top: "+aStructureTop+ + ", Tower: "+aStructureTower+ + ", Base: "+aStructureBase+ + ", Casing Count: "+aCasingCount1+" | Found: "+mCasing1+ + ", Casing Count: "+aCasingCount2+" | Found: "+mCasing2+ + ", Casing Count: "+aCasingCount3+" | Found: "+mCasing3+ + ", Casing Count: "+aCasingCount4+" | Found: "+mCasing4); + return false; + } + log("Built "+this.getLocalName()+" with "+mCasing1+" Structural Solar casings, "+mCasing2+" Thermally Insulated casings, "+mCasing3+" Salt Containment casings, "+mCasing4+" Thermal Containment casings."); + return aAllCasings && aAllStructure; + } + + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + // Tower + buildPiece(STRUCTURE_PIECE_TOP, stackSize, hintsOnly, 2, 2, 0); + buildPiece(STRUCTURE_PIECE_TOWER, stackSize, hintsOnly, 1, 1, -7); + buildPiece(STRUCTURE_PIECE_BASE, stackSize, hintsOnly, 5, 5, -22); + + //Solar Heaters + if (stackSize.stackSize >= 1) { + buildPiece(SOLAR_HEATER_RING_1, stackSize, hintsOnly, 7, 7, -27); + if (stackSize.stackSize >= 2) { + buildPiece(SOLAR_HEATER_RING_2, stackSize, hintsOnly, 9, 9, -27); + if (stackSize.stackSize >= 3) { + buildPiece(SOLAR_HEATER_RING_3, stackSize, hintsOnly, 11, 11, -27); + if (stackSize.stackSize >= 4) { + buildPiece(SOLAR_HEATER_RING_4, stackSize, hintsOnly, 13, 13, -27); + if (stackSize.stackSize >= 5) { + buildPiece(SOLAR_HEATER_RING_5, stackSize, hintsOnly, 15, 15, -27); + } + } + } + } + } + } + + @Override + public IStructureDefinition<GregtechMetaTileEntity_SolarTower> getStructureDefinition() { + return STRUCTURE_DEFINITION.get(getClass()); + } + + public final boolean addGenericHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } + else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } } - return new String[]{ - "Contributing Green Energy towards the future", - mCasingName+"s for the base of the tower", - }; + log("Bad Hatch"); + return false; } @Override @@ -76,10 +397,10 @@ extends GregtechMeta_MultiBlockBase { @Override public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { if (aSide == 0 || aSide == 1) { - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 6)), + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12)), new GT_RenderedTexture(aActive ? TexturesGtBlock.Overlay_Machine_Controller_Default_Active : TexturesGtBlock.Overlay_Machine_Controller_Default)}; } - return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.getIndexFromPage(3, 6))}; + return new ITexture[]{Textures.BlockIcons.getCasingTextureForId(TAE.GTPP_INDEX(12))}; } @Override @@ -97,68 +418,174 @@ extends GregtechMeta_MultiBlockBase { return null; } - @Override - public boolean isFacingValid(final byte aFacing) { - return aFacing <= 1; - } - - private Set<String> mCachedReflectors = new HashSet<String>(); - - public Set<String> getConnectedSolarReflectors(){ - Set<String> mValidTilePositions = new HashSet<String>(); - IGregTechTileEntity tTileEntity; - Map<String, BlockPos> mFastMap = new HashMap<String, BlockPos>(); - for (int x = -64; x <= 64; x++) { - for (int z = -64; z <= 64; z++) { - int aX, aY, aZ; - aX = this.getBaseMetaTileEntity().getXCoord(); - aY = this.mHeight; - aZ = this.getBaseMetaTileEntity().getZCoord(); - BlockPos b = new BlockPos(aX+x, aY, aZ+z, this.getBaseMetaTileEntity().getWorld()); - - tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntity(aX + x, this.mHeight, aZ + z); - if (tTileEntity == null) { - continue; - } - else { - Logger.INFO("Found Tile Entity at "+b.getLocationString()); - if (tTileEntity.getMetaTileEntity() instanceof TileEntitySolarHeater) { - TileEntitySolarHeater mTile = (TileEntitySolarHeater) tTileEntity.getMetaTileEntity(); - if (mTile != null) { - b = new BlockPos(tTileEntity.getXCoord(), tTileEntity.getYCoord(), tTileEntity.getZCoord(), tTileEntity.getWorld()); - if (!mTile.mHasTower || mTile.mSolarTower == null) { - Logger.INFO("Found Solar Reflector, Injecting Data."); - mTile.setSolarTower(b); - } - mFastMap.put(b.getUniqueIdentifier(), b); - } - } - else { - continue; - } - } + private int getHeaterTier() { + int aSolarHeaterCounter = this.mSolarHeaters.size(); + if (aSolarHeaterCounter > 0) { + if (aSolarHeaterCounter == 36) { + return 1; + } + else if (aSolarHeaterCounter == 88) { + return 2; + } + else if (aSolarHeaterCounter == 156) { + return 4; + } + else if (aSolarHeaterCounter == 240) { + return 8; + } + else if (aSolarHeaterCounter == 340) { + return 16; + } + } + return 0; + } + + private int getHeaterCountForTier(int aTier) { + switch (aTier) { + case 1: + return 36; + case 2: + return 88; + case 4: + return 156; + case 8: + return 240; + case 16: + return 340; + default: + return 0; + } + } - if (addToMachineList(tTileEntity, mCasingTextureID)) { - continue; - } - } + public boolean getConnectedSolarReflectors(){ + + this.mSolarHeaters.clear(); + int aRing = 1; + + if (this.mSolarHeaters.size() < 36) { + // 15x15 + boolean aRing1 = checkPiece(SOLAR_HEATER_RING_1, 7, 7, -27); + if (aRing1) { + //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size()); + } + } + if (this.mSolarHeaters.size() < 88) { + // 17x17 + boolean aRing2 = checkPiece(SOLAR_HEATER_RING_2, 9, 9, -27); + if (aRing2) { + //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size()); + } } + if (this.mSolarHeaters.size() < 156) { + // 19x19 + boolean aRing3 = checkPiece(SOLAR_HEATER_RING_3, 11, 11, -27); + if (aRing3) { + //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size()); + } + } + if (this.mSolarHeaters.size() < 240) { + // 21x21 + boolean aRing4 = checkPiece(SOLAR_HEATER_RING_4, 13, 13, -27); + if (aRing4) { + //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size()); + } + } + if (this.mSolarHeaters.size() < 340) { + // 23x23 + boolean aRing5 = checkPiece(SOLAR_HEATER_RING_5, 15, 15, -27); + if (aRing5) { + //log("Found Ring: "+(aRing++)+", Total: "+this.mSolarHeaters.size()); + } + } + return mSolarHeaters.size() > 0; + } - for (BlockPos p : mFastMap.values()) { - if (mValidTilePositions.add(p.getUniqueIdentifier())); + private boolean addSolarHeater(IGregTechTileEntity aTileEntity, int a) { + if (aTileEntity == null) { + return false; + } + else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof TileEntitySolarHeater) { + TileEntitySolarHeater mTile = (TileEntitySolarHeater) aMetaTileEntity; + if (mTile != null) { + if (!mTile.hasSolarTower() && mTile.canSeeSky()) { + //Logger.INFO("Found Solar Reflector, Injecting Data."); + mTile.setSolarTower(this); + return this.mSolarHeaters.add(mTile); + } + } + } } - mCachedReflectors = mValidTilePositions; - return mCachedReflectors; + return false; } + + private Fluid mColdSalt = null; + private Fluid mHotSalt = null; @Override - public boolean checkRecipe(final ItemStack aStack) { - //this.mEfficiencyIncrease = 100; - //this.mMaxProgresstime = 100; - //this.mEUt = -4; + public boolean checkRecipe(final ItemStack aStack) { + this.mEfficiencyIncrease = 10; + this.mMaxProgresstime = 100; + + if (this.mSolarHeaters.isEmpty() || this.mSolarHeaters.size() < 340 || this.getTotalRuntimeInTicks() % 200 == 0) { + getConnectedSolarReflectors(); + } + + int aTier = getHeaterTier(); + int aHeaters = getHeaterCountForTier(aTier); + + //Manage Heat every 5s + //Add Heat First, if sources available + if (aHeaters > 0) { + for (int i = 0; i < aHeaters; i++) { + Math.min((this.mHeatLevel += aTier), 20000); + } + } + + //Remove Heat, based on time of day + if (mHeatLevel > 0) { + if (mHeatLevel > 20000) { + this.mHeatLevel = 20000; + } + } + World w = this.getBaseMetaTileEntity().getWorld(); + if (w != null) { + int aRemovalFactor = 0; + if (w.isDaytime()) { + aRemovalFactor = 1; + } + else { + aRemovalFactor = 8; + } + for (int i = 0; i<MathUtils.randInt((aHeaters/10), aHeaters); i++){ + this.mHeatLevel -= aRemovalFactor; + } + } + + if (this.mEfficiency == this.getMaxEfficiency(null) && this.mHeatLevel >= 10000) { + if (mColdSalt == null) { + mColdSalt = MISC_MATERIALS.SOLAR_SALT_COLD.getFluid(); + } + if (mHotSalt == null) { + mHotSalt = MISC_MATERIALS.SOLAR_SALT_HOT.getFluid(); + } + ArrayList<FluidStack> aFluids = this.getStoredFluids(); + for (FluidStack aFluid : aFluids) { + if (aFluid.getFluid().equals(mColdSalt)) { + if (aFluid.amount >= (aTier * 1000)) { + this.depleteInput(FluidUtils.getFluidStack(mColdSalt, (aTier * 1000))); + this.addOutput(FluidUtils.getFluidStack(mHotSalt, (aTier * 1000))); + break; + } + } + } + } + + return true; } - + @Override public int getMaxParallelRecipes() { return 1; @@ -175,27 +602,6 @@ extends GregtechMeta_MultiBlockBase { } @Override - public boolean checkMultiblock(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - this.mHeight = 0; - for (int i = 0; i <= 19; i++) { - if (!checkLayer(i)) { - Logger.INFO("Invalid Structure on Y level "+i); - return false; - } - } - if (mMaintenanceHatches.size() != 1) { - Logger.INFO("Bad Hatches"); - return false; - } - - this.mHeight = this.getBaseMetaTileEntity().getYCoord() - 19; - Logger.INFO("Built Structure"); - if (!aBaseMetaTileEntity.getWorld().isRemote) - getConnectedSolarReflectors(); - return true; - } - - @Override public int getMaxEfficiency(final ItemStack aStack) { return 10000; } @@ -216,36 +622,29 @@ extends GregtechMeta_MultiBlockBase { } public Block getCasingBlock() { - return ModBlocks.blockCasings4Misc; + return ModBlocks.blockSpecialMultiCasings; } + public Block getCasingBlock2() { + return ModBlocks.blockCasings2Misc; + } public byte getCasingMeta() { - return 4; + return 6; } public byte getCasingMeta2() { - return 5; + return 8; } public byte getCasingMeta3() { - return 6; + return 7; } - public boolean isValidCasingBlock(Block aBlock, int aMeta) { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta()) { - return true; - } - if (aBlock == getCasingBlock() && aMeta == getCasingMeta2()) { - return true; - } - if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { - return true; - } - Logger.INFO("Found "+(aBlock != null ? aBlock.getLocalizedName() : "Air") + "With Meta "+aMeta); - return false; + public byte getCasingMeta4() { + return 11; } public byte getCasingTextureIndex() { @@ -254,7 +653,7 @@ extends GregtechMeta_MultiBlockBase { @Override public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { - if (this.mHeight > 3) {} + } @@ -262,441 +661,48 @@ extends GregtechMeta_MultiBlockBase { @Override public void saveNBTData(NBTTagCompound aNBT) { super.saveNBTData(aNBT); - aNBT.setInteger("mHeight", mHeight); aNBT.setInteger("mHeatLevel", mHeatLevel); } @Override public void loadNBTData(NBTTagCompound aNBT) { super.loadNBTData(aNBT); - mHeight = aNBT.getInteger("mHeight"); mHeatLevel = aNBT.getInteger("mHeatLevel"); } - public boolean checkLayer(int aY) { - if (aY >= 0 && aY <= 6) { - return checkTopLayers(-aY); - } - if (aY >= 7 && aY <= 16) { - return checkTowerLayer(-aY); - } - else if (aY >= 17 && aY <= 19) { - return checkBaseLayer(-aY); - } - Logger.INFO("Bad Y level to check"); - return false; - } - - public boolean checkTopLayers(int aY) { - Block aBlock; - int aMeta; - - if (aY == 0) { - return true; - } else if (aY == -1) { - for (int x = -1; x <= 1; x++) { - for (int z = -1; z <= 1; z++) { - aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - } - } else if (aY == -2 || aY == -6) { - for (int x = -2; x <= 2; x++) { - for (int z = -2; z <= 2; z++) { - aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - //Edge Casing - if (x == -2 || x == 2 || z == -2 || z == 2) { - //Edge Corners - if ((x == 2 || x == -2) && (z == 2 | z == -2)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - else { - continue; - } - } - else { - //Edge Sides - if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - } - - //Internal - else { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta2()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - } - } - } - //Top Layers 7x7 - else if (aY == -3 || aY == -5) { - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - //Edge Casing - if (x == -3 || x == 3 || z == -3 || z == 3) { - - //3, 3 - //2, 3 - //3, 2 - - //Air Spacing - if (x == 3 && (z == -3 || z == -2 || z == 2 || z == 3)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - else { - continue; - } - } - else if (x == -3 && (z == -3 || z == -2 || z == 2 || z == 3)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - else { - continue; - } - } - else if (z == 3 && (x == -3 || x == -2 || x == 2 || x == 3)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - else { - continue; - } - } - else if (z == -3 && (x == -3 || x == -2 || x == 2 || x == 3)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Outside Corner "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - else { - continue; - } - } - else { - //Edge Sides - if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - } - else if ((x == -2 || x == 2) & (z == -2 || z == 2)) { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta3()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - //Internal - else { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta2()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - } - } - } - //Midle Top Layer 9x9 - else if (aY == -4) { - //Check Inner 5x5 - for (int x = -2; x <= 2; x++) { - for (int z = -2; z <= 2; z++) { - if (getBaseMetaTileEntity().getBlockOffset(x, aY, z) != getCasingBlock() && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z) != getCasingMeta2()) { - Logger.INFO("Error at offset: X:" + x + ", Y:" + aY + ", Z:" + z); - return false; - } - else { - continue; - } - } - } - //Check Pos Sides - for (int z = -1; z <= -1; z++) { - if (getBaseMetaTileEntity().getBlockOffset(3, aY, z) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(3, aY, z) == getCasingMeta2()) { - continue; - } else if (getBaseMetaTileEntity().getBlockOffset(-3, aY, z) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(-3, aY, z) == getCasingMeta2()) { - continue; - } else { - Logger.INFO("1 Error at offset: X:3/-3" + ", Y:" + aY + ", Z:" + z); - return false; - } - - } - for (int x = -1; x <= -1; x++) { - if (getBaseMetaTileEntity().getBlockOffset(x, aY, 3) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, 3) == getCasingMeta2()) { - continue; - } else if (getBaseMetaTileEntity().getBlockOffset(x, aY, -3) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, -3) == getCasingMeta2()) { - continue; - } else { - Logger.INFO("1 Error at offset: X:" + x + ", Y:" + aY + ", Z:3/-3"); - return false; - } - } - - //Corner Casings - for (int z = -2; z <= -2; z++) { - if (z == -2 || z == 2) { - if (getBaseMetaTileEntity().getBlockOffset(3, aY, z) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(3, aY, z) == getCasingMeta3()) { - continue; - } else if (getBaseMetaTileEntity().getBlockOffset(-3, aY, z) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(-3, aY, z) == getCasingMeta3()) { - continue; - } else { - Logger.INFO("2 Error at offset: X:3/-3" + ", Y:" + aY + ", Z:" + z); - return false; - } - } - } - for (int x = -2; x <= -2; x++) { - if (x == -2 || x == 2) { - if (getBaseMetaTileEntity().getBlockOffset(x, aY, 3) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, 3) == getCasingMeta3()) { - continue; - } else if (getBaseMetaTileEntity().getBlockOffset(x, aY, -3) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, -3) == getCasingMeta3()) { - continue; - } else { - Logger.INFO("2 Error at offset: X:" + x + ", Y:" + aY + ", Z:3/-3"); - return false; - } - } - } - //Check Sides Casings - for (int z = -1; z <= -1; z++) { - if (getBaseMetaTileEntity().getBlockOffset(4, aY, z) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(4, aY, z) == getCasingMeta3()) { - continue; - } else if (getBaseMetaTileEntity().getBlockOffset(-4, aY, z) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(-4, aY, z) == getCasingMeta3()) { - continue; - } else { - Logger.INFO("1 Error at offset: X:3/-3" + ", Y:" + aY + ", Z:" + z); - return false; - } - - } - for (int x = -1; x <= -1; x++) { - if (getBaseMetaTileEntity().getBlockOffset(x, aY, 4) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, 4) == getCasingMeta3()) { - continue; - } else if (getBaseMetaTileEntity().getBlockOffset(x, aY, -4) == getCasingBlock() - && this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, -4) == getCasingMeta3()) { - continue; - } else { - Logger.INFO("1 Error at offset: X:" + x + ", Y:" + aY + ", Z:3/-3"); - return false; - } - } - } - return true; - } - - public boolean checkTowerLayer(int aY) { - Block aBlock; - int aMeta; - for (int x = -1; x <= 1; x++) { - for (int z = -1; z <= 1; z++) { - aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - if (x == -1 || x == 1 || z == -1 || z == 1) { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block Externally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } else { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta2()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - } - } - return true; - } - - public boolean checkBaseLayer(int aY) { - Block aBlock; - int aMeta; - - int requiredMeta = getCasingMeta2(); - if (aY == -19) { - requiredMeta = getCasingMeta(); - } - - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - aBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - aMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - - if ((x == 3 && z == 3) || (x == 2 && z == 2) || (x == 3 && z == 2) || (x == 2 && z == 3)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - return false; - } - } - else if ((x == -3 && z == -3) || (x == -2 && z == -2) || (x == -3 && z == -2) || (x == -2 && z == -3)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - return false; - } - } - else if ((x == -3 && z == 3) || (x == -2 && z == 2) || (x == -3 && z == 2) || (x == -2 && z == 3)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - return false; - } - } - else if ((x == 3 && z == -3) || (x == 2 && z == -2) || (x == 3 && z == -2) || (x == 2 && z == -3)) { - if (!getBaseMetaTileEntity().getAirOffset(x, aY, z)) { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - return false; - } - } - else { - IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z); - if (addToMachineList(tTileEntity, mCasingTextureID)) { - continue; - } - if (x == 0 && z == 0) { - if (aBlock == getCasingBlock() && aMeta == requiredMeta) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - else { - if (aBlock == getCasingBlock() && aMeta == getCasingMeta()) { - continue; - } else { - Logger.INFO("Error at offset: X:"+x+", Y:"+aY+", Z:"+z); - Logger.INFO("Found Bad Block Internally on Layer "+aY+": "+(aBlock != null ? aBlock.getLocalizedName() : "Air")+" | Meta: "+aMeta); - return false; - } - } - } - } - } - return true; - } - @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - - //Add Heat every second - if (aTick % 20 == 0) { - - //Add Heat First, if sources available - int aCacheSize = this.mCachedReflectors.size(); - if (aCacheSize > 0) { - int aCount = aCacheSize; - for (int i = 0; i < aCount; i++) { - this.mHeatLevel++; - } - } - - //Remove Heat, based on time of day - World w = this.getBaseMetaTileEntity().getWorld(); - if (w != null) { - int aRemovalFactor = 0; - if (w.isDaytime()) { - aRemovalFactor = 1; - } - else { - aRemovalFactor = 3; - } - for (int i = 0; i<MathUtils.randInt((aCacheSize/10), (aCacheSize*10)); i++){ - this.mHeatLevel -= aRemovalFactor; - } - } - } } @Override public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPreTick(aBaseMetaTileEntity, aTick); - if (this.mCachedReflectors.isEmpty()) { - if (aTick % (30*20) == 0) { - this.getConnectedSolarReflectors(); - } - } + super.onPreTick(aBaseMetaTileEntity, aTick); + // Fix GT bug + if (this.getBaseMetaTileEntity().getFrontFacing() != 1) { + this.getBaseMetaTileEntity().setFrontFacing((byte) 1); + } } @Override public void onRemoval() { - this.mCachedReflectors.clear(); + resetSolarHeaters(); super.onRemoval(); } + private void resetSolarHeaters() { + for (TileEntitySolarHeater aTile : this.mSolarHeaters) { + aTile.clearSolarTower(); + } + this.mSolarHeaters.clear(); + } + @Override public String[] getExtraInfoData() { return new String[] { "Internal Heat Level: "+this.mHeatLevel, - "Connected Solar Reflectors: "+this.mCachedReflectors.size() + "Connected Solar Reflectors: "+this.mSolarHeaters.size() }; } - - - - - - - - } -*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java index 4759457d8d..d3db328bd4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/algae/GregtechMTE_AlgaePondBase.java @@ -42,7 +42,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; -public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase { +public class GregtechMTE_AlgaePondBase extends GregtechMeta_MultiBlockBase<GregtechMTE_AlgaePondBase> { private int mLevel = -1; private int mCasing; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java index 4a01809ac7..daad2f50da 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/chemplant/GregtechMTE_ChemicalPlant.java @@ -585,7 +585,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt public boolean checkRecipeGeneric( ItemStack[] aItemInputs, FluidStack[] aFluidInputs, int aMaxParallelRecipes, int aEUPercent, - int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isOC) { + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe) { // Based on the Processing Array. A bit overkill, but very flexible. @@ -609,7 +609,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt } // checks if it has a catalyst - ItemStack tCatalystRecipe = findCatalyst(aItemInputs); + ItemStack tCatalystRecipe = null; boolean aDoesRecipeNeedCatalyst = false; for (ItemStack aInputItem : tRecipe.mInputs) { if (ItemUtils.isCatalyst(aInputItem)) { @@ -618,6 +618,7 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt } } if (aDoesRecipeNeedCatalyst) { + tCatalystRecipe = findCatalyst(aItemInputs, tRecipe.mInputs); if (tCatalystRecipe == null) { log("does not have catalyst"); return false; @@ -959,12 +960,16 @@ public class GregtechMTE_ChemicalPlant extends GregtechMeta_MultiBlockBase<Gregt return allowedParallel; } - private ItemStack findCatalyst(ItemStack[] aItemInputs) { + private ItemStack findCatalyst(ItemStack[] aItemInputs, ItemStack[] aRecipeInputs) { if (aItemInputs != null) { for (final ItemStack aInput : aItemInputs) { if (aInput != null) { if (ItemUtils.isCatalyst(aInput)) { - return aInput; + for (ItemStack aRecipeInput : aRecipeInputs) { + if (GT_Utility.areStacksEqual(aRecipeInput, aInput, true)) { + return aInput; + } + } } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java new file mode 100644 index 0000000000..6221dba89d --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java @@ -0,0 +1,170 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; + +import static gtPlusPlus.core.lib.CORE.RANDOM; + +import java.util.ArrayList; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.FluidStack; + +@SuppressWarnings("deprecation") +public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbineBase { + + public GT_MTE_LargeTurbine_Gas(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + + public GT_MTE_LargeTurbine_Gas(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MTE_LargeTurbine_Gas(mName); + } + + @Override + public int getCasingMeta() { + return 3; + } + + @Override + public byte getCasingTextureIndex() { + return 58; + } + + + @Override + protected boolean requiresOutputHatch() { + return false; + } + + @Override + public int getPollutionPerSecond(ItemStack aStack) { + return 5000; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null) { + return 0; + } + GT_Recipe tFuel = GT_Recipe_Map.sTurbineFuels.findFuel(aLiquid); + if (tFuel != null) { + return tFuel.mSpecialValue; + } + return 0; + } + + @Override + int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { + if (aFluids.size() >= 1) { + int tEU = 0; + int actualOptimalFlow = 0; + + FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + int fuelValue = getFuelValue(firstFuelType); + //log("Fuel Value of "+aFluids.get(0).getLocalizedName()+" is "+fuelValue+"eu"); + if (aOptFlow < fuelValue) { + // turbine too weak and/or fuel too powerful + // at least consume 1L + this.realOptFlow = 1; + // wastes the extra fuel and generate aOptFlow directly + depleteInput(new FluidStack(firstFuelType, 1)); + this.storedFluid += 1; + return GT_Utility.safeInt((long) aOptFlow * (long) aBaseEff / 10000L); + } + + actualOptimalFlow = GT_Utility.safeInt((long) aOptFlow / fuelValue); + this.realOptFlow = actualOptimalFlow; + + int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int flow = 0; + int totalFlow = 0; + + storedFluid = 0; + for (FluidStack aFluid : aFluids) { + if (aFluid.isFluidEqual(firstFuelType)) { + flow = Math.min(aFluid.amount, remainingFlow); // try to use up to 125% of optimal flow w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluid, flow)); // deplete that amount + this.storedFluid += aFluid.amount; + remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches + totalFlow += flow; // track total input used + } + } + if (totalFlow <= 0) return 0; + tEU = GT_Utility.safeInt((long) totalFlow * fuelValue); + + //log("Total Flow: "+totalFlow); + //log("Real Optimal Flow: "+actualOptimalFlow); + //log("Flow: "+flow); + //log("Remaining Flow: "+remainingFlow); + + if (totalFlow == actualOptimalFlow) { + tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); + } else { + float efficiency = 1.0f - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); + tEU *= efficiency; + tEU = GT_Utility.safeInt((long) tEU * (long) aBaseEff / 10000L); + } + + return tEU; + + } + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return (RANDOM.nextInt(4) == 0) ? 0 : 1; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + } + + @Override + public String getCustomGUIResourceName() { + return null; + } + + @Override + public String getMachineType() { + return "Large Gas Turbine"; + } + + @Override + protected String getTurbineType() { + return "Gas"; + } + + @Override + protected String getCasingName() { + return "Reinforced Gas Turbine Casing"; + } + + @Override + protected ITexture getTextureFrontFace() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS5); + } + + @Override + protected ITexture getTextureFrontFaceActive() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java new file mode 100644 index 0000000000..20a8d7e964 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java @@ -0,0 +1,262 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; + +import java.util.ArrayList; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.items.GT_MetaGenerated_Tool; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Recipe; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; +import gregtech.api.util.GT_Utility; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + +@SuppressWarnings("deprecation") +public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTurbineBase { + + public GT_MTE_LargeTurbine_Plasma(int aID, String aName, String aNameRegional) { + super(aID, aName, aNameRegional); + } + + + public GT_MTE_LargeTurbine_Plasma(String aName) { + super(aName); + } + + @Override + public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MTE_LargeTurbine_Plasma(mName); + } + + @Override + public int getCasingMeta() { + return 4; + } + + @Override + public byte getCasingTextureIndex() { + return 60; + } + + @Override + protected boolean requiresOutputHatch() { + return true; + } + + @Override + public int getPollutionPerSecond(ItemStack aStack) { + return 0; + } + + public int getFuelValue(FluidStack aLiquid) { + if (aLiquid == null) { + return 0; + } + GT_Recipe tFuel = GT_Recipe_Map.sPlasmaFuels.findFuel(aLiquid); + if (tFuel != null) { + return tFuel.mSpecialValue; + } + return 0; + } + + public boolean checkRecipeGeneric( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) { + + try { + ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies(); + if (aEmptyTurbineRotorHatches.size() > 0) { + log("Found "+aEmptyTurbineRotorHatches.size()+" Assemblies without Turbine."); + ArrayList<ItemStack> aTurbines = getAllBufferedTurbines(); + hatch : for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) { + for (ItemStack aTurbineItem : aTurbines) { + if (aTurbineItem == null) { + continue; + } + if (aTurbineItem != null && aHatch.insertTurbine(aTurbineItem.copy())) { + boolean aDidDeplete = depleteTurbineFromStock(aTurbineItem); + log("Put Turbine into Assembly - "+aDidDeplete); + continue hatch; + } + } + } + } + //log("Found "+getFullTurbineAssemblies().size()+" Assemblies with a Turbine."); + + if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) { + log("BAD RETURN - 1"); + stopMachine(); + return false; + } + + //log("Running checkRecipeGeneric(0)"); + + ArrayList<FluidStack> tFluids = getStoredFluids(); + + if (tFluids.size() > 0) { + if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() + || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { + counter = 0; + float aTotalBaseEff = 0; + float aTotalOptimalFlow = 0; + ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine(); + for (int i=0;i<18;i++) { + if (i == 0) { + aTotalBaseEff += GT_Utility.safeInt((long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + } + aTotalOptimalFlow += GT_Utility.safeInt((long) Math.max(Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() + * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed + * 50)); + } + + baseEff = MathUtils.roundToClosestInt(aTotalBaseEff); + optFlow = MathUtils.roundToClosestInt(aTotalOptimalFlow); + if(optFlow<=0 || baseEff<=0){ + log("Running checkRecipeGeneric(bad-1)"); + stopMachine();//in case the turbine got removed + return false; + } + } else { + counter++; + } + } + + // How much the turbine should be producing with this flow + int newPower = fluidIntoPower(tFluids, optFlow, baseEff); + int difference = newPower - this.mEUt; // difference between current output and new output + + // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick) + // This is how much the turbine can actually change during this tick + int maxChangeAllowed = Math.max(200, GT_Utility.safeInt((long) Math.abs(difference) / 5)); + + if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change + int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. + this.mEUt += change; // Apply the change + } + else { + this.mEUt = newPower; + } + if (this.mEUt <= 0) { + this.mEUt=0; + this.mEfficiency=0; + log("Running checkRecipeGeneric(bad-2)"); + return false; + } else { + this.mMaxProgresstime = 20; + this.mEfficiencyIncrease = 200; + // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + //log("GOOD RETURN - Making: "+this.mEUt+" EU/t"); + return true; + } + } + catch (Throwable t) { + t.printStackTrace(); + } + return false; + } + + @Override + int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { + if (aFluids.size() >= 1) { + aOptFlow *= 800;//CHANGED THINGS HERE, check recipe runs once per 20 ticks + int tEU = 0; + + int actualOptimalFlow = 0; + + FluidStack firstFuelType = new FluidStack(aFluids.get(0), 0); // Identify a SINGLE type of fluid to process. Doesn't matter which one. Ignore the rest! + int fuelValue = getFuelValue(firstFuelType); + actualOptimalFlow = GT_Utility.safeInt((long) Math.ceil((double) aOptFlow / (double) fuelValue)); + this.realOptFlow = actualOptimalFlow; // For scanner info + + int remainingFlow = GT_Utility.safeInt((long) (actualOptimalFlow * 1.25f)); // Allowed to use up to 125% of optimal flow. Variable required outside of loop for multi-hatch scenarios. + int flow = 0; + int totalFlow = 0; + + storedFluid = 0; + for (FluidStack aFluid : aFluids) { + if (aFluid.isFluidEqual(firstFuelType)) { + flow = Math.min(aFluid.amount, remainingFlow); // try to use up w/o exceeding remainingFlow + depleteInput(new FluidStack(aFluid, flow)); // deplete that amount + this.storedFluid += aFluid.amount; + remainingFlow -= flow; // track amount we're allowed to continue depleting from hatches + totalFlow += flow; // track total input used + } + } + String fn = FluidRegistry.getFluidName(firstFuelType); + String[] nameSegments = fn.split("\\.", 2); + if (nameSegments.length == 2) { + String outputName = nameSegments[1]; + FluidStack output = FluidRegistry.getFluidStack(outputName, totalFlow); + if (output == null) { + output = FluidRegistry.getFluidStack("molten." + outputName, totalFlow); + } + if (output != null) { + addOutput(output); + } + } + if (totalFlow <= 0) return 0; + tEU = GT_Utility.safeInt((long) ((fuelValue / 20D) * (double) totalFlow)); + + //GT_FML_LOGGER.info(totalFlow+" : "+fuelValue+" : "+aOptFlow+" : "+actualOptimalFlow+" : "+tEU); + + if (totalFlow == actualOptimalFlow) { + tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU)); + } else { + double efficiency = 1.0D - Math.abs((totalFlow - actualOptimalFlow) / (float) actualOptimalFlow); + + tEU = (int) (tEU * efficiency); + tEU = GT_Utility.safeInt((long) (aBaseEff / 10000D * tEU)); + } + + return tEU; + + } + return 0; + } + + @Override + public int getDamageToComponent(ItemStack aStack) { + return 1; + } + + @Override + public String getCustomGUIResourceName() { + return null; + } + + @Override + public String getMachineType() { + return "Large Plasma Turbine"; + } + + + @Override + protected String getTurbineType() { + return "Plasma"; + } + + @Override + protected String getCasingName() { + return "Reinforced Plasma Turbine Casing"; + } + + @Override + protected ITexture getTextureFrontFace() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU5); + } + + @Override + protected ITexture getTextureFrontFaceActive() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5); + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java index f52f02b5de..d1e3e35938 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java @@ -1,23 +1,22 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; import java.util.ArrayList; import gregtech.GT_Mod; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +@SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTurbineBase { public boolean achievement = false; @@ -31,36 +30,14 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu super(aName); } - public String[] getTooltip() { - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 9); - } - return new String[]{ - "Controller Block for the XL High Pressure Steam Turbine", - "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Superheated Steam Input Hatch (Side centered)", - "1x Maintenance Hatch (Side centered)", - "1x Dynamo Hatch (Back centered)", - "1x Output Hatch for Steam (Side centered)", - mCasingName+"s for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)", - "Output depending on Rotor and fitting", - "Use screwdriver to adjust fitting of turbine"}; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MTE_LargeTurbine_SHSteam(mName); } @Override - public Block getCasingBlock() { - return ModBlocks.blockCasings4Misc; - } - - @Override - public byte getCasingMeta() { - return 9; + public int getCasingMeta() { + return 2; } @Override @@ -68,11 +45,21 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu return 59; } + @Override + protected boolean requiresOutputHatch() { + return true; + } + @Override - public int getPollutionPerTick(ItemStack aStack) { + public int getPollutionPerSecond(ItemStack aStack) { return 0; } + @Override + public int getFuelValue(FluidStack aLiquid) { + return 0; + } + @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { if(looseFit) { @@ -142,11 +129,9 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu return (looseFit && CORE.RANDOM.nextInt(4)==0)?0:1; } - @Override - public String[] getExtraInfoData() { - super.looseFit = looseFit; - return super.getInfoData(); - } + public boolean isLooseMode() { + return looseFit; + } @Override public void saveNBTData(NBTTagCompound aNBT) { @@ -161,11 +146,6 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu } @Override - public boolean hasSlotInGUI() { - return true; - } - - @Override public String getCustomGUIResourceName() { return null; } @@ -175,5 +155,24 @@ public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTu return "Large Super-heated Steam Turbine"; } + @Override + protected String getTurbineType() { + return "Super-heated Steam"; + } + + @Override + protected String getCasingName() { + return "Reinforced HP Steam Turbine Casing"; + } + + @Override + protected ITexture getTextureFrontFace() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5); + } + + @Override + protected ITexture getTextureFrontFaceActive() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5); + } + } -*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java index 2e6f6149e7..f285d3e8de 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java @@ -1,4 +1,3 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; import static gtPlusPlus.core.lib.CORE.RANDOM; @@ -6,19 +5,19 @@ import static gtPlusPlus.core.lib.CORE.RANDOM; import java.util.ArrayList; import gregtech.GT_Mod; +import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; -import gtPlusPlus.core.block.ModBlocks; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +@SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurbineBase { private float water; @@ -34,36 +33,14 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb super(aName); } - public String[] getTooltip() { - if (mCasingName.toLowerCase().contains(".name")) { - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, 8); - } - return new String[]{ - "Controller Block for the XL Steam Turbine", - "Size(WxHxD): 3x3x4 (Hollow), Controller (Front centered)", - "1x Steam Input Hatch (Side centered)", - "1x Maintenance Hatch (Side centered)", - "1x Dynamo Hatch (Back centered)", - "1x Output Hatch for Distilled Water (Side centered)", - mCasingName+"s for the rest (24 at least!)", - "Needs a Turbine Item (Inside controller GUI)", - "Output depending on Rotor and fitting", - "Use screwdriver to adjust fitting of turbine"}; - } - @Override public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MTE_LargeTurbine_Steam(mName); } @Override - public Block getCasingBlock() { - return ModBlocks.blockCasings4Misc; - } - - @Override - public byte getCasingMeta() { - return 8; + public int getCasingMeta() { + return 1; } @Override @@ -71,8 +48,13 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb return 16; } + @Override + protected boolean requiresOutputHatch() { + return true; + } + @Override - public int getPollutionPerTick(ItemStack aStack) { + public int getPollutionPerSecond(ItemStack aStack) { return 0; } @@ -82,6 +64,10 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb water = water - usage; return usage; } + + public int getFuelValue(FluidStack aLiquid) { + return 0; + } @Override int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff) { @@ -149,13 +135,10 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb public int getDamageToComponent(ItemStack aStack) { return (looseFit && RANDOM.nextInt(4)==0)?0:1; } - - - @Override - public String[] getExtraInfoData() { - super.looseFit = looseFit; - return super.getInfoData(); - } + + public boolean isLooseMode() { + return looseFit; + } @Override public void saveNBTData(NBTTagCompound aNBT) { @@ -170,12 +153,6 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb } @Override - public boolean hasSlotInGUI() { - return true; - } - - - @Override public String getCustomGUIResourceName() { return null; } @@ -185,5 +162,24 @@ public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurb return "Large Steam Turbine"; } + @Override + protected String getTurbineType() { + return "Steam"; + } + + @Override + protected String getCasingName() { + return "Reinforced Steam Turbine Casing"; + } + + @Override + protected ITexture getTextureFrontFace() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5); + } + + @Override + protected ITexture getTextureFrontFaceActive() { + return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5); + } + } -*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java index 9da724c6eb..4b2f60abd1 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GregtechMetaTileEntity_LargerTurbineBase.java @@ -1,10 +1,17 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.lazy; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofChain; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.onElementPass; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdder; + import java.util.ArrayList; -import gregtech.api.GregTech_API; -import gregtech.api.enums.TAE; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import com.gtnewhorizon.structurelib.structure.StructureDefinition; + +import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.gui.GT_GUIContainer_MultiMachine; import gregtech.api.interfaces.ITexture; @@ -13,374 +20,577 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.items.GT_MetaGenerated_Tool; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Dynamo; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Input; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_InputBus; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Muffler; -import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Output; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; -import gregtech.common.items.GT_MetaGenerated_Tool_01; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.block.ModBlocks; -import gtPlusPlus.core.util.Utils; +import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; -import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils; import gtPlusPlus.core.util.sys.KeyboardUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMeta_MultiBlockBase; import gtPlusPlus.xmod.gregtech.common.StaticFields59; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; -import gtPlusPlus.xmod.gregtech.common.blocks.textures.turbine.LargeTurbineTextureHandler; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; import net.minecraftforge.fluids.FluidStack; -public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechMeta_MultiBlockBase { +public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechMeta_MultiBlockBase<GregtechMetaTileEntity_LargerTurbineBase> { protected int baseEff = 0; protected int optFlow = 0; protected double realOptFlow = 0; protected int storedFluid = 0; protected int counter = 0; - protected boolean looseFit=false; + protected int mCasing; + + public ITexture frontFace; + public ITexture frontFaceActive; + + + public ArrayList<GT_MetaTileEntity_Hatch_Turbine> mTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); - private final int mCasingTextureID; - public static String mCasingName; - - public ArrayList<GT_MetaTileEntity_Hatch_Turbine> mTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); public GregtechMetaTileEntity_LargerTurbineBase(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, getCasingMeta()); - mCasingTextureID = getTAE(); - GT9_5_Active = getCasingMeta() == 8 ? LargeTurbineTextureHandler.frontFaceActive_4 : LargeTurbineTextureHandler.frontFaceHPActive_4; - GT9_5 = getCasingMeta() == 8 ? LargeTurbineTextureHandler.frontFace_4 : LargeTurbineTextureHandler.frontFaceHP_4; - frontFaceActive = new GT_RenderedTexture(GT9_5_Active); - frontFace = new GT_RenderedTexture(GT9_5); - + frontFace = getTextureFrontFace(); + frontFaceActive = getTextureFrontFaceActive(); + } public GregtechMetaTileEntity_LargerTurbineBase(String aName) { super(aName); - mCasingName = ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, getCasingMeta()); - mCasingTextureID = getTAE(); - GT9_5_Active = getCasingMeta() == 8 ? LargeTurbineTextureHandler.frontFaceActive_4 : LargeTurbineTextureHandler.frontFaceHPActive_4; - GT9_5 = getCasingMeta() == 8 ? LargeTurbineTextureHandler.frontFace_4 : LargeTurbineTextureHandler.frontFaceHP_4; - frontFaceActive = new GT_RenderedTexture(GT9_5_Active); - frontFace = new GT_RenderedTexture(GT9_5); + frontFace = getTextureFrontFace(); + frontFaceActive = getTextureFrontFaceActive(); } - public final int getTAE() { - return TAE.getIndexFromPage(3, getCasingMeta()); - } - public final String getCasingNaming() { - return ItemUtils.getLocalizedNameOfBlock(ModBlocks.blockCasings4Misc, getCasingMeta()); - } + protected abstract ITexture getTextureFrontFace(); + + protected abstract ITexture getTextureFrontFaceActive(); + + protected abstract String getTurbineType(); + + protected abstract String getCasingName(); + + protected abstract boolean requiresOutputHatch(); @Override - public boolean isCorrectMachinePart(ItemStack aStack) { - return getMaxEfficiency(aStack) > 0; - } + protected final GT_Multiblock_Tooltip_Builder createTooltip() { + GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); + tt.addMachineType(getMachineType()) + .addInfo("Controller Block for the XL "+getTurbineType()+" Turbine") + .addPollutionAmount(getPollutionPerSecond(null)) + .addSeparator() + .beginStructureBlock(3, 9, 3, false) + .addController("Top Middle") + .addCasingInfo(getCasingName(), 360) + .addOtherStructurePart("Rotor Assembly", "Any 1 dot hint", 1) + .addInputBus("Any 4 dot hint (min 1)", 4) + .addInputHatch("Any 4 dot hint(min 1)", 4); + if (requiresOutputHatch()) { + tt.addOutputHatch("Any 4 dot hint(min 1)", 4); + } + tt.addDynamoHatch("Any 4 dot hint(min 1)", 4) + .addMaintenanceHatch("Any 4 dot hint(min 1)", 4); + if (requiresMufflers()) { + tt.addMufflerHatch("Any 7 dot hint (x4)", 7); + } + tt.toolTipFinisher(CORE.GT_Tooltip_Builder); + return tt; + } + + private static final String STRUCTURE_PIECE_MAIN = "main"; + private static final ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>> STRUCTURE_DEFINITION = new ClassValue<IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase>>() { + @Override + protected IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> computeValue(Class<?> type) { + return StructureDefinition.<GregtechMetaTileEntity_LargerTurbineBase>builder() + // c = turbine casing + // s = turbine shaft + // t = turbine housing + // h = dynamo/maint + // m = muffler + .addShape(STRUCTURE_PIECE_MAIN, (new String[][]{ + {"ccchccc", "ccccccc", "ccmmmcc", "ccm~mcc", "ccmmmcc", "ccccccc", "ccchccc"}, + {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"}, + {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, + {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, + {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"}, + {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, + {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, + {"ctchctc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "cscccsc", "ctchctc"}, + {"ccchccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccccccc", "ccchccc"}, + })) + + .addElement('c', lazy(t -> onElementPass(x -> ++x.mCasing, ofBlock(t.getCasingBlock(), t.getCasingMeta())))) + .addElement('s', lazy(t -> ofBlock(t.getCasingBlock(), t.getTurbineShaftMeta()))) + .addElement('t', lazy(t -> ofHatchAdder(GregtechMetaTileEntity_LargerTurbineBase::addTurbineHatch, t.getCasingTextureIndex(), 1))) + .addElement('h', lazy(t -> ofChain( + ofHatchAdder(GregtechMetaTileEntity_LargerTurbineBase::addGenericHatch, t.getCasingTextureIndex(), 4), + onElementPass(x -> ++x.mCasing, ofBlock(t.getCasingBlock(), t.getCasingMeta())) + ))) + .addElement('m', lazy(t -> ofChain( + ofHatchAdder(GregtechMetaTileEntity_LargerTurbineBase::addMuffler, t.getCasingTextureIndex(), 7), + onElementPass(x -> ++x.mCasing, ofBlock(t.getCasingBlock(), t.getCasingMeta()))))) + .build(); + } + }; - public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png"); + @Override + public IStructureDefinition<GregtechMetaTileEntity_LargerTurbineBase> getStructureDefinition() { + return STRUCTURE_DEFINITION.get(getClass()); } - @Override - public boolean checkMultiblock(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { - return checkMachine2(aBaseMetaTileEntity, aStack); + private boolean requiresMufflers() { + return getPollutionPerSecond(null) > 0; } - public boolean checkMachine2(final IGregTechTileEntity aBaseMetaTileEntity, final ItemStack aStack) { - //9 high - //7x7 - + @Override + public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack aStack) { this.mDynamoHatches.clear(); this.mTurbineRotorHatches.clear(); this.mMaintenanceHatches.clear(); - this.mMufflerHatches.clear(); + if (requiresMufflers()) { + this.mMufflerHatches.clear(); + } + this.mInputBusses.clear(); this.mInputHatches.clear(); - this.mOutputHatches.clear(); - - for (int i=0;i>-9;i--) { - if (!getLayer(i)) { - Logger.INFO("Bad Layer: "+(+i)); - return false; - } - } - - Logger.INFO("Hatches | Found "+mTurbineRotorHatches.size()+" Rotor Assemblies, "+12+" are required."); - Logger.INFO("Hatches | Found "+mMaintenanceHatches.size()+" Maint. hatches, "+1+" are required."); - Logger.INFO("Hatches | Found "+mDynamoHatches.size()+" Dynamos, "+1+" or more are required."); - Logger.INFO("Hatches | Found "+mMufflerHatches.size()+" Mufflers, "+4+" are required."); - Logger.INFO("Hatches | Found "+mInputHatches.size()+" Input Hatches, "+1+" or more are required."); - Logger.INFO("Hatches | Found "+mOutputHatches.size()+" Output Hatches, "+1+" ore more are required."); - - if (mTurbineRotorHatches.size() != 12 || + if (requiresOutputHatch()) { + this.mOutputHatches.clear(); + } + mCasing = 0; + + boolean aStructure = checkPiece(STRUCTURE_PIECE_MAIN, 3, 3, 0); + boolean aCasingCount = mCasing >= 360; + log("Structure Check: "+aStructure); + if (!aCasingCount || + mTurbineRotorHatches.size() != 12 || mMaintenanceHatches.size() != 1 || mDynamoHatches.size() < 1 || - mMufflerHatches.size() != 4 || + (requiresMufflers() && mMufflerHatches.size() != 4) || + mInputBusses.size() < 1 || mInputHatches.size() < 1 || - mOutputHatches.size() < 1 + (requiresOutputHatch() && mOutputHatches.size() < 1) ) { + log("Bad Hatches - Turbine Housings: "+mTurbineRotorHatches.size()+ + ", Maint: "+mMaintenanceHatches.size()+ + ", Dynamo: "+mDynamoHatches.size()+ + ", Muffler: "+mMufflerHatches.size()+ + ", Input Buses: "+mInputBusses.size()+ + ", Input Hatches: "+mInputHatches.size()+ + ", Output Hatches: "+mOutputHatches.size()+ + ", Casing Count: "+aCasingCount+" | Found: "+mCasing); return false; - } - Logger.INFO("Built Structure"); - return true; + } + log("Built "+this.getLocalName()+" with "+mCasing+"/360 casings."); + return aCasingCount && aStructure; } + @Override + public void construct(ItemStack stackSize, boolean hintsOnly) { + buildPiece(STRUCTURE_PIECE_MAIN, stackSize, hintsOnly, 3, 3, 0); + } - public boolean getLayer(int aY) { - if (aY == 0 || aY == -2 || aY == -3 || aY == -5 || aY == -6 || aY == -8) { - return checkNormalLayer(aY); + public boolean addTurbineHatch(final IGregTechTileEntity aTileEntity, final int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; } - else { - return checkTurbineLayer(aY); - } - } - - public boolean checkNormalLayer(int aY) { - Block tBlock; - int tMeta; - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - tBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - tMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - IGregTechTileEntity tTileEntity; - - if (aY == 0 && x == 0 && z == 0) { - continue; - } - else if ((x == 0 && z == -3) || (x == 0 && z == 3) || (x == 3 && z == 0) || (x == -3 && z == 0) || - ((aY == 0) && (x == 0 && z == -2) || (x == 0 && z == 2) || (x == 2 && z == 0) || (x == -2 && z == 0))) { - tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z); - if (this.addToMachineList(tTileEntity, this.mCasingTextureID)) { - Logger.INFO("Added Hatch at offset "+x+", "+aY+", "+z+" | Type: "+tTileEntity.getInventoryName()); - continue; - } - } - else if (isValidCasingBlock(tBlock, tMeta)) { - continue; - } else { - if (tBlock != null) { - log("Offset: "+x+", "+aY+", "+z); - log("Found "+tBlock.getLocalizedName()+" with Meta "+tMeta); - log("Expected "+getCasingBlock().getLocalizedName()+" with Meta "+getCasingMeta()); - } - return false; - } + final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity == null) { + return false; + } + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { + log("Found GT_MetaTileEntity_Hatch_Turbine"); + updateTexture(aTileEntity, aBaseCasingIndex); + GT_MetaTileEntity_Hatch_Turbine aTurbineHatch = (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity; + IGregTechTileEntity g = this.getBaseMetaTileEntity(); + if (aTurbineHatch.setController(new BlockPos(g.getXCoord(), g.getYCoord(), g.getZCoord(), g.getWorld()))) { + boolean aDidAdd = this.mTurbineRotorHatches.add(aTurbineHatch); + Logger.INFO("Injected Controller into Turbine Assembly. Found: "+this.mTurbineRotorHatches.size()); + return aDidAdd; + } + else { + Logger.INFO("Failed to inject controller into Turbine Assembly Hatch."); } } - return true; + log("Bad Turbine Housing"); + return false; } - - public boolean checkTurbineLayer(int aY) { - if (!checkTurbineLayerX(aY)) { - return checkTurbineLayerZ(aY); + public final boolean addMuffler(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Muffler) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } } + return false; + } + + public final boolean addGenericHatch(IGregTechTileEntity aTileEntity, int aBaseCasingIndex) { + if (aTileEntity == null) { + return false; + } else { - return true; + IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); + if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Maintenance){ + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Input) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Output) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_InputBus) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } + else if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Dynamo) { + return addToMachineList(aTileEntity, aBaseCasingIndex); + } } + log("Bad Hatch"); + return false; } - public boolean checkTurbineLayerX(int aY) { - Logger.INFO("checking X"); - Block tBlock; - int tMeta; - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - tBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - tMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); + @Override + public boolean isCorrectMachinePart(ItemStack aStack) { + return getMaxEfficiency(aStack) > 0; + } - if ((x == 0 && z == -3) || (x == 0 && z == 3) || (x == 3 && z == 0) || (x == -3 && z == 0) || - ((aY == 0) && (x == 0 && z == -2) || (x == 0 && z == 2) || (x == 2 && z == 0) || (x == -2 && z == 0))) { - IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z); - if (this.addToMachineList(tTileEntity, this.mCasingTextureID)) { - Logger.INFO("Added Hatch at offset "+x+", "+aY+", "+z+" | Type: "+tTileEntity.getInventoryName()); - continue; - } - } + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_MultiMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), "LargeTurbine.png"); + } + public boolean isValidCasingBlock(Block aBlock, int aMeta) { + if (Block.isEqualTo(aBlock, getCasingBlock()) && aMeta == getCasingMeta()) { + return true; + }return false; + } - if (x == -2 || x == 2) { - - //Find Hatches on the ends - if (z == -3 || z == 3) { - IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z); - if (this.addTurbineHatch(tTileEntity, this.mCasingTextureID)) { - log("Found x axis Turbine Assembly at Offset: "+x+", "+aY+", "+z); - continue; - } - else { - log("Missing x axis Turbine Assembly at Offset: "+x+", "+aY+", "+z); - } - } - - if (isValidTurbineBlock(tBlock, tMeta)) { - continue; - } - else { - return false; - } - } - else { - if (isValidCasingBlock(tBlock, tMeta)) { - continue; - } - else { - return false; - } - } - } - } + public boolean isValidTurbineShaft(Block aBlock, int aMeta) { + if (aBlock == getCasingBlock() && aMeta == getTurbineShaftMeta()) { + return true; + } + return false; + } + + public final Block getCasingBlock() { + return ModBlocks.blockSpecialMultiCasings; + } + + @Override + public final boolean hasSlotInGUI() { return true; } - public boolean checkTurbineLayerZ(int aY) { - Logger.INFO("checking Z"); - Block tBlock; - int tMeta; - for (int x = -3; x <= 3; x++) { - for (int z = -3; z <= 3; z++) { - tBlock = this.getBaseMetaTileEntity().getBlockOffset(x, aY, z); - tMeta = this.getBaseMetaTileEntity().getMetaIDOffset(x, aY, z); - - if ((x == 0 && z == -3) || (x == 0 && z == 3) || (x == 3 && z == 0) || (x == -3 && z == 0) || - ((aY == 0) && (x == 0 && z == -2) || (x == 0 && z == 2) || (x == 2 && z == 0) || (x == -2 && z == 0))) { - IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z); - if (this.addToMachineList(tTileEntity, this.mCasingTextureID)) { - Logger.INFO("Added Hatch at offset "+x+", "+aY+", "+z+" | Type: "+tTileEntity.getInventoryName()); - continue; - } - } + public abstract int getCasingMeta(); - if (z == -2 || z == 2) { - - //Find Hatches on the ends - if (x == -3 || x == 3) { - IGregTechTileEntity tTileEntity = this.getBaseMetaTileEntity().getIGregTechTileEntityOffset(x, aY, z); - if (this.addTurbineHatch(tTileEntity, this.mCasingTextureID)) { - log("Found z axis Turbine Assembly at Offset: "+x+", "+aY+", "+z); - continue; - } - else { - log("Missing z axis Turbine Assembly at Offset: "+x+", "+aY+", "+z); - } - } - - if (isValidTurbineBlock(tBlock, tMeta)) { - continue; - } - else { - return false; + public byte getTurbineShaftMeta() { + return 0; + } + + public abstract byte getCasingTextureIndex(); + + public abstract int getFuelValue(FluidStack aLiquid); + + public static boolean isValidTurbine(ItemStack aTurbine) { + return (aTurbine !=null && aTurbine.getItem() instanceof GT_MetaGenerated_Tool && aTurbine.getItemDamage() >= 170 && aTurbine.getItemDamage() <= 176); + } + + protected ArrayList<ItemStack> getAllBufferedTurbines(){ + ArrayList<ItemStack> aTurbinesInStorage = new ArrayList<ItemStack>(); + for (GT_MetaTileEntity_Hatch_InputBus aBus: this.mInputBusses) { + if (isValidMetaTileEntity(aBus)) { + for (ItemStack aContent : aBus.mInventory) { + if (isValidTurbine(aContent)) { + aTurbinesInStorage.add(aContent); } } - else { - if (isValidCasingBlock(tBlock, tMeta)) { - continue; - } - else { - return false; - } - } - } - } - return true; - } + } + } + return aTurbinesInStorage; + } - public boolean isValidCasingBlock(Block aBlock, int aMeta) { - if (GregTech_API.sBlockMachines == aBlock) { - return true; + public boolean areAllTurbinesTheSame() { + ArrayList<GT_MetaTileEntity_Hatch_Turbine> aTurbineAssemblies = getFullTurbineAssemblies(); + if (aTurbineAssemblies.size() < 12) { + log("Found "+aTurbineAssemblies.size()+", expected 12."); + return false; } - if (Block.isEqualTo(aBlock, getCasingBlock()) && (int) aMeta == (int) getCasingMeta()) { - return true; + AutoMap<Materials> aTurbineMats = new AutoMap<Materials>(); + AutoMap<Integer> aTurbineSizes = new AutoMap<Integer>(); + for (GT_MetaTileEntity_Hatch_Turbine aHatch : aTurbineAssemblies) { + aTurbineMats.add(GT_MetaGenerated_Tool.getPrimaryMaterial(aHatch.getTurbine())); + aTurbineSizes.add(getTurbineSize(aHatch.getTurbine())); } - log("Found "+(aBlock != null ? aBlock.getLocalizedName() : "Air") + " With Meta "+aMeta+", Expected "+getCasingBlock().getLocalizedName()+" With Meta "+getCasingMeta()); - return false; + Materials aBaseMat = aTurbineMats.get(0); + int aBaseSize = aTurbineSizes.get(0); + for (int aSize : aTurbineSizes) { + if (aBaseSize != aSize) { + return false; + } + } + for (Materials aMat : aTurbineMats) { + if (aBaseMat != aMat) { + return false; + } + } + return true; } - public boolean isValidTurbineBlock(Block aBlock, int aMeta) { - if (aBlock == getCasingBlock() && aMeta == getCasingMetaTurbine()) { - return true; + public static int getTurbineSize(ItemStack aTurbine) { + if (isValidTurbine(aTurbine)) { + if (aTurbine.getItemDamage() >= 170 && aTurbine.getItemDamage() < 172) { + return 1; + } + else if (aTurbine.getItemDamage() >= 172 && aTurbine.getItemDamage() < 174) { + return 2; + } + else if (aTurbine.getItemDamage() >= 174 && aTurbine.getItemDamage() < 176) { + return 3; + } + else if (aTurbine.getItemDamage() >= 176 && aTurbine.getItemDamage() < 178) { + return 4; + } } - log("Found "+(aBlock != null ? aBlock.getLocalizedName() : "Air") + " With Meta "+aMeta+", Expected "+getCasingBlock().getLocalizedName()+" With Meta "+getCasingMetaTurbine()); - return false; + return 0; } - public Block getCasingBlock() { - return ModBlocks.blockCasings4Misc; + public static String getTurbineSizeString(int aSize) { + switch (aSize) { + case 1: + return "Small Turbine"; + case 2: + return "Turbine"; + case 3: + return "Large Turbine"; + case 4: + return "Huge Turbine"; + default: + return ""; + } } - public abstract byte getCasingMeta(); + protected ArrayList<GT_MetaTileEntity_Hatch_Turbine> getEmptyTurbineAssemblies() { + ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); + //log("Checking "+mTurbineRotorHatches.size()+" Assemblies for empties."); + for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) { + if (!aTurbineHatch.hasTurbine()) { + //log("Found Assembly without Turbine."); + aEmptyTurbineRotorHatches.add(aTurbineHatch); + } + } + return aEmptyTurbineRotorHatches; + } - public byte getCasingMetaTurbine() { - return 7; + protected ArrayList<GT_MetaTileEntity_Hatch_Turbine> getFullTurbineAssemblies() { + ArrayList<GT_MetaTileEntity_Hatch_Turbine> aTurbineRotorHatches = new ArrayList<GT_MetaTileEntity_Hatch_Turbine>(); + //log("Checking "+mTurbineRotorHatches.size()+" Assemblies for Turbines."); + for (GT_MetaTileEntity_Hatch_Turbine aTurbineHatch : this.mTurbineRotorHatches) { + if (aTurbineHatch.hasTurbine()) { + //log("Found Assembly with Turbine."); + aTurbineRotorHatches.add(aTurbineHatch); + } + } + return aTurbineRotorHatches; } - public abstract byte getCasingTextureIndex(); + protected boolean depleteTurbineFromStock(ItemStack aTurbine) { + for (GT_MetaTileEntity_Hatch_InputBus aInputBus : this.mInputBusses) { + for (int slot = 0; slot < aInputBus.mInventory.length; slot++) { + ItemStack aStack = aInputBus.getStackInSlot(slot); + if (aStack != null && GT_Utility.areStacksEqual(aStack, aTurbine)) { + aInputBus.setInventorySlotContents(slot, null); + updateSlots(); + return true; + } + } + } + return false; + } @Override - public boolean checkRecipe(ItemStack aStack) { - if((counter&7)==0 && (aStack==null || !(aStack.getItem() instanceof GT_MetaGenerated_Tool) || aStack.getItemDamage() < 170 || aStack.getItemDamage() >179)) { - stopMachine(); - return false; - } - ArrayList<FluidStack> tFluids = getStoredFluids(); - if (tFluids.size() > 0) { - if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() - || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { - counter = 0; - baseEff = MathUtils.safeInt((long)((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); - optFlow = MathUtils.safeInt((long)Math.max(Float.MIN_NORMAL, - ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() - * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed - * 50)); - if(optFlow<=0 || baseEff<=0){ - stopMachine();//in case the turbine got removed - return false; + public boolean checkRecipe(final ItemStack aStack) { + return checkRecipeGeneric(new ItemStack[] {}, getStoredFluids().toArray(new FluidStack[] {}), 1, 100, 100, 10000); + } + + public boolean checkRecipeGeneric( + ItemStack[] aItemInputs, FluidStack[] aFluidInputs, + int aMaxParallelRecipes, int aEUPercent, + int aSpeedBonusPercent, int aOutputChanceRoll, GT_Recipe aRecipe, boolean isPerpectOC) { + + try { + ArrayList<GT_MetaTileEntity_Hatch_Turbine> aEmptyTurbineRotorHatches = getEmptyTurbineAssemblies(); + if (aEmptyTurbineRotorHatches.size() > 0) { + log("Found "+aEmptyTurbineRotorHatches.size()+" Assemblies without Turbine."); + ArrayList<ItemStack> aTurbines = getAllBufferedTurbines(); + hatch : for (GT_MetaTileEntity_Hatch_Turbine aHatch : aEmptyTurbineRotorHatches) { + for (ItemStack aTurbineItem : aTurbines) { + if (aTurbineItem == null) { + continue; + } + if (aTurbineItem != null && aHatch.insertTurbine(aTurbineItem.copy())) { + boolean aDidDeplete = depleteTurbineFromStock(aTurbineItem); + log("Put Turbine into Assembly - "+aDidDeplete); + continue hatch; + } + } } - } else { - counter++; } - } - else { - Logger.INFO("Did not find any valid input fluids."); - } + //log("Found "+getFullTurbineAssemblies().size()+" Assemblies with a Turbine."); - int newPower = fluidIntoPower(tFluids, optFlow, baseEff); // How much the turbine should be producing with this flow - int difference = newPower - this.mEUt; // difference between current output and new output + if (getEmptyTurbineAssemblies().size() > 0 || !areAllTurbinesTheSame()) { + log("BAD RETURN - 1"); + stopMachine(); + return false; + } - // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick) - // This is how much the turbine can actually change during this tick - int maxChangeAllowed = Math.max(10, MathUtils.safeInt((long)Math.abs(difference)/100)); + //log("Running checkRecipeGeneric(0)"); + + ArrayList<FluidStack> tFluids = getStoredFluids(); + + if (tFluids.size() > 0) { + if (baseEff == 0 || optFlow == 0 || counter >= 512 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled() + || this.getBaseMetaTileEntity().hasInventoryBeenModified()) { + counter = 0; + + //log("Running checkRecipeGeneric(1)"); + float aTotalBaseEff = 0; + float aTotalOptimalFlow = 0; + + ItemStack aStack = getFullTurbineAssemblies().get(0).getTurbine(); + for (int i=0;i<18;i++) { + if (i == 0) { + aTotalBaseEff += GT_Utility.safeInt((long) ((5F + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolCombatDamage(aStack)) * 1000F)); + //log("Bumped base eff to "+aTotalBaseEff); + } + aTotalOptimalFlow += GT_Utility.safeInt((long) Math.max(Float.MIN_NORMAL, + ((GT_MetaGenerated_Tool) aStack.getItem()).getToolStats(aStack).getSpeedMultiplier() + * GT_MetaGenerated_Tool.getPrimaryMaterial(aStack).mToolSpeed + * 50)); + //log("Bumped base optimal flow to "+aTotalOptimalFlow); + } - if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change - int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. - this.mEUt += change; // Apply the change - } else { - this.mEUt = newPower; + //log("Running checkRecipeGeneric(2)"); + //log("Total base eff: "+aTotalBaseEff); + //log("Total base optimal flow: "+aTotalOptimalFlow); + baseEff = MathUtils.roundToClosestInt(aTotalBaseEff); + optFlow = MathUtils.roundToClosestInt(aTotalOptimalFlow); + //log("Total eff: "+baseEff); + //log("Total optimal flow: "+optFlow); + if(optFlow<=0 || baseEff<=0){ + log("Running checkRecipeGeneric(bad-1)"); + stopMachine();//in case the turbine got removed + return false; + } + } else { + counter++; + } + } + + //log("Total eff: "+baseEff); + //log("Total optimal flow: "+optFlow); + + // How much the turbine should be producing with this flow + int newPower = fluidIntoPower(tFluids, optFlow, baseEff); + //log("Bumped newPower to "+newPower); + //log("New Power: "+newPower); + int difference = newPower - this.mEUt; // difference between current output and new output + //log("diff: "+difference); + + // Magic numbers: can always change by at least 10 eu/t, but otherwise by at most 1 percent of the difference in power level (per tick) + // This is how much the turbine can actually change during this tick + int maxChangeAllowed = Math.max(10, GT_Utility.safeInt((long)Math.abs(difference)/100)); + //log("Max Change Allowed: "+maxChangeAllowed); + + if (Math.abs(difference) > maxChangeAllowed) { // If this difference is too big, use the maximum allowed change + int change = maxChangeAllowed * (difference > 0 ? 1 : -1); // Make the change positive or negative. + this.mEUt += change; // Apply the change + //log("Applied power change."); + } + else { + this.mEUt = newPower; + //log("Using same value."); + } + if (this.mEUt <= 0) { + this.mEUt=0; + this.mEfficiency=0; + log("Running checkRecipeGeneric(bad-2)"); + //stopMachine(); + return false; + } else { + this.mMaxProgresstime = 1; + this.mEfficiencyIncrease = 10; + // Overvoltage is handled inside the MultiBlockBase when pushing out to dynamos. no need to do it here. + // Play sounds (GT++ addition - GT multiblocks play no sounds) + startProcess(); + //log("GOOD RETURN - Making: "+this.mEUt+" EU/t"); + return true; + } + } + catch (Throwable t) { + t.printStackTrace(); } + return false; + } - if (this.mEUt <= 0) { - //stopMachine(); - this.mEUt=0; - this.mEfficiency=0; + public boolean doRandomMaintenanceDamage() { + if (getMaxParallelRecipes() == 0 || getRepairStatus() == 0) { + stopMachine(); return false; - } else { - this.mMaxProgresstime = 1; - this.mEfficiencyIncrease = 10; - if(this.mDynamoHatches.size()>0){ - for(GT_MetaTileEntity_Hatch dynamo:mDynamoHatches) - if(isValidMetaTileEntity(dynamo) && dynamo.maxEUOutput() < mEUt) - explodeMultiblock(); - } - return true; } + if (mRuntime++ > 1000) { + mRuntime = 0; + if (getBaseMetaTileEntity().getRandomNumber(6000) == 0) { + switch (getBaseMetaTileEntity().getRandomNumber(6)) { + case 0: + mWrench = false; + break; + case 1: + mScrewdriver = false; + break; + case 2: + mSoftHammer = false; + break; + case 3: + mHardHammer = false; + break; + case 4: + mSolderingTool = false; + break; + case 5: + mCrowbar = false; + break; + } + } + for (GT_MetaTileEntity_Hatch_Turbine aHatch : getFullTurbineAssemblies()) { + aHatch.damageTurbine(mEUt, damageFactorLow, damageFactorHigh); + } + } + return true; + } + + @Override + public int getMaxParallelRecipes() { + return (getFullTurbineAssemblies().size()); + } + + public boolean runRecipe(GT_MetaTileEntity_Hatch_Turbine aHatch) { + return false; } abstract int fluidIntoPower(ArrayList<FluidStack> aFluids, int aOptFlow, int aBaseEff); @@ -391,19 +601,17 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM } public int getMaxEfficiency(ItemStack aStack) { - if (GT_Utility.isStackInvalid(aStack)) { - return 0; - } - if (aStack.getItem() instanceof GT_MetaGenerated_Tool_01) { - return 10000; - } - return 0; + return this.getMaxParallelRecipes() == 12 ? 10000 : 0; } @Override public boolean explodesOnComponentBreak(ItemStack aStack) { return true; } + public boolean isLooseMode() { + return false; + } + @Override public String[] getExtraInfoData() { int mPollutionReduction=0; @@ -413,17 +621,20 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM } } - String tRunning = mMaxProgresstime>0 ? - + String tRunning = mMaxProgresstime > 0 ? EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.running.true")+EnumChatFormatting.RESET : EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.running.false")+EnumChatFormatting.RESET; + String tMaintainance = getIdealStatus() == getRepairStatus() ? EnumChatFormatting.GREEN+StatCollector.translateToLocal("GT5U.turbine.maintenance.false")+EnumChatFormatting.RESET : EnumChatFormatting.RED+StatCollector.translateToLocal("GT5U.turbine.maintenance.true")+EnumChatFormatting.RESET ; int tDura = 0; - if (mInventory[1] != null && mInventory[1].getItem() instanceof GT_MetaGenerated_Tool_01) { - tDura = MathUtils.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(mInventory[1]) * (GT_MetaGenerated_Tool.getToolDamage(mInventory[1]))+1)); + String aTurbineDamage = ""; + for (GT_MetaTileEntity_Hatch_Turbine aHatch : this.getFullTurbineAssemblies()) { + ItemStack aTurbine = aHatch.getTurbine(); + tDura = MathUtils.safeInt((long)(100.0f / GT_MetaGenerated_Tool.getToolMaxDamage(aTurbine) * (GT_MetaGenerated_Tool.getToolDamage(aTurbine))+1)); + aTurbineDamage += EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"% | "; } long storedEnergy=0; @@ -434,38 +645,23 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM maxEnergy+=tHatch.getBaseMetaTileEntity().getEUCapacity(); } } - String[] ret = new String[]{ - // 8 Lines available for information panels - tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", */ -/* 1 *//* - - tMaintainance, */ -/* 2 *//* - - StatCollector.translateToLocal("GT5U.turbine.efficiency")+": "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", */ -/* 2 *//* - StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ */ -/* 3 *//* - - EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", - StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + */ -/* 4 *//* - - EnumChatFormatting.YELLOW+" ("+(looseFit?StatCollector.translateToLocal("GT5U.turbine.loose"):StatCollector.translateToLocal("GT5U.turbine.tight"))+")", */ -/* 5 *//* - - StatCollector.translateToLocal("GT5U.turbine.fuel")+": "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", */ -/* 6 *//* - - StatCollector.translateToLocal("GT5U.turbine.dmg")+": "+EnumChatFormatting.RED+Integer.toString(tDura)+EnumChatFormatting.RESET+"%", */ -/* 7 *//* - - StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" */ -/* 8 *//* + boolean aIsSteam = this.getClass().getName().toLowerCase().contains("steam"); + String[] ret = new String[]{ + // 8 Lines available for information panels + tRunning + ": " + EnumChatFormatting.RED+mEUt+EnumChatFormatting.RESET+" EU/t", + tMaintainance, + StatCollector.translateToLocal("GT5U.turbine.efficiency")+": "+EnumChatFormatting.YELLOW+(mEfficiency/100F)+EnumChatFormatting.RESET+"%", + StatCollector.translateToLocal("GT5U.multiblock.energy")+": " + EnumChatFormatting.GREEN + Long.toString(storedEnergy) + EnumChatFormatting.RESET +" EU / "+ + EnumChatFormatting.YELLOW + Long.toString(maxEnergy) + EnumChatFormatting.RESET +" EU", + StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t" + + EnumChatFormatting.YELLOW+" ("+(isLooseMode()?StatCollector.translateToLocal("GT5U.turbine.loose"):StatCollector.translateToLocal("GT5U.turbine.tight"))+")", + StatCollector.translateToLocal("GT5U.turbine.fuel")+": "+EnumChatFormatting.GOLD+storedFluid+EnumChatFormatting.RESET+"L", + StatCollector.translateToLocal("GT5U.turbine.dmg")+": "+aTurbineDamage, + StatCollector.translateToLocal("GT5U.multiblock.pollution")+": "+ EnumChatFormatting.GREEN + mPollutionReduction+ EnumChatFormatting.RESET+" %" }; - if (!this.getClass().getName().contains("Steam")) + if (!aIsSteam) ret[4]=StatCollector.translateToLocal("GT5U.turbine.flow")+": "+EnumChatFormatting.YELLOW+MathUtils.safeInt((long)realOptFlow)+EnumChatFormatting.RESET+" L/t"; return ret; @@ -479,19 +675,22 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM public boolean polluteEnvironment(int aPollutionLevel) { - mPollution += aPollutionLevel; - for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { - if (isValidMetaTileEntity(tHatch)) { - if (mPollution >= 1000) { - if (tHatch.polluteEnvironment()) { - mPollution -= 1000; + if (this.requiresMufflers()) { + mPollution += aPollutionLevel; + for (GT_MetaTileEntity_Hatch_Muffler tHatch : mMufflerHatches) { + if (isValidMetaTileEntity(tHatch)) { + if (mPollution >= 10000) { + if (PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10000)) { + mPollution -= 10000; + } + } else { + break; } - } else { - break; } } + return mPollution < 10000; } - return mPollution < 1000; + return true; } @Override public long maxAmperesOut() { @@ -505,114 +704,65 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM //super.onModeChangeByScrewdriver(aSide, aPlayer, aX, aY, aZ); } else { + /* this.mIsAnimated = Utils.invertBoolean(mIsAnimated); if (this.mIsAnimated) { - PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture."); + PlayerUtils.messagePlayer(aPlayer, "Using Animated Turbine Texture."); } else { - PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture."); + PlayerUtils.messagePlayer(aPlayer, "Using Static Turbine Texture."); } if (mTurbineRotorHatches.size() > 0) { - for (GT_MetaTileEntity_Hatch_Turbine h : mTurbineRotorHatches) { - if (h != null) { - h.mUsingAnimation = mIsAnimated; - } + for (GT_MetaTileEntity_Hatch_Turbine h : mTurbineRotorHatches) { + if (h != null) { + h.mUsingAnimation = mIsAnimated; } + } } - } + */} } @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setBoolean("mIsAnimated", mIsAnimated); + public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? getFrontFacingTurbineTexture(aActive) : Textures.BlockIcons.getCasingTextureForId(getCasingTextureIndex())}; } - @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - mIsAnimated = aNBT.getBoolean("mIsAnimated"); - } - - private boolean mIsAnimated = true; - public ITexture frontFace; - public ITexture frontFaceActive; - private CustomIcon GT9_5_Active; - private CustomIcon GT9_5; - - public boolean usingAnimations() { - return mIsAnimated; - } - - @Override - public final ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[1][aColorIndex + 1], aFacing == aSide ? getFrontFacingTurbineTexture(aActive) : Textures.BlockIcons.getCasingTextureForId(getTAE())}; - } - protected ITexture getFrontFacingTurbineTexture(boolean isActive) { - if (usingAnimations()) { - if (isActive) { - return frontFaceActive; - } + if (isActive) { + return frontFaceActive; } return frontFace; } - - public boolean addTurbineHatch(final IGregTechTileEntity aTileEntity, - final int aBaseCasingIndex) { - if (aTileEntity == null) { - return false; - } - final IMetaTileEntity aMetaTileEntity = aTileEntity.getMetaTileEntity(); - if (aMetaTileEntity == null) { - return false; - } - if (aMetaTileEntity instanceof GT_MetaTileEntity_Hatch_Turbine) { - log("Found GT_MetaTileEntity_Hatch_Turbine"); - updateTexture(aTileEntity, aBaseCasingIndex); - GT_MetaTileEntity_Hatch_Turbine aTurbineHatch = (GT_MetaTileEntity_Hatch_Turbine) aMetaTileEntity; - IGregTechTileEntity g = this.getBaseMetaTileEntity(); - if (aTurbineHatch.setController(new BlockPos(g.getXCoord(), g.getYCoord(), g.getZCoord(), g.getWorld()))) { - Logger.INFO("Injected Controller into Turbine Assembly."); - return this.mTurbineRotorHatches.add(aTurbineHatch); - } - else { - Logger.INFO("Failed to inject controller into Turbine Assembly Hatch."); - } - } - return false; - } - + @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - super.onPostTick(aBaseMetaTileEntity, aTick); if (aBaseMetaTileEntity.isServerSide()) { - if (mUpdate == 0 || this.mStartUpCheck == 0) { + if (mUpdate == 1 || mStartUpCheck == 1) { + log("Cleared Rotor Assemblies."); this.mTurbineRotorHatches.clear(); } - } - if (aTick % 20 == 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { + } + super.onPostTick(aBaseMetaTileEntity, aTick); + if (this.maxProgresstime() > 0 || this.getBaseMetaTileEntity().hasWorkJustBeenEnabled()) { enableAllTurbineHatches(); } - + if (this.maxProgresstime() <= 0) { + stopMachine(); + } + } @Override public void startProcess() { super.startProcess(); enableAllTurbineHatches(); } - @Override - public void onMachineBlockUpdate() { - super.onMachineBlockUpdate(); - } - @Override - public boolean onRunningTick(ItemStack aStack) { - return super.onRunningTick(aStack); - } + @Override public void stopMachine() { - super.stopMachine(); + baseEff = 0; + optFlow = 0; disableAllTurbineHatches(); + super.stopMachine(); } @Override public void onRemoval() { @@ -630,7 +780,7 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM public boolean disableAllTurbineHatches() { return updateTurbineHatches(false) > 0; } - + private Long mLastHatchUpdate; public int updateTurbineHatches(boolean aState) { int aUpdated = 0; @@ -648,16 +798,97 @@ public abstract class GregtechMetaTileEntity_LargerTurbineBase extends GregtechM mLastHatchUpdate = System.currentTimeMillis()/1000; return aUpdated; } - - @Override - public int getMaxParallelRecipes() { - return 1; - } @Override public int getEuDiscountForParallelism() { return 0; } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + // Fix GT bug + if (this.getBaseMetaTileEntity().getFrontFacing() != 1) { + log("Fixing Bad Facing. (GT Bug)"); + this.getBaseMetaTileEntity().setFrontFacing((byte) 1); + } + } + + /** + * Called every tick the Machine runs + */ + public boolean onRunningTick(ItemStack aStack) { + if (mEUt > 0) { + addEnergyOutput(((long) mEUt * mEfficiency) / 10000); + return true; + } + return false; + } + + @Override + public boolean addEnergyOutput(long aEU) { + if (aEU <= 0) { + return true; + } + if (this.mAllDynamoHatches.size() > 0) { + return addEnergyOutputMultipleDynamos(aEU, true); + } + return false; + } + public boolean addEnergyOutputMultipleDynamos(long aEU, boolean aAllowMixedVoltageDynamos) { + int injected = 0; + long totalOutput = 0; + long aFirstVoltageFound = -1; + boolean aFoundMixedDynamos = false; + for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) { + if(aDynamo == null) { + return false; + } + if (isValidMetaTileEntity(aDynamo)) { + long aVoltage = aDynamo.maxEUOutput(); + long aTotal = aDynamo.maxAmperesOut() * aVoltage; + // Check against voltage to check when hatch mixing + if (aFirstVoltageFound == -1) { + aFirstVoltageFound = aVoltage; + } + else { + if (aFirstVoltageFound != aVoltage) { + aFoundMixedDynamos = true; + } + } + totalOutput += aTotal; + } + } + + if (totalOutput < aEU || (aFoundMixedDynamos && !aAllowMixedVoltageDynamos)) { + explodeMultiblock(); + return false; + } + + long leftToInject; + long aVoltage; + int aAmpsToInject; + int aRemainder; + int ampsOnCurrentHatch; + for (GT_MetaTileEntity_Hatch aDynamo : mAllDynamoHatches) { + if (isValidMetaTileEntity(aDynamo)) { + leftToInject = aEU - injected; + aVoltage = aDynamo.maxEUOutput(); + aAmpsToInject = (int) (leftToInject / aVoltage); + aRemainder = (int) (leftToInject - (aAmpsToInject * aVoltage)); + ampsOnCurrentHatch= (int) Math.min(aDynamo.maxAmperesOut(), aAmpsToInject); + for (int i = 0; i < ampsOnCurrentHatch; i++) { + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aVoltage, false); + } + injected+=aVoltage*ampsOnCurrentHatch; + if(aRemainder>0 && ampsOnCurrentHatch<aDynamo.maxAmperesOut()){ + aDynamo.getBaseMetaTileEntity().increaseStoredEnergyUnits(aRemainder, false); + injected+=aRemainder; + } + } + } + return injected > 0; + } + } -*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java index 78adb094ed..344b7f710a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/storage/GregtechMetaTileEntity_PowerSubStationController.java @@ -14,8 +14,7 @@ import com.gtnewhorizon.structurelib.structure.IStructureDefinition; import com.gtnewhorizon.structurelib.structure.IStructureElement; import com.gtnewhorizon.structurelib.structure.StructureDefinition; -import gregtech.api.enums.TAE; -import gregtech.api.enums.Textures; +import gregtech.api.enums.*; import gregtech.api.interfaces.ITexture; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; @@ -57,6 +56,8 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe } protected long mAverageEuUsage = 0; + protected long mAverageEuAdded = 0; + protected long mAverageEuConsumed = 0; protected long mTotalEnergyAdded = 0; protected long mTotalEnergyConsumed = 0; protected long mTotalEnergyLost = 0; @@ -87,7 +88,6 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe protected GT_Multiblock_Tooltip_Builder createTooltip() { GT_Multiblock_Tooltip_Builder tt = new GT_Multiblock_Tooltip_Builder(); tt.addMachineType(getMachineType()) - .addInfo("[BUG] GUI does not work until structure is assembled correctly. (Do Not Report issue)") .addInfo("Consumes " + this.ENERGY_TAX + "% of the average voltage of all energy type hatches") .addInfo("Does not require maintenance") .addInfo("Can be built with variable height between " + (CELL_HEIGHT_MIN + 2) + "-" + (CELL_HEIGHT_MAX + 2) + "") @@ -128,7 +128,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe @Override public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) { - if (mBatteryCapacity <= 0) return false; + //if (mBatteryCapacity <= 0) return false; if (!aBaseMetaTileEntity.isClientSide()) { aBaseMetaTileEntity.openGUI(aPlayer); } @@ -194,7 +194,7 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe public static int getMaxHatchTier(int aCellTier) { switch(aCellTier) { case 9: - return CORE.GTNH ? 15 : 9; + return GT_Values.VOLTAGE_NAMES[9].equals("Ultimate High Voltage") ? 15 : 9; default: if (aCellTier < 4) { return 0; @@ -476,6 +476,8 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe @Override public void saveNBTData(NBTTagCompound aNBT) { aNBT.setLong("mAverageEuUsage", this.mAverageEuUsage); + aNBT.setLong("mAverageEuAdded", this.mAverageEuAdded); + aNBT.setLong("mAverageEuConsumed", this.mAverageEuConsumed); //Usage Stats aNBT.setLong("mTotalEnergyAdded", this.mTotalEnergyAdded); @@ -493,7 +495,13 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe // Best not to get a long if the Tag Map is holding an int if (aNBT.hasKey("mAverageEuUsage")) { this.mAverageEuUsage = aNBT.getLong("mAverageEuUsage"); - } + } + if (aNBT.hasKey("mAverageEuAdded")) { + this.mAverageEuAdded = aNBT.getLong("mAverageEuAdded"); + } + if (aNBT.hasKey("mAverageEuConsumed")) { + this.mAverageEuConsumed = aNBT.getLong("mAverageEuConsumed"); + } //Usage Stats this.mTotalEnergyAdded = aNBT.getLong("mTotalEnergyAdded"); @@ -510,8 +518,8 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe @Override public boolean checkRecipe(final ItemStack aStack) { - this.mProgresstime = 1; - this.mMaxProgresstime = 1; + this.mProgresstime = 0; + this.mMaxProgresstime = 200; this.mEUt = 0; this.mEfficiencyIncrease = 10000; this.fixAllMaintenanceIssue(); @@ -528,34 +536,43 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe return 0; } - private void drawEnergyFromHatch(MetaTileEntity aHatch) { - if (!isValidMetaTileEntity(aHatch)) return; + private long drawEnergyFromHatch(MetaTileEntity aHatch) { + if (!isValidMetaTileEntity(aHatch)) { + return 0; + } long stored = aHatch.getEUVar(); long voltage = aHatch.maxEUInput() * aHatch.maxAmperesIn(); if (voltage > stored) { - return; + return 0; } if (this.getBaseMetaTileEntity().increaseStoredEnergyUnits(voltage, false)) { aHatch.setEUVar((stored - voltage)); this.mTotalEnergyAdded += voltage; + return voltage; } + return 0; } - private void addEnergyToHatch(MetaTileEntity aHatch) { - if (!isValidMetaTileEntity(aHatch)) return; + private long addEnergyToHatch(MetaTileEntity aHatch) { + if (!isValidMetaTileEntity(aHatch)) { + return 0; + } long voltage = aHatch.maxEUOutput() * aHatch.maxAmperesOut(); - if (aHatch.getEUVar() > aHatch.maxEUStore() - voltage) return; + if (aHatch.getEUVar() > aHatch.maxEUStore() - voltage) { + return 0; + } if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(voltage, false)) { aHatch.getBaseMetaTileEntity().increaseStoredEnergyUnits(voltage, false); this.mTotalEnergyConsumed+=voltage; + return voltage; } - + return 0; } private long computeEnergyTax() { @@ -586,23 +603,32 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe this.mTotalEnergyLost += Math.min(mDecrease, this.getEUVar()); this.setEUVar(Math.max(0, this.getEUVar() - mDecrease)); + long aInputAverage = 0; + long aOutputAverage = 0; // Input Power for (Object THatch : this.mDischargeHatches) { GT_MetaTileEntity_Hatch_OutputBattery tHatch = (GT_MetaTileEntity_Hatch_OutputBattery) THatch; drawEnergyFromHatch(tHatch); + aInputAverage += tHatch.maxEUInput() * tHatch.maxAmperesIn(); } for (GT_MetaTileEntity_Hatch tHatch : this.mAllEnergyHatches) { drawEnergyFromHatch(tHatch); + aInputAverage += tHatch.maxEUInput() * tHatch.maxAmperesIn(); } // Output Power for (Object THatch : this.mChargeHatches) { GT_MetaTileEntity_Hatch_InputBattery tHatch = (GT_MetaTileEntity_Hatch_InputBattery) THatch; - addEnergyToHatch(tHatch); + aOutputAverage += addEnergyToHatch(tHatch); } for (GT_MetaTileEntity_Hatch tHatch : this.mAllDynamoHatches) { - addEnergyToHatch(tHatch); + aOutputAverage += addEnergyToHatch(tHatch); } + // reset progress time + mProgresstime = 0; + + this.mAverageEuAdded = aInputAverage; + this.mAverageEuConsumed = aOutputAverage; return true; @@ -658,6 +684,8 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe "Requires Maintenance: " + (!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED)+ mMaint + EnumChatFormatting.RESET +" | Code: ["+(!mMaint ? EnumChatFormatting.GREEN : EnumChatFormatting.RED) + errorCode + EnumChatFormatting.RESET +"]", "----------------------", "Stats for Nerds", + "Average Input: " + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(this.mAverageEuAdded) + EnumChatFormatting.RESET + " EU", + "Average Output: " + EnumChatFormatting.GOLD + GT_Utility.formatNumbers(this.mAverageEuConsumed) + EnumChatFormatting.RESET + " EU", "Total Input: " + EnumChatFormatting.BLUE + GT_Utility.formatNumbers(this.mTotalEnergyAdded) + EnumChatFormatting.RESET + " EU", "Total Output: " + EnumChatFormatting.GOLD + GT_Utility.formatNumbers(this.mTotalEnergyConsumed) + EnumChatFormatting.RESET + " EU", "Total Costs: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.mTotalEnergyLost) + EnumChatFormatting.RESET + " EU", @@ -726,6 +754,14 @@ public class GregtechMetaTileEntity_PowerSubStationController extends GregtechMe return 32768; } + public final long getAverageEuAdded() { + return this.mAverageEuAdded; + } + + public final long getAverageEuConsumed() { + return this.mAverageEuConsumed; + } + @Override public void onModeChangeByScrewdriver(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { mIsOutputtingPower = Utils.invertBoolean(mIsOutputtingPower); 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 new file mode 100644 index 0000000000..67999087f3 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/GT_TileEntity_ComputerCube.java @@ -0,0 +1,1052 @@ +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 Ic2ExpReactorPlanner.SimulationData; +import cpw.mods.fml.common.FMLCommonHandler; +import gregtech.api.GregTech_API; +import gregtech.api.enums.*; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.objects.*; +import gregtech.api.util.*; +import gregtech.api.util.GT_Recipe.GT_Recipe_Map; +import gregtech.common.items.behaviors.Behaviour_DataOrb; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_Container_ComputerCube; +import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_GUIContainer_ComputerCube; +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; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + +public class GT_TileEntity_ComputerCube extends GT_MetaTileEntity_BasicTank { + + 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 Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + Logger.INFO("CC-Sever ID: "+aID); + return new GT_Container_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode); + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + Logger.INFO("CC-Client ID: "+aID); + return new GT_GUIContainer_ComputerCube(aPlayerInventory, aBaseMetaTileEntity, mMode); + } + + @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}; + } + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer, mMode); + 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(byte 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(byte aFacing) { + 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 byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 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]; + } + + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java index 5d8e9d468d..4b73bba6df 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/misc/TileEntitySolarHeater.java @@ -1,4 +1,3 @@ -/* package gtPlusPlus.xmod.gregtech.common.tileentities.misc; import gregtech.api.enums.Textures; @@ -13,16 +12,18 @@ import gtPlusPlus.api.objects.minecraft.BlockPos; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_SolarTower; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock { - public String mSolarTower; public boolean mHasTower = false; - - private Integer mTX, mTY, mTZ; + private GregtechMetaTileEntity_SolarTower mTower = null; + + private int mTX, mTY, mTZ; private Byte mRequiredFacing; public TileEntitySolarHeater(final int aID, final String aName, final String aNameRegional, final int aTier, @@ -88,7 +89,8 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock } public ITexture[] getSides(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } public ITexture[] getFrontActive(final byte aColor) { @@ -110,7 +112,8 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock } public ITexture[] getSidesActive(final byte aColor) { - return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top) }; + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top), + new GT_RenderedTexture(Textures.BlockIcons.SOLARPANEL_IV) }; } @Override @@ -223,7 +226,7 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock @Override public void saveNBTData(NBTTagCompound aNBT) { aNBT.setBoolean("mHasTower", mHasTower); - if (mHasTower && mTX != null && mTY != null && mTZ != null) { + if (mHasTower) { aNBT.setInteger("mTX", mTX); aNBT.setInteger("mTY", mTY); aNBT.setInteger("mTZ", mTZ); @@ -262,57 +265,55 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock public void onExplosion() { } - + + public boolean hasSolarTower() { + return mHasTower; + } + public GregtechMetaTileEntity_SolarTower getSolarTower() { - if (this.mHasTower && this.mSolarTower != null && this.mSolarTower.length() > 0) { - BlockPos p = BlockPos.generateBlockPos(mSolarTower); - if (p != null) { - IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntity(p.xPos, p.yPos, p.zPos); - if (tTileEntity != null && tTileEntity instanceof GregtechMetaTileEntity_SolarTower) { - return (GregtechMetaTileEntity_SolarTower) tTileEntity; - } - } + if (this.mHasTower) { + return mTower; } return null; } + public boolean canSeeSky() { + if (this.getBaseMetaTileEntity().getWorld().canBlockSeeTheSky(this.getBaseMetaTileEntity().getXCoord(), this.getBaseMetaTileEntity().getYCoord(), this.getBaseMetaTileEntity().getZCoord())) { + return true; + } + return false; + } - public boolean setSolarTower(BlockPos aTowerPos) { - if (!this.mHasTower && setSolarTowerInternal(aTowerPos.getUniqueIdentifier())) { - IGregTechTileEntity tTileEntity = getBaseMetaTileEntity().getIGregTechTileEntity(aTowerPos.xPos, aTowerPos.yPos, aTowerPos.zPos); - if (tTileEntity != null && tTileEntity instanceof GregtechMetaTileEntity_SolarTower) { - this.mTX = tTileEntity.getXCoord(); - this.mTY = (int) tTileEntity.getYCoord(); - this.mTZ = tTileEntity.getZCoord(); - this.mHasTower = true; - return true; - } - } + + public boolean setSolarTower(GregtechMetaTileEntity_SolarTower aTowerTile) { + if (!hasSolarTower()) { + this.mTX = aTowerTile.getBaseMetaTileEntity().getXCoord(); + this.mTY = (int) aTowerTile.getBaseMetaTileEntity().getYCoord(); + this.mTZ = aTowerTile.getBaseMetaTileEntity().getZCoord(); + this.mHasTower = true; + this.mTower = aTowerTile; + return true; + } return false; } - - private boolean clearSolarTower() { - if (mHasTower || mTX != null || mTY != null || mTZ != null || mRequiredFacing != null || this.mSolarTower != null) { - this.mTX = null; - this.mTY = null; - this.mTZ = null; - this.mRequiredFacing = null; - this.mSolarTower = null; - this.mHasTower = false; - return true; - } - return false; - } - - private final boolean setSolarTowerInternal(String aTowerPos) { - this.mSolarTower = aTowerPos; - return this.mSolarTower != null && this.mSolarTower.length() > 0; + + public boolean clearSolarTower() { + if (mHasTower || mRequiredFacing != null || this.mTower != null) { + this.mTX = 0; + this.mTY = 0; + this.mTZ = 0; + this.mRequiredFacing = null; + this.mTower = null; + this.mHasTower = false; + return true; + } + return false; } @Override public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { super.onPostTick(aBaseMetaTileEntity, aTick); - + } @Override @@ -345,4 +346,3 @@ public class TileEntitySolarHeater extends GT_MetaTileEntity_TieredMachineBlock } } -*/ diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java new file mode 100644 index 0000000000..9bb2443683 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneBase.java @@ -0,0 +1,121 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_TieredMachineBlock; +import gregtech.api.objects.GT_ItemStack; +import gtPlusPlus.core.lib.CORE; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +public abstract class GT_MetaTileEntity_RedstoneBase extends GT_MetaTileEntity_TieredMachineBlock { + + protected int mOpenerCount; + + public GT_MetaTileEntity_RedstoneBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_RedstoneBase(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_RedstoneBase(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + public GT_MetaTileEntity_RedstoneBase(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) { + super(aName, aTier, aInvSlotCount, aDescription, aTextures); + } + + @Override + public final boolean isSimpleMachine() { + return false; + } + + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return aSide != getBaseMetaTileEntity().getFrontFacing(); + } + + @Override + public final boolean isValidSlot(int aIndex) { + return false; + } + + @Override + public final boolean isFacingValid(byte aFacing) { + return true; + } + + @Override + public final boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + + @Override + public abstract void saveNBTData(NBTTagCompound aNBT); + + @Override + public abstract void loadNBTData(NBTTagCompound aNBT); + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + return false; + } + + @Override + public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, gregtech.api.interfaces.tileentity.IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, gregtech.api.interfaces.tileentity.IGregTechTileEntity aBaseMetaTileEntity) { + return null; + } + + @Override + public final void onOpenGUI() { + super.onOpenGUI(); + mOpenerCount++; + } + + @Override + public final void onCloseGUI() { + super.onCloseGUI(); + mOpenerCount--; + } + + public boolean hasRedstoneSignal() { + if (getBaseMetaTileEntity().getStrongestRedstone() > 0) { + return true; + } + for (byte i=0;i<6;i++) { + if (getBaseMetaTileEntity().getOutputRedstoneSignal(i) > 0) { + return true; + } + } + return false; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public String[] getDescription() { + return new String[]{ + this.mDescription, + CORE.GT_Tooltip + }; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java new file mode 100644 index 0000000000..0c0cc44d93 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneButtonPanel.java @@ -0,0 +1,207 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_RedstoneButtonPanel extends GT_MetaTileEntity_RedstoneBase { + + public byte mRedstoneStrength = 0, mType = 0, mUpdate = 0; + + public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[64]; + + static { + for (int i=0;i<64;i++) { + sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/ButtonPanel/"+i); + } + } + + public GT_MetaTileEntity_RedstoneButtonPanel(int aID) { + super(aID, "redstone.button.panel", "Button Panel", 5, 0, "Right-click with Screwdriver to change Button Design"); + } + + public GT_MetaTileEntity_RedstoneButtonPanel(final String aName, String aDescription, final ITexture[][][] aTextures) { + super(aName, 5, 0, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_RedstoneButtonPanel(this.mName, mDescription, this.mTextures); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setByte("mRedstoneStrength", mRedstoneStrength); + aNBT.setByte("mType", mType); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mRedstoneStrength = aNBT.getByte("mRedstoneStrength"); + mType = aNBT.getByte("mType"); + } + + @Override + public void onValueUpdate(byte aValue) { + mRedstoneStrength = (byte)(aValue & 15); + mType = (byte)(aValue >>> 4); + } + + @Override + public byte getUpdateData() { + return (byte)((mRedstoneStrength & 15) | (mType << 4)); + } + + @Override + public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ) { + if (aSide == getBaseMetaTileEntity().getFrontFacing()) { + if (getBaseMetaTileEntity().isServerSide()) { + mUpdate = 2; + switch (mType) { + case 0: default: + switch (aSide) { + case 0: case 1: + mRedstoneStrength = (byte)((byte)( aX*4) + 4 * (byte)( aZ*4)); + break; + case 2: + mRedstoneStrength = (byte)((byte)(4-aX*4) + 4 * (byte)(4-aY*4)); + break; + case 3: + mRedstoneStrength = (byte)((byte)( aX*4) + 4 * (byte)(4-aY*4)); + break; + case 4: + mRedstoneStrength = (byte)((byte)( aZ*4) + 4 * (byte)(4-aY*4)); + break; + case 5: + mRedstoneStrength = (byte)((byte)(4-aZ*4) + 4 * (byte)(4-aY*4)); + break; + } + break; + case 1: + switch (aSide) { + case 0: case 1: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)( aX*2) + 2 * (byte)( aZ*2))))); + break; + case 2: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)(2-aX*2) + 2 * (byte)(2-aY*2))))); + break; + case 3: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)( aX*2) + 2 * (byte)(2-aY*2))))); + break; + case 4: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)( aZ*2) + 2 * (byte)(2-aY*2))))); + break; + case 5: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << (((byte)(2-aZ*2) + 2 * (byte)(2-aY*2))))); + break; + } + break; + case 2: + switch (aSide) { + case 0: case 1: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)( aZ*4)))); + break; + case 2: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)(4-aY*4)))); + break; + case 3: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)(4-aY*4)))); + break; + case 4: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)(4-aY*4)))); + break; + case 5: + mRedstoneStrength = (byte)(mRedstoneStrength ^ (1 << ((byte)(4-aY*4)))); + break; + } + break; + } + } + return true; + } + return false; + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (getBaseMetaTileEntity().isServerSide()) { + getBaseMetaTileEntity().setGenericRedstoneOutput(true); + if (mUpdate > 0) { + mUpdate--; + } + else if (getBaseMetaTileEntity().isAllowedToWork()) { + mRedstoneStrength = 0; + } + for (byte i = 0; i < 6; i++) { + getBaseMetaTileEntity().setStrongOutputRedstoneSignal(i, i == getBaseMetaTileEntity().getFrontFacing()?(byte)0:mRedstoneStrength); + getBaseMetaTileEntity().setInternalOutputRedstoneSignal(i, i == getBaseMetaTileEntity().getFrontFacing()?(byte)0:mRedstoneStrength); + } + } + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aSide == getBaseMetaTileEntity().getFrontFacing()) mType=(byte)((mType+1)%3); + } + + @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.getBottom(i); + rTextures[3][i + 1] = this.getTop(i); + rTextures[4][i + 1] = this.getSides(i); + rTextures[5][i + 1] = this.getFront(i); + rTextures[6][i + 1] = this.getSidesActive(i); + rTextures[7][i + 1] = this.getBottomActive(i); + rTextures[8][i + 1] = this.getTopActive(i); + rTextures[9][i + 1] = this.getSidesActive(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(sIconList[mType*16+mRedstoneStrength])}; + } + return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; + } + + public ITexture[] getFront(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_Off)}; + } + + public ITexture[] getTopActive(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Main_On)}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_Off)}; + } + + public ITexture[] getBottomActive(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Main_On)}; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_Off)}; + } + + public ITexture[] getSidesActive(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Main_On)}; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java new file mode 100644 index 0000000000..379345ec6a --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneCircuitBlock.java @@ -0,0 +1,498 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; + +import java.util.*; + +import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.IRedstoneCircuitBlock; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.ICoverable; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.*; +import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_Container_RedstoneCircuitBlock; +import gtPlusPlus.xmod.gregtech.api.gui.computer.GT_GUIContainer_RedstoneCircuitBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public class GT_MetaTileEntity_RedstoneCircuitBlock extends GT_MetaTileEntity_RedstoneBase implements IRedstoneCircuitBlock { + + public int mGate = 0, mGateData[] = new int[]{0, 0, 0, 0, 0, 0, 0, 0}; + public boolean bOutput = true; + + public GT_MetaTileEntity_RedstoneCircuitBlock(int aID) { + super(aID, "redstone.circuit", "Redstone Circuit Block", 1, 5, "Computes Redstone"); + } + + public GT_MetaTileEntity_RedstoneCircuitBlock(final String aName, String aDescription, final ITexture[][][] aTextures) { + super(aName, 1, 5, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_RedstoneCircuitBlock(this.mName, mDescription, this.mTextures); + } + + @Override + public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_RedstoneCircuitBlock(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_RedstoneCircuitBlock(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public boolean hasSidedRedstoneOutputBehavior() { + return true; + } + + @Override + public boolean isEnetInput() { + return true; + } + + @Override + public boolean isEnetOutput() { + return true; + } + + @Override + public boolean isInputFacing(byte aSide) { + return !this.isOutputFacing(aSide); + } + + @Override + public boolean isElectric() { + return true; + } + + @Override + public boolean isPneumatic() { + return false; + } + + @Override + public boolean isSteampowered() { + return false; + } + + @Override + public boolean isOutputFacing(byte aSide) { + return aSide == this.getOutputFacing(); + } + + @Override + public long getMinimumStoredEU() { + return 512; + } + + @Override + public long maxEUInput() { + return GT_Values.V[1]; + } + + @Override + public long maxEUOutput() { + return bOutput ? GT_Values.V[1] : 0; + } + + @Override + public long maxAmperesIn() { + return 2; + } + + @Override + public long maxAmperesOut() { + return 1; + } + + @Override + public int getSizeInventory() { + return 5; + } + + @Override + public long maxEUStore() { + return GT_Values.V[3] * 1024; + } + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer, 147); + return true; + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setInteger("mGate", mGate); + aNBT.setIntArray("mGateData", mGateData); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mGate = aNBT.getInteger("mGate"); + mGateData = aNBT.getIntArray("mGateData"); + if (mGateData.length != 8) + mGateData = new int[]{0, 0, 0, 0, 0, 0, 0, 0}; + } + + public void switchOutput() { + bOutput = !bOutput; + } + + public void switchGateForward(boolean aShift) { + try { + Set<Integer> tKeys = GregTech_API.sCircuitryBehaviors.keySet(); + ArrayList<Integer> tList = new ArrayList<Integer>(); + tList.addAll(tKeys); + if (tList.size() <= 0) + return; + Collections.sort(tList); + if (!GregTech_API.sCircuitryBehaviors.containsKey(mGate)) + mGate = tList.get(0); + int tIndex = Collections.binarySearch(tList, mGate); + tIndex += aShift ? 16 : 1; + while (tIndex >= tList.size()) + tIndex -= tList.size(); + mGate = tList.get(tIndex); + switchGate(); + } + catch (Throwable e) { + GT_Log.err.print(e); + } + } + + public void switchGateBackward(boolean aShift) { + try { + Set<Integer> tKeys = GregTech_API.sCircuitryBehaviors.keySet(); + ArrayList<Integer> tList = new ArrayList<Integer>(); + tList.addAll(tKeys); + if (tList.size() <= 0) + return; + Collections.sort(tList); + if (!GregTech_API.sCircuitryBehaviors.containsKey(mGate)) + mGate = tList.get(0); + int tIndex = Collections.binarySearch(tList, mGate); + tIndex -= aShift ? 16 : 1; + while (tIndex < 0) + tIndex += tList.size(); + mGate = tList.get(tIndex); + switchGate(); + } + catch (Throwable e) { + GT_Log.err.print(e); + } + } + + @Override + public void onFacingChange() { + resetRedstone(); + } + + private void resetRedstone() { + getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 0, (byte) 0); + getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 1, (byte) 0); + getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 2, (byte) 0); + getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 3, (byte) 0); + getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 4, (byte) 0); + getBaseMetaTileEntity().setInternalOutputRedstoneSignal((byte) 5, (byte) 0); + } + + public void changeGateData(int aIndex, int aValue) { + mGateData[aIndex] += aValue; + validateGateData(); + } + + public void stackGateData(int aIndex, ItemStack aStack) { + mGateData[aIndex] = GT_Utility.stackToInt(aStack); + validateGateData(); + } + + private void switchGate() { + resetRedstone(); + for (int i = 0; i < mGateData.length; i++) + mGateData[i] = 0; + GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tBehaviour != null) + try { + tBehaviour.initParameters(mGateData, this); + } + catch (Throwable e) { + GT_Log.err.print(e); + } + validateGateData(); + } + + private void validateGateData() { + GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tBehaviour != null) + try { + tBehaviour.validateParameters(mGateData, this); + } + catch (Throwable e) { + GT_Log.err.print(e); + } + } + + @Override + public void onFirstTick(IGregTechTileEntity aBaseMetaTileEntity) { + super.onFirstTick(aBaseMetaTileEntity); + getBaseMetaTileEntity().setGenericRedstoneOutput(true); + validateGateData(); + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + getBaseMetaTileEntity().setGenericRedstoneOutput(true); + if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) { + mInventory[0] = mInventory[1] = mInventory[2] = mInventory[3] = mInventory[4] = null; + if (getBaseMetaTileEntity().getUniversalEnergyStored() >= getMinimumStoredEU()) { + if (getBaseMetaTileEntity().isActive()) { + GT_CircuitryBehavior tBehaviour = GregTech_API.sCircuitryBehaviors.get(mGate); + if (tBehaviour != null) { + try { + tBehaviour.onTick(mGateData, this); + if (tBehaviour.displayItemStack(mGateData, this, 0)) + mInventory[1] = getCoverByID(mGateData[0]); + if (tBehaviour.displayItemStack(mGateData, this, 1)) + mInventory[2] = getCoverByID(mGateData[1]); + if (tBehaviour.displayItemStack(mGateData, this, 2)) + mInventory[3] = getCoverByID(mGateData[2]); + if (tBehaviour.displayItemStack(mGateData, this, 3)) + mInventory[4] = getCoverByID(mGateData[3]); + } + catch (Throwable e) { + GT_Log.err.print(e); + } + } + } + getBaseMetaTileEntity().setErrorDisplayID(0); + } + else { + getBaseMetaTileEntity().setErrorDisplayID(1); + } + } + } + + @Override + public void onPostTick(final IGregTechTileEntity aBaseMetaTileEntity, final long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + //Only Calc server-side + if (!this.getBaseMetaTileEntity().isServerSide()) { + return; + } + //Emit Redstone + for (byte i=0;i<6;i++) { + byte aRedstone = getBaseMetaTileEntity().getOutputRedstoneSignal(i); + this.getBaseMetaTileEntity().setInternalOutputRedstoneSignal(i, aRedstone); + } + + } + + @Override + public final boolean hasRedstoneSignal() { + for (byte i=0;i<6;i++) { + if (getBaseMetaTileEntity().getOutputRedstoneSignal(i) > 0) { + return true; + } + } + return false; + } + + @Override + public boolean allowGeneralRedstoneOutput() { + return true; + } + + /** The Item List for Covers */ + public static final Map<Integer, ItemStack> sCoversItems = new HashMap<Integer, ItemStack>(); + + private static void initCovers() { + for (GT_ItemStack aKey : GregTech_API.sCovers.keySet()) { + ItemStack aStack = aKey.toStack().copy(); + if (aStack != null) { + sCoversItems.put(GT_Utility.stackToInt(aStack), aStack); + } + } + } + + public static ItemStack getCoverByID(int aStack) { + if (sCoversItems.isEmpty()) { + initCovers(); + } + return sCoversItems.get(Integer.valueOf(aStack)); + } + + @Override + public byte getOutputFacing() { + return getBaseMetaTileEntity().getBackFacing(); + } + + @Override + public boolean setRedstone(byte aStrength, byte aSide) { + if (getOutputRedstone(aSide) != aStrength) { + if (getBaseMetaTileEntity().decreaseStoredEnergyUnits(1, false)) { + getBaseMetaTileEntity().setInternalOutputRedstoneSignal(aSide, aStrength); + getBaseMetaTileEntity().setErrorDisplayID(0); + return true; + } + else { + getBaseMetaTileEntity().setErrorDisplayID(1); + return false; + } + } + return false; + } + + /* @Override + public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { + if (aSide == getOutputFacing()) { + if (aSide == 0) + return aRedstone ? 56 : 54; + if (aSide == 1) + return aRedstone ? 53 : 52; + return aRedstone ? 94 : 93; + } + if (aSide == 0) + return aRedstone ? 60 : 59; + if (aSide == 1) + return aRedstone ? 58 : 57; + return aRedstone ? 62 : 61; + }*/ + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return false; + } + + @Override + public byte getOutputRedstone(byte aSide) { + return getBaseMetaTileEntity().getOutputRedstoneSignal(aSide); + } + + @Override + public byte getInputRedstone(byte aSide) { + return getBaseMetaTileEntity().getInternalInputRedstoneSignal(aSide); + } + + @Override + public Block getBlockAtSide(byte aSide) { + return getBaseMetaTileEntity().getBlockAtSide(aSide); + } + + @Override + public byte getMetaIDAtSide(byte aSide) { + return getBaseMetaTileEntity().getMetaIDAtSide(aSide); + } + + @Override + public TileEntity getTileEntityAtSide(byte aSide) { + return getBaseMetaTileEntity().getTileEntityAtSide(aSide); + } + + @Override + public int getRandom(int aRange) { + return getBaseMetaTileEntity().getRandomNumber(aRange); + } + + @Override + public GT_CoverBehavior getCover(byte aSide) { + return getBaseMetaTileEntity().getCoverBehaviorAtSide(aSide); + } + + @Override + public int getCoverID(byte aSide) { + return getBaseMetaTileEntity().getCoverIDAtSide(aSide); + } + + @Override + public int getCoverVariable(byte aSide) { + return getBaseMetaTileEntity().getCoverDataAtSide(aSide); + } + + @Override + public ICoverable getOwnTileEntity() { + return getBaseMetaTileEntity(); + } + + @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.getSides(i); + rTextures[1][i + 1] = this.getBack(i); + rTextures[2][i + 1] = this.getBottom(i); + rTextures[3][i + 1] = this.getTop(i); + rTextures[4][i + 1] = this.getSides(i); + rTextures[5][i + 1] = this.getSidesActive(i); + rTextures[6][i + 1] = this.getBackActive(i); + rTextures[7][i + 1] = this.getBottomActive(i); + rTextures[8][i + 1] = this.getTopActive(i); + rTextures[9][i + 1] = this.getSidesActive(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; + } + + private GT_RenderedTexture getBase() { + return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Simple_Top); + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off)}; + } + + public ITexture[] getTopActive(final byte aColor) { + return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)}; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off), new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red)}; + } + + public ITexture[] getBackActive(final byte aColor) { + return new ITexture[] {getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On), new GT_RenderedTexture(TexturesGtBlock.Casing_InventoryManagaer_Red_Redstone)}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)}; + } + + public ITexture[] getBottomActive(final byte aColor) { + return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On)}; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off)}; + } + + public ITexture[] getSidesActive(final byte aColor) { + return new ITexture[]{getBase(), new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On)}; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java new file mode 100644 index 0000000000..81517c83b9 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneLamp.java @@ -0,0 +1,75 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; + +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_RedstoneLamp extends GT_MetaTileEntity_RedstoneBase { + + public byte mRedstoneStrength = 0, mType = 0; + public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[2]; + + static { + sIconList[0] = new CustomIcon("TileEntities/gt4/redstone/Lamp/off"); + sIconList[1] = new CustomIcon("TileEntities/gt4/redstone/Lamp/on"); + } + + public GT_MetaTileEntity_RedstoneLamp(int aID) { + super(aID, "redstone.lamp", "Redstone Controlled Lamp", 0, 0, "Redstone Controlled Lamp"); + } + + public GT_MetaTileEntity_RedstoneLamp(final String aName, String aDescription, final ITexture[][][] aTextures) { + super(aName, 0, 0, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_RedstoneLamp(this.mName, mDescription, this.mTextures); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) { + getBaseMetaTileEntity().setLightValue(getBaseMetaTileEntity().getStrongestRedstone()); + getBaseMetaTileEntity().setActive(getBaseMetaTileEntity().getStrongestRedstone()>0); + } + } + + @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.getSides(i); + rTextures[1][i + 1] = this.getSidesActive(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 1 : 0)][aColorIndex + 1]; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[] {new GT_RenderedTexture(sIconList[0])}; + } + + public ITexture[] getSidesActive(final byte aColor) { + return new ITexture[] {new GT_RenderedTexture(sIconList[1])}; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java new file mode 100644 index 0000000000..1f65385793 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthDisplay.java @@ -0,0 +1,144 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; + +import gregtech.api.enums.Textures; +import gregtech.api.enums.Textures.BlockIcons; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + +public class GT_MetaTileEntity_RedstoneStrengthDisplay extends GT_MetaTileEntity_RedstoneBase { + + public byte mRedstoneStrength = 0, mType = 0; + public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[144]; + + static { + for (int i=0;i<144;i++) { + sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/Display/"+i); + } + } + + public GT_MetaTileEntity_RedstoneStrengthDisplay(int aID, String aUnlocal, String aLocal, String aDescription) { + super(aID, aUnlocal, aLocal, 5, 0, aDescription); + } + + public GT_MetaTileEntity_RedstoneStrengthDisplay(final String aName, String aDescription, final ITexture[][][] aTextures) { + super(aName, 5, 0, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_RedstoneStrengthDisplay(this.mName, mDescription, this.mTextures); + } + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + aNBT.setByte("mRedstoneStrength", mRedstoneStrength); + aNBT.setByte("mType", mType); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + mRedstoneStrength = aNBT.getByte("mRedstoneStrength"); + mType = aNBT.getByte("mType"); + } + + @Override + public void onValueUpdate(byte aValue) { + mRedstoneStrength = (byte) (aValue & 15); + mType = (byte) (aValue >>> 4); + } + + @Override + public byte getUpdateData() { + return (byte) ((mRedstoneStrength & 15) | (mType << 4)); + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + if (getBaseMetaTileEntity().isAllowedToWork() && getBaseMetaTileEntity().isServerSide()) { + mRedstoneStrength = getBaseMetaTileEntity().getStrongestRedstone(); + } + } + + /*@Override + public int getTextureIndex(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { + if (aSide == 0) + return aRedstone ? 60 : 59; + if (aSide == 1) + return aRedstone ? 58 : 57; + return aRedstone ? 62 : 61; + }*/ + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aSide == getBaseMetaTileEntity().getFrontFacing()) + mType = (byte) ((mType + 1) % 6); + } + + /*@Override + public IIcon getTextureIcon(byte aSide, byte aFacing, boolean aActive, boolean aRedstone) { + return aSide == aFacing ? sIconList[mType * 16 + mRedstoneStrength] : null; + }*/ + + @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.getBottom(i); + rTextures[3][i + 1] = this.getTop(i); + rTextures[4][i + 1] = this.getSides(i); + rTextures[5][i + 1] = this.getFront(i); + rTextures[6][i + 1] = this.getSidesActive(i); + rTextures[7][i + 1] = this.getBottomActive(i); + rTextures[8][i + 1] = this.getTopActive(i); + rTextures[9][i + 1] = this.getSidesActive(i); + } + return rTextures; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength])}; + } + return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; + } + + public ITexture[] getFront(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]}; + } + + public ITexture[] getTop(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_Off)}; + } + + public ITexture[] getTopActive(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Top_On)}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_Off)}; + } + + public ITexture[] getBottomActive(final byte aColor) { + return new ITexture[] { Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Bottom_On)}; + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_Off)}; + } + + public ITexture[] getSidesActive(final byte aColor) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(TexturesGtBlock.Casing_Redstone_Side_On)}; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java new file mode 100644 index 0000000000..efa3763370 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/redstone/GT_MetaTileEntity_RedstoneStrengthScale.java @@ -0,0 +1,50 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.redstone; + +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock.CustomIcon; +import net.minecraft.entity.player.EntityPlayer; + +public class GT_MetaTileEntity_RedstoneStrengthScale extends GT_MetaTileEntity_RedstoneStrengthDisplay { + + public static TexturesGtBlock.CustomIcon[] sIconList = new TexturesGtBlock.CustomIcon[32]; + + static { + for (int i=0;i<32;i++) { + sIconList[i] = new CustomIcon("TileEntities/gt4/redstone/Scale/"+i); + } + } + + public GT_MetaTileEntity_RedstoneStrengthScale(int aID) { + super(aID, "redstone.display.scale", "Redstone Scale", "Redstone Strength on a Scale"); + } + + public GT_MetaTileEntity_RedstoneStrengthScale(final String aName, String aDescription, final ITexture[][][] aTextures) { + super(aName, aDescription, aTextures); + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_RedstoneStrengthScale(this.mName, mDescription, this.mTextures); + } + + @Override + public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) { + if (aSide == getBaseMetaTileEntity().getFrontFacing()) + mType = (byte) ((mType + 1) % 2); + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + if (aSide == aFacing) { + return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColorIndex + 1], new GT_RenderedTexture(sIconList[mType * 16 + mRedstoneStrength])}; + } + return this.mTextures[(aActive || hasRedstoneSignal() ? 5 : 0) + (aSide == aFacing ? 0 : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + 1]; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java new file mode 100644 index 0000000000..0b815bfae7 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_AdvancedCraftingTable.java @@ -0,0 +1,551 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.storage; + +import java.util.ArrayList; + +import gregtech.api.enums.GT_Values; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_Utility; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.item.general.ItemBlueprint; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.xmod.gregtech.api.gui.workbench.GT_Container_AdvancedWorkbench; +import gtPlusPlus.xmod.gregtech.api.gui.workbench.GT_GUIContainer_AdvancedWorkbench; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + +public class GT_MetaTileEntity_AdvancedCraftingTable extends GT_MetaTileEntity_BasicTank { + + public boolean mFlushMode = false; + + protected String mLocalName; + + public GT_MetaTileEntity_AdvancedCraftingTable(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription) { + super(aID, aName, aNameRegional, aTier, 35, aDescription); + mLocalName = aNameRegional; + } + + public GT_MetaTileEntity_AdvancedCraftingTable(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, 35, aDescription, aTextures); + } + + @Override + public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_AdvancedWorkbench(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_AdvancedWorkbench(aPlayerInventory, aBaseMetaTileEntity, mLocalName); + } + + @Override + public boolean isTransformerUpgradable() { + return true; + } + @Override + public boolean isSimpleMachine() { + return true; + } + @Override + public boolean isValidSlot(int aIndex) { + return aIndex < 31 || aIndex > 32; + } + @Override + public boolean isFacingValid(byte aFacing) { + return true; + } + @Override + public boolean isAccessAllowed(EntityPlayer aPlayer) { + return true; + } + @Override + public boolean isEnetInput() { + return isElectric(); + } + @Override + public boolean isInputFacing(byte aSide) { + return true; + } + @Override + public long maxEUInput() { + return isElectric() ? GT_Values.V[3] : 0; + } + @Override + public long maxEUStore() { + return isElectric() ? GT_Values.V[3] * 1024 : 0; + } + + @Override + public boolean isElectric() { + return isAdvanced(); + } + + @Override + public boolean isPneumatic() { + return false; + } + + @Override + public boolean isSteampowered() { + return false; + } + + @Override + public long maxAmperesIn() { + return isElectric() ? 2 : 0; + } + + @Override + public long getMinimumStoredEU() { + return isElectric() ? GT_Values.V[3] * 2 : 0; + } + + @Override + public int getSizeInventory() { + return 35; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_AdvancedCraftingTable(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @Override + public boolean doesFillContainers() { + return false; + } + @Override + public boolean doesEmptyContainers() { + return false; + } + @Override + public boolean canTankBeFilled() { + return true; + } + @Override + public boolean canTankBeEmptied() { + return true; + } + @Override + public boolean displaysItemStack() { + return false; + } + @Override + public boolean displaysStackSize() { + return false; + } + + public void sortIntoTheInputSlots() { + for (byte i = 21; i < 30; i++) + if (mInventory[i] != null) { + if (mInventory[i].stackSize == 0) { + mInventory[i] = null; + } + if (mInventory[i] != null) + for (byte j = 0; j < 16; j++) { + if (GT_Utility.areStacksEqual( + mInventory[i], mInventory[j] + )) { + GT_Utility.moveStackFromSlotAToSlotB( + getBaseMetaTileEntity(), getBaseMetaTileEntity(), i, j, (byte) 64, (byte) 1, (byte) 64, (byte) 1 + ); + } + } + if (mInventory[i] != null) + for (byte j = 0; j < 16; j++) { + if (mInventory[j] == null) { + GT_Utility.moveStackFromSlotAToSlotB( + getBaseMetaTileEntity(), getBaseMetaTileEntity(), i, j, (byte) 64, (byte) 1, (byte) 64, (byte) 1 + ); + } + } + } + } + + private void fillLiquidContainers() { + for (byte i = 16; i < 21 && mFluid != null; i++) { + ItemStack tOutput = GT_Utility.fillFluidContainer(mFluid, mInventory[i], false, true); + if (tOutput != null) { + if (mInventory[i].stackSize == 1) { + mFluid.amount -= GT_Utility.getFluidForFilledItem( + tOutput, true + ).amount * tOutput.stackSize; + mInventory[i] = tOutput; + } + else + for (byte j = 16; j < 21; j++) { + if (mInventory[j] == null || (GT_Utility.areStacksEqual( + tOutput, mInventory[j] + ) && mInventory[j].stackSize + + tOutput.stackSize <= tOutput.getMaxStackSize())) { + mFluid.amount -= GT_Utility.getFluidForFilledItem( + tOutput, true + ).amount * tOutput.stackSize; + getBaseMetaTileEntity().decrStackSize(i, 1); + if (mInventory[j] == null) { + mInventory[j] = tOutput; + } + else { + mInventory[j].stackSize++; + } + break; + } + } + if (mFluid != null && mFluid.amount <= 0) + mFluid = null; + } + } + if (mFluid != null && mFluid.amount <= 0) + mFluid = null; + } + + public void setBluePrint(ItemStack aStack) { + if (aStack == null) { + aStack = mInventory[30]; + Logger.INFO("Using Slot 30 supply."); + } + if (mInventory[31] == null || aStack == null || aStack.getItem() == null + || aStack.getItemDamage() != 0 || aStack.stackSize != 1 + || !(aStack.getItem() instanceof ItemBlueprint)) { + try { + Logger.INFO( + "Could not set Blueprint. Slot 31: " + + (mInventory[31] != null ? mInventory[31].getDisplayName() : "Null") + + ", aStack: "+(aStack != null ? aStack.getDisplayName() : "Null") + + ", Damage: "+(aStack != null ? aStack.getItemDamage() : "Null")); + } + catch (Throwable t) { + t.printStackTrace(); + } + return; + } + if (!aStack.getTagCompound().hasKey("Inventory")) { + NBTTagCompound tNBT = new NBTTagCompound(); + NBTTagList tNBT_ItemList = new NBTTagList(); + for (int i = 0; i < 9; i++) { + ItemStack tStack = mInventory[i + 21]; + if (tStack != null) { + NBTTagCompound tag = new NBTTagCompound(); + tag.setByte("Slot", (byte) i); + tStack.writeToNBT(tag); + tNBT_ItemList.appendTag(tag); + } + } + tNBT.setTag("Inventory", tNBT_ItemList); + tNBT.setBoolean("mBlueprint", true); + tNBT.setInteger("mID", MathUtils.randInt(1, Short.MAX_VALUE)); + tNBT.setString("mName", mInventory[31].getDisplayName()); + aStack.setTagCompound(tNBT); + Logger.INFO("Set NBT of crafting table to Stack in slot 30."); + } + else { + Logger.INFO("Blueprint already has recipe tags."); + } + + } + + public ItemStack getCraftingOutput() { + if (mInventory[30] != null && mInventory[30].getItem() != null + && mInventory[30].getItemDamage() == 0 + && mInventory[30].hasTagCompound() && mInventory[30].getItem() instanceof ItemBlueprint) { + //Logger.INFO("Getting Blueprint Data in slot 30. "+mInventory[30].getDisplayName()); + NBTTagCompound tNBT = mInventory[30].getTagCompound(); + NBTTagList tNBT_ItemList = tNBT.getTagList("Blueprint", 10); + for (int i = 0; i < tNBT_ItemList.tagCount() && i < 9; i++) { + NBTTagCompound tag = (NBTTagCompound) tNBT_ItemList.getCompoundTagAt( + i + ); + byte slot = tag.getByte("Slot"); + if (slot >= 0 && slot < 9 && mInventory[slot + 21] == null) { + mInventory[slot + 21] = GT_Utility.loadItem(tag); + if (mInventory[slot + 21] != null) + mInventory[slot + 21].stackSize = 0; + } + } + } + mInventory[31] = GT_ModHandler.getAllRecipeOutput( + getBaseMetaTileEntity().getWorld(), new ItemStack[]{ + mInventory[21], mInventory[22], mInventory[23], + mInventory[24], mInventory[25], mInventory[26], + mInventory[27], mInventory[28], mInventory[29] + } + ); + return mInventory[31]; + } + + public boolean canDoCraftingOutput() { + if (mInventory[31] == null) + return false; + for (ItemStack tStack : recipeContent()) { + if (tStack.stackSize > getAmountOf(tStack)) { + return false; + } + } + return true; + } + + private int getAmountOf(ItemStack aStack) { + int tAmount = 0; + for (byte i = 0; i < 30 && tAmount < 9; i++) { + if (GT_Utility.areStacksOrToolsEqual(aStack, mInventory[i])) { + tAmount += mInventory[i].stackSize; + } + } + return tAmount; + } + + private ArrayList<ItemStack> recipeContent() { + ArrayList<ItemStack> tList = new ArrayList<ItemStack>(); + for (byte i = 21; i < 30; i++) { + if (mInventory[i] != null) { + boolean temp = false; + for (byte j = 0; j < tList.size(); j++) { + if (GT_Utility.areStacksOrToolsEqual( + mInventory[i], tList.get(j) + )) { + tList.get(j).stackSize++; + temp = true; + break; + } + } + if (!temp) + tList.add(GT_Utility.copy(1, mInventory[i])); + } + } + return tList; + } + + public ItemStack consumeMaterials(EntityPlayer aPlayer, ItemStack aHoldStack) { + if (mInventory[31] == null) + return aHoldStack; + if (aHoldStack != null) { + if (!GT_Utility.areStacksEqual(aHoldStack, mInventory[31])) + return aHoldStack; + if (aHoldStack.stackSize + + mInventory[31].stackSize > aHoldStack.getMaxStackSize()) + return aHoldStack; + } + for (byte i = 21; i < 30; i++) + if (mInventory[i] != null) { + for (byte j = 0; j <= i; j++) { + if (j < 21 || j == i) { + if (GT_Utility.areStacksOrToolsEqual( + mInventory[i], mInventory[j] + ) && mInventory[j].stackSize > 0) { + ItemStack tStack = GT_Utility.getContainerItem( + mInventory[j], true + ); + if (tStack == null + || (tStack.isItemStackDamageable() + && tStack.getItemDamage() >= tStack.getMaxDamage())) { + getBaseMetaTileEntity().decrStackSize(j, 1); + } + else if (mInventory[j].stackSize == 1) { + mInventory[j] = tStack; + } + else { + getBaseMetaTileEntity().decrStackSize(j, 1); + for (byte k = 0; k < 21; k++) { + if (mInventory[k] == null) { + mInventory[k] = tStack; + break; + } + else { + if (GT_Utility.areStacksEqual( + tStack, mInventory[k] + )) { + if (tStack.stackSize + + mInventory[k].stackSize <= mInventory[k].getMaxStackSize()) { + mInventory[k].stackSize += tStack.stackSize; + break; + } + } + } + } + } + break; + } + } + } + } + if (aHoldStack == null) { + aHoldStack = GT_Utility.copy(mInventory[31]); + aHoldStack.onCrafting( + getBaseMetaTileEntity().getWorld(), aPlayer, mInventory[31].stackSize + ); + } + else { + aHoldStack.stackSize += mInventory[31].stackSize; + aHoldStack.onCrafting( + getBaseMetaTileEntity().getWorld(), aPlayer, mInventory[31].stackSize + ); + } + + fillLiquidContainers(); + + return aHoldStack; + } + + @Override + public int rechargerSlotStartIndex() { + return 16; + } + + @Override + public int rechargerSlotCount() { + return 5; + } + + @Override + public long getOutputTier() { + return GT_Utility.getTier(getBaseMetaTileEntity().getInputVoltage()); + } + + @Override + public int getCapacity() { + return 64000; + } + + @Override + public int getTankPressure() { + return -100; + } + + @Override + public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + return aIndex == 33 || (mFlushMode && aIndex >= 21 && aIndex < 30); + } + + @Override + public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { + if (aIndex < 16) { + for (byte i = 0; i < 16; i++) + if (GT_Utility.areStacksOrToolsEqual(aStack, mInventory[i])) + return aIndex == i; + return true; + } + return false; + } + + @Override + public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPreTick(aBaseMetaTileEntity, aTick); + getCraftingOutput(); + } + + @Override + public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { + super.onPostTick(aBaseMetaTileEntity, aTick); + if (getBaseMetaTileEntity().isServerSide()) { + if (getBaseMetaTileEntity().hasInventoryBeenModified()) + getCraftingOutput(); + fillLiquidContainers(); + if (mFlushMode) { + mFlushMode = false; + for (byte i = 21; i < 30; i++) { + if (mInventory[i] != null) { + if (mInventory[i].stackSize == 0) { + mInventory[i] = null; + } + else { + mFlushMode = true; + break; + } + } + } + } + } + /*if (aTick % 100 == 0) { + for (int i = 0; i < this.mInventory.length; i++) { + ItemStack aSlot = mInventory[i]; + Logger.INFO("Slot "+i+" "+(aSlot != null ? "contains "+aSlot.getDisplayName() : "is empty")); + } + }*/ + } + + @Override + public String[] getDescription() { + return new String[] { + isAdvanced() ? "For the very large Projects" : "For the smaller Projects", + "Hold Shift in GUI to see slot usage", + this.mDescription, + CORE.GT_Tooltip }; + } + + @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.getBack(i); + rTextures[2][i + 1] = this.getBottom(i); + rTextures[3][i + 1] = this.getTop(i); + rTextures[4][i + 1] = this.getSides(i); + rTextures[5][i + 1] = this.getFront(i); + rTextures[6][i + 1] = this.getBack(i); + rTextures[7][i + 1] = this.getBottom(i); + rTextures[8][i + 1] = this.getTop(i); + rTextures[9][i + 1] = this.getSides(i); + } + return rTextures; + } + + protected boolean isAdvanced() { + return true; + } + + @Override + public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing, + final byte aColorIndex, final boolean aActive, final boolean aRedstone) { + return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing ? 0 + : aSide == GT_Utility.getOppositeSide(aFacing) ? 1 : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex + + 1]; + } + + public ITexture[] getFront(final byte aColor) { + return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)}; + } + + public ITexture[] getBack(final byte aColor) { + return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)}; + } + + public ITexture[] getBottom(final byte aColor) { + return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Bottom) : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Bottom)}; + } + + public ITexture[] getTop(final byte aColor) { + if (isAdvanced()) { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Top), + new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Crafting_Overlay) }; + } + else { + return new ITexture[] { new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Top), + new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Crafting_Overlay) }; + } + } + + public ITexture[] getSides(final byte aColor) { + return new ITexture[] { isAdvanced() ? new GT_RenderedTexture(TexturesGtBlock.Casing_Adv_Workbench_Side) : new GT_RenderedTexture(TexturesGtBlock.Casing_Workbench_Side)}; + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java new file mode 100644 index 0000000000..f421d391c0 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_BronzeCraftingTable.java @@ -0,0 +1,83 @@ +package gtPlusPlus.xmod.gregtech.common.tileentities.storage; + +import gregtech.api.GregTech_API; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.metatileentity.MetaTileEntity; +import gregtech.api.objects.GT_ItemStack; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.xmod.gregtech.api.gui.workbench.GT_Container_BronzeWorkbench; +import gtPlusPlus.xmod.gregtech.api.gui.workbench.GT_GUIContainer_BronzeWorkbench; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; + +public class GT_MetaTileEntity_BronzeCraftingTable extends GT_MetaTileEntity_AdvancedCraftingTable { + + public GT_MetaTileEntity_BronzeCraftingTable(final int aID, final String aName, final String aNameRegional, final int aTier, final String aDescription) { + super(aID, aName, aNameRegional, aTier, aDescription); + } + + public GT_MetaTileEntity_BronzeCraftingTable(final String aName, final int aTier, final String aDescription, final ITexture[][][] aTextures) { + super(aName, aTier, aDescription, aTextures); + } + + @Override + public Object getServerGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_Container_BronzeWorkbench(aPlayerInventory, aBaseMetaTileEntity); + } + + @Override + public Object getClientGUI(final int aID, final InventoryPlayer aPlayerInventory, final IGregTechTileEntity aBaseMetaTileEntity) { + return new GT_GUIContainer_BronzeWorkbench(aPlayerInventory, aBaseMetaTileEntity, mLocalName); + } + + @Override + public boolean isTransformerUpgradable() { + return false; + } + + @Override + public boolean isInputFacing(byte aSide) { + return false; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_BronzeCraftingTable(this.mName, this.mTier, this.mDescription, this.mTextures); + } + + @Override + public boolean onRightclick(final IGregTechTileEntity aBaseMetaTileEntity, final EntityPlayer aPlayer) { + if (aBaseMetaTileEntity.isClientSide()) { + return true; + } + aBaseMetaTileEntity.openGUI(aPlayer); + return true; + } + + @SuppressWarnings("deprecation") + @Override + public boolean allowCoverOnSide(byte aSide, GT_ItemStack aStack) { + return GregTech_API.getCoverBehavior(aStack.toStack()).isSimpleCover(); + } + + @Override + public int rechargerSlotStartIndex() { + return 0; + } + + @Override + public int rechargerSlotCount() { + return 0; + } + + @Override + public int getCapacity() { + return 16000; + } + + @Override + protected boolean isAdvanced() { + return false; + } +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java index 320e2175b0..e18f5d4bfc 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GregtechMetaEnergyBuffer.java @@ -2,12 +2,6 @@ package gtPlusPlus.xmod.gregtech.common.tileentities.storage; import static gregtech.api.enums.GT_Values.V; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; - import gregtech.api.enums.Textures; import gregtech.api.gui.GT_Container_1by1; import gregtech.api.gui.GT_GUIContainer_1by1; @@ -17,12 +11,16 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.objects.GT_ItemStack; import gregtech.api.objects.GT_RenderedTexture; import gregtech.api.util.GT_Utility; - import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.minecraft.PlayerUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.base.GregtechMetaTileEntity; import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { @@ -252,7 +250,7 @@ public class GregtechMetaEnergyBuffer extends GregtechMetaTileEntity { return true; } - private void showEnergy(final World worldIn, final EntityPlayer playerIn){ + protected void showEnergy(final World worldIn, final EntityPlayer playerIn){ final long tempStorage = this.getBaseMetaTileEntity().getStoredEU(); final double c = ((double) tempStorage / this.maxEUStore()) * 100; final double roundOff = Math.round(c * 100.00) / 100.00; diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java index e918d8015e..d2fb97010a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/Gregtech_Blocks.java @@ -16,6 +16,7 @@ public class Gregtech_Blocks { ModBlocks.blockCasingsTieredGTPP = new GregtechMetaTieredCasingBlocks1(); ModBlocks.blockSpecialMultiCasings = new GregtechMetaSpecialMultiCasings(); + ModBlocks.blockSpecialMultiCasings2 = new GregtechMetaSpecialMultiCasings2(); ModBlocks.blockCustomMachineCasings = new GregtechMetaSpecialMachineCasings(); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java index 9e58d486d3..f5abad2373 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelter.java @@ -134,12 +134,12 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { if (CORE.RA.addBlastSmelterRecipe(tItemStackTest, M.getFluidStack(fluidAmount), 100, (duration/(mTotalPartsCounter > 0 ? mTotalPartsCounter : 1)), (int) aVoltage)){ Logger.WARNING("[BAS] Success."); Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe."); - if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration, 120)){ + /*if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/9, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - } + }*/ /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/4, 120)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } @@ -157,12 +157,12 @@ public class RecipeGen_BlastSmelter extends RecipeGen_Base { Logger.WARNING("[BAS] Success."); if (GT_Values.RA.addFluidSolidifierRecipe(ItemList.Shape_Mold_Ingot.get(0), M.getFluidStack(144), M.getIngot(1), duration/2, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid solidifier recipe."); - if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration/2, 60)){ + /*if (GT_Values.RA.addFluidExtractionRecipe(M.getIngot(1), null, M.getFluidStack(144), 100, duration/2, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } if (GT_Values.RA.addFluidExtractionRecipe(M.getNugget(1), null, M.getFluidStack(16), 100, duration/2/9, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); - } + }*/ /*if (GT_Values.RA.addFluidExtractionRecipe(M.getSmallDust(1), null, M.getFluid(36), 100, duration/2/4, 60)){ Logger.WARNING("[BAS] Success, Also added a Fluid Extractor recipe."); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java index 63c2d18783..3e54a7fe5d 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_BlastSmelterGT_GTNH.java @@ -8,10 +8,12 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.FluidUtils; +import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.OreDictionary; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -124,9 +126,9 @@ public class RecipeGen_BlastSmelterGT_GTNH { FluidStack[] inputsF; int voltage, time, special; boolean enabled; - inputs = x.mInputs; - outputs = x.mOutputs; - inputsF = x.mFluidInputs; + inputs = x.mInputs.clone(); + outputs = x.mOutputs.clone(); + inputsF = x.mFluidInputs.clone(); voltage = x.mEUt; time = x.mDuration; enabled = x.mEnabled; @@ -157,6 +159,13 @@ public class RecipeGen_BlastSmelterGT_GTNH { //If this recipe is enabled and we have a valid molten fluidstack, let's try add this recipe. if (enabled && isValid(inputs, outputs, inputsF, mMoltenStack)) { //Build correct input stack + ArrayList<ItemStack> aTempList = new ArrayList<ItemStack>(); + for (ItemStack aPossibleCircuit : inputs) { + if (!ItemUtils.isControlCircuit(aPossibleCircuit)) { + aTempList.add(aPossibleCircuit); + } + } + inputs = aTempList.toArray(new ItemStack[aTempList.size()]); ItemStack[] newInput = new ItemStack[inputs.length+1]; int l = 1; for (ItemStack y : inputs) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java index cd43d6201c..54e9716520 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Extruder.java @@ -3,23 +3,22 @@ package gtPlusPlus.xmod.gregtech.loaders; import java.util.HashSet; import java.util.Set; -import net.minecraft.item.ItemStack; - -import gregtech.api.GregTech_API; +import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; -import gregtech.api.util.GT_Recipe; - import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; import gtPlusPlus.core.util.minecraft.ItemUtils; +import net.minecraft.item.ItemStack; public class RecipeGen_Extruder extends RecipeGen_Base { public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>(); + private static boolean mRotorShapeEnabled = false; static { MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + mRotorShapeEnabled = ItemUtils.doesItemListEntryExist("Shape_Extruder_Rotor"); } public RecipeGen_Extruder(final Material M){ @@ -48,10 +47,10 @@ public class RecipeGen_Extruder extends RecipeGen_Base { Logger.WARNING("Generating Extruder recipes for "+material.getLocalizedName()); - + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBlock(1))) { //Ingot Recipe - if (addExtruderRecipe( + if (GT_Values.RA.addExtruderRecipe( material.getBlock(1), shape_Ingot, material.getIngot(9), @@ -64,7 +63,7 @@ public class RecipeGen_Extruder extends RecipeGen_Base { } //Block Recipe - if (addExtruderRecipe( + if (GT_Values.RA.addExtruderRecipe( material.getIngot(9), shape_Block, material.getBlock(1), @@ -80,97 +79,101 @@ public class RecipeGen_Extruder extends RecipeGen_Base { //Plate Recipe if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1))) - if (addExtruderRecipe( - itemIngot, - shape_Plate, - itemPlate, - 10, - material.vVoltageMultiplier)){ - Logger.WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Failed"); - } - - //Ring Recipe - if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRing(1))) - if (!material.isRadioactive){ - if (addExtruderRecipe( + if (GT_Values.RA.addExtruderRecipe( itemIngot, - shape_Ring, - material.getRing(4), - (int) Math.max(material.getMass() * 2L * 1, 1), + shape_Plate, + itemPlate, + 10, material.vVoltageMultiplier)){ - Logger.WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Success"); } else { - Logger.WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Plate Recipe: "+material.getLocalizedName()+" - Failed"); + } + + //Ring Recipe + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRing(1))) + if (!material.isRadioactive){ + if (GT_Values.RA.addExtruderRecipe( + itemIngot, + shape_Ring, + material.getRing(4), + (int) Math.max(material.getMass() * 2L * 1, 1), + material.vVoltageMultiplier)){ + Logger.WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Extruder Ring Recipe: "+material.getLocalizedName()+" - Failed"); + } } - } //Gear Recipe if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getGear(1))) - if (!material.isRadioactive){ - if (addExtruderRecipe( - material.getIngot(4), - shape_Gear, - itemGear, - (int) Math.max(material.getMass() * 5L, 1), - material.vVoltageMultiplier)){ - Logger.WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Success"); + if (!material.isRadioactive){ + if (GT_Values.RA.addExtruderRecipe( + material.getIngot(4), + shape_Gear, + itemGear, + (int) Math.max(material.getMass() * 5L, 1), + material.vVoltageMultiplier)){ + Logger.WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Failed"); + } } - else { - Logger.WARNING("Extruder Gear Recipe: "+material.getLocalizedName()+" - Failed"); - } - } //Rod Recipe if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRod(1))) - if (addExtruderRecipe( - itemIngot, - shape_Rod, - material.getRod(2), - (int) Math.max(material.getMass() * 2L * 1, 1), - material.vVoltageMultiplier)){ - Logger.WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Success"); - } - else { - Logger.WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Failed"); - } - - - //Bolt Recipe - if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) - if (!material.isRadioactive){ - if (addExtruderRecipe( + if (GT_Values.RA.addExtruderRecipe( itemIngot, - shape_Bolt, - material.getBolt(8), + shape_Rod, + material.getRod(2), (int) Math.max(material.getMass() * 2L * 1, 1), material.vVoltageMultiplier)){ - Logger.WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Success"); + Logger.WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Success"); } else { - Logger.WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Extruder Rod Recipe: "+material.getLocalizedName()+" - Failed"); } - } - } + + //Bolt Recipe + if (ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getBolt(1))) + if (!material.isRadioactive){ + if (GT_Values.RA.addExtruderRecipe( + itemIngot, + shape_Bolt, + material.getBolt(8), + (int) Math.max(material.getMass() * 2L * 1, 1), + material.vVoltageMultiplier)){ + Logger.WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Extruder Bolt Recipe: "+material.getLocalizedName()+" - Failed"); + } + } + + //Rotor Recipe + // Shape_Extruder_Rotor + if (mRotorShapeEnabled && ItemUtils.checkForInvalidItems(material.getIngot(1)) && ItemUtils.checkForInvalidItems(material.getRotor(1))) + if (GT_Values.RA.addExtruderRecipe( + material.getIngot(5), + ItemUtils.getValueOfItemList("Shape_Extruder_Rotor", 0, ItemUtils.getErrorStack(1)), + material.getRotor(1), + 200, + 60)){ + Logger.WARNING("Extruder Rotor Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Extruder Rotor Recipe: "+material.getLocalizedName()+" - Failed"); + } - public static boolean addExtruderRecipe(final ItemStack aInput, final ItemStack aShape, final ItemStack aOutput, int aDuration, final int aEUt) { - if ((aInput == null) || (aShape == null) || (aOutput == null)) { - return false; - } - if ((aDuration = GregTech_API.sRecipeFile.get("extruder", aOutput, aDuration)) <= 0) { - return false; - } - GT_Recipe.GT_Recipe_Map.sExtruderRecipes.addRecipe(true, new ItemStack[]{aInput, aShape}, new ItemStack[]{aOutput}, null, null, null, aDuration, aEUt, 0); - return true; - } + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java index 9fe86985f4..488af954d6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_FluidCanning.java @@ -177,6 +177,8 @@ public class RecipeGen_FluidCanning implements Runnable { private final boolean addFluidExtractionRecipe(GT_Recipe aRecipe) { boolean result = false; + CORE.crash(); + Logger.INFO("[FE-Debug] "+aRecipe.mFluidOutputs[0].amount+"L of "+aRecipe.mFluidOutputs[0].getLocalizedName()+" fluid extractor from 1 " + aRecipe.mInputs[0].getDisplayName() + " - Success. Time: "+aRecipe.mDuration+", Voltage: "+aRecipe.mEUt); int aCount1 = GT_Recipe_Map.sFluidExtractionRecipes.mRecipeList.size(); int aCount2 = aCount1; GT_Recipe_Map.sFluidExtractionRecipes.addRecipe(aRecipe); @@ -187,7 +189,7 @@ public class RecipeGen_FluidCanning implements Runnable { } else { Logger.INFO("[ERROR] Failed adding Extraction recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); - //dumpStack(); + dumpStack(); } return result; } @@ -204,7 +206,7 @@ public class RecipeGen_FluidCanning implements Runnable { } else { Logger.INFO("[ERROR] Failed adding Canning recipe for "+ItemUtils.getArrayStackNames(aRecipe.mInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mOutputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidInputs)+", "+ItemUtils.getArrayStackNames(aRecipe.mFluidOutputs)); - //dumpStack(); + dumpStack(); } return result; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java index e87fc08c90..0661ea5ea4 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Fluids.java @@ -5,6 +5,8 @@ import java.util.Set; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.util.GT_OreDictUnificator; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -15,8 +17,10 @@ import gtPlusPlus.core.util.minecraft.ItemUtils; public class RecipeGen_Fluids extends RecipeGen_Base { public final static Set<RunnableWithInfo<Material>> mRecipeGenMap = new HashSet<RunnableWithInfo<Material>>(); + private static boolean mRotorShapeEnabled = false; static { MaterialGenerator.mRecipeMapsToGenerate.put(mRecipeGenMap); + mRotorShapeEnabled = ItemUtils.doesItemListEntryExist("Shape_Extruder_Rotor"); } public RecipeGen_Fluids(final Material M) { @@ -44,85 +48,6 @@ public class RecipeGen_Fluids extends RecipeGen_Base { if (material.getFluidStack(1) != null && !material.getFluidStack(1).getUnlocalizedName().toLowerCase().contains("plasma")) { - if (!material.requiresBlastFurnace()) { - - // Ingot - if (ItemUtils.checkForInvalidItems(material.getIngot(1))) - if (CORE.RA.addFluidExtractionRecipe( - material.getIngot(1), // Input - material.getFluidStack(144), // Fluid Output - 1 * 20, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING("144l fluid extractor from 1 ingot Recipe: " + material.getLocalizedName() - + " - Success"); - } else { - Logger.WARNING("144l fluid extractor from 1 ingot Recipe: " + material.getLocalizedName() - + " - Failed"); - } - - // Plate - if (ItemUtils.checkForInvalidItems(material.getPlate(1))) - if (CORE.RA.addFluidExtractionRecipe( - material.getPlate(1), // Input - material.getFluidStack(144), // Fluid Output - 1 * 20, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING("144l fluid extractor from 1 plate Recipe: " + material.getLocalizedName() - + " - Success"); - } else { - Logger.WARNING("144l fluid extractor from 1 plate Recipe: " + material.getLocalizedName() - + " - Failed"); - } - - // Double Plate - if (ItemUtils.checkForInvalidItems(material.getPlateDouble(1))) - if (CORE.RA.addFluidExtractionRecipe( - material.getPlateDouble(1), // Input - material.getFluidStack(288), // Fluid Output - 1 * 20, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING("144l fluid extractor from 1 double plate Recipe: " + material.getLocalizedName() - + " - Success"); - } else { - Logger.WARNING("144l fluid extractor from 1 double plate Recipe: " + material.getLocalizedName() - + " - Failed"); - } - - // Nugget - if (ItemUtils.checkForInvalidItems(material.getNugget(1))) - if (CORE.RA.addFluidExtractionRecipe( - material.getNugget(1), // Input - material.getFluidStack(16), // Fluid Output - 16, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING("16l fluid extractor from 1 nugget Recipe: " + material.getLocalizedName() - + " - Success"); - } else { - Logger.WARNING("16l fluid extractor from 1 nugget Recipe: " + material.getLocalizedName() - + " - Failed"); - } - - // Block - if (ItemUtils.checkForInvalidItems(material.getBlock(1))) - if (CORE.RA.addFluidExtractionRecipe( - material.getBlock(1), // Input - material.getFluidStack(144 * 9), // Fluid Output - 288, // Duration - material.vVoltageMultiplier // Eu Tick - )) { - Logger.WARNING((144 * 9) + "l fluid extractor from 1 block Recipe: " - + material.getLocalizedName() + " - Success"); - } else { - Logger.WARNING((144 * 9) + "l fluid extractor from 1 block Recipe: " - + material.getLocalizedName() + " - Failed"); - } - - } - // Making Shapes from fluid // Ingot @@ -215,6 +140,7 @@ public class RecipeGen_Fluids extends RecipeGen_Base { ItemList mold_Bolt = ItemUtils.getValueOfItemList("Shape_Mold_Bolt", null); ItemList mold_Screw = ItemUtils.getValueOfItemList("Shape_Mold_Screw", null); ItemList mold_Ring = ItemUtils.getValueOfItemList("Shape_Mold_Ring", null); + ItemList mold_Rotor = ItemUtils.getValueOfItemList("Shape_Mold_Rotor", null); // Rod if (ItemUtils.checkForInvalidItems(material.getRod(1))) @@ -291,7 +217,23 @@ public class RecipeGen_Fluids extends RecipeGen_Base { Logger.WARNING((144 * 9) + "l fluid molder from 1 ring Recipe: " + material.getLocalizedName() + " - Failed"); } + + // Rotor + if (ItemUtils.checkForInvalidItems(material.getRotor(1))) + if (mold_Rotor != null && GT_Values.RA.addFluidSolidifierRecipe(mold_Rotor.get(0), // Item Shape + material.getFluidStack(612), // Fluid Input + material.getRotor(1), // output + 100, // Duration + material.vVoltageMultiplier // Eu Tick + )) { + Logger.WARNING((144 * 9) + "l fluid molder from 1 rotor Recipe: " + material.getLocalizedName() + + " - Success"); + } else { + Logger.WARNING((144 * 9) + "l fluid molder from 1 rotor Recipe: " + material.getLocalizedName() + + " - Failed"); + } + } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java index 830fae78ab..bcf3ef1f9f 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_MetalRecipe.java @@ -1,7 +1,10 @@ package gtPlusPlus.xmod.gregtech.loaders; import gregtech.api.enums.GT_Values; +import gregtech.api.enums.OrePrefixes; import gregtech.api.util.GT_ModHandler; +import gregtech.api.util.GT_OreDictUnificator; +import gregtech.api.util.GT_Utility; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -114,6 +117,32 @@ public class RecipeGen_MetalRecipe extends RecipeGen_Base { else { Logger.WARNING("Lathe Screw Recipe: "+material.getLocalizedName()+" - Failed"); } + + // Fine Wire + if (ItemUtils.checkForInvalidItems(material.getFineWire(1)) && (ItemUtils.checkForInvalidItems(material.getIngot(1)) || ItemUtils.checkForInvalidItems(material.getWire01(1)))) + if (GT_Values.RA.addWiremillRecipe( + ItemUtils.checkForInvalidItems(material.getWire01(1)) ? material.getWire01(1) : material.getIngot(1), + material.getFineWire(ItemUtils.checkForInvalidItems(material.getWire01(1)) ? 4 : 8), + 100, + 4)){ + Logger.WARNING("Wiremill Fine Wire Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Wiremill Fine Wire Recipe: "+material.getLocalizedName()+" - Failed"); + } + // Fine Wire + if (ItemUtils.checkForInvalidItems(material.getFineWire(1)) && (ItemUtils.checkForInvalidItems(material.getRod(1)))) + if (GT_Values.RA.addWiremillRecipe( + material.getRod(1), + material.getFineWire(4), + 50, + 4)){ + Logger.WARNING("Wiremill Fine Wire Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Wiremill Fine Wire Recipe: "+material.getLocalizedName()+" - Failed"); + } + } }
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java index 5f53defc2f..7355ac7dc0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plasma.java @@ -8,6 +8,8 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.recipe.common.CI; +import gtPlusPlus.core.util.minecraft.ItemUtils; import net.minecraft.item.ItemStack; public class RecipeGen_Plasma extends RecipeGen_Base { @@ -27,15 +29,18 @@ public class RecipeGen_Plasma extends RecipeGen_Base { generateRecipes(this.toGenerate); } - private void generateRecipes(final Material material) { - // Cool Plasma - ItemStack aPlasmaCell = material.getPlasmaCell(1); - ItemStack aCell = material.getCell(1); - if (material.getPlasmaCell(1) != null){ - GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, aPlasmaCell), GT_Utility.getFluidForFilledItem(aPlasmaCell, true) == null ? GT_Utility.getContainerItem(aPlasmaCell, true) : null, (int) Math.max(1024L, 1024L * material.getMass()), 4); - } - if (material.getCell(1) != null && material.getPlasmaCell(1) != null){ - GT_Values.RA.addVacuumFreezerRecipe(aPlasmaCell, aCell, (int) Math.max(material.getMass() * 2L, 1L)); + private void generateRecipes(final Material material) { + if (material.getPlasma() != null) { + // Cool Plasma + ItemStack aPlasmaCell = material.getPlasmaCell(1); + ItemStack aCell = material.getCell(1); + ItemStack aContainerItem = GT_Utility.getFluidForFilledItem(aPlasmaCell, true) == null ? GT_Utility.getContainerItem(aPlasmaCell, true) : CI.emptyCells(1); + if (ItemUtils.checkForInvalidItems(new ItemStack[] {aPlasmaCell, aContainerItem})){ + GT_Values.RA.addFuel(GT_Utility.copyAmount(1L, aPlasmaCell), aContainerItem, (int) Math.max(1024L, 1024L * material.getMass()), 4); + } + if (ItemUtils.checkForInvalidItems(new ItemStack[] {aCell, aPlasmaCell})){ + GT_Values.RA.addVacuumFreezerRecipe(aPlasmaCell, aCell, (int) Math.max(material.getMass() * 2L, 1L)); + } } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java index 56d11520d0..6b512f4b3a 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Plates.java @@ -6,6 +6,8 @@ import java.util.Set; import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.ItemList; +import gregtech.api.objects.GT_RenderedTexture; +import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_Recipe; import gtPlusPlus.api.interfaces.RunnableWithInfo; import gtPlusPlus.api.objects.Logger; @@ -93,7 +95,7 @@ public class RecipeGen_Plates extends RecipeGen_Base { Logger.WARNING("Cutting Machine Recipe: "+material.getLocalizedName()+" - Success"); } else { - Logger.WARNING("ACutting Machine Recipe: "+material.getLocalizedName()+" - Failed"); + Logger.WARNING("Cutting Machine Recipe: "+material.getLocalizedName()+" - Failed"); } @@ -121,6 +123,20 @@ public class RecipeGen_Plates extends RecipeGen_Base { else { Logger.WARNING("Bender Recipe: "+material.getLocalizedName()+" - Failed"); } + + //Bender + if (ItemUtils.checkForInvalidItems(material.getPlate(1)) && ItemUtils.checkForInvalidItems(material.getFoil(1))) + if (addBenderRecipe( + material.getPlate(1), + material.getFoil(4), + (int) Math.max(material.getMass(), 1L), + material.vVoltageMultiplier)){ + GregTech_API.registerCover(material.getFoil(1), new GT_RenderedTexture(material.getTextureSet().mTextures[70], material.getRGBA(), false), null); + Logger.WARNING("Bender Foil Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Bender Foil Recipe: "+material.getLocalizedName()+" - Failed"); + } } public static boolean addBenderRecipe(final ItemStack aInput1, final ItemStack aOutput1, int aDuration, final int aEUt) { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java index acb7e5fe02..ed9203fe34 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_Recycling.java @@ -1,6 +1,8 @@ package gtPlusPlus.xmod.gregtech.loaders; +import static gregtech.api.enums.GT_Values.L; import static gregtech.api.enums.GT_Values.M; +import static gregtech.api.enums.GT_Values.RA; import java.util.ArrayList; import java.util.Map; @@ -9,6 +11,7 @@ import org.apache.commons.lang3.reflect.FieldUtils; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.SubTag; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -105,7 +108,7 @@ public class RecipeGen_Recycling implements Runnable { for (final Pair<OrePrefixes, ItemStack> validPrefix : mValidPairs) { try { - if (material == null || validPrefix == null || material.getState() != MaterialState.SOLID || validPrefix.getKey() == OrePrefixes.ingotHot) { + if (material == null || validPrefix == null || (material.getState() != MaterialState.SOLID && material.getState() != MaterialState.LIQUID) || validPrefix.getKey() == OrePrefixes.ingotHot) { continue; } @@ -137,9 +140,13 @@ public class RecipeGen_Recycling implements Runnable { //Fluid Extractor if (ItemUtils.checkForInvalidItems(tempStack)) { // mValidItems[mSlotIndex++] = tempStack; - if ((mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluidStack(mFluidAmount), 30, material.vVoltageMultiplier)) { + + int aFluidAmount = (int) ((L * validPrefix.getKey().mMaterialAmount) / (M * tempStack.stackSize)); + int aDuration = (int) Math.max(1, (24 * validPrefix.getKey().mMaterialAmount) / M); + boolean aGenFluidExtraction = CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluidStack(aFluidAmount), aDuration, material.vVoltageMultiplier); + if (aGenFluidExtraction/*(mDust != null) && CORE.RA.addFluidExtractionRecipe(tempStack, material.getFluidStack(mFluidAmount), 30, material.vVoltageMultiplier)*/) { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Success - Recycle " - + tempStack.getDisplayName() + " and obtain " + mFluidAmount+"mb of "+material.getFluidStack(1).getLocalizedName()+"."); + + tempStack.getDisplayName() + " and obtain " + aFluidAmount+"mb of "+material.getFluidStack(1).getLocalizedName()+". Time: "+aDuration+", Voltage: "+material.vVoltageMultiplier); } else { Logger.WARNING("Fluid Recycle Recipe: " + material.getLocalizedName() + " - Failed"); diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java index ea129a2b0e..1a6221b09e 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/RecipeGen_ShapedCrafting.java @@ -9,6 +9,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.material.Material; import gtPlusPlus.core.material.MaterialGenerator; +import gtPlusPlus.core.recipe.common.CI; import gtPlusPlus.core.util.minecraft.ItemUtils; import gtPlusPlus.core.util.minecraft.RecipeUtils; import net.minecraft.item.ItemStack; @@ -177,6 +178,34 @@ public class RecipeGen_ShapedCrafting extends RecipeGen_Base { Logger.WARNING("Bolt Recipe: "+material.getLocalizedName()+" - Failed"); } } + + //Shaped Recipe - Fine Wire + if (!material.isRadioactive && ItemUtils.checkForInvalidItems(material.getFoil(1)) && ItemUtils.checkForInvalidItems(material.getFineWire(1))) { + if (RecipeUtils.addShapedRecipe( + material.getFoil(1), CI.craftingToolWireCutter, null, + null, null, null, + null, null, null, + material.getFineWire(1))){ + Logger.WARNING("Fine Wire Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Fine Wire Recipe: "+material.getLocalizedName()+" - Failed"); + } + } + + //Shaped Recipe - Foil + if (ItemUtils.checkForInvalidItems(material.getFoil(1)) && ItemUtils.checkForInvalidItems(material.getPlate(1))) { + if (RecipeUtils.addShapedRecipe( + CI.craftingToolHammer_Hard, material.getPlate(1), null, + null, null, null, + null, null, null, + material.getFoil(2))){ + Logger.WARNING("Foil Recipe: "+material.getLocalizedName()+" - Success"); + } + else { + Logger.WARNING("Foil Recipe: "+material.getLocalizedName()+" - Failed"); + } + } //Shaped Recipe - Ingot to Rod diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java new file mode 100644 index 0000000000..2ae16af406 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/loaders/recipe/RecipeLoader_MolecularTransformer.java @@ -0,0 +1,32 @@ +package gtPlusPlus.xmod.gregtech.loaders.recipe; + +import static advsolar.utils.MTRecipeManager.transformerRecipes; + +import advsolar.utils.MTRecipeRecord; +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.lib.CORE; +import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.core.util.minecraft.MaterialUtils; + +public class RecipeLoader_MolecularTransformer { + + public static void run() { + + for (int i = 0; i < transformerRecipes.size(); i++) { + MTRecipeRecord aRecipe = transformerRecipes.get(i); + int aEU = MaterialUtils.getVoltageForTier(5); + Logger.INFO("======================="); + Logger.INFO("Generating GT recipe for Molecular Transformer."); + Logger.INFO("Input: "+aRecipe.inputStack.getDisplayName()+", Output: "+aRecipe.outputStack.getDisplayName()+", EU/t: "+aEU); + float aTicks = (float) aRecipe.energyPerOperation / (float) aEU; + Logger.INFO("Ticks: "+aTicks); + int aTicksRoundedUp = MathUtils.roundToClosestInt(Math.ceil(aTicks)); + Logger.INFO("Ticks: "+aTicksRoundedUp); + Logger.INFO("Total EU equal or greater? "+((aTicksRoundedUp * aEU) >= aRecipe.energyPerOperation)); + CORE.RA.addMolecularTransformerRecipe(aRecipe.inputStack, aRecipe.outputStack, aTicksRoundedUp, aEU, 2); + Logger.INFO("======================="); + } + + } + +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java index d727da4211..79a9f788df 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/recipes/GregtechRecipeAdder.java @@ -1,6 +1,7 @@ package gtPlusPlus.xmod.gregtech.recipes; import static gregtech.GT_Mod.GT_FML_LOGGER; +import static gregtech.api.enums.GT_Values.RA; import static gtPlusPlus.core.lib.CORE.GTNH; import java.lang.reflect.InvocationTargetException; @@ -1267,12 +1268,39 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { @Override public boolean addFluidExtractionRecipe(ItemStack input, FluidStack output, int aTime, int aEu) { - return MaterialGenerator.addFluidExtractionRecipe(GT_Values.NI, input, output, aTime, aEu); + + boolean aRecipe = RA.addFluidSmelterRecipe( + GT_Utility.copyAmount(1, input), + null, + output, + 10000, + aTime, + aEu, + false); + if (aRecipe) { + Logger.INFO("Added Fluid Extractor Recipe: " + + input.getDisplayName() + " and obtain " + + output.amount+"mb of "+output.getLocalizedName() + +". Time: "+aTime+", Voltage: " + +aEu); + } + return aRecipe; + + //return MaterialGenerator.addFluidExtractionRecipe(GT_Values.NI, input, output, aTime, aEu); } @Override public boolean addFluidExtractionRecipe(ItemStack aEmpty, ItemStack aRemains, FluidStack aFluid, int aDuration, int aEU) { - return MaterialGenerator.addFluidExtractionRecipe(aEmpty, aRemains, aFluid, aDuration, aEU); + boolean aRecipe = RA.addFluidSmelterRecipe( + GT_Utility.copyAmount(1, aEmpty), + aRemains, + aFluid, + 10000, + aDuration, + aEU, + false); + return aRecipe; + //return MaterialGenerator.addFluidExtractionRecipe(aEmpty, aRemains, aFluid, aDuration, aEU); } @Override @@ -1844,7 +1872,26 @@ public class GregtechRecipeAdder implements IGregtech_RecipeAdder { } - + public boolean addMolecularTransformerRecipe(ItemStack aInput, ItemStack aOutput, int aDuration, int aEUt, int aAmps) { + if ((aInput == null) || (aOutput == null)) { + return false; + } + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + new ItemStack[] {aInput}, + new ItemStack[] {aOutput}, + null, + new int[] {10000}, + new FluidStack[] {}, + new FluidStack[] {}, + aDuration, + aEUt, + aAmps); + + int aSize = GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size(); + GTPP_Recipe_Map.sMolecularTransformerRecipes.add(aRecipe); + return GTPP_Recipe_Map.sMolecularTransformerRecipes.mRecipeList.size() > aSize; +} 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 0817202e85..e71e71d6ed 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/Gregtech4Content.java @@ -1,13 +1,18 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import gregtech.api.GregTech_API; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.lib.LoadedMods; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; -import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractGenerator; -import gtPlusPlus.xmod.gregtech.common.tileentities.automation.GT_MetaTileEntity_TesseractTerminal; +import gtPlusPlus.xmod.gregtech.common.tileentities.automation.*; +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.*; +import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_AdvancedCraftingTable; +import gtPlusPlus.xmod.gregtech.common.tileentities.storage.GT_MetaTileEntity_BronzeCraftingTable; import gtPlusPlus.xmod.gregtech.common.tileentities.storage.shelving.*; public class Gregtech4Content { @@ -16,20 +21,75 @@ public class Gregtech4Content { public static void run() { if (LoadedMods.Gregtech) { + Logger.INFO("Max MTE: "+GregTech_API.METATILEENTITIES.length+" | "+GregTech_API.MAXIMUM_METATILE_IDS); workbenches(); thermalBoiler(); multiCrafter(); tesseracts(); shelves(); + 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() { // Gregtech 4 Workbenches - //Utils.LOG_INFO("Gregtech 4 Content | Registering Workbenches."); - // Free //GregtechItemList.GT4_Workbench_Bronze.set(new - // GT_MetaTileEntity_BronzeCraftingTable(828, "workbench.bronze", - // "Bronze Workbench", 0).getStackForm(1L)); + Logger.INFO("Gregtech 4 Content | Registering Workbenches."); + GregtechItemList.GT4_Workbench_Bronze.set(new GT_MetaTileEntity_BronzeCraftingTable(31081, "workbench.basic", "Bronze Workbench", 0, "Stores 16000L of fluid").getStackForm(1L)); + GregtechItemList.GT4_Workbench_Advanced.set(new GT_MetaTileEntity_AdvancedCraftingTable(31082, "workbench.advanced", "Advanced Workbench", 3, "Stores 64000L of fluid").getStackForm(1L)); + + } + + private static void redstone() { + Logger.INFO("Gregtech 4 Content | Registering Redstone Blocks."); + GregtechItemList.GT4_Redstone_Lamp.set(new GT_MetaTileEntity_RedstoneLamp(31120).getStackForm(1L)); + GregtechItemList.GT4_Redstone_Button_Panel.set(new GT_MetaTileEntity_RedstoneButtonPanel(31121).getStackForm(1L)); + GregtechItemList.GT4_Redstone_Scale.set(new GT_MetaTileEntity_RedstoneStrengthScale(31122).getStackForm(1L)); + GregtechItemList.GT4_Redstone_Display.set(new GT_MetaTileEntity_RedstoneStrengthDisplay(31123, "redstone.display.strength", "Redstone Display", "Displays Redstone Strength").getStackForm(1L)); + GregtechItemList.GT4_Redstone_Circuit.set(new GT_MetaTileEntity_RedstoneCircuitBlock(31124).getStackForm(1L)); + + } + + private static void automation() { + Logger.INFO("Gregtech 4 Content | Registering Auto Workbenches."); + GregtechItemList.GT4_Electric_Auto_Workbench_LV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31091, 1, "Automatic crafting machine").getStackForm(1L)); + GregtechItemList.GT4_Electric_Auto_Workbench_MV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31092, 2, "Automatic crafting machine").getStackForm(1L)); + GregtechItemList.GT4_Electric_Auto_Workbench_HV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31093, 3, "Automatic crafting machine").getStackForm(1L)); + GregtechItemList.GT4_Electric_Auto_Workbench_EV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31094, 4, "Automatic crafting machine").getStackForm(1L)); + GregtechItemList.GT4_Electric_Auto_Workbench_IV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31095, 5, "Automatic crafting machine").getStackForm(1L)); + GregtechItemList.GT4_Electric_Auto_Workbench_LuV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31096, 6, "Automatic crafting machine").getStackForm(1L)); + GregtechItemList.GT4_Electric_Auto_Workbench_ZPM.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31097, 7, "Automatic crafting machine").getStackForm(1L)); + GregtechItemList.GT4_Electric_Auto_Workbench_UV.set(new GT_MetaTileEntity_ElectricAutoWorkbench(31098, 8, "Automatic crafting machine").getStackForm(1L)); + + Logger.INFO("Gregtech 4 Content | Registering Inventory Managers."); + GregtechItemList.GT4_Electric_Inventory_Manager_LV.set(new GT_MetaTileEntity_ElectricInventoryManager(31101, 1, "Manages your inventory and stuff").getStackForm(1L)); + GregtechItemList.GT4_Electric_Inventory_Manager_MV.set(new GT_MetaTileEntity_ElectricInventoryManager(31102, 2, "Manages your inventory and stuff").getStackForm(1L)); + GregtechItemList.GT4_Electric_Inventory_Manager_HV.set(new GT_MetaTileEntity_ElectricInventoryManager(31103, 3, "Manages your inventory and stuff").getStackForm(1L)); + GregtechItemList.GT4_Electric_Inventory_Manager_EV.set(new GT_MetaTileEntity_ElectricInventoryManager(31104, 4, "Manages your inventory and stuff").getStackForm(1L)); + GregtechItemList.GT4_Electric_Inventory_Manager_IV.set(new GT_MetaTileEntity_ElectricInventoryManager(31105, 5, "Manages your inventory and stuff").getStackForm(1L)); + GregtechItemList.GT4_Electric_Inventory_Manager_LuV.set(new GT_MetaTileEntity_ElectricInventoryManager(31106, 6, "Manages your inventory and stuff").getStackForm(1L)); + GregtechItemList.GT4_Electric_Inventory_Manager_ZPM.set(new GT_MetaTileEntity_ElectricInventoryManager(31107, 7, "Manages your inventory and stuff").getStackForm(1L)); + GregtechItemList.GT4_Electric_Inventory_Manager_UV.set(new GT_MetaTileEntity_ElectricInventoryManager(31108, 8, "Manages your inventory and stuff").getStackForm(1L)); + } + + private static void basic() { + Logger.INFO("Gregtech 4 Content | Registering Crop Managers."); + GregtechItemList.GT4_Crop_Harvester_LV.set(new GT_MetaTileEntity_CropHarvestor(31111, 1, "Harvests the Cropsticks in front of it").getStackForm(1L)); + GregtechItemList.GT4_Crop_Harvester_MV.set(new GT_MetaTileEntity_CropHarvestor(31112, 2, "Harvests the Cropsticks in front of it").getStackForm(1L)); + GregtechItemList.GT4_Crop_Harvester_HV.set(new GT_MetaTileEntity_CropHarvestor(31113, 3, "Harvests the Cropsticks in front of it").getStackForm(1L)); + GregtechItemList.GT4_Crop_Harvester_EV.set(new GT_MetaTileEntity_CropHarvestor(31114, 4, "Harvests the Cropsticks in front of it").getStackForm(1L)); + GregtechItemList.GT4_Crop_Harvester_IV.set(new GT_MetaTileEntity_CropHarvestor(31115, 5, "Harvests the Cropsticks in front of it").getStackForm(1L)); + GregtechItemList.GT4_Crop_Harvester_LuV.set(new GT_MetaTileEntity_CropHarvestor(31116, 6, "Harvests the Cropsticks in front of it").getStackForm(1L)); + GregtechItemList.GT4_Crop_Harvester_ZPM.set(new GT_MetaTileEntity_CropHarvestor(31117, 7, "Harvests the Cropsticks in front of it").getStackForm(1L)); + GregtechItemList.GT4_Crop_Harvester_UV.set(new GT_MetaTileEntity_CropHarvestor(31118, 8, "Harvests the Cropsticks in front of it").getStackForm(1L)); } private static void tesseracts() { diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java index 9a5fa6f6de..3c1140fea0 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechConduits.java @@ -40,7 +40,7 @@ public class GregtechConduits { * */ - private static OrePrefixes cableGt16; + public static OrePrefixes cableGt16; static{ if(GTNH) { try { @@ -52,7 +52,7 @@ public class GregtechConduits { } //30000-30999 - + private static int BaseWireID = 30600; private static int BasePipeID = 30700; private static int BasePipeHexadecupleID = 30100; @@ -74,7 +74,7 @@ public class GregtechConduits { } private static void run3() { - + if (Utils.getGregtechVersionAsInt() >= 50930) { try { Class<GT_MetaPipeEntity_Fluid> aPipeEntity = GT_MetaPipeEntity_Fluid.class; @@ -103,17 +103,17 @@ public class GregtechConduits { e.printStackTrace(); } } - - + + //Generate Heat Pipes //GregtechItemList.HeatPipe_Tier_1.set(new GT_MetaPipeEntity_Heat(31021, "gtpp.pipe.heat.basic.01", "Lead Heat Pipe (500C)", Materials.Lead, 500).getStackForm(1L)); //GregtechItemList.HeatPipe_Tier_2.set(new GT_MetaPipeEntity_Heat(31022, "gtpp.pipe.heat.basic.02", "Iron Heat Pipe (500C)", Materials.Iron, 500).getStackForm(1L)); //GregtechItemList.HeatPipe_Tier_3.set(new GT_MetaPipeEntity_Heat(31023, "gtpp.pipe.heat.basic.03", "Silver Heat Pipe (1500C)", Materials.Silver, 1500).getStackForm(1L)); - - - + + + } - + private static void generateFluidMultiPipes(Constructor<GT_MetaPipeEntity_Fluid> aClazz, Materials aMaterial, String name, String displayName, int startID, int baseCapacity, int heatCapacity, boolean gasProof){ GT_MetaPipeEntity_Fluid aPipe; try { @@ -453,245 +453,165 @@ public class GregtechConduits { return true; } - public static boolean generateWireRecipes(Material aMaterial){ + public static boolean generateWireRecipes(Material aMaterial) { + + ItemStack aPlate = aMaterial.getPlate(1); + ItemStack aIngot = aMaterial.getIngot(1); + ItemStack aWire01 = aMaterial.getWire01(1); + ItemStack aWire02 = aMaterial.getWire02(1); + ItemStack aWire04 = aMaterial.getWire04(1); + ItemStack aWire08 = aMaterial.getWire08(1); + ItemStack aWire12 = aMaterial.getWire12(1); + ItemStack aWire16 = aMaterial.getWire16(1); + ItemStack aCable01 = aMaterial.getCable01(1); + ItemStack aCable02 = aMaterial.getCable02(1); + ItemStack aCable04 = aMaterial.getCable04(1); + ItemStack aCable08 = aMaterial.getCable08(1); + ItemStack aCable12 = aMaterial.getCable12(1); + ItemStack aCable16 = aMaterial.getCable16(1); + + // Adds manual crafting recipe + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aPlate, aWire01})) { + RecipeUtils.addShapedRecipe(aPlate, CI.craftingToolWireCutter, null, null, null, null, null, null, null, aWire01); + } - //Adds manual crafting recipe - RecipeUtils.addShapedRecipe( - Utils.sanitizeString("plate"+aMaterial.getLocalizedName()), CI.craftingToolWireCutter, null, - null, null, null, - null, null, null, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1)); - - //Wire mill - GT_Values.RA.addWiremillRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("ingot"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 2), - 5*20, - 4); - - //Extruder - GT_Values.RA.addExtruderRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("ingot"+aMaterial.getLocalizedName()), 1), - ItemList.Shape_Extruder_Wire.get(0), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 2), - 196, - 96); - - GT_Values.RA.addUnboxingRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("cableGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - null, - 100, - 8); - - //Shapeless Down-Crafting - //2x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt02"+aMaterial.getLocalizedName()), 1)}, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 2) - ); - //4x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1)}, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 4) - ); - //8x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt08"+aMaterial.getLocalizedName()), 1)}, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 8) - ); - //12x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt12"+aMaterial.getLocalizedName()), 1)}, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 12) - ); - //16x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt16"+aMaterial.getLocalizedName()), 1)}, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 16) - ); - - - //1x -> 2x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1) - }, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt02"+aMaterial.getLocalizedName()), 1) - ); - - //2x -> 4x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt02"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt02"+aMaterial.getLocalizedName()), 1) - }, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1) - ); - - //4x -> 8x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1) - }, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt08"+aMaterial.getLocalizedName()), 1) - ); - - //8x -> 12x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt08"+aMaterial.getLocalizedName()), 1) - }, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt12"+aMaterial.getLocalizedName()), 1) - ); - - //12x -> 16x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt12"+aMaterial.getLocalizedName()), 1) - }, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt16"+aMaterial.getLocalizedName()), 1) - ); - - //8x -> 16x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt08"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt08"+aMaterial.getLocalizedName()), 1) - }, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt16"+aMaterial.getLocalizedName()), 1) - ); - - //1x -> 4x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1) - }, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1) - ); - - //1x -> 8x - RecipeUtils.addShapelessGregtechRecipe( - new ItemStack[]{ - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1) - }, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt08"+aMaterial.getLocalizedName()), 1) - ); - - - //Wire to Cable - //1x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 1), - CI.getNumberedCircuit(24), - FluidUtils.getFluidStack("molten.rubber", 144), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("cableGt01"+aMaterial.getLocalizedName()), 1), - 100, - 8); - //2x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt02"+aMaterial.getLocalizedName()), 1), - CI.getNumberedCircuit(24), - FluidUtils.getFluidStack("molten.rubber", 144), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("cableGt02"+aMaterial.getLocalizedName()), 1), - 100, - 8); - //4x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1), - CI.getNumberedCircuit(24), - FluidUtils.getFluidStack("molten.rubber", 288), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("cableGt04"+aMaterial.getLocalizedName()), 1), - 100, - 8); - //8x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt08"+aMaterial.getLocalizedName()), 1), - CI.getNumberedCircuit(24), - FluidUtils.getFluidStack("molten.rubber", 432), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("cableGt08"+aMaterial.getLocalizedName()), 1), - 100, - 8); - //12x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt12"+aMaterial.getLocalizedName()), 1), - CI.getNumberedCircuit(24), - FluidUtils.getFluidStack("molten.rubber", 576), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("cableGt12"+aMaterial.getLocalizedName()), 1), - 100, - 8); - - if(GTNH){ - //16x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt16"+aMaterial.getLocalizedName()), 1), - CI.getNumberedCircuit(24), - FluidUtils.getFluidStack("molten.rubber", 720), - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("cableGt16"+aMaterial.getLocalizedName()), 1), - 100, - 8); - } - - //Assemble small wires into bigger wires - - //2x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 2), - CI.getNumberedCircuit(2), - null, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt02"+aMaterial.getLocalizedName()), 1), - 100, - 8); - - //4x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 2), - CI.getNumberedCircuit(4), - null, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt04"+aMaterial.getLocalizedName()), 1), - 100, - 8); - - //8x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 2), - CI.getNumberedCircuit(8), - null, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt08"+aMaterial.getLocalizedName()), 1), - 100, - 8); - - //12x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 2), - CI.getNumberedCircuit(12), - null, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt12"+aMaterial.getLocalizedName()), 1), - 100, - 8); - - //16x - GT_Values.RA.addAssemblerRecipe( - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt01"+aMaterial.getLocalizedName()), 2), - CI.getNumberedCircuit(16), - null, - ItemUtils.getItemStackOfAmountFromOreDict(Utils.sanitizeString("wireGt16"+aMaterial.getLocalizedName()), 1), - 100, - 8); + // Wire mill + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aIngot, aWire01})) { + GT_Values.RA.addWiremillRecipe(aIngot, aMaterial.getWire01(2), 5 * 20, 4); + } + + // Extruder + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aIngot, aWire01})) { + GT_Values.RA.addExtruderRecipe(aIngot, ItemList.Shape_Extruder_Wire.get(0), aMaterial.getWire01(2), 196, 96); + } + + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aCable01, aWire01})) { + GT_Values.RA.addUnboxingRecipe(aCable01, aWire01, null, 100, 8); + } + + // Shapeless Down-Crafting + // 2x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire02}, aMaterial.getWire01(2)); + } + + // 4x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire04})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire04}, aMaterial.getWire01(4)); + } + + // 8x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire08})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire08}, aMaterial.getWire01(8)); + } + + // 12x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire12})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire12}, aMaterial.getWire01(12)); + } + + // 16x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire16})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire16}, aMaterial.getWire01(16)); + } + + // 1x -> 2x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire01, aWire01}, aWire02); + } + + // 2x -> 4x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire02, aWire04})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire02, aWire02}, aWire04); + } + + // 4x -> 8x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire04, aWire08})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire04, aWire04}, aWire08); + } + + // 8x -> 12x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire04, aWire08, aWire12})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire04, aWire08}, aWire12); + } + + // 12x -> 16x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire04, aWire12, aWire16})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire04, aWire12}, aWire16); + } + + // 8x -> 16x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire08, aWire16})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire08, aWire08}, aWire16); + } + + // 1x -> 4x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire04})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire01, aWire01, aWire01, aWire01}, aWire04); + } + + // 1x -> 8x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire08})) { + RecipeUtils.addShapelessGregtechRecipe(new ItemStack[]{aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01, aWire01}, aWire08); + } + + // Wire to Cable + // 1x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aCable01})) { + GT_Values.RA.addAssemblerRecipe(aWire01, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 144), aCable01, 100, 8); + } + + // 2x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire02, aCable02})) { + GT_Values.RA.addAssemblerRecipe(aWire02, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 144), aCable02, 100, 8); + } + + // 4x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire04, aCable04})) { + GT_Values.RA.addAssemblerRecipe(aWire04, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 288), aCable04, 100, 8); + } + + // 8x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire08, aCable08})) { + GT_Values.RA.addAssemblerRecipe(aWire08, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 432), aCable08, 100, 8); + } + + // 12x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire12, aCable12})) { + GT_Values.RA.addAssemblerRecipe(aWire12, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 576), aCable12, 100, 8); + } + + // 16x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire16, aCable16})) { + GT_Values.RA.addAssemblerRecipe(aWire16, CI.getNumberedCircuit(24), FluidUtils.getFluidStack("molten.rubber", 720), aCable16, 100, 8); + } + + // Assemble small wires into bigger wires + + // 2x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) { + GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(2), CI.getNumberedCircuit(2), null, aWire02, 100, 8); + } + + // 4x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) { + GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(4), CI.getNumberedCircuit(4), null, aWire04, 100, 8); + } + + // 8x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) { + GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(8), CI.getNumberedCircuit(8), null, aWire08, 100, 8); + } + + // 12x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) { + GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(12), CI.getNumberedCircuit(12), null, aWire12, 100, 8); + } + + // 16x + if (ItemUtils.checkForInvalidItems(new ItemStack[]{aWire01, aWire02})) { + GT_Values.RA.addAssemblerRecipe(aMaterial.getWire01(16), CI.getNumberedCircuit(16), null, aWire16, 100, 8); + } return true; } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java index 8340b7088c..67c54a7699 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFactoryGradeReplacementMultis.java @@ -4,7 +4,7 @@ import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialVacuumFreezer; -//import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_AssemblyLine; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_AssemblyLine; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_DistillationTower; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_EBF; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.advanced.GregtechMetaTileEntity_Adv_Fusion_MK4; @@ -26,9 +26,9 @@ public class GregtechFactoryGradeReplacementMultis { //31021 GregtechItemList.Machine_Adv_DistillationTower.set(new GregtechMetaTileEntity_Adv_DistillationTower(31021, "multimachine.adv.distillationtower", "Dangote Distillus").getStackForm(1L)); - /*if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { + if (CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { GregtechItemList.Machine_Adv_AssemblyLine.set(new GregtechMetaTileEntity_Adv_AssemblyLine(31024, "multimachine.adv.assemblyline", "Compound Fabricator").getStackForm(1L)); - }*/ + } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java index 9e940dff26..9301844071 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialElementDuplicator.java @@ -12,7 +12,7 @@ public class GregtechIndustrialElementDuplicator { Logger.INFO("Gregtech5u Content | Registering Elemental Duplicator Multiblock."); GregtechItemList.Controller_ElementalDuplicator.set(new GregtechMTE_ElementalDuplicator(31050, "gtpp.multimachine.replicator", "Elemental Duplicator").getStackForm(1L)); - GregtechItemList.Hatch_Input_Elemental_Duplicator.set(new GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(31051, "hatch.input_bus.elementalorbholder", "Elemental Data Orb Storage", 7).getStackForm(1L)); + GregtechItemList.Hatch_Input_Elemental_Duplicator.set(new GT_MetaTileEntity_Hatch_ElementalDataOrbHolder(31051, "hatch.input_bus.elementalorbholder", "Data Orb Repository", 7).getStackForm(1L)); } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java new file mode 100644 index 0000000000..6e13934a8d --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialForgeHammer.java @@ -0,0 +1,22 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialForgeHammer; + +public class GregtechIndustrialForgeHammer { + + public static void run() { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Industrial Forge Hammer Multiblock."); + run1(); + } + + } + + private static void run1() { + GregtechItemList.Controller_IndustrialForgeHammer.set(new GregtechMetaTileEntity_IndustrialForgeHammer(31075, + "industrialhammer.controller.tier.single", "Industrial Sledgehammer").getStackForm(1L)); + + } +}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java index f07be17ffd..8489f0d59c 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechIndustrialMassFabricator.java @@ -3,6 +3,7 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.util.GT_Recipe; +import gregtech.common.tileentities.machines.basic.GT_MetaTileEntity_Massfabricator; import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.core.lib.CORE; @@ -33,9 +34,9 @@ public class GregtechIndustrialMassFabricator { } private static void generateRecipes() { - + //Generate Scrap->UUA Recipes - + //Basic UUA1 @@ -63,7 +64,7 @@ public class GregtechIndustrialMassFabricator { GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(UUA_From_Scrap); GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(UUA_From_ScrapBoxes); - + if (!CORE.MAIN_GREGTECH_5U_EXPERIMENTAL_FORK) { //Basic UUM GT_Recipe generateUUM = new GTPP_Recipe( @@ -94,10 +95,13 @@ public class GregtechIndustrialMassFabricator { } else { + GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes.addFakeRecipe(false, null, null, null, null, new FluidStack[]{Materials.UUMatter.getFluid(1L)}, GT_MetaTileEntity_Massfabricator.sDurationMultiplier, 256, 0); + GT_Recipe.GT_Recipe_Map.sMassFabFakeRecipes.addFakeRecipe(false, null, null, null, new FluidStack[]{Materials.UUAmplifier.getFluid(GT_MetaTileEntity_Massfabricator.sUUAperUUM)}, new FluidStack[]{Materials.UUMatter.getFluid(1L)}, GT_MetaTileEntity_Massfabricator.sDurationMultiplier / GT_MetaTileEntity_Massfabricator.sUUASpeedBonus, 256, 0); + //Basic UUM GT_Recipe generateUUM_LV = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(15)}, + new ItemStack[] {CI.getNumberedCircuit(1)}, new ItemStack[] {GT_Values.NI}, null, null, new FluidStack[] {GT_Values.NF}, @@ -105,119 +109,31 @@ public class GregtechIndustrialMassFabricator { 160*20, 256, 0); - GT_Recipe generateUUM_MV = new GTPP_Recipe( - false, - new ItemStack[] {CI.getNumberedCircuit(14)}, - new ItemStack[] {GT_Values.NI}, - null, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, - 160*20, - 512, - 0); - GT_Recipe generateUUM_HV = new GTPP_Recipe( - false, - new ItemStack[] {CI.getNumberedCircuit(13)}, - new ItemStack[] {GT_Values.NI}, - null, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, - 160*20, - 1024, - 0); - GT_Recipe generateUUM_EV = new GTPP_Recipe( - false, - new ItemStack[] {CI.getNumberedCircuit(12)}, - new ItemStack[] {GT_Values.NI}, - null, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, - 160*20, - 2048, - 0); - GT_Recipe generateUUM_IV = new GTPP_Recipe( - false, - new ItemStack[] {CI.getNumberedCircuit(11)}, - new ItemStack[] {GT_Values.NI}, - null, null, - new FluidStack[] {GT_Values.NF}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, - 160*20, - 4096, - 0); //Basic UUM GT_Recipe generateUUMFromUUA_LV = new GTPP_Recipe( false, - new ItemStack[] {CI.getNumberedCircuit(5)}, - new ItemStack[] {GT_Values.NI}, - null, null, - new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, - 40*20, - 256, - 0); - GT_Recipe generateUUMFromUUA_MV = new GTPP_Recipe( - false, - new ItemStack[] {CI.getNumberedCircuit(4)}, - new ItemStack[] {GT_Values.NI}, - null, null, - new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, - 40*20, - 512, - 0); - GT_Recipe generateUUMFromUUA_HV = new GTPP_Recipe( - false, - new ItemStack[] {CI.getNumberedCircuit(3)}, - new ItemStack[] {GT_Values.NI}, - null, null, - new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, - 40*20, - 1024, - 0); - GT_Recipe generateUUMFromUUA_EV = new GTPP_Recipe( - false, new ItemStack[] {CI.getNumberedCircuit(2)}, new ItemStack[] {GT_Values.NI}, null, null, new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, new FluidStack[] {Materials.UUMatter.getFluid(1)}, 40*20, - 2048, - 0); - GT_Recipe generateUUMFromUUA_IV = new GTPP_Recipe( - false, - new ItemStack[] {CI.getNumberedCircuit(1)}, - new ItemStack[] {GT_Values.NI}, - null, null, - new FluidStack[] {Materials.UUAmplifier.getFluid(1)}, - new FluidStack[] {Materials.UUMatter.getFluid(1)}, - 40*20, - 4096, + 256, 0); GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_LV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_MV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_HV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_EV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUM_IV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_LV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_MV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_HV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_EV); - GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_IV); + GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.add(generateUUMFromUUA_LV); } - + Logger.INFO("Generated "+GTPP_Recipe.GTPP_Recipe_Map.sMatterFab2Recipes.mRecipeList.size()+" Matter Fabricator recipes."); - - + + } - + public static ItemStack getScrapPile() { @@ -226,5 +142,5 @@ public class GregtechIndustrialMassFabricator { public static ItemStack getScrapBox() { return ItemUtils.getSimpleStack(ItemUtils.getItemFromFQRN("IC2:itemScrapbox")); } - + }
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java index 9b9f5fd59b..282ca1ffaa 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechLargeTurbinesAndHeatExchanger.java @@ -2,21 +2,27 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_Gas; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_Plasma; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_SHSteam; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.turbines.GT_MTE_LargeTurbine_Steam; public class GregtechLargeTurbinesAndHeatExchanger { public static void run() { if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { Logger.INFO("Gregtech5u Content | Registering Larger Turbines & Extra Large Heat Exchanger."); - run1(); + run1(); } } private static void run1() { - /* GregtechItemList.Large_Steam_Turbine.set(new GT_MTE_LargeTurbine_Steam(865, "multimachine.largerturbine", "XL Turbo Steam Turbine").getStackForm(1L)); - GregtechItemList.Large_HPSteam_Turbine.set(new GT_MTE_LargeTurbine_SHSteam(866, "multimachine.largerhpturbine", "XL Turbo HP Steam Turbine").getStackForm(1L)); - GregtechItemList.Hatch_Turbine_Rotor.set(new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L)); - */ + GregtechItemList.Large_Steam_Turbine.set(new GT_MTE_LargeTurbine_Steam(865, "multimachine.largerturbine", "XL Turbo Steam Turbine").getStackForm(1L)); + GregtechItemList.Large_HPSteam_Turbine.set(new GT_MTE_LargeTurbine_SHSteam(866, "multimachine.largerhpturbine", "XL Turbo HP Steam Turbine").getStackForm(1L)); + GregtechItemList.Large_Gas_Turbine.set(new GT_MTE_LargeTurbine_Gas(31073, "multimachine.largergasturbine", "XL Turbo Gas Turbine").getStackForm(1L)); + GregtechItemList.Large_Plasma_Turbine.set(new GT_MTE_LargeTurbine_Plasma(31074, "multimachine.largerplasmaturbine", "XL Turbo Plasma Turbine").getStackForm(1L)); + GregtechItemList.Hatch_Turbine_Rotor.set(new GT_MetaTileEntity_Hatch_Turbine(30010, "hatch.turbine", "Rotor Assembly", 8).getStackForm(1L)); } }
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java new file mode 100644 index 0000000000..4a0a0dc1b2 --- /dev/null +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechMolecularTransformer.java @@ -0,0 +1,22 @@ +package gtPlusPlus.xmod.gregtech.registration.gregtech; + +import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; +import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.processing.GregtechMetaTileEntity_IndustrialMolecularTransformer; + +public class GregtechMolecularTransformer { + + public static void run() { + if (gtPlusPlus.core.lib.LoadedMods.Gregtech) { + Logger.INFO("Gregtech5u Content | Registering Molecular Transformer Multiblock."); + run1(); + } + + } + + private static void run1() { + GregtechItemList.Controller_MolecularTransformer.set(new GregtechMetaTileEntity_IndustrialMolecularTransformer(31072, + "moleculartransformer.controller.tier.single", "Molecular Transformer").getStackForm(1L)); + + } +}
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java index 3e9582b80a..7a71707f24 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechPowerBreakers.java @@ -1,5 +1,6 @@ package gtPlusPlus.xmod.gregtech.registration.gregtech; +import gregtech.api.enums.GT_Values; import gtPlusPlus.api.objects.Logger; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicBreaker; @@ -26,7 +27,7 @@ public class GregtechPowerBreakers { GregtechItemList.BreakerBox_HV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.03", "High Voltage Breaker Box", 3, "", 16)).getStackForm(1L)); GregtechItemList.BreakerBox_EV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.04", - "Extreme Voltage Breaker Box", 16, "", 16)).getStackForm(1L)); + "Extreme Voltage Breaker Box", 4, "", 16)).getStackForm(1L)); GregtechItemList.BreakerBox_IV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.05", "Insane Voltage Breaker Box", 5, "", 16)).getStackForm(1L)); GregtechItemList.BreakerBox_LuV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.06", @@ -36,7 +37,7 @@ public class GregtechPowerBreakers { GregtechItemList.BreakerBox_UV.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.08", "Ultimate Voltage Breaker Box", 8, "", 16)).getStackForm(1L)); GregtechItemList.BreakerBox_MAX.set((new GT_MetaTileEntity_BasicBreaker(aStartID++, "breaker.tier.09", - "MAX Voltage Breaker Box", 9, "", 16)).getStackForm(1L)); + GT_Values.VN[9]+" Breaker Box", 9, "", 16)).getStackForm(1L)); } }
\ No newline at end of file diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java index d7f8f7f4d5..b4cdf581ae 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechSolarTower.java @@ -1,10 +1,12 @@ -/* package gtPlusPlus.xmod.gregtech.registration.gregtech; +import gregtech.api.util.GTPP_Recipe; import gtPlusPlus.api.objects.Logger; +import gtPlusPlus.core.material.MISC_MATERIALS; import gtPlusPlus.xmod.gregtech.api.enums.GregtechItemList; import gtPlusPlus.xmod.gregtech.common.tileentities.machines.multi.production.GregtechMetaTileEntity_SolarTower; import gtPlusPlus.xmod.gregtech.common.tileentities.misc.TileEntitySolarHeater; +import net.minecraftforge.fluids.FluidStack; public class GregtechSolarTower { @@ -28,5 +30,20 @@ public class GregtechSolarTower { "Part of the Clean Green energy movement", 0).getStackForm(1L)); + // NEI recipe + GTPP_Recipe aRecipe = new GTPP_Recipe( + false, + null, + null, + null, + null, + new FluidStack[] {MISC_MATERIALS.SOLAR_SALT_COLD.getFluidStack(1000)}, + new FluidStack[] {MISC_MATERIALS.SOLAR_SALT_HOT.getFluidStack(1000)}, + 0, + 0, + 0); + GTPP_Recipe.GTPP_Recipe_Map.sSolarTowerRecipes.add(aRecipe); + + } -}*/ +} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java index 1c5181130b..5023e80543 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechTeslaTower.java @@ -1,4 +1,3 @@ -/* package gtPlusPlus.xmod.gregtech.registration.gregtech; import gtPlusPlus.api.objects.Logger; @@ -14,4 +13,3 @@ public class GregtechTeslaTower { } } -*/ diff --git a/src/main/resources/assets/gregtech/lang/en_US.lang b/src/main/resources/assets/gregtech/lang/en_US.lang index 4f6b835f67..cd01a7a2aa 100644 --- a/src/main/resources/assets/gregtech/lang/en_US.lang +++ b/src/main/resources/assets/gregtech/lang/en_US.lang @@ -15,6 +15,7 @@ GTPP.multiblock.efficiency=Efficiency GTPP.multiblock.problems=Problems GTPP.multiblock.mei=Max Energy Income GTPP.multiblock.usage=Probably uses +GTPP.multiblock.generation=Probably generates GTPP.multiblock.specialvalue=Special Value GTPP.multiblock.duration=Duration @@ -22,7 +23,7 @@ GTPP.multiblock.duration=Duration GTPP.CC.machinetier=Control Core Tier GTPP.CC.discount=EU Discount -GTPP.CC.parallel=Maximum Parallel Processing +GTPP.CC.parallel=Maximum Parallel //Tooltips for the Charger Packs GTPP.battpack.tooltip.1=Worn as a Belt within Baubles diff --git a/src/main/resources/assets/gregtech/textures/gui/HatchDataOrb.png b/src/main/resources/assets/gregtech/textures/gui/HatchDataOrb.png Binary files differnew file mode 100644 index 0000000000..c161ec40af --- /dev/null +++ b/src/main/resources/assets/gregtech/textures/gui/HatchDataOrb.png diff --git a/src/main/resources/assets/miscutils/lang/en_US.lang b/src/main/resources/assets/miscutils/lang/en_US.lang index c7d3e9a938..505a52d4e8 100644 --- a/src/main/resources/assets/miscutils/lang/en_US.lang +++ b/src/main/resources/assets/miscutils/lang/en_US.lang @@ -107,6 +107,11 @@ tile.blockCompressedObsidian.2.name=Triple Compressed Obsidian (729) tile.blockCompressedObsidian.3.name=Quadruple Compressed Obsidian (6561) tile.blockCompressedObsidian.4.name=Quintuple Compressed Obsidian (59049) tile.blockCompressedObsidian.5.name=Inverted Obsidian +tile.blockCompressedObsidian.6.name=Compressed Glowstone (9) +tile.blockCompressedObsidian.7.name=Double Compressed Glowstone (81) +tile.blockCompressedObsidian.8.name=Triple Compressed Glowstone (729) +tile.blockCompressedObsidian.9.name=Quadruple Compressed Glowstone (6561) +tile.blockCompressedObsidian.10.name=Quintuple Compressed Glowstone (59049) tile.blockNet.name=Net @@ -3370,6 +3375,9 @@ item.FrothMonaziteflotation.name=Monazite Flotation Froth Cell item.BasicGenericChemItem.13.name=Formaldehyde Catalyst item.hydrogenchloridemix.name=Hydrogen Chlorine Mix +//Added 19/01/22 +item.SunnariumBit.name=Sunnarium Bit + //Added 29/01/22 sleep.event.okay=You slept well and now feel a little better. sleep.event.good=You slept well and now feel much better. diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BLUE.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BLUE.png Binary files differnew file mode 100644 index 0000000000..19456fb462 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BLUE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BLUE_REDSTONE.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BLUE_REDSTONE.png Binary files differnew file mode 100644 index 0000000000..870d09e8f2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BLUE_REDSTONE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BOXES.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BOXES.png Binary files differnew file mode 100644 index 0000000000..553c674b58 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_BOXES.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CROP.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CROP.png Binary files differnew file mode 100644 index 0000000000..f6dec1fccf --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CROP.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CYAN.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CYAN.png Binary files differnew file mode 100644 index 0000000000..ba9dfee948 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CYAN.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CYAN_REDSTONE.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CYAN_REDSTONE.png Binary files differnew file mode 100644 index 0000000000..61d7b97402 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_CYAN_REDSTONE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_GREEN.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_GREEN.png Binary files differnew file mode 100644 index 0000000000..00614a28ee --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_GREEN.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_GREEN_REDSTONE.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_GREEN_REDSTONE.png Binary files differnew file mode 100644 index 0000000000..15e5e3807e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_GREEN_REDSTONE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_PURPLE.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_PURPLE.png Binary files differnew file mode 100644 index 0000000000..89a22fde86 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_PURPLE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_PURPLE_REDSTONE.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_PURPLE_REDSTONE.png Binary files differnew file mode 100644 index 0000000000..2b577185f7 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_PURPLE_REDSTONE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_RED.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_RED.png Binary files differnew file mode 100644 index 0000000000..78f0f3a7b7 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_RED.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_RED_REDSTONE.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_RED_REDSTONE.png Binary files differnew file mode 100644 index 0000000000..120c04d087 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_RED_REDSTONE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_SIDE_CABINET.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_SIDE_CABINET.png Binary files differnew file mode 100644 index 0000000000..6ed62a002d --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_SIDE_CABINET.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_YELLOW.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_YELLOW.png Binary files differnew file mode 100644 index 0000000000..0f26874430 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_YELLOW.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_YELLOW_REDSTONE.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_YELLOW_REDSTONE.png Binary files differnew file mode 100644 index 0000000000..eacf4df06f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/OVERLAY_YELLOW_REDSTONE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_bottom.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_bottom.png Binary files differnew file mode 100644 index 0000000000..faa25b4887 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_bottom.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_side.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_side.png Binary files differnew file mode 100644 index 0000000000..652245a61c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_side.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_top.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_top.png Binary files differnew file mode 100644 index 0000000000..568a7332ab --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_top.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_top_crafting.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_top_crafting.png Binary files differnew file mode 100644 index 0000000000..0e4219dbab --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/bronze_top_crafting.png 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 differnew file mode 100644 index 0000000000..76ebee594c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/computer.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/machine_top_crafting.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/machine_top_crafting.png Binary files differnew file mode 100644 index 0000000000..a8b157975c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/machine_top_crafting.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/0.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/0.png Binary files differnew file mode 100644 index 0000000000..10d882e13f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/0.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/1.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/1.png Binary files differnew file mode 100644 index 0000000000..b4cf1ad1c5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/1.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/10.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/10.png Binary files differnew file mode 100644 index 0000000000..5be386c991 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/10.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/11.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/11.png Binary files differnew file mode 100644 index 0000000000..4d2770d6ea --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/11.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/12.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/12.png Binary files differnew file mode 100644 index 0000000000..dda5b9f70c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/12.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/13.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/13.png Binary files differnew file mode 100644 index 0000000000..08083ce68d --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/13.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/14.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/14.png Binary files differnew file mode 100644 index 0000000000..d368a109ba --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/14.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/15.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/15.png Binary files differnew file mode 100644 index 0000000000..974026d8c1 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/15.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/16.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/16.png Binary files differnew file mode 100644 index 0000000000..64797504ea --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/16.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/17.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/17.png Binary files differnew file mode 100644 index 0000000000..ed3ba22f03 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/17.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/18.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/18.png Binary files differnew file mode 100644 index 0000000000..0822a9ff9e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/18.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/19.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/19.png Binary files differnew file mode 100644 index 0000000000..d17c80290e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/19.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/2.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/2.png Binary files differnew file mode 100644 index 0000000000..02b703dd72 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/2.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/20.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/20.png Binary files differnew file mode 100644 index 0000000000..4d789dcd34 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/20.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/21.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/21.png Binary files differnew file mode 100644 index 0000000000..1a86034ee6 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/21.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/22.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/22.png Binary files differnew file mode 100644 index 0000000000..5b614c2b75 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/22.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/23.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/23.png Binary files differnew file mode 100644 index 0000000000..e5c64819ce --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/23.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/24.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/24.png Binary files differnew file mode 100644 index 0000000000..9cd772a7bc --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/24.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/25.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/25.png Binary files differnew file mode 100644 index 0000000000..758f3a5925 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/25.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/26.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/26.png Binary files differnew file mode 100644 index 0000000000..582a7226ea --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/26.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/27.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/27.png Binary files differnew file mode 100644 index 0000000000..bf8bee95fd --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/27.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/28.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/28.png Binary files differnew file mode 100644 index 0000000000..59ec6fc494 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/28.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/29.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/29.png Binary files differnew file mode 100644 index 0000000000..0ebf3022a1 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/29.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/3.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/3.png Binary files differnew file mode 100644 index 0000000000..726b97e140 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/3.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/30.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/30.png Binary files differnew file mode 100644 index 0000000000..a5b703fcd6 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/30.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/31.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/31.png Binary files differnew file mode 100644 index 0000000000..49b84b97a4 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/31.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/32.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/32.png Binary files differnew file mode 100644 index 0000000000..c6fd476b1a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/32.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/33.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/33.png Binary files differnew file mode 100644 index 0000000000..0300e86059 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/33.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/34.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/34.png Binary files differnew file mode 100644 index 0000000000..5ef3e61175 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/34.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/35.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/35.png Binary files differnew file mode 100644 index 0000000000..8e077d1d7d --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/35.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/36.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/36.png Binary files differnew file mode 100644 index 0000000000..5aff3c93de --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/36.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/37.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/37.png Binary files differnew file mode 100644 index 0000000000..c3cad83294 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/37.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/38.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/38.png Binary files differnew file mode 100644 index 0000000000..87b3fb5225 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/38.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/39.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/39.png Binary files differnew file mode 100644 index 0000000000..10798b86d8 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/39.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/4.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/4.png Binary files differnew file mode 100644 index 0000000000..ad834b3576 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/4.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/40.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/40.png Binary files differnew file mode 100644 index 0000000000..ce6321458d --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/40.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/41.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/41.png Binary files differnew file mode 100644 index 0000000000..d5a2428eb1 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/41.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/42.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/42.png Binary files differnew file mode 100644 index 0000000000..70317dd7a7 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/42.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/43.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/43.png Binary files differnew file mode 100644 index 0000000000..3c61345b63 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/43.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/44.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/44.png Binary files differnew file mode 100644 index 0000000000..764853abfa --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/44.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/45.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/45.png Binary files differnew file mode 100644 index 0000000000..7c7c30d998 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/45.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/46.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/46.png Binary files differnew file mode 100644 index 0000000000..367a85067b --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/46.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/47.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/47.png Binary files differnew file mode 100644 index 0000000000..52de50d2b2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/47.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/48.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/48.png Binary files differnew file mode 100644 index 0000000000..f283ec79b2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/48.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/49.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/49.png Binary files differnew file mode 100644 index 0000000000..426c42b558 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/49.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/5.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/5.png Binary files differnew file mode 100644 index 0000000000..011bee76c3 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/5.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/50.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/50.png Binary files differnew file mode 100644 index 0000000000..7b23d35271 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/50.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/51.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/51.png Binary files differnew file mode 100644 index 0000000000..b930b49af3 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/51.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/52.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/52.png Binary files differnew file mode 100644 index 0000000000..6e73111695 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/52.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/53.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/53.png Binary files differnew file mode 100644 index 0000000000..98d2cdb4c5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/53.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/54.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/54.png Binary files differnew file mode 100644 index 0000000000..5db3a982ea --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/54.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/55.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/55.png Binary files differnew file mode 100644 index 0000000000..00b697cdf7 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/55.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/56.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/56.png Binary files differnew file mode 100644 index 0000000000..0464a70a58 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/56.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/57.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/57.png Binary files differnew file mode 100644 index 0000000000..e70c013912 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/57.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/58.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/58.png Binary files differnew file mode 100644 index 0000000000..e9938feff2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/58.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/59.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/59.png Binary files differnew file mode 100644 index 0000000000..890f09f231 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/59.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/6.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/6.png Binary files differnew file mode 100644 index 0000000000..42eeda7b4e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/6.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/60.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/60.png Binary files differnew file mode 100644 index 0000000000..94db5b9946 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/60.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/61.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/61.png Binary files differnew file mode 100644 index 0000000000..6efa02daf2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/61.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/62.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/62.png Binary files differnew file mode 100644 index 0000000000..3983966fda --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/62.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/63.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/63.png Binary files differnew file mode 100644 index 0000000000..7f14006fe7 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/63.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/7.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/7.png Binary files differnew file mode 100644 index 0000000000..edd4a94aee --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/7.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/8.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/8.png Binary files differnew file mode 100644 index 0000000000..1a63ac762c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/8.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/9.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/9.png Binary files differnew file mode 100644 index 0000000000..9964ac7486 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/ButtonPanel/9.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/0.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/0.png Binary files differnew file mode 100644 index 0000000000..aac94f4d6c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/0.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/1.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/1.png Binary files differnew file mode 100644 index 0000000000..4571bca877 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/1.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/10.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/10.png Binary files differnew file mode 100644 index 0000000000..2391919c11 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/10.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/100.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/100.png Binary files differnew file mode 100644 index 0000000000..644ed36a90 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/100.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/101.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/101.png Binary files differnew file mode 100644 index 0000000000..b67da08aed --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/101.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/102.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/102.png Binary files differnew file mode 100644 index 0000000000..1d8c4e2490 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/102.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/103.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/103.png Binary files differnew file mode 100644 index 0000000000..eace1e1e7e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/103.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/104.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/104.png Binary files differnew file mode 100644 index 0000000000..e63d77edad --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/104.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/105.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/105.png Binary files differnew file mode 100644 index 0000000000..63f45d2287 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/105.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/106.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/106.png Binary files differnew file mode 100644 index 0000000000..6c571f8e58 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/106.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/107.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/107.png Binary files differnew file mode 100644 index 0000000000..204a0aa231 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/107.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/108.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/108.png Binary files differnew file mode 100644 index 0000000000..4c927a85f2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/108.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/109.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/109.png Binary files differnew file mode 100644 index 0000000000..9fa6010d04 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/109.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/11.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/11.png Binary files differnew file mode 100644 index 0000000000..ee82155436 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/11.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/110.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/110.png Binary files differnew file mode 100644 index 0000000000..7bd92aaa6e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/110.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/111.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/111.png Binary files differnew file mode 100644 index 0000000000..70a75f9600 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/111.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/112.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/112.png Binary files differnew file mode 100644 index 0000000000..22220a9ba6 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/112.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/113.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/113.png Binary files differnew file mode 100644 index 0000000000..0d40f42170 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/113.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/114.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/114.png Binary files differnew file mode 100644 index 0000000000..e4ea8065da --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/114.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/115.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/115.png Binary files differnew file mode 100644 index 0000000000..43541eeeb2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/115.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/116.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/116.png Binary files differnew file mode 100644 index 0000000000..c8d30df85a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/116.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/117.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/117.png Binary files differnew file mode 100644 index 0000000000..349f3114af --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/117.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/118.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/118.png Binary files differnew file mode 100644 index 0000000000..8f07eb15cc --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/118.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/119.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/119.png Binary files differnew file mode 100644 index 0000000000..bb75cda218 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/119.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/12.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/12.png Binary files differnew file mode 100644 index 0000000000..907c77700e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/12.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/120.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/120.png Binary files differnew file mode 100644 index 0000000000..7ca146e829 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/120.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/121.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/121.png Binary files differnew file mode 100644 index 0000000000..52019a127f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/121.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/122.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/122.png Binary files differnew file mode 100644 index 0000000000..0021064944 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/122.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/123.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/123.png Binary files differnew file mode 100644 index 0000000000..16a2322abb --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/123.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/124.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/124.png Binary files differnew file mode 100644 index 0000000000..3728d698e5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/124.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/125.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/125.png Binary files differnew file mode 100644 index 0000000000..338086ea34 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/125.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/126.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/126.png Binary files differnew file mode 100644 index 0000000000..cf92e50fe1 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/126.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/127.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/127.png Binary files differnew file mode 100644 index 0000000000..44f46489f4 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/127.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/128.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/128.png Binary files differnew file mode 100644 index 0000000000..cd3d00ed5d --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/128.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/129.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/129.png Binary files differnew file mode 100644 index 0000000000..e15af0cd81 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/129.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/13.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/13.png Binary files differnew file mode 100644 index 0000000000..16a9298fa0 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/13.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/130.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/130.png Binary files differnew file mode 100644 index 0000000000..236b4b80b9 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/130.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/131.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/131.png Binary files differnew file mode 100644 index 0000000000..2146a21dcb --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/131.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/132.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/132.png Binary files differnew file mode 100644 index 0000000000..8e6c4b7fab --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/132.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/133.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/133.png Binary files differnew file mode 100644 index 0000000000..968baf1add --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/133.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/134.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/134.png Binary files differnew file mode 100644 index 0000000000..5a9274232f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/134.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/135.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/135.png Binary files differnew file mode 100644 index 0000000000..0fd7625761 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/135.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/136.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/136.png Binary files differnew file mode 100644 index 0000000000..9f16c39367 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/136.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/137.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/137.png Binary files differnew file mode 100644 index 0000000000..15eb15c7e0 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/137.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/138.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/138.png Binary files differnew file mode 100644 index 0000000000..4e86dfaf93 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/138.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/139.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/139.png Binary files differnew file mode 100644 index 0000000000..790c0d4a74 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/139.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/14.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/14.png Binary files differnew file mode 100644 index 0000000000..5c2827b117 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/14.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/140.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/140.png Binary files differnew file mode 100644 index 0000000000..0a2f07d9fe --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/140.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/141.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/141.png Binary files differnew file mode 100644 index 0000000000..6ad3543609 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/141.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/142.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/142.png Binary files differnew file mode 100644 index 0000000000..65942b572f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/142.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/143.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/143.png Binary files differnew file mode 100644 index 0000000000..7ee3b4c91d --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/143.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/15.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/15.png Binary files differnew file mode 100644 index 0000000000..8291c9a39c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/15.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/16.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/16.png Binary files differnew file mode 100644 index 0000000000..2a8779fb61 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/16.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/17.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/17.png Binary files differnew file mode 100644 index 0000000000..1ddd1f6ad5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/17.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/18.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/18.png Binary files differnew file mode 100644 index 0000000000..ac0dcc3f76 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/18.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/19.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/19.png Binary files differnew file mode 100644 index 0000000000..1d2101a43a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/19.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/2.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/2.png Binary files differnew file mode 100644 index 0000000000..e412953793 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/2.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/20.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/20.png Binary files differnew file mode 100644 index 0000000000..e5d71c3965 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/20.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/21.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/21.png Binary files differnew file mode 100644 index 0000000000..ad8cb864ba --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/21.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/22.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/22.png Binary files differnew file mode 100644 index 0000000000..751662e049 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/22.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/23.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/23.png Binary files differnew file mode 100644 index 0000000000..142c713efe --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/23.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/24.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/24.png Binary files differnew file mode 100644 index 0000000000..5e1097bf80 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/24.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/25.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/25.png Binary files differnew file mode 100644 index 0000000000..391d12d2cd --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/25.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/26.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/26.png Binary files differnew file mode 100644 index 0000000000..5dc9635b3a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/26.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/27.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/27.png Binary files differnew file mode 100644 index 0000000000..03fcb8285b --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/27.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/28.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/28.png Binary files differnew file mode 100644 index 0000000000..01d8912612 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/28.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/29.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/29.png Binary files differnew file mode 100644 index 0000000000..7755b75e4a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/29.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/3.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/3.png Binary files differnew file mode 100644 index 0000000000..cf3107aecd --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/3.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/30.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/30.png Binary files differnew file mode 100644 index 0000000000..fb1e7714cf --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/30.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/31.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/31.png Binary files differnew file mode 100644 index 0000000000..38e66ff784 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/31.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/32.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/32.png Binary files differnew file mode 100644 index 0000000000..20083e41ae --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/32.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/33.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/33.png Binary files differnew file mode 100644 index 0000000000..bbcd289595 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/33.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/34.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/34.png Binary files differnew file mode 100644 index 0000000000..cb5c142713 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/34.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/35.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/35.png Binary files differnew file mode 100644 index 0000000000..50e459ac1e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/35.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/36.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/36.png Binary files differnew file mode 100644 index 0000000000..741ca3ac20 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/36.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/37.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/37.png Binary files differnew file mode 100644 index 0000000000..64af38a224 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/37.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/38.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/38.png Binary files differnew file mode 100644 index 0000000000..de2abc3646 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/38.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/39.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/39.png Binary files differnew file mode 100644 index 0000000000..ff782c55c4 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/39.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/4.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/4.png Binary files differnew file mode 100644 index 0000000000..10de7d0317 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/4.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/40.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/40.png Binary files differnew file mode 100644 index 0000000000..b35c8b37e3 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/40.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/41.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/41.png Binary files differnew file mode 100644 index 0000000000..1da7e74566 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/41.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/42.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/42.png Binary files differnew file mode 100644 index 0000000000..aaab388552 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/42.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/43.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/43.png Binary files differnew file mode 100644 index 0000000000..3581670fb5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/43.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/44.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/44.png Binary files differnew file mode 100644 index 0000000000..d4422e227b --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/44.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/45.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/45.png Binary files differnew file mode 100644 index 0000000000..f24d8c84e3 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/45.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/46.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/46.png Binary files differnew file mode 100644 index 0000000000..7a32bac3cb --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/46.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/47.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/47.png Binary files differnew file mode 100644 index 0000000000..19667bb6be --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/47.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/48.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/48.png Binary files differnew file mode 100644 index 0000000000..13d8bd9307 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/48.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/49.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/49.png Binary files differnew file mode 100644 index 0000000000..5874834cf1 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/49.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/5.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/5.png Binary files differnew file mode 100644 index 0000000000..0a1c52ad33 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/5.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/50.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/50.png Binary files differnew file mode 100644 index 0000000000..7d30aba7b6 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/50.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/51.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/51.png Binary files differnew file mode 100644 index 0000000000..63991ec562 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/51.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/52.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/52.png Binary files differnew file mode 100644 index 0000000000..07824b69dc --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/52.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/53.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/53.png Binary files differnew file mode 100644 index 0000000000..e01ce3cb2e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/53.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/54.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/54.png Binary files differnew file mode 100644 index 0000000000..0cc8baaf9a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/54.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/55.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/55.png Binary files differnew file mode 100644 index 0000000000..dd20f55350 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/55.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/56.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/56.png Binary files differnew file mode 100644 index 0000000000..8e5d6fc552 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/56.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/57.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/57.png Binary files differnew file mode 100644 index 0000000000..cf867dbb2f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/57.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/58.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/58.png Binary files differnew file mode 100644 index 0000000000..2986bea8f6 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/58.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/59.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/59.png Binary files differnew file mode 100644 index 0000000000..52f08e5a5b --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/59.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/6.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/6.png Binary files differnew file mode 100644 index 0000000000..2768d1935f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/6.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/60.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/60.png Binary files differnew file mode 100644 index 0000000000..d27ed3ed00 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/60.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/61.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/61.png Binary files differnew file mode 100644 index 0000000000..55f19a1f1b --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/61.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/62.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/62.png Binary files differnew file mode 100644 index 0000000000..588c573775 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/62.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/63.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/63.png Binary files differnew file mode 100644 index 0000000000..761953786f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/63.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/64.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/64.png Binary files differnew file mode 100644 index 0000000000..f863c2635e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/64.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/65.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/65.png Binary files differnew file mode 100644 index 0000000000..a9052658b6 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/65.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/66.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/66.png Binary files differnew file mode 100644 index 0000000000..4b7af976a5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/66.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/67.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/67.png Binary files differnew file mode 100644 index 0000000000..ac293cd370 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/67.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/68.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/68.png Binary files differnew file mode 100644 index 0000000000..5ead585025 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/68.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/69.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/69.png Binary files differnew file mode 100644 index 0000000000..74e2a6b31b --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/69.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/7.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/7.png Binary files differnew file mode 100644 index 0000000000..5fd2f744a9 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/7.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/70.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/70.png Binary files differnew file mode 100644 index 0000000000..b571a65158 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/70.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/71.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/71.png Binary files differnew file mode 100644 index 0000000000..88a39782ac --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/71.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/72.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/72.png Binary files differnew file mode 100644 index 0000000000..23752aea81 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/72.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/73.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/73.png Binary files differnew file mode 100644 index 0000000000..8d74fb171f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/73.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/74.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/74.png Binary files differnew file mode 100644 index 0000000000..946544c42d --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/74.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/75.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/75.png Binary files differnew file mode 100644 index 0000000000..f457d249da --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/75.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/76.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/76.png Binary files differnew file mode 100644 index 0000000000..5fd30ed50f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/76.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/77.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/77.png Binary files differnew file mode 100644 index 0000000000..c846c18e86 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/77.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/78.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/78.png Binary files differnew file mode 100644 index 0000000000..91d8c1e291 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/78.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/79.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/79.png Binary files differnew file mode 100644 index 0000000000..7f3bb56a09 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/79.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/8.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/8.png Binary files differnew file mode 100644 index 0000000000..9f408b7dbf --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/8.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/80.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/80.png Binary files differnew file mode 100644 index 0000000000..60c0c9041e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/80.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/81.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/81.png Binary files differnew file mode 100644 index 0000000000..62fde6b46c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/81.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/82.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/82.png Binary files differnew file mode 100644 index 0000000000..b4885d28ed --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/82.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/83.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/83.png Binary files differnew file mode 100644 index 0000000000..3e00f22271 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/83.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/84.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/84.png Binary files differnew file mode 100644 index 0000000000..5350e00ac0 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/84.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/85.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/85.png Binary files differnew file mode 100644 index 0000000000..aab39c408c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/85.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/86.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/86.png Binary files differnew file mode 100644 index 0000000000..6150482d1f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/86.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/87.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/87.png Binary files differnew file mode 100644 index 0000000000..8f9a554135 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/87.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/88.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/88.png Binary files differnew file mode 100644 index 0000000000..e8ef3944be --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/88.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/89.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/89.png Binary files differnew file mode 100644 index 0000000000..0129fd6b32 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/89.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/9.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/9.png Binary files differnew file mode 100644 index 0000000000..166abf574e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/9.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/90.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/90.png Binary files differnew file mode 100644 index 0000000000..b7146ab582 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/90.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/91.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/91.png Binary files differnew file mode 100644 index 0000000000..fd663e0718 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/91.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/92.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/92.png Binary files differnew file mode 100644 index 0000000000..ff071f2eaa --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/92.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/93.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/93.png Binary files differnew file mode 100644 index 0000000000..bed5021da3 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/93.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/94.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/94.png Binary files differnew file mode 100644 index 0000000000..997fc2835f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/94.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/95.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/95.png Binary files differnew file mode 100644 index 0000000000..78900cf455 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/95.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/96.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/96.png Binary files differnew file mode 100644 index 0000000000..82cf7f8776 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/96.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/97.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/97.png Binary files differnew file mode 100644 index 0000000000..8e1754bea8 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/97.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/98.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/98.png Binary files differnew file mode 100644 index 0000000000..e88435698c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/98.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/99.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/99.png Binary files differnew file mode 100644 index 0000000000..77314ce820 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Display/99.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Lamp/off.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Lamp/off.png Binary files differnew file mode 100644 index 0000000000..e24f9ff199 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Lamp/off.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Lamp/on.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Lamp/on.png Binary files differnew file mode 100644 index 0000000000..6f4745f516 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Lamp/on.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/0.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/0.png Binary files differnew file mode 100644 index 0000000000..99e41e3fbf --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/0.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/1.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/1.png Binary files differnew file mode 100644 index 0000000000..c1bf500e05 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/1.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/10.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/10.png Binary files differnew file mode 100644 index 0000000000..5a196e3a1f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/10.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/11.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/11.png Binary files differnew file mode 100644 index 0000000000..974338f8b9 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/11.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/12.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/12.png Binary files differnew file mode 100644 index 0000000000..ffb2619f16 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/12.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/13.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/13.png Binary files differnew file mode 100644 index 0000000000..18889c5d4f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/13.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/14.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/14.png Binary files differnew file mode 100644 index 0000000000..f2babfe8ef --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/14.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/15.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/15.png Binary files differnew file mode 100644 index 0000000000..b6a47cab6c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/15.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/16.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/16.png Binary files differnew file mode 100644 index 0000000000..fb19d35e39 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/16.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/17.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/17.png Binary files differnew file mode 100644 index 0000000000..1f26a011ff --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/17.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/18.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/18.png Binary files differnew file mode 100644 index 0000000000..38c8494bcb --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/18.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/19.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/19.png Binary files differnew file mode 100644 index 0000000000..f0a57c9542 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/19.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/2.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/2.png Binary files differnew file mode 100644 index 0000000000..af2372797c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/2.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/20.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/20.png Binary files differnew file mode 100644 index 0000000000..99bb2485b5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/20.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/21.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/21.png Binary files differnew file mode 100644 index 0000000000..90c66a8a1e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/21.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/22.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/22.png Binary files differnew file mode 100644 index 0000000000..43236b0090 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/22.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/23.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/23.png Binary files differnew file mode 100644 index 0000000000..e7a9e84fc0 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/23.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/24.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/24.png Binary files differnew file mode 100644 index 0000000000..f15026ec0f --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/24.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/25.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/25.png Binary files differnew file mode 100644 index 0000000000..a1fd4d6c12 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/25.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/26.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/26.png Binary files differnew file mode 100644 index 0000000000..650e2a28ea --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/26.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/27.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/27.png Binary files differnew file mode 100644 index 0000000000..a9a833c72a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/27.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/28.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/28.png Binary files differnew file mode 100644 index 0000000000..297c509211 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/28.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/29.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/29.png Binary files differnew file mode 100644 index 0000000000..bfa0569cb0 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/29.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/3.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/3.png Binary files differnew file mode 100644 index 0000000000..9238c4d418 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/3.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/30.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/30.png Binary files differnew file mode 100644 index 0000000000..dac28502eb --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/30.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/31.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/31.png Binary files differnew file mode 100644 index 0000000000..c92456a0b9 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/31.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/4.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/4.png Binary files differnew file mode 100644 index 0000000000..4483223ff3 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/4.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/5.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/5.png Binary files differnew file mode 100644 index 0000000000..4bd0c30028 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/5.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/6.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/6.png Binary files differnew file mode 100644 index 0000000000..af066c32cf --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/6.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/7.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/7.png Binary files differnew file mode 100644 index 0000000000..06742246f9 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/7.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/8.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/8.png Binary files differnew file mode 100644 index 0000000000..793f5b8b82 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/8.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/9.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/9.png Binary files differnew file mode 100644 index 0000000000..53a53221cd --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/Scale/9.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_main_off.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_main_off.png Binary files differnew file mode 100644 index 0000000000..24f983dbc5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_main_off.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_main_on.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_main_on.png Binary files differnew file mode 100644 index 0000000000..1b31323313 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_main_on.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_off.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_off.png Binary files differnew file mode 100644 index 0000000000..1a0d063865 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_off.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_on.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_on.png Binary files differnew file mode 100644 index 0000000000..2c2d01db7a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_bottom_redstone_on.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_main_off.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_main_off.png Binary files differnew file mode 100644 index 0000000000..14d33b6e4b --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_main_off.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_main_on.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_main_on.png Binary files differnew file mode 100644 index 0000000000..baa8fff68a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_main_on.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_off.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_off.png Binary files differnew file mode 100644 index 0000000000..9751d83585 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_off.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_on.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_on.png Binary files differnew file mode 100644 index 0000000000..53d80ccab9 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_side_redstone_on.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_main_off.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_main_off.png Binary files differnew file mode 100644 index 0000000000..24f983dbc5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_main_off.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_main_on.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_main_on.png Binary files differnew file mode 100644 index 0000000000..1b31323313 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_main_on.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_off.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_off.png Binary files differnew file mode 100644 index 0000000000..1a0d063865 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_off.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_on.png b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_on.png Binary files differnew file mode 100644 index 0000000000..2c2d01db7a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/TileEntities/gt4/redstone/machine_top_redstone_on.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone1.png b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone1.png Binary files differnew file mode 100644 index 0000000000..17010ff1a3 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone1.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone2.png b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone2.png Binary files differnew file mode 100644 index 0000000000..72befd9bfd --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone2.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone3.png b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone3.png Binary files differnew file mode 100644 index 0000000000..8af7fb854c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone3.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone4.png b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone4.png Binary files differnew file mode 100644 index 0000000000..3def965ce9 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone4.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone5.png b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone5.png Binary files differnew file mode 100644 index 0000000000..b97c9add06 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/compressed/glowstone5.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_COBBLE.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_COBBLE.png Binary files differnew file mode 100644 index 0000000000..6b3bdee64e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_COBBLE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_CONNECTOR.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_CONNECTOR.png Binary files differnew file mode 100644 index 0000000000..91385fe0b1 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_CONNECTOR.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_DATA_ORB.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_DATA_ORB.png Binary files differnew file mode 100644 index 0000000000..f2bdf0ad4a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_DATA_ORB.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_FIRE.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_FIRE.png Binary files differnew file mode 100644 index 0000000000..2ed6d34918 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_FIRE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_GRINDER.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_GRINDER.png Binary files differnew file mode 100644 index 0000000000..b62d2b59fa --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_GRINDER.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_GT.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_GT.png Binary files differnew file mode 100644 index 0000000000..d81efabf11 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_GT.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_ICE.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_ICE.png Binary files differnew file mode 100644 index 0000000000..a693664179 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_ICE.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_IMPLOSION.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_IMPLOSION.png Binary files differnew file mode 100644 index 0000000000..537aa06353 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_IMPLOSION.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_LAPO.png b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_LAPO.png Binary files differnew file mode 100644 index 0000000000..82109b7dd2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/iconsets/OVERLAY_LAPO.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_MAGIC_B.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_MAGIC_B.png Binary files differnew file mode 100644 index 0000000000..265d18b0f7 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_MAGIC_B.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_MAGIC_B.png.mcmeta b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_MAGIC_B.png.mcmeta new file mode 100644 index 0000000000..d0b9e70fe5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_MAGIC_B.png.mcmeta @@ -0,0 +1,6 @@ +{ + "animation":{ + "frametime":4, + "frames": [0, 2, 3, 3, 4, 5, 6, 7, 7, 6, 5, 4, 3, 2, 1, 0] + } +}
\ No newline at end of file diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_E.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_E.png Binary files differnew file mode 100644 index 0000000000..9880dcab11 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_E.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_F.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_F.png Binary files differnew file mode 100644 index 0000000000..882115d975 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_F.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_G.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_G.png Binary files differnew file mode 100644 index 0000000000..3c19830902 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_G.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_H.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_H.png Binary files differnew file mode 100644 index 0000000000..b4bc37fbda --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_H.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_I.png b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_I.png Binary files differnew file mode 100644 index 0000000000..4a59e02f78 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/metro/TEXTURE_TECH_PANEL_I.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/1.png b/src/main/resources/assets/miscutils/textures/blocks/number/1.png Binary files differnew file mode 100644 index 0000000000..106e6e0d05 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/1.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/10.png b/src/main/resources/assets/miscutils/textures/blocks/number/10.png Binary files differnew file mode 100644 index 0000000000..169ce8c5f8 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/10.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/11.png b/src/main/resources/assets/miscutils/textures/blocks/number/11.png Binary files differnew file mode 100644 index 0000000000..bf43b17391 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/11.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/12.png b/src/main/resources/assets/miscutils/textures/blocks/number/12.png Binary files differnew file mode 100644 index 0000000000..9a0b758056 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/12.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/13.png b/src/main/resources/assets/miscutils/textures/blocks/number/13.png Binary files differnew file mode 100644 index 0000000000..956d49540e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/13.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/14.png b/src/main/resources/assets/miscutils/textures/blocks/number/14.png Binary files differnew file mode 100644 index 0000000000..23133d3134 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/14.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/15.png b/src/main/resources/assets/miscutils/textures/blocks/number/15.png Binary files differnew file mode 100644 index 0000000000..07e60e9fee --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/15.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/16.png b/src/main/resources/assets/miscutils/textures/blocks/number/16.png Binary files differnew file mode 100644 index 0000000000..4cf29a3598 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/16.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/2.png b/src/main/resources/assets/miscutils/textures/blocks/number/2.png Binary files differnew file mode 100644 index 0000000000..aa8f532163 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/2.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/3.png b/src/main/resources/assets/miscutils/textures/blocks/number/3.png Binary files differnew file mode 100644 index 0000000000..fdc79c3699 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/3.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/4.png b/src/main/resources/assets/miscutils/textures/blocks/number/4.png Binary files differnew file mode 100644 index 0000000000..bc77ccf7be --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/4.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/5.png b/src/main/resources/assets/miscutils/textures/blocks/number/5.png Binary files differnew file mode 100644 index 0000000000..d32b0d02e8 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/5.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/6.png b/src/main/resources/assets/miscutils/textures/blocks/number/6.png Binary files differnew file mode 100644 index 0000000000..a7fe7400a9 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/6.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/7.png b/src/main/resources/assets/miscutils/textures/blocks/number/7.png Binary files differnew file mode 100644 index 0000000000..8b6cec6694 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/7.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/8.png b/src/main/resources/assets/miscutils/textures/blocks/number/8.png Binary files differnew file mode 100644 index 0000000000..d2f992d6c5 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/8.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/number/9.png b/src/main/resources/assets/miscutils/textures/blocks/number/9.png Binary files differnew file mode 100644 index 0000000000..24151f645c --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/number/9.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/special/block_1.png b/src/main/resources/assets/miscutils/textures/blocks/special/block_1.png Binary files differnew file mode 100644 index 0000000000..2d497c1f81 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/special/block_1.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/special/block_2.png b/src/main/resources/assets/miscutils/textures/blocks/special/block_2.png Binary files differnew file mode 100644 index 0000000000..efec483a20 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/special/block_2.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/special/block_3.png b/src/main/resources/assets/miscutils/textures/blocks/special/block_3.png Binary files differnew file mode 100644 index 0000000000..c6376014e2 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/special/block_3.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/special/block_4.png b/src/main/resources/assets/miscutils/textures/blocks/special/block_4.png Binary files differnew file mode 100644 index 0000000000..55c42584ba --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/special/block_4.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/special/block_5.png b/src/main/resources/assets/miscutils/textures/blocks/special/block_5.png Binary files differnew file mode 100644 index 0000000000..6b2c6a77b1 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/special/block_5.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/special/block_6.png b/src/main/resources/assets/miscutils/textures/blocks/special/block_6.png Binary files differnew file mode 100644 index 0000000000..446478f1de --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/special/block_6.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/special/block_7.png b/src/main/resources/assets/miscutils/textures/blocks/special/block_7.png Binary files differnew file mode 100644 index 0000000000..a8f51c0b68 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/special/block_7.png diff --git a/src/main/resources/assets/miscutils/textures/blocks/special/block_8.png b/src/main/resources/assets/miscutils/textures/blocks/special/block_8.png Binary files differnew file mode 100644 index 0000000000..08afad396a --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/blocks/special/block_8.png diff --git a/src/main/resources/assets/miscutils/textures/gui/CropHarvestor.png b/src/main/resources/assets/miscutils/textures/gui/CropHarvestor.png Binary files differnew file mode 100644 index 0000000000..39a39c1423 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/CropHarvestor.png diff --git a/src/main/resources/assets/miscutils/textures/gui/ElectricAutoWorkbench.png b/src/main/resources/assets/miscutils/textures/gui/ElectricAutoWorkbench.png Binary files differnew file mode 100644 index 0000000000..74b2edbb82 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/ElectricAutoWorkbench.png diff --git a/src/main/resources/assets/miscutils/textures/gui/InventoryManager.png b/src/main/resources/assets/miscutils/textures/gui/InventoryManager.png Binary files differnew file mode 100644 index 0000000000..dfebd41ab3 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/InventoryManager.png diff --git a/src/main/resources/assets/miscutils/textures/gui/RedstoneCircuitBlock.png b/src/main/resources/assets/miscutils/textures/gui/RedstoneCircuitBlock.png Binary files differnew file mode 100644 index 0000000000..0df259c657 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/RedstoneCircuitBlock.png diff --git a/src/main/resources/assets/miscutils/textures/gui/computer/0.png b/src/main/resources/assets/miscutils/textures/gui/computer/0.png Binary files differnew file mode 100644 index 0000000000..d96545981e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/computer/0.png diff --git a/src/main/resources/assets/miscutils/textures/gui/computer/1.png b/src/main/resources/assets/miscutils/textures/gui/computer/1.png Binary files differnew file mode 100644 index 0000000000..249e8fc4f1 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/computer/1.png diff --git a/src/main/resources/assets/miscutils/textures/gui/computer/2.png b/src/main/resources/assets/miscutils/textures/gui/computer/2.png Binary files differnew file mode 100644 index 0000000000..90a9447503 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/computer/2.png diff --git a/src/main/resources/assets/miscutils/textures/gui/computer/3.png b/src/main/resources/assets/miscutils/textures/gui/computer/3.png Binary files differnew file mode 100644 index 0000000000..bf176cd722 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/computer/3.png diff --git a/src/main/resources/assets/miscutils/textures/gui/computer/4.png b/src/main/resources/assets/miscutils/textures/gui/computer/4.png Binary files differnew file mode 100644 index 0000000000..93156df2fe --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/computer/4.png diff --git a/src/main/resources/assets/miscutils/textures/gui/computer/5.png b/src/main/resources/assets/miscutils/textures/gui/computer/5.png Binary files differnew file mode 100644 index 0000000000..eb4dd0d086 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/computer/5.png diff --git a/src/main/resources/assets/miscutils/textures/gui/computer/6.png b/src/main/resources/assets/miscutils/textures/gui/computer/6.png Binary files differnew file mode 100644 index 0000000000..0eda26a397 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/computer/6.png diff --git a/src/main/resources/assets/miscutils/textures/gui/computer/Redstone.png b/src/main/resources/assets/miscutils/textures/gui/computer/Redstone.png Binary files differnew file mode 100644 index 0000000000..cd287a0a2e --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/gui/computer/Redstone.png diff --git a/src/main/resources/assets/miscutils/textures/items/itemSunnariumBit.png b/src/main/resources/assets/miscutils/textures/items/itemSunnariumBit.png Binary files differnew file mode 100644 index 0000000000..acf4cbd064 --- /dev/null +++ b/src/main/resources/assets/miscutils/textures/items/itemSunnariumBit.png |