diff options
5 files changed, 282 insertions, 145 deletions
diff --git a/build.gradle b/build.gradle index fc159f61f6..8949f060c3 100644 --- a/build.gradle +++ b/build.gradle @@ -2,8 +2,8 @@ buildscript { repositories { mavenCentral() maven { - name = "forge" - url = "http://files.minecraftforge.net/maven" + name = "gt" + url = "https://gregtech.overminddl1.com/" } maven { name = "sonatype" @@ -32,12 +32,14 @@ file "build.properties" withReader { } version = "${config.gt.version}" -group= "gregtech" +group = "gregtech" archivesBaseName = "gregtech" -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 -compileJava.options.encoding("UTF-8") +compileJava { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + options.encoding = "UTF-8" +} minecraft { version = "${config.minecraft.version}-${config.forge.version}" @@ -48,8 +50,8 @@ idea.module.inheritOutputDirs = true repositories { maven { - name = 'Forge' - url = 'http://files.minecraftforge.net/maven' + name = "gt" + url = "https://gregtech.overminddl1.com/" } maven { name = "chickenbones" @@ -67,7 +69,6 @@ repositories { name = 'DVS1 Maven FS' url = 'http://dvs1.progwml6.com/files/maven' } - maven { // AppleCore url = "http://www.ryanliptak.com/maven/" } @@ -75,12 +76,11 @@ repositories { name = 'UsrvDE' url = "http://jenkins.usrv.eu:8081/nexus/content/repositories/releases/" } - ivy { + ivy { name = 'gtnh_download_source_stupid_underscore_typo' artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]_[revision].[ext]") } - - ivy { + ivy { name = 'gtnh_download_source' artifactPattern("http://downloads.gtnewhorizons.com/Mods_for_Jenkins/[module]-[revision].[ext]") } @@ -88,6 +88,7 @@ repositories { dependencies { //Hard dep to start (Without this, it wont compile nor start) + compile 'com.google.code.findbugs:jsr305:1.3.9' compile "net.industrial-craft:industrialcraft-2:${config.ic2.version}:dev" //Hard dep to compile (Without this, it wont compile, not even as library) @@ -97,14 +98,15 @@ dependencies { api "codechicken:CodeChickenCore:${config.minecraft.version}-${config.codechickencore.version}:dev" api "codechicken:NotEnoughItems:${config.minecraft.version}-${config.nei.version}:dev" api "com.enderio.core:EnderCore:${config.enderiocore.version}:dev" - api ("com.enderio:EnderIO:${config.enderio.version}:dev"){ + api("com.enderio:EnderIO:${config.enderio.version}:dev") { transitive = false } //Soft Depths (Without this, it wont compile, not needed as library) + compileOnly 'commons-io:commons-io:2.4' compileOnly "eu.usrv:YAMCore:${config.minecraft.version}-${config.yamcore.version}:deobf" compileOnly "tconstruct:TConstruct:${config.minecraft.version}-${config.tconstruct.version}:deobf" - compileOnly "codechicken:Translocator:${config.minecraft.version}-${config.translocators.version}:dev" + compileOnly "codechicken:Translocator:${config.minecraft.version}-${config.translocators.version}:dev" compileOnly "net.sengir.forestry:forestry_${config.minecraft.version}:${config.forestry.version}:dev" compileOnly files("libs/Galacticraft-API-1.7-${config.gc.version}.jar") compileOnly files("libs/GalacticraftCore-Dev-${config.gc.version}.jar") @@ -115,8 +117,7 @@ dependencies { compileOnly name: 'IC2NuclearControl', version: config.nc.version, ext: 'jar' } -processResources -{ +processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version @@ -124,32 +125,32 @@ processResources // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' - + // replace version and mcversion - expand 'version':project.version, 'mcversion':project.minecraft.version + expand 'version': project.version, 'mcversion': project.minecraft.version } - - // copy everything else, thats not the mcmod.info + + // copy everything else, that's not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } - exclude '**/Thumbs.db' + exclude '**/Thumbs.db' } task sourceJar(type: Jar) { from sourceSets.main.allSource - classifier = 'sources' + archiveClassifier.set('sources') } task devJar(type: Jar) { from sourceSets.main.output - classifier = 'dev' + archiveClassifier.set('dev') } task apiJar(type: Jar) { from sourceSets.main.allSource include("gregtech/api/**") - classifier = 'api' + archiveClassifier.set('api') } artifacts { @@ -158,17 +159,17 @@ artifacts { archives(apiJar) } -task signJar(dependsOn: 'reobf'){ +task signJar(dependsOn: 'reobf') { doLast { ant.signjar( - destDir: jar.destinationDir, - jar: jar.getArchivePath(), - alias: findProperty('keyStoreAlias') ?: '', - keystore: findProperty('keyStore') ?: '', - storepass: findProperty('keyStorePass') ?: '', - digestalg: findProperty('signDigestAlg') ?: '', - tsaurl: findProperty('signTSAurl') ?: '', - verbose: true - ) + destDir: jar.getDestinationDirectory(), + jar: jar.getArchivePath(), + alias: findProperty('keyStoreAlias') ?: '', + keystore: findProperty('keyStore') ?: '', + storepass: findProperty('keyStorePass') ?: '', + digestalg: findProperty('signDigestAlg') ?: '', + tsaurl: findProperty('signTSAurl') ?: '', + verbose: true + ) } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java index a2b357e302..7cef8278be 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler.java @@ -201,7 +201,7 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa protected void produceSteam(int aAmount) { mExcessWater -= aAmount; if (mExcessWater < 0) { - int tWaterToConsume = -mExcessWater / GT_Values.STEAM_PER_WATER + 1; + int tWaterToConsume = -mExcessWater / GT_Values.STEAM_PER_WATER; mFluid.amount -= tWaterToConsume; mExcessWater += GT_Values.STEAM_PER_WATER * tWaterToConsume; } @@ -245,7 +245,7 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa private void calculateHeatUp(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if ((this.mTemperature < getMaxTemperature()) && (this.mProcessingEnergy > 0) && (aTick % 12L == 0L)) { this.mProcessingEnergy -= getEnergyConsumption(); - this.mTemperature += 1; + this.mTemperature += getHeatUpAmount(); } aBaseMetaTileEntity.setActive(this.mProcessingEnergy > 0); } @@ -370,5 +370,9 @@ public abstract class GT_MetaTileEntity_Boiler extends GT_MetaTileEntity_BasicTa protected abstract int getCooldownInterval(); + protected int getHeatUpAmount() { + return 1; + } + protected abstract void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick); } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java index b08c4bf8cf..3fd061eff5 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar.java @@ -1,122 +1,165 @@ package gregtech.common.tileentities.boilers; import gregtech.api.enums.Dyes; -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_LanguageManager; import gregtech.api.util.GT_Utility; import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; +import static gregtech.api.GregTech_API.sMachineFile; +import static gregtech.api.enums.ConfigCategories.machineconfig; public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { + public static final String LPS_FMT = "%s L/s"; + private static final String localizedDescFormat = GT_LanguageManager.addStringLocalization( + "gt.blockmachines.boiler.solar.desc.format", + "Steam Power by the Sun%n" + + "Produces %sL of Steam per second%n" + + "Calcifies over time, reducing Steam output to %sL/s%n" + + "Break and replace to descale"); + protected final Config mConfig; + protected int basicTemperatureMod = 5; // Base Celsius gain or loss + private int mRunTimeTicks = 0; + public GT_MetaTileEntity_Boiler_Solar(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional, new String[0]); + mConfig = createConfig(); } public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); + mConfig = createConfig(); } public GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); + mConfig = createConfig(); + } + + protected GT_MetaTileEntity_Boiler_Solar(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { + super(aName, aTier, aDescription, aTextures); + mConfig = aConfig; + } + + protected Config createConfig() { + return new Config(machineconfig + ".boiler.solar.bronze",1080000,40,120,45); + } + + /** + * for WAILA + * + * @deprecated replaced by {@link #getMaxOutputPerSecond()} + */ + @Deprecated + public int getBasicOutput() { + return (int) (getMaxOutputPerSecond() * 1.25F); + } + + public int getMaxOutputPerSecond() { + return mConfig.getMaxOutputPerSecond(); + } + + /** + * for WAILA + * + * @deprecated replaced by {@link #getProductionPerSecond()} + */ + @SuppressWarnings("unused") + @Deprecated + public int getCalcificationOutput() { + return (int) (getProductionPerSecond() * 1.25F); } @Override public String[] getDescription() { - return new String[]{ - "Steam Power by the Sun", - "Produces 120L of Steam per second", - "Calcifies over time, reducing Steam output to 40L/s", - "Break and replace to decalcify"}; + return String.format(localizedDescFormat, + GT_Utility.formatNumbers(getMaxOutputPerSecond()), + GT_Utility.formatNumbers(getMinOutputPerSecond())) + .split("\\R"); } + public int getMinOutputPerSecond() { + return mConfig.getMinOutputPerSecond(); + } + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { ITexture[][][] rTextures = new ITexture[4][17][]; - for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR)}; - rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[2][(i + 1)] = tmp2; - ITexture[] tmp3 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_BRONZEBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; - rTextures[3][(i + 1)] = tmp3; + for (int color = -1; color < 16; color++) { + int i = color + 1; + short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); + rTextures[0][i] = new ITexture[]{ + new GT_RenderedTexture(BlockIcons.MACHINE_BRONZEBRICKS_BOTTOM, colorModulation)}; + rTextures[1][i] = new ITexture[]{ + new GT_RenderedTexture(BlockIcons.MACHINE_BRONZEBRICKS_TOP, colorModulation), + new GT_RenderedTexture(BlockIcons.BOILER_SOLAR)}; + rTextures[2][i] = new ITexture[]{ + new GT_RenderedTexture(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation)}; + rTextures[3][i] = new ITexture[]{ + new GT_RenderedTexture(BlockIcons.MACHINE_BRONZEBRICKS_SIDE, colorModulation), + new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE)}; } return rTextures; } - public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { - return mTextures[aSide >= 2 ? ((byte) (aSide != aFacing ? 2 : 3)) : aSide][aColorIndex + 1]; - } - - public int maxProgresstime() { - return 500; - } - + @Override public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 16000); + return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, getCapacity()); } + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", 16000); + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarBoiler.png", getCapacity()); } - public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); - } - - private int mRunTime = 0; - @Override - public void saveNBTData(NBTTagCompound aNBT) { - super.saveNBTData(aNBT); - aNBT.setInteger("mRunTime", this.mRunTime); + public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { + int i = aColorIndex + 1; + if (aSide >= 2) { + if (aSide != aFacing) return mTextures[2][i]; + return mTextures[3][i]; + } + return mTextures[aSide][i]; } @Override - public void loadNBTData(NBTTagCompound aNBT) { - super.loadNBTData(aNBT); - this.mRunTime = aNBT.getInteger("mRunTime"); + public int maxProgresstime() { + return 500; } @Override - public String[] getInfoData() { - return new String[]{ - "Heat Capacity: " + EnumChatFormatting.GREEN + GT_Utility.formatNumbers(this.mTemperature * 100 / maxProgresstime()) + " % " + EnumChatFormatting.RESET - + " Hot time: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.mRunTime*25/20)+EnumChatFormatting.RESET+" s", - "Min output: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.basicMaxOuput*20/25)+EnumChatFormatting.RESET+ " L/s" - + " Max output: " + EnumChatFormatting.RED + GT_Utility.formatNumbers(this.basicOutput*20/25)+EnumChatFormatting.RESET+" L/s", - "Current Output: " + EnumChatFormatting.YELLOW + GT_Utility.formatNumbers(getProductionPerSecond()*20/25) +EnumChatFormatting.RESET+" L/s"}; + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("mRunTime", mRunTimeTicks); } @Override - public boolean isGivingInformation() { - return true; + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + mRunTimeTicks = aNBT.getInteger("mRunTime"); } - protected int basicOutput = 150; - protected int basicMaxOuput = 50; - protected int basicTemperatureMod = 5; - protected int basicLossTimerLimit = 45; - - // Calcification start time is 43200*25/20=54,000s or 15 hours of game time. - static final int CALCIFICATION_TIME = 43200; - @Override protected void produceSteam(int aAmount) { super.produceSteam(aAmount); - mRunTime++; + // produceSteam is getting called every 10 ticks + if (mRunTimeTicks >= 0 && mRunTimeTicks < (Integer.MAX_VALUE - 10)) mRunTimeTicks += 10; + else mRunTimeTicks = Integer.MAX_VALUE; // Prevent Integer overflow wrap } @Override protected void pushSteamToInventories(IGregTechTileEntity aBaseMetaTileEntity) { + if (mSteam == null || mSteam.amount == 0) return; pushSteamToSide(aBaseMetaTileEntity, aBaseMetaTileEntity.getFrontFacing()); } @@ -126,15 +169,19 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { } @Override - protected int getProductionPerSecond() { - if (this.mTemperature < 100 ) { + public int getProductionPerSecond() { + if (mTemperature < 100) { return 0; } - if (this.mRunTime > CALCIFICATION_TIME) { - // Calcification takes about 2/3 CALCIFICATION_TIME to completely calcify on basic solar. For HP solar, it takes about 2x CALCIFICATION_TIME - return Math.max(this.basicMaxOuput, this.basicOutput - ((this.mRunTime - CALCIFICATION_TIME) / (CALCIFICATION_TIME/150))); // Every 288*25 ticks, or 6 minutes, lose 1 L output. + if (mRunTimeTicks > mConfig.getCalcificationTicks()) { + /* When reaching calcification ticks; discount the proportion of run-time spent on calcification + * from the maximum output per second, and return this or the minimum output per second + */ + return Math.max(mConfig.getMinOutputPerSecond(), + mConfig.getMaxOutputPerSecond() + - mConfig.getMaxOutputPerSecond() * (mRunTimeTicks - mConfig.getCalcificationTicks()) / mConfig.getCalcificationTicks()); } else { - return this.basicOutput; + return mConfig.getMaxOutputPerSecond(); } } @@ -145,29 +192,118 @@ public class GT_MetaTileEntity_Boiler_Solar extends GT_MetaTileEntity_Boiler { @Override protected int getEnergyConsumption() { - return 1; + return basicTemperatureMod; } @Override protected int getCooldownInterval() { - return basicLossTimerLimit / basicTemperatureMod; + return mConfig.getCoolDownTicks() / basicTemperatureMod; + } + + @Override + protected int getHeatUpAmount() { + return basicTemperatureMod; } @Override protected void updateFuel(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { - if ((aTick % 256L == 0L) && (!aBaseMetaTileEntity.getWorld().isThundering())) { - boolean bRain = aBaseMetaTileEntity.getWorld().isRaining() && aBaseMetaTileEntity.getBiome().rainfall > 0.0F; - mProcessingEnergy += bRain && aBaseMetaTileEntity.getWorld().skylightSubtracted >= 4 || !aBaseMetaTileEntity.getSkyAtSide((byte) 1) ? 0 : !bRain && aBaseMetaTileEntity.getWorld().isDaytime() ? 8 * basicTemperatureMod : basicTemperatureMod; + World world = aBaseMetaTileEntity.getWorld(); + // Heat-up every 12s (240 ticks), has to be multiple of 20 ticks + if ((aTick % 240L != 0L) || (world.isThundering())) { + return; + } + if (!aBaseMetaTileEntity.getSkyAtSide((byte) ForgeDirection.UP.ordinal())) { + return; + } + boolean weatherClear = !world.isRaining() || aBaseMetaTileEntity.getBiome().rainfall == 0.0F; + if (!weatherClear && world.skylightSubtracted >= 4) { + return; + } + if (weatherClear) { + if (world.isDaytime()) { + mProcessingEnergy += 8 * basicTemperatureMod; + } else { + mProcessingEnergy += basicTemperatureMod; + } + } else { + mProcessingEnergy += basicTemperatureMod; } } - /** for waila */ - public int getBasicOutput() { - return basicOutput; + @Override + public boolean isGivingInformation() { + return true; } - /** for waila */ - public int getCalcificationOutput() { - return getProductionPerSecond(); + @Override + public String[] getInfoData() { + return String.format("Heat Capacity: " + EnumChatFormatting.GREEN + "%s %%" + EnumChatFormatting.RESET + + " Hot time: " + EnumChatFormatting.RED + "%s s" + EnumChatFormatting.RESET + "%n" + + "Min output: " + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + + " Max output: " + EnumChatFormatting.RED + LPS_FMT + EnumChatFormatting.RESET + "%n" + + "Current Output: " + EnumChatFormatting.YELLOW + LPS_FMT + EnumChatFormatting.RESET, + GT_Utility.formatNumbers(getHeatCapacityPercent()), + GT_Utility.formatNumbers(getHotTimeSeconds()), + GT_Utility.formatNumbers(getMinOutputPerSecond()), + GT_Utility.formatNumbers(getMaxOutputPerSecond()), + GT_Utility.formatNumbers(getProductionPerSecond())) + .split("\\R"); + } + + public int getHeatCapacityPercent() { + return mTemperature * 100 / maxProgresstime(); + } + + public int getHotTimeSeconds() { + return mRunTimeTicks / 20; + } + + @Override + public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { + return new GT_MetaTileEntity_Boiler_Solar(mName, mTier, mDescriptionArray, mTextures, mConfig); + } + + protected static class Config { + private final int calcificationTicks; + private final int minOutputPerSecond; + private final int maxOutputPerSecond; + private final int coolDownTicks; + + public Config(String aCategory, + int aDefaultCalcificationTicks, + int aDefaultMinOutputPerSecond, + int aDefaultMaxOutputPerSecond, + int aDefaultCoolDownTicks) { + calcificationTicks = get(aCategory,"CalcificationTicks", aDefaultCalcificationTicks, + "Number of run-time ticks before boiler starts calcification.", + "100% calcification and minimal output will be reached at 2 times this."); + minOutputPerSecond = get(aCategory,"MinOutputPerSecond", aDefaultMinOutputPerSecond); + maxOutputPerSecond = get(aCategory,"MaxOutputPerSecond", aDefaultMaxOutputPerSecond); + coolDownTicks = get(aCategory,"CoolDownTicks", aDefaultCoolDownTicks, "Number of ticks it takes to lose 1°C."); + } + + protected int get(final String aCategory, final String aKey, final int aDefaultValue, final String... aComments) { + final StringBuilder tCommentBuilder = new StringBuilder(); + for (String tComment: aComments) + tCommentBuilder.append(tComment).append('\n'); + tCommentBuilder.append("Default: ").append(aDefaultValue); + return sMachineFile.mConfig.get(aCategory, aKey, aDefaultValue, tCommentBuilder.toString()).getInt(); + } + + public int getCalcificationTicks() { + return calcificationTicks; + } + + public int getMinOutputPerSecond() { + return minOutputPerSecond; + } + + public int getMaxOutputPerSecond() { + return maxOutputPerSecond; + } + + public int getCoolDownTicks() { + return coolDownTicks; + } } } diff --git a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java index 594d338204..feaaa7fa32 100644 --- a/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java +++ b/src/main/java/gregtech/common/tileentities/boilers/GT_MetaTileEntity_Boiler_Solar_Steel.java @@ -1,75 +1,71 @@ package gregtech.common.tileentities.boilers; import gregtech.api.enums.Dyes; -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.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler; import net.minecraft.entity.player.InventoryPlayer; +import static gregtech.api.enums.ConfigCategories.machineconfig; + public class GT_MetaTileEntity_Boiler_Solar_Steel extends GT_MetaTileEntity_Boiler_Solar { public GT_MetaTileEntity_Boiler_Solar_Steel(int aID, String aName, String aNameRegional) { super(aID, aName, aNameRegional); - basicOutput = 450; - basicMaxOuput = 150; - basicLossTimerLimit = 75; // Cools down slower than normal boiler } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - basicOutput = 450; - basicMaxOuput = 150; - basicLossTimerLimit = 75; } public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) { super(aName, aTier, aDescription, aTextures); - basicOutput = 450; - basicMaxOuput = 150; - basicLossTimerLimit = 75; } + public GT_MetaTileEntity_Boiler_Solar_Steel(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures, Config aConfig) { + super(aName, aTier, aDescription, aTextures, aConfig); + } + + @Override + protected Config createConfig() { + return new Config(machineconfig + ".boiler.solar.steel",108000, 120, 360, 75); + } + + @Override public ITexture[][][] getTextureSet(ITexture[] aTextures) { + ITexture[][][] rTextures = new ITexture[4][17][]; - for (byte i = -1; i < 16; i = (byte) (i + 1)) { - ITexture[] tmp0 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_BOTTOM, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[0][(i + 1)] = tmp0; - ITexture[] tmp1 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_TOP, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.BOILER_SOLAR)}; - rTextures[1][(i + 1)] = tmp1; - ITexture[] tmp2 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa))}; - rTextures[2][(i + 1)] = tmp2; - ITexture[] tmp3 = {new GT_RenderedTexture(Textures.BlockIcons.MACHINE_STEELBRICKS_SIDE, Dyes.getModulation(i, Dyes._NULL.mRGBa)), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE)}; - rTextures[3][(i + 1)] = tmp3; + for (int color = -1; color < 16; color++) { + int i = color + 1; + short[] colorModulation = Dyes.getModulation(color, Dyes._NULL.mRGBa); + rTextures[0][i] = new ITexture[]{ + new GT_RenderedTexture(BlockIcons.MACHINE_STEELBRICKS_BOTTOM, colorModulation)}; + rTextures[1][i] = new ITexture[]{ + new GT_RenderedTexture(BlockIcons.MACHINE_STEELBRICKS_TOP, colorModulation), + new GT_RenderedTexture(BlockIcons.BOILER_SOLAR)}; + rTextures[2][i] = new ITexture[]{ + new GT_RenderedTexture(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation)}; + rTextures[3][i] = new ITexture[]{ + new GT_RenderedTexture(BlockIcons.MACHINE_STEELBRICKS_SIDE, colorModulation), + new GT_RenderedTexture(BlockIcons.OVERLAY_PIPE)}; } return rTextures; } - public Object getServerGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_Container_Boiler(aPlayerInventory, aBaseMetaTileEntity, 32000); - } - + @Override public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) { - return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarHPBoiler.png", 32000); + return new GT_GUIContainer_Boiler(aPlayerInventory, aBaseMetaTileEntity, "SolarHPBoiler.png", getCapacity()); } @Override - public String[] getDescription() { - return new String[]{ - "Steam Power by the Sun", - "Produces 360L of Steam per second", - "Calcifies over time, reducing Steam output to 120L/s", - "Break and replace to decalcify"}; - } - public int getCapacity() { return 32000; } + @Override public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { - return new GT_MetaTileEntity_Boiler_Solar_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures); + return new GT_MetaTileEntity_Boiler_Solar_Steel(this.mName, this.mTier, this.mDescriptionArray, this.mTextures, this.mConfig); } - } diff --git a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java index d9d67aa6ea..73248fb2c7 100644 --- a/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java +++ b/src/main/java/gregtech/loaders/postload/GT_MachineRecipeLoader.java @@ -146,8 +146,8 @@ public class GT_MachineRecipeLoader implements Runnable { GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.LightFuel, 5L), GT_OreDictUnificator.get(OrePrefixes.cell, Materials.HeavyFuel, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NF, GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 6L), 16, 120); GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.LightFuel, 5L), Materials.Empty.getCells(1), GT_Values.NI, GT_Utility.getIntegratedCircuit(1), Materials.HeavyFuel.getFluid(1000L), GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 6L), 16, 120); GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.HeavyFuel, 1L), Materials.Empty.getCells(5), GT_Values.NI, GT_Utility.getIntegratedCircuit(1), Materials.LightFuel.getFluid(5000L), GT_Values.NF, GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Fuel, 6L), 16, 120); - GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.LightFuel, 5L), GT_Values.NI, GT_Values.NI, GT_Utility.getIntegratedCircuit(5), Materials.HeavyFuel.getFluid(1000L), Materials.Fuel.getFluid(6000L), Materials.Empty.getCells(5), 120, 120); - GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.HeavyFuel, 1L), GT_Values.NI, GT_Values.NI, GT_Utility.getIntegratedCircuit(6), Materials.LightFuel.getFluid(5000L), Materials.Fuel.getFluid(6000L), Materials.Empty.getCells(1), 120, 120); + GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.LightFuel, 5L), GT_Values.NI, GT_Values.NI, GT_Utility.getIntegratedCircuit(5), Materials.HeavyFuel.getFluid(1000L), Materials.Fuel.getFluid(6000L), Materials.Empty.getCells(5), 16, 120); + GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.HeavyFuel, 1L), GT_Values.NI, GT_Values.NI, GT_Utility.getIntegratedCircuit(6), Materials.LightFuel.getFluid(5000L), Materials.Fuel.getFluid(6000L), Materials.Empty.getCells(1), 16, 120); GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.cell, Materials.Water, 5L), GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Stone, 1L), GT_Values.NI, GT_Values.NI, Materials.Lubricant.getFluid(20), new FluidStack(ItemList.sDrillingFluid, 5000), Materials.Empty.getCells(5), 64, 16); GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lapis, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, Materials.Water.getFluid(125), FluidRegistry.getFluidStack("ic2coolant", 125), GT_Values.NI, 256, 48); GT_Values.RA.addMixerRecipe(GT_OreDictUnificator.get(OrePrefixes.dust, Materials.Lapis, 1L), GT_Values.NI, GT_Values.NI, GT_Values.NI, GT_ModHandler.getDistilledWater(1000), FluidRegistry.getFluidStack("ic2coolant", 1000), GT_Values.NI, 256, 48); |