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) {
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) {

View file

@ -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 {