Skip to content

Commit

Permalink
make steam boilers not automateable
Browse files Browse the repository at this point in the history
  • Loading branch information
Blood-Asp committed Dec 11, 2015
1 parent e0b128e commit 873902f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,11 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
}

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
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;
Expand Down Expand Up @@ -58,6 +59,20 @@ public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechT
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)) {
Expand Down Expand Up @@ -92,12 +107,17 @@ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
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 {
Expand Down

0 comments on commit 873902f

Please sign in to comment.