make steam boilers not automateable

This commit is contained in:
Blood-Asp 2015-12-11 15:25:48 +01:00
parent e0b128e9fa
commit 873902f4bf
2 changed files with 25 additions and 5 deletions

View file

@ -244,11 +244,11 @@ public abstract class GT_MetaTileEntity_Boiler
} }
public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) { 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) { 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) { public void doSound(byte aIndex, double aX, double aY, double aZ) {

View file

@ -10,6 +10,7 @@ import gregtech.api.util.GT_ModHandler;
import gregtech.common.gui.GT_Container_Boiler; import gregtech.common.gui.GT_Container_Boiler;
import gregtech.common.gui.GT_GUIContainer_Boiler; import gregtech.common.gui.GT_GUIContainer_Boiler;
import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidHandler;
@ -59,6 +60,20 @@ public class GT_MetaTileEntity_Boiler_Solar
return new GT_MetaTileEntity_Boiler_Solar(this.mName, this.mTier, this.mDescription, this.mTextures); 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) { public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) { if ((aBaseMetaTileEntity.isServerSide()) && (aTick > 20L)) {
if (this.mTemperature <= 20) { if (this.mTemperature <= 20) {
@ -92,12 +107,17 @@ public class GT_MetaTileEntity_Boiler_Solar
return; return;
} }
this.mFluid.amount -= 1; this.mFluid.amount -= 1;
mRunTime += 1;
int tOutput = 150;
if(mRunTime > 10000){
tOutput = Math.max(50, 150 - ((mRunTime-10000)/100));
}
if (this.mSteam == null) { if (this.mSteam == null) {
this.mSteam = GT_ModHandler.getSteam(150L); this.mSteam = GT_ModHandler.getSteam(tOutput);
} else if (GT_ModHandler.isSteam(this.mSteam)) { } else if (GT_ModHandler.isSteam(this.mSteam)) {
this.mSteam.amount += 150; this.mSteam.amount += tOutput;
} else { } else {
this.mSteam = GT_ModHandler.getSteam(150L); this.mSteam = GT_ModHandler.getSteam(tOutput);
} }
} }
} else { } else {