aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines
diff options
context:
space:
mode:
authorAlkalus <draknyte1@hotmail.com>2017-11-17 15:47:20 +1000
committerAlkalus <draknyte1@hotmail.com>2017-11-17 15:47:20 +1000
commita9f330848748bf4c75fab648407124f70c70e462 (patch)
tree8acaef1fcddfe9b8ed3a6a85102c9326103235b2 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines
parent94389c154e4d517e4fcdebdacc3da9be414e8c75 (diff)
downloadGT5-Unofficial-a9f330848748bf4c75fab648407124f70c70e462.tar.gz
GT5-Unofficial-a9f330848748bf4c75fab648407124f70c70e462.tar.bz2
GT5-Unofficial-a9f330848748bf4c75fab648407124f70c70e462.zip
+ Added in the Compact Fusion Reactor.
% Did work on the CFR. $ Fixed a tooltip on the Pollution Detector.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java2
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java687
2 files changed, 688 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java
index 3474431355..8ca0a672b2 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaPollutionDetector.java
@@ -191,7 +191,7 @@ public class GregtechMetaPollutionDetector extends GregtechMetaTileEntity {
}
else {
PlayerUtils.messagePlayer(playerIn, "This chunk contains "+getCurrentChunkPollution()+" pollution.");
- PlayerUtils.messagePlayer(playerIn, "Average over last ten minutes: "+getAveragePollutionOverLastTen()+" pollution.");
+ PlayerUtils.messagePlayer(playerIn, "Emit Redstone at pollution level: "+this.mRedstoneLevel);
}
}
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java
new file mode 100644
index 0000000000..b604eb94a2
--- /dev/null
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java
@@ -0,0 +1,687 @@
+package gtPlusPlus.xmod.gregtech.common.tileentities.machines.basic;
+
+import java.util.ArrayList;
+import java.util.Random;
+
+import gregtech.api.enums.GT_Values;
+import gregtech.api.enums.Textures;
+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_Recipe;
+import gregtech.api.util.GT_Utility;
+import gregtech.api.util.Recipe_GT;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.util.Utils;
+import gtPlusPlus.core.util.math.MathUtils;
+import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_DeluxeMachine;
+import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+
+public class GregtechMetaTileEntity_CompactFusionReactor
+extends
+GT_MetaTileEntity_DeluxeMachine {
+
+ private boolean mCanProcessRecipe = false;
+ private boolean mCharging = false;
+ private long mChargeConsumed = 0;
+
+ private GT_Recipe mLastRecipe;
+ private long mEUStore;
+ private boolean mRunningOnLoad = false;
+ private boolean mMachine = false;
+ private int mEfficiency, mEfficiencyIncrease, mEfficiencyMax = 0;
+ private int mStartUpCheck = 100, mUpdate = 0;
+ private FluidStack[] mOutputFluids = null;
+
+ public GregtechMetaTileEntity_CompactFusionReactor(int aID, String aName,
+ String aNameRegional, int aTier) {
+ super(aID, aName, aNameRegional, aTier, 1, "It's like a midget Ra.", 1,
+ 1, "PotionBrewer.png", "");
+ }
+
+ public GregtechMetaTileEntity_CompactFusionReactor(String aName, int aTier,
+ String aDescription, ITexture[][][] aTextures, String aGUIName,
+ String aNEIName) {
+ super(aName, aTier, 1, aDescription, aTextures, 1, 1, aGUIName,
+ aNEIName);
+ }
+
+ @Override
+ public String[] getDescription() {
+ return new String[]{this.mDescription,
+ "Not Very Fast, but not very big either.",
+ "Each side pair in/out puts to different slots.",
+ "Top & Bottom Sides are Outputs.",
+ "Front & Back are Input Plasma 1.", "Sides are Input Plasma 2.",
+ CORE.GT_Tooltip};
+ }
+
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GregtechMetaTileEntity_CompactFusionReactor(this.mName,
+ this.mTier, this.mDescription, this.mTextures, this.mGUIName,
+ this.mNEIName);
+ }
+
+ public int tier() {
+ return this.mTier;
+ }
+
+ public int tierOverclock() {
+ return this.mTier == 6 ? 0 : this.mTier == 7 ? 1 : 2;
+ }
+
+ private GT_RenderedTexture getCasingTexture() {
+ return new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Advanced);
+ }
+
+ @Override
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ final ITexture[][][] rTextures = new ITexture[10][17][];
+ for (byte i = -1; i < 16; i++) {
+ rTextures[0][i + 1] = this.getFront(i);
+ rTextures[1][i + 1] = this.getBack(i);
+ rTextures[2][i + 1] = this.getBottom(i);
+ rTextures[3][i + 1] = this.getTop(i);
+ rTextures[4][i + 1] = this.getSides(i);
+ rTextures[5][i + 1] = this.getFrontActive(i);
+ rTextures[6][i + 1] = this.getBackActive(i);
+ rTextures[7][i + 1] = this.getBottomActive(i);
+ rTextures[8][i + 1] = this.getTopActive(i);
+ rTextures[9][i + 1] = this.getSidesActive(i);
+ }
+ return rTextures;
+ }
+
+ @Override
+ public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity,
+ final byte aSide, final byte aFacing, final byte aColorIndex,
+ final boolean aActive, final boolean aRedstone) {
+ return this.mTextures[(aActive ? 5 : 0) + (aSide == aFacing
+ ? 0
+ : aSide == GT_Utility.getOppositeSide(aFacing)
+ ? 1
+ : aSide == 0 ? 2 : aSide == 1 ? 3 : 4)][aColorIndex
+ + 1];
+ }
+
+ @Override
+ public GT_Recipe.GT_Recipe_Map getRecipeList() {
+ return Recipe_GT.Gregtech_Recipe_Map.sSlowFusionRecipes;
+ }
+
+ @Override
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ }
+
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity,
+ int aIndex, byte aSide, ItemStack aStack) {
+ return (super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack))
+ && (getRecipeList().containsInput(aStack));
+ }
+
+ @Override
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ return (aFluid.getFluid().getName().contains("plasma"))
+ || (super.isFluidInputAllowed(aFluid));
+ }
+
+ @Override
+ public int getCapacity() {
+ return 32000;
+ }
+
+ @Override
+ public void abortProcess() {
+ super.abortProcess();
+ }
+
+ long mFusionPoint = 20000000L;
+ @Override
+ public int checkRecipe() {
+ Utils.LOG_INFO("Recipe Tick 1.");
+ if (!this.mCanProcessRecipe) {
+ Utils.LOG_INFO("Recipe Tick 1.1 - Cannot Process Recipe.");
+ if (this.mChargeConsumed < mFusionPoint) {
+ Utils.LOG_INFO("Recipe Tick 1.2 - Cannot Ignite Fusion, Charge too low.");
+ this.mCharging = true;
+ this.mCanProcessRecipe = false;
+ if (this.getBaseMetaTileEntity().decreaseStoredEnergyUnits(
+ (mFusionPoint / 100), false)) {
+ Utils.LOG_INFO("Recipe Tick 1.3 - Charging Internal storage. "+(mFusionPoint / 100)+"/"+mFusionPoint);
+ mChargeConsumed += (mFusionPoint / 100);
+ }
+ } else {
+ mChargeConsumed = 0;
+ this.mCharging = false;
+ this.mCanProcessRecipe = true;
+
+ }
+ } else {
+ Utils.LOG_INFO("Recipe Tick 1.1 - Try to Process Recipe.");
+ if (checkRecipeMulti()) {
+ Utils.LOG_INFO("Recipe Tick 1.2 - Process Recipe was Successful.");
+ return 2;
+ }
+ }
+ Utils.LOG_INFO("Recipe Tick 2. - Process Recipe failed.");
+ return 0;
+ }
+
+ public ArrayList<FluidStack> getStoredFluids() {
+ ArrayList<FluidStack> mList = new ArrayList<FluidStack>();
+ mList.add(this.mFluid);
+ mList.add(this.mFluid2);
+ return mList;
+ }
+
+ public boolean checkRecipeMulti() {
+ ArrayList<FluidStack> tFluidList = getStoredFluids();
+ int tFluidList_sS = tFluidList.size();
+ for (int i = 0; i < tFluidList_sS - 1; i++) {
+ for (int j = i + 1; j < tFluidList_sS; j++) {
+ if (GT_Utility.areFluidsEqual((FluidStack) tFluidList.get(i),
+ (FluidStack) tFluidList.get(j))) {
+ if (((FluidStack) tFluidList
+ .get(i)).amount >= ((FluidStack) tFluidList
+ .get(j)).amount) {
+ tFluidList.remove(j--);
+ tFluidList_sS = tFluidList.size();
+ } else {
+ tFluidList.remove(i--);
+ tFluidList_sS = tFluidList.size();
+ break;
+ }
+ }
+ }
+ }
+ if (tFluidList.size() > 1) {
+ FluidStack[] tFluids = tFluidList
+ .toArray(new FluidStack[tFluidList.size()]);
+ GT_Recipe tRecipe = GT_Recipe.GT_Recipe_Map.sFusionRecipes
+ .findRecipe(this.getBaseMetaTileEntity(), this.mLastRecipe,
+ false, GT_Values.V[8], tFluids, new ItemStack[]{});
+ if ((tRecipe == null && !mRunningOnLoad)
+ || (maxEUStore() < tRecipe.mSpecialValue)) {
+ this.mLastRecipe = null;
+ return false;
+ }
+ if (mRunningOnLoad || tRecipe.isRecipeInputEqual(true, tFluids,
+ new ItemStack[]{})) {
+ this.mLastRecipe = tRecipe;
+ this.mEUt = (this.mLastRecipe.mEUt
+ * overclock(this.mLastRecipe.mSpecialValue));
+ this.mMaxProgresstime = this.mLastRecipe.mDuration
+ / overclock(this.mLastRecipe.mSpecialValue);
+
+ this.mEfficiencyIncrease = 10000;
+
+ this.mOutputFluids = this.mLastRecipe.mFluidOutputs;
+ mRunningOnLoad = false;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int overclock(int mStartEnergy) {
+ if (tierOverclock() == 1) {
+ return 1;
+ }
+ if (tierOverclock() == 2) {
+ return mStartEnergy < 160000000 ? 2 : 1;
+ }
+ return mStartEnergy < 160000000 ? 4 : mStartEnergy < 320000000 ? 2 : 1;
+ }
+
+ @Override
+ public boolean displaysItemStack() {
+ return false;
+ }
+
+ @Override
+ public boolean doesAutoOutputFluids() {
+ return true;
+ }
+
+ @Override
+ public boolean doesEmptyContainers() {
+ return true;
+ }
+
+ @Override
+ public boolean doesFillContainers() {
+ return true;
+ }
+
+ @Override
+ public long maxAmperesIn() {
+ return 16L;
+ }
+
+ @Override
+ public long maxEUStore() {
+ return Long.MAX_VALUE;
+ }
+
+ @Override
+ public void doExplosion(long aExplosionPower) {
+ super.doExplosion(aExplosionPower * 2);
+ }
+
+ @Override
+ public void onPreTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ super.onPreTick(aBaseMetaTileEntity, aTick);
+ onRunningTickMulti();
+ if ((aBaseMetaTileEntity.isClientSide())
+ && (aBaseMetaTileEntity.isActive())
+ && (aBaseMetaTileEntity.getFrontFacing() != 1)
+ && (aBaseMetaTileEntity.getCoverIDAtSide((byte) 1) == 0)
+ && (!aBaseMetaTileEntity.getOpacityAtSide((byte) 1))) {
+ if (MathUtils.randInt(0, 4) == 4) {
+ final Random tRandom = aBaseMetaTileEntity.getWorld().rand;
+ aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.8F)
+ - (tRandom.nextFloat() * 0.6F),
+ aBaseMetaTileEntity.getYCoord() + 0.3f
+ + (tRandom.nextFloat() * 0.2F),
+ (aBaseMetaTileEntity.getZCoord() + 1.2F)
+ - (tRandom.nextFloat() * 1.6F),
+ 0.0D, 0.0D, 0.0D);
+ aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.4F)
+ - (tRandom.nextFloat() * 0.3F),
+ aBaseMetaTileEntity.getYCoord() + 0.2f
+ + (tRandom.nextFloat() * 0.1F),
+ (aBaseMetaTileEntity.getZCoord() + 0.8F)
+ - (tRandom.nextFloat() * 0.6F),
+ 0.0D, 0.0D, 0.0D);
+ aBaseMetaTileEntity.getWorld().spawnParticle("magicCrit",
+ (aBaseMetaTileEntity.getXCoord() + 0.6F)
+ - (tRandom.nextFloat() * 0.9F),
+ aBaseMetaTileEntity.getYCoord() + 0.4f
+ + (tRandom.nextFloat() * 0.3F),
+ (aBaseMetaTileEntity.getZCoord() + 1.8F)
+ - (tRandom.nextFloat() * 2.6F),
+ 0.0D, 0.0D, 0.0D);
+ }
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ aNBT.setBoolean("mCanProcessRecipe", this.mCanProcessRecipe);
+ aNBT.setBoolean("mCharging", this.mCharging);
+ aNBT.setLong("mChargeConsumed", this.mChargeConsumed);
+ aNBT.setInteger("mEfficiency", this.mEfficiency);
+ aNBT.setInteger("mEfficiencyIncrease", this.mEfficiencyIncrease);
+ aNBT.setInteger("mEfficiencyMax", this.mEfficiencyMax);
+ aNBT.setInteger("mStartUpCheck", this.mStartUpCheck);
+ aNBT.setInteger("mUpdate", mUpdate);
+ aNBT.setInteger("mEfficiencyIncrease", mEfficiencyIncrease);
+ aNBT.setBoolean("mRunningOnLoad", this.mRunningOnLoad);
+ aNBT.setBoolean("mMachine", this.mMachine);
+ aNBT.setLong("mEUStore", this.mEUStore);
+ super.saveNBTData(aNBT);
+ }
+
+ @Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ if (mMaxProgresstime > 0)
+ mRunningOnLoad = true;
+ this.mCanProcessRecipe = aNBT.getBoolean("mCanProcessRecipe");
+ this.mCharging = aNBT.getBoolean("mCharging");
+ this.mChargeConsumed = aNBT.getLong("mChargeConsumed");
+ this.mEfficiency = aNBT.getInteger("mEfficiency");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mEfficiencyMax = aNBT.getInteger("mEfficiencyMax");
+ this.mStartUpCheck = aNBT.getInteger("mStartUpCheck");
+ this.mUpdate = aNBT.getInteger("mUpdate");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mEfficiencyIncrease = aNBT.getInteger("mEfficiencyIncrease");
+ this.mRunningOnLoad = aNBT.getBoolean("mRunningOnLoad");
+ this.mMachine = aNBT.getBoolean("mMachine");
+ this.mEUStore = aNBT.getLong("mEUStore");
+ super.loadNBTData(aNBT);
+ }
+
+ @Override
+ public String[] getInfoData() {
+ String tier = tier() == 6 ? "I" : tier() == 7 ? "II" : "III";
+ float plasmaOut = 0;
+ String fusionName = "";
+ int powerRequired = 0;
+ if (this.mLastRecipe != null) {
+ fusionName = this.mLastRecipe.mFluidOutputs[0].getLocalizedName()+" Fusion.";
+ powerRequired = this.mLastRecipe.mEUt;
+ if (this.mLastRecipe.getFluidOutput(0) != null) {
+ plasmaOut = (float) this.mLastRecipe.getFluidOutput(0).amount
+ / (float) this.mLastRecipe.mDuration;
+ }
+ }
+
+ return new String[]{"Fusion Reactor MK " + tier,
+ "EU Required: " + powerRequired + "EU/t",
+ "Stored EU: " + this.getEUVar() + " / " + maxEUStore(),
+ "Plasma Output: " + plasmaOut + "L/t",
+ "Current Recipe: "+fusionName};
+ }
+
+ @Override
+ public boolean isGivingInformation() {
+ return true;
+ }
+
+ public ITexture[] getFront(final byte aColor) {
+ return new ITexture[]{this.getCasingTexture(), new GT_RenderedTexture(
+ TexturesGtBlock.Overlay_MatterFab)};
+ }
+
+ public ITexture[] getBack(final byte aColor) {
+ return new ITexture[]{this.getCasingTexture(),new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getBottom(final byte aColor) {
+ return new ITexture[]{ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
+ }
+
+ public ITexture[] getTop(final byte aColor) {
+ return new ITexture[]{ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS) };
+ }
+
+ public ITexture[] getSides(final byte aColor) {
+ return new ITexture[]{this.getCasingTexture(), new GT_RenderedTexture(
+ TexturesGtBlock.Overlay_Machine_Dimensional_Blue)};
+ }
+
+ public ITexture[] getFrontActive(final byte aColor) {
+ return new ITexture[]{this.getCasingTexture(), new GT_RenderedTexture(
+ TexturesGtBlock.Overlay_MatterFab_Active)};
+ }
+
+ public ITexture[] getBackActive(final byte aColor) {
+ return new ITexture[]{
+ this.getCasingTexture(), new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ }
+
+ public ITexture[] getBottomActive(final byte aColor) {
+ return new ITexture[]{ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
+ }
+
+ public ITexture[] getTopActive(final byte aColor) {
+ return new ITexture[]{ new GT_RenderedTexture(Textures.BlockIcons.MACHINE_CASING_FUSION_GLASS_YELLOW) };
+ }
+
+ public ITexture[] getSidesActive(final byte aColor) {
+ return new ITexture[]{this.getCasingTexture(), new GT_RenderedTexture(
+ TexturesGtBlock.Overlay_Machine_Dimensional_Blue)};
+ }
+
+ @Override
+ public void onMachineBlockUpdate() {
+ this.mUpdate = 50;
+ }
+
+ @Override
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity,
+ long aTick) {
+ //super.onPostTick(aBaseMetaTileEntity, aTick);
+ if (aBaseMetaTileEntity.isServerSide()) {
+ Utils.LOG_INFO("1");
+ if (mEfficiency < 0)
+ mEfficiency = 0;
+ if (mRunningOnLoad) {
+ Utils.LOG_INFO("2");
+ this.mEUStore = (int) aBaseMetaTileEntity.getStoredEU();
+ checkRecipeMulti();
+ }
+ if (--mUpdate == 0 || --mStartUpCheck == 0) {
+ Utils.LOG_INFO("3");
+ mMachine = true;
+ }
+ if (mStartUpCheck < 0) {
+ Utils.LOG_INFO("4");
+ if (mMachine) {
+ Utils.LOG_INFO("5");
+
+ if (aBaseMetaTileEntity.getStoredEU()
+ + (2048 * tierOverclock()) < maxEUStore()) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits(
+ 2048 * tierOverclock(), true);
+ }
+ if (this.mEUStore <= 0 && mMaxProgresstime > 0) {
+ Utils.LOG_INFO("6");
+ stopMachine();
+ this.mLastRecipe = null;
+ }
+ if (mMaxProgresstime > 0) {
+ Utils.LOG_INFO("7");
+ this.getBaseMetaTileEntity()
+ .decreaseStoredEnergyUnits(mEUt, true);
+ if (mMaxProgresstime > 0 && ++mProgresstime >= mMaxProgresstime) {
+ if (mOutputFluids != null)
+ for (FluidStack tStack : mOutputFluids)
+ if (tStack != null)
+ addOutput(tStack);
+ mEfficiency = Math.max(0,
+ (mEfficiency + mEfficiencyIncrease));
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ if (mOutputFluids != null && mOutputFluids.length > 0) {
+
+ }
+ this.mEUStore = (int) aBaseMetaTileEntity
+ .getStoredEU();
+ if (aBaseMetaTileEntity.isAllowedToWork())
+ checkRecipeMulti();
+ }
+ } else {
+ Utils.LOG_INFO("8");
+ if (aTick % 100 == 0
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled()
+ || aBaseMetaTileEntity
+ .hasInventoryBeenModified()) {
+ Utils.LOG_INFO("9");
+ // turnCasingActive(mMaxProgresstime > 0);
+ if (aBaseMetaTileEntity.isAllowedToWork()) {
+ Utils.LOG_INFO("10");
+ this.mEUStore = (int) aBaseMetaTileEntity
+ .getStoredEU();
+ if (checkRecipeMulti()) {
+ Utils.LOG_INFO("11");
+ if (this.mEUStore < this.mLastRecipe.mSpecialValue) {
+ Utils.LOG_INFO("12");
+ mMaxProgresstime = 0;
+ // turnCasingActive(false);
+ }
+ aBaseMetaTileEntity
+ .decreaseStoredEnergyUnits(
+ this.mLastRecipe.mSpecialValue,
+ true);
+ }
+ }
+ if (mMaxProgresstime <= 0)
+ mEfficiency = Math.max(0, mEfficiency - 1000);
+ }
+ }
+ } else {
+ // turnCasingActive(false);
+ Utils.LOG_INFO("Bad");
+ this.mLastRecipe = null;
+ stopMachine();
+ }
+ }
+ Utils.LOG_INFO("Good");
+ aBaseMetaTileEntity.setActive(mMaxProgresstime > 0);
+ }
+ }
+
+ public boolean onRunningTickMulti() {
+ if (mEUt < 0) {
+ if (!drainEnergyInput(
+ ((long) -mEUt * 10000) / Math.max(1000, mEfficiency))) {
+ this.mLastRecipe = null;
+ stopMachine();
+ return false;
+ }
+ }
+ if (this.mEUStore <= 0) {
+ this.mLastRecipe = null;
+ stopMachine();
+ return false;
+ }
+ return true;
+ }
+
+ public boolean drainEnergyInput(long aEU) {
+ return false;
+ }
+
+ public boolean addOutput(FluidStack aLiquid) {
+ if (aLiquid == null)
+ return false;
+ FluidStack copiedFluidStack = aLiquid.copy();
+ this.mOutputFluid = copiedFluidStack;
+ return false;
+ }
+
+ public void stopMachine() {
+ mEUt = 0;
+ mEfficiency = 0;
+ mProgresstime = 0;
+ mMaxProgresstime = 0;
+ mEfficiencyIncrease = 0;
+ getBaseMetaTileEntity().disableWorking();
+ }
+
+ @Override
+ public boolean isLiquidInput(byte aSide) {
+ switch(aSide) {
+ case 0 :
+ return true;
+ case 1 :
+ return true;
+ case 2 :
+ return true;
+ case 3 :
+ return false;
+ case 4 :
+ return false;
+ case 5 :
+ return false;
+ default :
+ return false;
+ }
+ }
+
+ @Override
+ public boolean isLiquidOutput(byte aSide) {
+ switch(aSide) {
+ case 0 :
+ return false;
+ case 1 :
+ return false;
+ case 2 :
+ return false;
+ case 3 :
+ return true;
+ case 4 :
+ return true;
+ case 5 :
+ return true;
+ default :
+ return true;
+ }
+ }
+
+ @Override
+ public int fill(FluidStack aFluid, boolean doFill) {
+ // TODO Auto-generated method stub
+ return super.fill(aFluid, doFill);
+ }
+
+ @Override
+ public FluidStack drain(int maxDrain, boolean doDrain) {
+ // TODO Auto-generated method stub
+ return super.drain(maxDrain, doDrain);
+ }
+
+ @Override
+ public int getTankPressure() {
+ // TODO Auto-generated method stub
+ return 500;
+ }
+
+ @Override
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN){
+ return false;
+ }
+ else {
+ return super.canFill(aSide, aFluid);
+ }
+ }
+
+ @Override
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN){
+ return super.canDrain(aSide, aFluid);
+ }
+ else {
+ return false;
+ }
+ }
+
+ @Override
+ public int fill_default(ForgeDirection aSide, FluidStack aFluid,
+ boolean doFill) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN){
+ return 0;
+ }
+ else {
+ return super.fill_default(aSide, aFluid, doFill);
+ }
+ }
+
+ @Override
+ public int fill(ForgeDirection aSide, FluidStack aFluid, boolean doFill) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN){
+ return super.fill(aSide, aFluid, doFill);
+ }
+ else {
+ return 0;
+ }
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, FluidStack aFluid,
+ boolean doDrain) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN){
+ return super.drain(aSide, aFluid, doDrain);
+ }
+ else {
+ return null;
+ }
+ }
+
+ @Override
+ public FluidStack drain(ForgeDirection aSide, int maxDrain,
+ boolean doDrain) {
+ if (aSide == ForgeDirection.UP || aSide == ForgeDirection.DOWN){
+ return super.drain(aSide, maxDrain, doDrain);
+ }
+ else {
+ return null;
+ }
+ }
+
+}