From 873902f4bf6c97a9ab33c18cce62a7cdfebfd9c0 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Fri, 11 Dec 2015 15:25:48 +0100 Subject: [PATCH] make steam boilers not automateable --- .../boilers/GT_MetaTileEntity_Boiler.java | 4 +-- .../GT_MetaTileEntity_Boiler_Solar.java | 26 ++++++++++++++++--- 2 files changed, 25 insertions(+), 5 deletions(-) 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 23a6f83c..04be6888 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 @@ -244,11 +244,11 @@ public abstract class GT_MetaTileEntity_Boiler } public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return (aIndex == 1) || (aIndex == 3); + return false; } public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { - return aIndex == 2; + return false; } public void doSound(byte aIndex, double aX, double aY, double aZ) { 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 c013f87a..1fa7723a 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 @@ -10,6 +10,7 @@ import gregtech.api.util.GT_ModHandler; 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.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidHandler; @@ -58,6 +59,20 @@ public class GT_MetaTileEntity_Boiler_Solar public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) { return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures); } + + private int mRunTime = 0; + + @Override + public void saveNBTData(NBTTagCompound aNBT) { + super.saveNBTData(aNBT); + aNBT.setInteger("mRunTime", this.mRunTime); + } + + @Override + public void loadNBTData(NBTTagCompound aNBT) { + super.loadNBTData(aNBT); + this.mRunTime = aNBT.getInteger("mRunTime"); + } public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) { if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { @@ -92,12 +107,17 @@ public class GT_MetaTileEntity_Boiler_Solar return; } this.mFluid.amount -= 1; + mRunTime += 1; + int tOutput = 150; + if(mRunTime > 10000){ + tOutput = Math.max(50, 150 - ((mRunTime-10000)/100)); + } if (this.mSteam == null) { - this.mSteam = GT_ModHandler.getSteam(150L); + this.mSteam = GT_ModHandler.getSteam(tOutput); } else if (GT_ModHandler.isSteam(this.mSteam)) { - this.mSteam.amount += 150; + this.mSteam.amount += tOutput; } else { - this.mSteam = GT_ModHandler.getSteam(150L); + this.mSteam = GT_ModHandler.getSteam(tOutput); } } } else {