aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java552
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java610
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java350
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java71
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java47
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java142
6 files changed, 1002 insertions, 770 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
index d600d0baca..b3d8b8aa8c 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/BaseCustomPower_MTE.java
@@ -8,277 +8,283 @@ import net.minecraftforge.common.util.ForgeDirection;
public class BaseCustomPower_MTE extends BaseCustomTileEntity {
- public BaseCustomPower_MTE() {
- super();
- Logger.INFO("Created new BaseCustomPower_MTE");
- }
-
- public boolean doesExplode() {
- return false;
- }
-
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- if (mMetaTileEntity == null) {
- Logger.INFO("Bad Tile");
- }
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.inputEnergyFrom(aSide) && aAmperage > 0L
- && aVoltage > 0L && this.getStoredEU() < this.getEUCapacity()
- && this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()) {
- Logger.INFO("Injecting Energy Units");
- return super.injectEnergyUnits(aSide, aVoltage, aAmperage);
- } else {
- Logger.INFO("canAccessData(): "+canAccessData());
- Logger.INFO("isElectric(): "+this.mMetaTileEntity.isElectric());
- Logger.INFO("InputEnergyFromSide("+aSide+"): "+this.inputEnergyFrom(aSide));
- Logger.INFO("aAmperage: "+aAmperage);
- Logger.INFO("aVoltage: "+aVoltage);
- Logger.INFO("this.getStoredEU() < this.getEUCapacity(): "+(this.getStoredEU() < this.getEUCapacity()));
- Logger.INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: "+(this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()));
- Logger.INFO("this.mMetaTileEntity.maxAmperesIn(): "+(this.mMetaTileEntity.maxAmperesIn()));
- Logger.INFO("this.mAcceptedAmperes: "+(this.getInputAmperage()));
- return 0L;
- }
- }
-
- public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
- Logger.INFO("Draining Energy Units 4");
- if (this.canAccessData() && this.mMetaTileEntity.isElectric() && this.outputsEnergyTo(aSide)
- && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) {
- if (this.decreaseStoredEU(aVoltage * aAmperage, false)) {
- this.mAverageEUOutput[this.mAverageEUOutputIndex] = (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex]
- + aVoltage * aAmperage);
- return true;
- } else {
- return false;
- }
- } else {
- return false;
- }
- }
-
- @Override
- public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
- Logger.INFO("Draining Energy Units 3");
- // TODO Auto-generated method stub
- return super.decreaseStoredEnergyUnits(aEnergy, aIgnoreTooLessEnergy);
- }
-
- @Override
- public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
- // TODO Auto-generated method stub
- return super.increaseStoredEnergyUnits(aEnergy, aIgnoreTooMuchEnergy);
- }
-
- @Override
- public boolean inputEnergyFrom(byte aSide) {
- // TODO Auto-generated method stub
- return super.inputEnergyFrom(aSide);
- }
-
- @Override
- public boolean outputsEnergyTo(byte aSide) {
- Logger.INFO("Draining Energy Units 2");
- // TODO Auto-generated method stub
- return super.outputsEnergyTo(aSide);
- }
-
- @Override
- public long getOutputAmperage() {
- // TODO Auto-generated method stub
- return super.getOutputAmperage();
- }
-
- @Override
- public long getOutputVoltage() {
- // TODO Auto-generated method stub
- return super.getOutputVoltage();
- }
-
- @Override
- public long getInputAmperage() {
- // TODO Auto-generated method stub
- return super.getInputAmperage();
- }
-
- @Override
- public long getInputVoltage() {
- // TODO Auto-generated method stub
- return super.getInputVoltage();
- }
-
- @Override
- public long getUniversalEnergyStored() {
- // TODO Auto-generated method stub
- return super.getUniversalEnergyStored();
- }
-
- @Override
- public long getUniversalEnergyCapacity() {
- // TODO Auto-generated method stub
- return super.getUniversalEnergyCapacity();
- }
-
- @Override
- public long getStoredEU() {
- // TODO Auto-generated method stub
- return super.getStoredEU();
- }
-
- @Override
- public long getEUCapacity() {
- // TODO Auto-generated method stub
- return super.getEUCapacity();
- }
-
- @Override
- public boolean setStoredEU(long aEnergy) {
- // TODO Auto-generated method stub
- return super.setStoredEU(aEnergy);
- }
-
- @Override
- public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) {
- Logger.INFO("Draining Energy Units 1");
- // TODO Auto-generated method stub
- return super.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy);
- }
-
- @Override
- public boolean decreaseStoredSteam(long aEnergy, boolean aIgnoreTooLessEnergy) {
- // TODO Auto-generated method stub
- return super.decreaseStoredSteam(aEnergy, aIgnoreTooLessEnergy);
- }
-
- @Override
- public void doEnergyExplosion() {
- // TODO Auto-generated method stub
- super.doEnergyExplosion();
- }
-
- @Override
- public void doExplosion(long aAmount) {
- // TODO Auto-generated method stub
- super.doExplosion(aAmount);
- }
-
- @Override
- public byte getLightValue() {
- // TODO Auto-generated method stub
- return super.getLightValue();
- }
-
- @Override
- public long getAverageElectricInput() {
- // TODO Auto-generated method stub
- return super.getAverageElectricInput();
- }
-
- @Override
- public long getAverageElectricOutput() {
- // TODO Auto-generated method stub
- return super.getAverageElectricOutput();
- }
-
- @Override
- public double getOutputEnergyUnitsPerTick() {
- // TODO Auto-generated method stub
- return super.getOutputEnergyUnitsPerTick();
- }
-
- @Override
- public double demandedEnergyUnits() {
- // TODO Auto-generated method stub
- return super.demandedEnergyUnits();
- }
-
- @Override
- public double injectEnergyUnits(ForgeDirection aDirection, double aAmount) {
- // TODO Auto-generated method stub
- return super.injectEnergyUnits(aDirection, aAmount);
- }
-
- @Override
- public boolean acceptsEnergyFrom(TileEntity aEmitter, ForgeDirection aDirection) {
- // TODO Auto-generated method stub
- return super.acceptsEnergyFrom(aEmitter, aDirection);
- }
-
- @Override
- public boolean emitsEnergyTo(TileEntity aReceiver, ForgeDirection aDirection) {
- // TODO Auto-generated method stub
- return super.emitsEnergyTo(aReceiver, aDirection);
- }
-
- @Override
- public double getOfferedEnergy() {
- // TODO Auto-generated method stub
- return super.getOfferedEnergy();
- }
-
- @Override
- public void drawEnergy(double amount) {
- // TODO Auto-generated method stub
- super.drawEnergy(amount);
- }
-
- @Override
- public int injectEnergy(ForgeDirection aForgeDirection, int aAmount) {
- // TODO Auto-generated method stub
- return super.injectEnergy(aForgeDirection, aAmount);
- }
-
- @Override
- public int addEnergy(int aEnergy) {
- // TODO Auto-generated method stub
- return super.addEnergy(aEnergy);
- }
-
- @Override
- public boolean isAddedToEnergyNet() {
- // TODO Auto-generated method stub
- return super.isAddedToEnergyNet();
- }
-
- @Override
- public int demandsEnergy() {
- // TODO Auto-generated method stub
- return super.demandsEnergy();
- }
-
- @Override
- public int getMaxSafeInput() {
- // TODO Auto-generated method stub
- return super.getMaxSafeInput();
- }
-
- @Override
- public int getMaxEnergyOutput() {
- // TODO Auto-generated method stub
- return super.getMaxEnergyOutput();
- }
-
- @Override
- public int injectEnergy(Direction aDirection, int aAmount) {
- // TODO Auto-generated method stub
- return super.injectEnergy(aDirection, aAmount);
- }
-
- @Override
- public boolean acceptsEnergyFrom(TileEntity aReceiver, Direction aDirection) {
- // TODO Auto-generated method stub
- return super.acceptsEnergyFrom(aReceiver, aDirection);
- }
-
- @Override
- public boolean emitsEnergyTo(TileEntity aReceiver, Direction aDirection) {
- // TODO Auto-generated method stub
- return super.emitsEnergyTo(aReceiver, aDirection);
- }
-
- @Override
- public boolean isUniversalEnergyStored(long aEnergyAmount) {
- // TODO Auto-generated method stub
- return super.isUniversalEnergyStored(aEnergyAmount);
- }
-
+ public BaseCustomPower_MTE() {
+ super();
+ Logger.INFO("Created new BaseCustomPower_MTE");
+ }
+
+ public boolean doesExplode() {
+ return false;
+ }
+
+ public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ if (mMetaTileEntity == null) {
+ Logger.INFO("Bad Tile");
+ }
+ if (this.canAccessData()
+ && this.mMetaTileEntity.isElectric()
+ && this.inputEnergyFrom(aSide)
+ && aAmperage > 0L
+ && aVoltage > 0L
+ && this.getStoredEU() < this.getEUCapacity()
+ && this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()) {
+ Logger.INFO("Injecting Energy Units");
+ return super.injectEnergyUnits(aSide, aVoltage, aAmperage);
+ } else {
+ Logger.INFO("canAccessData(): " + canAccessData());
+ Logger.INFO("isElectric(): " + this.mMetaTileEntity.isElectric());
+ Logger.INFO("InputEnergyFromSide(" + aSide + "): " + this.inputEnergyFrom(aSide));
+ Logger.INFO("aAmperage: " + aAmperage);
+ Logger.INFO("aVoltage: " + aVoltage);
+ Logger.INFO("this.getStoredEU() < this.getEUCapacity(): " + (this.getStoredEU() < this.getEUCapacity()));
+ Logger.INFO("this.mMetaTileEntity.maxAmperesIn() >= this.mAcceptedAmperes: "
+ + (this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()));
+ Logger.INFO("this.mMetaTileEntity.maxAmperesIn(): " + (this.mMetaTileEntity.maxAmperesIn()));
+ Logger.INFO("this.mAcceptedAmperes: " + (this.getInputAmperage()));
+ return 0L;
+ }
+ }
+
+ public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ Logger.INFO("Draining Energy Units 4");
+ if (this.canAccessData()
+ && this.mMetaTileEntity.isElectric()
+ && this.outputsEnergyTo(aSide)
+ && this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) {
+ if (this.decreaseStoredEU(aVoltage * aAmperage, false)) {
+ this.mAverageEUOutput[this.mAverageEUOutputIndex] =
+ (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex] + aVoltage * aAmperage);
+ return true;
+ } else {
+ return false;
+ }
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean decreaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ Logger.INFO("Draining Energy Units 3");
+ // TODO Auto-generated method stub
+ return super.decreaseStoredEnergyUnits(aEnergy, aIgnoreTooLessEnergy);
+ }
+
+ @Override
+ public boolean increaseStoredEnergyUnits(long aEnergy, boolean aIgnoreTooMuchEnergy) {
+ // TODO Auto-generated method stub
+ return super.increaseStoredEnergyUnits(aEnergy, aIgnoreTooMuchEnergy);
+ }
+
+ @Override
+ public boolean inputEnergyFrom(byte aSide) {
+ // TODO Auto-generated method stub
+ return super.inputEnergyFrom(aSide);
+ }
+
+ @Override
+ public boolean outputsEnergyTo(byte aSide) {
+ Logger.INFO("Draining Energy Units 2");
+ // TODO Auto-generated method stub
+ return super.outputsEnergyTo(aSide);
+ }
+
+ @Override
+ public long getOutputAmperage() {
+ // TODO Auto-generated method stub
+ return super.getOutputAmperage();
+ }
+
+ @Override
+ public long getOutputVoltage() {
+ // TODO Auto-generated method stub
+ return super.getOutputVoltage();
+ }
+
+ @Override
+ public long getInputAmperage() {
+ // TODO Auto-generated method stub
+ return super.getInputAmperage();
+ }
+
+ @Override
+ public long getInputVoltage() {
+ // TODO Auto-generated method stub
+ return super.getInputVoltage();
+ }
+
+ @Override
+ public long getUniversalEnergyStored() {
+ // TODO Auto-generated method stub
+ return super.getUniversalEnergyStored();
+ }
+
+ @Override
+ public long getUniversalEnergyCapacity() {
+ // TODO Auto-generated method stub
+ return super.getUniversalEnergyCapacity();
+ }
+
+ @Override
+ public long getStoredEU() {
+ // TODO Auto-generated method stub
+ return super.getStoredEU();
+ }
+
+ @Override
+ public long getEUCapacity() {
+ // TODO Auto-generated method stub
+ return super.getEUCapacity();
+ }
+
+ @Override
+ public boolean setStoredEU(long aEnergy) {
+ // TODO Auto-generated method stub
+ return super.setStoredEU(aEnergy);
+ }
+
+ @Override
+ public boolean decreaseStoredEU(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ Logger.INFO("Draining Energy Units 1");
+ // TODO Auto-generated method stub
+ return super.decreaseStoredEU(aEnergy, aIgnoreTooLessEnergy);
+ }
+
+ @Override
+ public boolean decreaseStoredSteam(long aEnergy, boolean aIgnoreTooLessEnergy) {
+ // TODO Auto-generated method stub
+ return super.decreaseStoredSteam(aEnergy, aIgnoreTooLessEnergy);
+ }
+
+ @Override
+ public void doEnergyExplosion() {
+ // TODO Auto-generated method stub
+ super.doEnergyExplosion();
+ }
+
+ @Override
+ public void doExplosion(long aAmount) {
+ // TODO Auto-generated method stub
+ super.doExplosion(aAmount);
+ }
+
+ @Override
+ public byte getLightValue() {
+ // TODO Auto-generated method stub
+ return super.getLightValue();
+ }
+
+ @Override
+ public long getAverageElectricInput() {
+ // TODO Auto-generated method stub
+ return super.getAverageElectricInput();
+ }
+
+ @Override
+ public long getAverageElectricOutput() {
+ // TODO Auto-generated method stub
+ return super.getAverageElectricOutput();
+ }
+
+ @Override
+ public double getOutputEnergyUnitsPerTick() {
+ // TODO Auto-generated method stub
+ return super.getOutputEnergyUnitsPerTick();
+ }
+
+ @Override
+ public double demandedEnergyUnits() {
+ // TODO Auto-generated method stub
+ return super.demandedEnergyUnits();
+ }
+
+ @Override
+ public double injectEnergyUnits(ForgeDirection aDirection, double aAmount) {
+ // TODO Auto-generated method stub
+ return super.injectEnergyUnits(aDirection, aAmount);
+ }
+
+ @Override
+ public boolean acceptsEnergyFrom(TileEntity aEmitter, ForgeDirection aDirection) {
+ // TODO Auto-generated method stub
+ return super.acceptsEnergyFrom(aEmitter, aDirection);
+ }
+
+ @Override
+ public boolean emitsEnergyTo(TileEntity aReceiver, ForgeDirection aDirection) {
+ // TODO Auto-generated method stub
+ return super.emitsEnergyTo(aReceiver, aDirection);
+ }
+
+ @Override
+ public double getOfferedEnergy() {
+ // TODO Auto-generated method stub
+ return super.getOfferedEnergy();
+ }
+
+ @Override
+ public void drawEnergy(double amount) {
+ // TODO Auto-generated method stub
+ super.drawEnergy(amount);
+ }
+
+ @Override
+ public int injectEnergy(ForgeDirection aForgeDirection, int aAmount) {
+ // TODO Auto-generated method stub
+ return super.injectEnergy(aForgeDirection, aAmount);
+ }
+
+ @Override
+ public int addEnergy(int aEnergy) {
+ // TODO Auto-generated method stub
+ return super.addEnergy(aEnergy);
+ }
+
+ @Override
+ public boolean isAddedToEnergyNet() {
+ // TODO Auto-generated method stub
+ return super.isAddedToEnergyNet();
+ }
+
+ @Override
+ public int demandsEnergy() {
+ // TODO Auto-generated method stub
+ return super.demandsEnergy();
+ }
+
+ @Override
+ public int getMaxSafeInput() {
+ // TODO Auto-generated method stub
+ return super.getMaxSafeInput();
+ }
+
+ @Override
+ public int getMaxEnergyOutput() {
+ // TODO Auto-generated method stub
+ return super.getMaxEnergyOutput();
+ }
+
+ @Override
+ public int injectEnergy(Direction aDirection, int aAmount) {
+ // TODO Auto-generated method stub
+ return super.injectEnergy(aDirection, aAmount);
+ }
+
+ @Override
+ public boolean acceptsEnergyFrom(TileEntity aReceiver, Direction aDirection) {
+ // TODO Auto-generated method stub
+ return super.acceptsEnergyFrom(aReceiver, aDirection);
+ }
+
+ @Override
+ public boolean emitsEnergyTo(TileEntity aReceiver, Direction aDirection) {
+ // TODO Auto-generated method stub
+ return super.emitsEnergyTo(aReceiver, aDirection);
+ }
+
+ @Override
+ public boolean isUniversalEnergyStored(long aEnergyAmount) {
+ // TODO Auto-generated method stub
+ return super.isUniversalEnergyStored(aEnergyAmount);
+ }
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
index e1b329c07f..332d911ac4 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
@@ -5,10 +5,10 @@ import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Recipe;
+import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.util.minecraft.gregtech.PollutionUtils;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import java.util.Collection;
import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
@@ -17,297 +17,317 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank {
- public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier, String aDescription,
- ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- }
-
- public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier,
- String[] aDescription, ITexture... aTextures) {
- super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
- }
-
- public GTPP_MTE_BasicLosslessGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- public GTPP_MTE_BasicLosslessGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 3, aDescription, aTextures);
- }
-
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- 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;
- }
-
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, 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];
- }
-
- public String[] getDescription() {
- String[] desc = new String[this.mDescriptionArray.length + 1];
- System.arraycopy(this.mDescriptionArray, 0, desc, 0, this.mDescriptionArray.length);
- desc[this.mDescriptionArray.length] = "Fuel Efficiency: " + this.getEfficiency() + "%";
- return desc;
- }
-
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- Logger.WARNING("Right Clicked");
- if (aBaseMetaTileEntity.isClientSide()) {
- return true;
- } else {
- aBaseMetaTileEntity.openGUI(aPlayer);
- return true;
- }
- }
-
- public ITexture[] getFront(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBack(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getBottom(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getTop(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getSides(byte aColor) {
- return new ITexture[]{BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
- }
-
- public ITexture[] getFrontActive(byte aColor) {
- return this.getFront(aColor);
- }
-
- public ITexture[] getBackActive(byte aColor) {
- return this.getBack(aColor);
- }
-
- public ITexture[] getBottomActive(byte aColor) {
- return this.getBottom(aColor);
- }
-
- public ITexture[] getTopActive(byte aColor) {
- return this.getTop(aColor);
- }
-
- public ITexture[] getSidesActive(byte aColor) {
- return this.getSides(aColor);
- }
-
- public boolean isFacingValid(byte aSide) {
- return aSide > 1;
- }
-
- public boolean isSimpleMachine() {
- return false;
- }
-
- public boolean isValidSlot(int aIndex) {
- return aIndex < 2;
- }
-
- public boolean isEnetOutput() {
- return true;
- }
-
- public boolean isOutputFacing(byte aSide) {
- return true;
- }
-
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- public long maxEUOutput() {
- return this.getBaseMetaTileEntity().isAllowedToWork() ? GT_Values.V[this.mTier] : 0L;
- }
-
- public long maxEUStore() {
- return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 40L + this.getMinimumStoredEU());
- }
-
- public boolean doesFillContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public boolean doesEmptyContainers() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public boolean canTankBeFilled() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public boolean canTankBeEmptied() {
- return this.getBaseMetaTileEntity().isAllowedToWork();
- }
-
- public boolean displaysItemStack() {
- return true;
- }
-
- public boolean displaysStackSize() {
- return false;
- }
-
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- int aVal = this.getFuelValue(aFluid);
- Logger.WARNING("Fuel Value: "+aVal);
- return aVal > 0;
- }
-
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
- int tFuelValue;
- if (this.mFluid == null) {
- if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
- this.mInventory[this.getStackDisplaySlot()] = null;
- } else {
- if (this.mInventory[this.getStackDisplaySlot()] == null) {
- this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
- }
-
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
- + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
- }
- } else {
- tFuelValue = this.getFuelValue(this.mFluid);
- int tConsumed = this.consumedFluidPerOperation(this.mFluid);
- if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) {
- long tFluidAmountToUse = Math.min((long) (this.mFluid.amount / tConsumed),
- (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
- if (tFluidAmountToUse > 0L && aBaseMetaTileEntity
- .increaseStoredEnergyUnits(tFluidAmountToUse * (long) tFuelValue, true)) {
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
- this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed);
- }
- }
- }
-
- if (this.mInventory[this.getInputSlot()] != null
- && aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() * 20L
- + this.getMinimumStoredEU()
- && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
- tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
- if (tFuelValue > 0) {
- ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
- if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
- aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
- aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
- PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
- }
- }
- }
- }
-
- if (aBaseMetaTileEntity.isServerSide()) {
- Logger.WARNING("Ticking Servside");
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity
- .getUniversalEnergyStored() >= this.maxEUOutput() + this.getMinimumStoredEU());
- }
-
- }
-
- public abstract int getPollution();
-
- public abstract GT_Recipe_Map getRecipes();
-
- public abstract int getEfficiency();
-
- public int consumedFluidPerOperation(FluidStack aLiquid) {
- return 1;
- }
-
- public int getFuelValue(FluidStack aLiquid) {
- if (aLiquid != null && this.getRecipes() != null) {
- Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
- if (tRecipeList != null) {
- Logger.WARNING("Fuels: "+tRecipeList.size());
- Iterator<GT_Recipe> var4 = tRecipeList.iterator();
-
- while (var4.hasNext()) {
- GT_Recipe tFuel = (GT_Recipe) var4.next();
- FluidStack tLiquid;
- if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null
- && aLiquid.isFluidEqual(tLiquid)) {
- Logger.WARNING("Fuel Ok");
- return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency()
- * (long) this.consumedFluidPerOperation(tLiquid) / 100L);
- }
- if ((tLiquid = tFuel.getRepresentativeFluidInput(0)) != null
- && aLiquid.isFluidEqual(tLiquid)) {
- Logger.WARNING("Fuel Ok");
- return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency()
- * (long) this.consumedFluidPerOperation(tLiquid) / 100L);
- }
- }
- }
-
- return 0;
- } else {
- return 0;
- }
- }
-
- public int getFuelValue(ItemStack aStack) {
- if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) {
- Logger.WARNING("Fuel Item OK");
- GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE,
- (FluidStack[]) null, new ItemStack[]{aStack});
- return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.getEfficiency() / 100L) : 0;
- } else {
- return 0;
- }
- }
-
- public ItemStack getEmptyContainer(ItemStack aStack) {
- if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) {
- GT_Recipe tFuel = this.getRecipes().findRecipe(this.getBaseMetaTileEntity(), false, Long.MAX_VALUE,
- (FluidStack[]) null, new ItemStack[]{aStack});
- return tFuel != null
- ? GT_Utility.copy(new Object[]{tFuel.getOutput(0)})
- : GT_Utility.getContainerItem(aStack, true);
- } else {
- return null;
- }
- }
-
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (this.getFuelValue(aStack) > 0
- || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
- }
-
- public int getCapacity() {
- return 16000;
- }
-
- public int getTankPressure() {
- return -100;
- }
-} \ No newline at end of file
+ public GTPP_MTE_BasicLosslessGenerator(
+ int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GTPP_MTE_BasicLosslessGenerator(
+ int aID, String aName, String aNameRegional, int aTier, String[] aDescription, ITexture... aTextures) {
+ super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
+ }
+
+ public GTPP_MTE_BasicLosslessGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ public GTPP_MTE_BasicLosslessGenerator(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
+ super(aName, aTier, 3, aDescription, aTextures);
+ }
+
+ public ITexture[][][] getTextureSet(ITexture[] aTextures) {
+ 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;
+ }
+
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ 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];
+ }
+
+ public String[] getDescription() {
+ String[] desc = new String[this.mDescriptionArray.length + 1];
+ System.arraycopy(this.mDescriptionArray, 0, desc, 0, this.mDescriptionArray.length);
+ desc[this.mDescriptionArray.length] = "Fuel Efficiency: " + this.getEfficiency() + "%";
+ return desc;
+ }
+
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
+ Logger.WARNING("Right Clicked");
+ if (aBaseMetaTileEntity.isClientSide()) {
+ return true;
+ } else {
+ aBaseMetaTileEntity.openGUI(aPlayer);
+ return true;
+ }
+ }
+
+ public ITexture[] getFront(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBack(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getBottom(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getTop(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getSides(byte aColor) {
+ return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ }
+
+ public ITexture[] getFrontActive(byte aColor) {
+ return this.getFront(aColor);
+ }
+
+ public ITexture[] getBackActive(byte aColor) {
+ return this.getBack(aColor);
+ }
+
+ public ITexture[] getBottomActive(byte aColor) {
+ return this.getBottom(aColor);
+ }
+
+ public ITexture[] getTopActive(byte aColor) {
+ return this.getTop(aColor);
+ }
+
+ public ITexture[] getSidesActive(byte aColor) {
+ return this.getSides(aColor);
+ }
+
+ public boolean isFacingValid(byte aSide) {
+ return aSide > 1;
+ }
+
+ public boolean isSimpleMachine() {
+ return false;
+ }
+
+ public boolean isValidSlot(int aIndex) {
+ return aIndex < 2;
+ }
+
+ public boolean isEnetOutput() {
+ return true;
+ }
+
+ public boolean isOutputFacing(byte aSide) {
+ return true;
+ }
+
+ public boolean isAccessAllowed(EntityPlayer aPlayer) {
+ return true;
+ }
+
+ public long maxEUOutput() {
+ return this.getBaseMetaTileEntity().isAllowedToWork() ? GT_Values.V[this.mTier] : 0L;
+ }
+
+ public long maxEUStore() {
+ return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 40L + this.getMinimumStoredEU());
+ }
+
+ public boolean doesFillContainers() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean doesEmptyContainers() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean canTankBeFilled() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean canTankBeEmptied() {
+ return this.getBaseMetaTileEntity().isAllowedToWork();
+ }
+
+ public boolean displaysItemStack() {
+ return true;
+ }
+
+ public boolean displaysStackSize() {
+ return false;
+ }
+
+ public boolean isFluidInputAllowed(FluidStack aFluid) {
+ int aVal = this.getFuelValue(aFluid);
+ Logger.WARNING("Fuel Value: " + aVal);
+ return aVal > 0;
+ }
+
+ public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
+ if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
+ int tFuelValue;
+ if (this.mFluid == null) {
+ if (aBaseMetaTileEntity.getUniversalEnergyStored() < this.maxEUOutput() + this.getMinimumStoredEU()) {
+ this.mInventory[this.getStackDisplaySlot()] = null;
+ } else {
+ if (this.mInventory[this.getStackDisplaySlot()] == null) {
+ this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
+ }
+
+ this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
+ + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
+ }
+ } else {
+ tFuelValue = this.getFuelValue(this.mFluid);
+ int tConsumed = this.consumedFluidPerOperation(this.mFluid);
+ if (tFuelValue > 0 && tConsumed > 0 && this.mFluid.amount > tConsumed) {
+ long tFluidAmountToUse = Math.min(
+ (long) (this.mFluid.amount / tConsumed),
+ (this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
+ if (tFluidAmountToUse > 0L
+ && aBaseMetaTileEntity.increaseStoredEnergyUnits(
+ tFluidAmountToUse * (long) tFuelValue, true)) {
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
+ this.mFluid.amount = (int) ((long) this.mFluid.amount - tFluidAmountToUse * (long) tConsumed);
+ }
+ }
+ }
+
+ if (this.mInventory[this.getInputSlot()] != null
+ && aBaseMetaTileEntity.getUniversalEnergyStored()
+ < this.maxEUOutput() * 20L + this.getMinimumStoredEU()
+ && GT_Utility.getFluidForFilledItem(this.mInventory[this.getInputSlot()], true) == null) {
+ tFuelValue = this.getFuelValue(this.mInventory[this.getInputSlot()]);
+ if (tFuelValue > 0) {
+ ItemStack tEmptyContainer = this.getEmptyContainer(this.mInventory[this.getInputSlot()]);
+ if (aBaseMetaTileEntity.addStackToSlot(this.getOutputSlot(), tEmptyContainer)) {
+ aBaseMetaTileEntity.increaseStoredEnergyUnits((long) tFuelValue, true);
+ aBaseMetaTileEntity.decrStackSize(this.getInputSlot(), 1);
+ PollutionUtils.addPollution(this.getBaseMetaTileEntity(), 10 * this.getPollution());
+ }
+ }
+ }
+ }
+
+ if (aBaseMetaTileEntity.isServerSide()) {
+ Logger.WARNING("Ticking Servside");
+ aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
+ && aBaseMetaTileEntity.getUniversalEnergyStored()
+ >= this.maxEUOutput() + this.getMinimumStoredEU());
+ }
+ }
+
+ public abstract int getPollution();
+
+ public abstract GT_Recipe_Map getRecipes();
+
+ public abstract int getEfficiency();
+
+ public int consumedFluidPerOperation(FluidStack aLiquid) {
+ return 1;
+ }
+
+ public int getFuelValue(FluidStack aLiquid) {
+ if (aLiquid != null && this.getRecipes() != null) {
+ Collection<GT_Recipe> tRecipeList = this.getRecipes().mRecipeList;
+ if (tRecipeList != null) {
+ Logger.WARNING("Fuels: " + tRecipeList.size());
+ Iterator<GT_Recipe> var4 = tRecipeList.iterator();
+
+ while (var4.hasNext()) {
+ GT_Recipe tFuel = (GT_Recipe) var4.next();
+ FluidStack tLiquid;
+ if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null
+ && aLiquid.isFluidEqual(tLiquid)) {
+ Logger.WARNING("Fuel Ok");
+ return (int) ((long) tFuel.mSpecialValue
+ * (long) this.getEfficiency()
+ * (long) this.consumedFluidPerOperation(tLiquid)
+ / 100L);
+ }
+ if ((tLiquid = tFuel.getRepresentativeFluidInput(0)) != null && aLiquid.isFluidEqual(tLiquid)) {
+ Logger.WARNING("Fuel Ok");
+ return (int) ((long) tFuel.mSpecialValue
+ * (long) this.getEfficiency()
+ * (long) this.consumedFluidPerOperation(tLiquid)
+ / 100L);
+ }
+ }
+ }
+
+ return 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public int getFuelValue(ItemStack aStack) {
+ if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) {
+ Logger.WARNING("Fuel Item OK");
+ GT_Recipe tFuel = this.getRecipes()
+ .findRecipe(
+ this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] {
+ aStack
+ });
+ return tFuel != null ? (int) ((long) tFuel.mSpecialValue * 1000L * (long) this.getEfficiency() / 100L) : 0;
+ } else {
+ return 0;
+ }
+ }
+
+ public ItemStack getEmptyContainer(ItemStack aStack) {
+ if (!GT_Utility.isStackInvalid(aStack) && this.getRecipes() != null) {
+ GT_Recipe tFuel = this.getRecipes()
+ .findRecipe(
+ this.getBaseMetaTileEntity(), false, Long.MAX_VALUE, (FluidStack[]) null, new ItemStack[] {
+ aStack
+ });
+ return tFuel != null
+ ? GT_Utility.copy(new Object[] {tFuel.getOutput(0)})
+ : GT_Utility.getContainerItem(aStack, true);
+ } else {
+ return null;
+ }
+ }
+
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack)
+ && (this.getFuelValue(aStack) > 0
+ || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
+ }
+
+ public int getCapacity() {
+ return 16000;
+ }
+
+ public int getTankPressure() {
+ return -100;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
index 2eb1d36791..f6cf2391b3 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
@@ -1,6 +1,7 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
-import gregtech.GT_Mod;
+import static gregtech.api.enums.GT_Values.V;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
@@ -16,6 +17,7 @@ import gregtech.api.util.GT_Recipe;
import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
import gregtech.api.util.GT_Utility;
import gtPlusPlus.api.objects.random.XSTR;
+import java.util.Arrays;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -26,10 +28,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidHandler;
-import java.util.Arrays;
-
-import static gregtech.api.enums.GT_Values.V;
-
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
@@ -40,14 +38,20 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
/**
* return values for checkRecipe()
*/
- protected static final int
- DID_NOT_FIND_RECIPE = 0,
+ protected static final int DID_NOT_FIND_RECIPE = 0,
FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
FOUND_AND_SUCCESSFULLY_USED_RECIPE = 2;
+
public static final int OTHER_SLOT_COUNT = 4;
public final ItemStack[] mOutputItems;
public final int mInputSlotCount, mAmperage;
- public boolean mAllowInputFromOutputSide = false, mFluidTransfer = false, mItemTransfer = false, mHasBeenUpdated = false, mStuttering = false, mCharge = false, mDecharge = false;
+ public boolean mAllowInputFromOutputSide = false,
+ mFluidTransfer = false,
+ mItemTransfer = false,
+ mHasBeenUpdated = false,
+ mStuttering = false,
+ mCharge = false,
+ mDecharge = false;
public int mMainFacing = -1, mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0;
public FluidStack mOutputFluid;
public String mGUIName = "", mNEIName = "";
@@ -56,6 +60,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
* Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
*/
protected GT_Recipe mLastRecipe = null;
+
private FluidStack mFluidOut;
/**
@@ -75,8 +80,26 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
* 12 = SideFacingPipeActive
* 13 = SideFacingPipeInactive
*/
- public GTPP_MTE_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, String aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) {
- super(aID, aName, aNameRegional, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aOverlays);
+ public GTPP_MTE_BasicMachine(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aAmperage,
+ String aDescription,
+ int aInputSlotCount,
+ int aOutputSlotCount,
+ String aGUIName,
+ String aNEIName,
+ ITexture... aOverlays) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1,
+ aDescription,
+ aOverlays);
mInputSlotCount = Math.max(0, aInputSlotCount);
mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
mAmperage = aAmperage;
@@ -84,8 +107,26 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
mNEIName = aNEIName;
}
- public GTPP_MTE_BasicMachine(int aID, String aName, String aNameRegional, int aTier, int aAmperage, String[] aDescription, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName, ITexture... aOverlays) {
- super(aID, aName, aNameRegional, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aOverlays);
+ public GTPP_MTE_BasicMachine(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aAmperage,
+ String[] aDescription,
+ int aInputSlotCount,
+ int aOutputSlotCount,
+ String aGUIName,
+ String aNEIName,
+ ITexture... aOverlays) {
+ super(
+ aID,
+ aName,
+ aNameRegional,
+ aTier,
+ OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1,
+ aDescription,
+ aOverlays);
mInputSlotCount = Math.max(0, aInputSlotCount);
mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
mAmperage = aAmperage;
@@ -93,7 +134,16 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
mNEIName = aNEIName;
}
- public GTPP_MTE_BasicMachine(String aName, int aTier, int aAmperage, String aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+ public GTPP_MTE_BasicMachine(
+ String aName,
+ int aTier,
+ int aAmperage,
+ String aDescription,
+ ITexture[][][] aTextures,
+ int aInputSlotCount,
+ int aOutputSlotCount,
+ String aGUIName,
+ String aNEIName) {
super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures);
mInputSlotCount = Math.max(0, aInputSlotCount);
mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
@@ -101,8 +151,17 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
mGUIName = aGUIName;
mNEIName = aNEIName;
}
-
- public GTPP_MTE_BasicMachine(String aName, int aTier, int aAmperage, String[] aDescription, ITexture[][][] aTextures, int aInputSlotCount, int aOutputSlotCount, String aGUIName, String aNEIName) {
+
+ public GTPP_MTE_BasicMachine(
+ String aName,
+ int aTier,
+ int aAmperage,
+ String[] aDescription,
+ ITexture[][][] aTextures,
+ int aInputSlotCount,
+ int aOutputSlotCount,
+ String aGUIName,
+ String aNEIName) {
super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures);
mInputSlotCount = Math.max(0, aInputSlotCount);
mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
@@ -112,18 +171,18 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
protected boolean isValidMainFacing(byte aSide) {
- return aSide > 1;
- }
-
- public boolean setMainFacing(byte aSide){
- if (!isValidMainFacing(aSide)) return false;
- mMainFacing = aSide;
- if(getBaseMetaTileEntity().getFrontFacing() == mMainFacing){
- getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide));
- }
+ return aSide > 1;
+ }
+
+ public boolean setMainFacing(byte aSide) {
+ if (!isValidMainFacing(aSide)) return false;
+ mMainFacing = aSide;
+ if (getBaseMetaTileEntity().getFrontFacing() == mMainFacing) {
+ getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide));
+ }
onFacingChange();
onMachineBlockUpdate();
- return true;
+ return true;
}
@Override
@@ -132,10 +191,12 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
aTextures = Arrays.copyOf(aTextures, 14);
for (int i = 0; i < aTextures.length; i++)
- if (aTextures[i] != null) for (byte c = -1; c < 16; c++) {
- if (rTextures[i][c + 1] == null)
- rTextures[i][c + 1] = new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
- }
+ if (aTextures[i] != null)
+ for (byte c = -1; c < 16; c++) {
+ if (rTextures[i][c + 1] == null)
+ rTextures[i][c + 1] =
+ new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][c + 1], aTextures[i]};
+ }
for (byte c = -1; c < 16; c++) {
if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c);
@@ -157,8 +218,28 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
@Override
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
- return mTextures[mMainFacing < 2 ? aSide == aFacing ? aActive ? 2 : 3 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1 : aSide == mMainFacing ? aActive ? 2 : 3 : (showPipeFacing() && aSide == aFacing) ? aSide == 0 ? aActive ? 8 : 9 : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13 : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex + 1];
+ public ITexture[] getTexture(
+ IGregTechTileEntity aBaseMetaTileEntity,
+ byte aSide,
+ byte aFacing,
+ byte aColorIndex,
+ boolean aActive,
+ boolean aRedstone) {
+ return mTextures[
+ mMainFacing < 2
+ ? aSide == aFacing
+ ? aActive ? 2 : 3
+ : aSide == 0 ? aActive ? 6 : 7 : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1
+ : aSide == mMainFacing
+ ? aActive ? 2 : 3
+ : (showPipeFacing() && aSide == aFacing)
+ ? aSide == 0
+ ? aActive ? 8 : 9
+ : aSide == 1 ? aActive ? 10 : 11 : aActive ? 12 : 13
+ : aSide == 0
+ ? aActive ? 6 : 7
+ : aSide == 1 ? aActive ? 4 : 5 : aActive ? 0 : 1][
+ aColorIndex + 1];
}
@Override
@@ -183,7 +264,9 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean isValidSlot(int aIndex) {
- return aIndex > 0 && super.isValidSlot(aIndex) && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
+ return aIndex > 0
+ && super.isValidSlot(aIndex)
+ && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
}
@Override
@@ -213,7 +296,9 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean isLiquidInput(byte aSide) {
- return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());
+ return aSide != mMainFacing
+ && (mAllowInputFromOutputSide
+ || aSide != getBaseMetaTileEntity().getFrontFacing());
}
@Override
@@ -304,7 +389,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean isFluidInputAllowed(FluidStack aFluid) {
- return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
+ return getFillableStack() != null
+ || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
}
@Override
@@ -372,7 +458,14 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public Object getClientGUI(int aID, InventoryPlayer aPlayerInventory, IGregTechTileEntity aBaseMetaTileEntity) {
- return new GT_GUIContainer_BasicMachine(aPlayerInventory, aBaseMetaTileEntity, getLocalName(), mGUIName, GT_Utility.isStringValid(mNEIName) ? mNEIName : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
+ return new GT_GUIContainer_BasicMachine(
+ aPlayerInventory,
+ aBaseMetaTileEntity,
+ getLocalName(),
+ mGUIName,
+ GT_Utility.isStringValid(mNEIName)
+ ? mNEIName
+ : getRecipeList() != null ? getRecipeList().mUnlocalizedName : "");
}
@Override
@@ -434,8 +527,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
if (++mProgresstime >= mMaxProgresstime) {
for (int i = 0; i < mOutputItems.length; i++)
for (int j = 0; j < mOutputItems.length; j++)
- if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i]))
- break;
+ if (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot() + ((j + i) % mOutputItems.length), mOutputItems[i])) break;
if (mOutputFluid != null)
if (getDrainableStack() == null) setDrainableStack(mOutputFluid.copy());
else if (mOutputFluid.isFluidEqual(getDrainableStack()))
@@ -451,8 +544,11 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
if (mProgresstime > 5) mStuttering = false;
XSTR aXSTR = new XSTR();
- //Dumb April Fools Shit
- // if(GT_Mod.gregtechproxy.mAprilFool && aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(), GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(), aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
+ // Dumb April Fools Shit
+ // if(GT_Mod.gregtechproxy.mAprilFool &&
+ // aXSTR.nextInt(5000)==0)GT_Utility.sendSoundToPlayers(aBaseMetaTileEntity.getWorld(),
+ // GregTech_API.sSoundList.get(5), 10.0F, -1.0F, aBaseMetaTileEntity.getXCoord(),
+ // aBaseMetaTileEntity.getYCoord(),aBaseMetaTileEntity.getZCoord());
} else {
if (!mStuttering) {
stutterProcess();
@@ -466,32 +562,65 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
boolean tRemovedOutputFluid = false;
- if (doesAutoOutputFluids() && getDrainableStack() != null && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || aTick % 20 == 0)) {
+ if (doesAutoOutputFluids()
+ && getDrainableStack() != null
+ && aBaseMetaTileEntity.getFrontFacing() != mMainFacing
+ && (tSucceeded || aTick % 20 == 0)) {
IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
if (tTank != null) {
FluidStack tDrained = drain(1000, false);
if (tDrained != null) {
- int tFilledAmount = tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
+ int tFilledAmount = tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
if (tFilledAmount > 0)
- tTank.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), drain(tFilledAmount, true), true);
+ tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ drain(tFilledAmount, true),
+ true);
}
}
if (getDrainableStack() == null) tRemovedOutputFluid = true;
}
- if (doesAutoOutput() && !isOutputEmpty() && aBaseMetaTileEntity.getFrontFacing() != mMainFacing && (tSucceeded || mOutputBlocked % 300 == 1 || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0)) {
+ if (doesAutoOutput()
+ && !isOutputEmpty()
+ && aBaseMetaTileEntity.getFrontFacing() != mMainFacing
+ && (tSucceeded
+ || mOutputBlocked % 300 == 1
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600 == 0)) {
TileEntity tTileEntity2 = aBaseMetaTileEntity.getTileEntityAtSide(aBaseMetaTileEntity.getFrontFacing());
- for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) {
- tCosts = GT_Utility.moveOneItemStack(aBaseMetaTileEntity, tTileEntity2, aBaseMetaTileEntity.getFrontFacing(), aBaseMetaTileEntity.getBackFacing(), null, false, (byte) 64, (byte) 1, (byte) 64, (byte) 1);
+ for (int i = 0, tCosts = 1;
+ i < mOutputItems.length && tCosts > 0 && aBaseMetaTileEntity.isUniversalEnergyStored(128);
+ i++) {
+ tCosts = GT_Utility.moveOneItemStack(
+ aBaseMetaTileEntity,
+ tTileEntity2,
+ aBaseMetaTileEntity.getFrontFacing(),
+ aBaseMetaTileEntity.getBackFacing(),
+ null,
+ false,
+ (byte) 64,
+ (byte) 1,
+ (byte) 64,
+ (byte) 1);
if (tCosts > 0) aBaseMetaTileEntity.decreaseStoredEnergyUnits(tCosts, true);
}
}
- if (mOutputBlocked != 0) if (isOutputEmpty()) mOutputBlocked = 0;
- else mOutputBlocked++;
+ if (mOutputBlocked != 0)
+ if (isOutputEmpty()) mOutputBlocked = 0;
+ else mOutputBlocked++;
if (allowToCheckRecipe()) {
- if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork() && (tRemovedOutputFluid || tSucceeded || aBaseMetaTileEntity.hasInventoryBeenModified() || aTick % 600 == 0 || aBaseMetaTileEntity.hasWorkJustBeenEnabled()) && hasEnoughEnergyToCheckRecipe()) {
+ if (mMaxProgresstime <= 0
+ && aBaseMetaTileEntity.isAllowedToWork()
+ && (tRemovedOutputFluid
+ || tSucceeded
+ || aBaseMetaTileEntity.hasInventoryBeenModified()
+ || aTick % 600 == 0
+ || aBaseMetaTileEntity.hasWorkJustBeenEnabled())
+ && hasEnoughEnergyToCheckRecipe()) {
if (checkRecipe() == 2) {
if (mInventory[3] != null && mInventory[3].stackSize <= 0) mInventory[3] = null;
for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
@@ -538,7 +667,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
if (ItemList.Display_Fluid.isStackEqual(mInventory[tDisplayStackSlot], true, true))
mInventory[tDisplayStackSlot] = null;
} else {
- mInventory[tDisplayStackSlot] = GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize());
+ mInventory[tDisplayStackSlot] =
+ GT_Utility.getFluidDisplayStack(getFillableStack(), displaysStackSize());
}
}
}
@@ -584,14 +714,20 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
protected boolean canOutput(GT_Recipe aRecipe) {
- return aRecipe != null && (aRecipe.mNeedsEmptyOutput ? isOutputEmpty() && getDrainableStack() == null : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs));
+ return aRecipe != null
+ && (aRecipe.mNeedsEmptyOutput
+ ? isOutputEmpty() && getDrainableStack() == null
+ : canOutput(aRecipe.getFluidOutput(0)) && canOutput(aRecipe.mOutputs));
}
protected boolean canOutput(ItemStack... aOutputs) {
if (aOutputs == null) return true;
ItemStack[] tOutputSlots = getAllOutputs();
for (int i = 0; i < tOutputSlots.length && i < aOutputs.length; i++)
- if (tOutputSlots[i] != null && aOutputs[i] != null && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false) || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) {
+ if (tOutputSlots[i] != null
+ && aOutputs[i] != null
+ && (!GT_Utility.areStacksEqual(tOutputSlots[i], aOutputs[i], false)
+ || tOutputSlots[i].stackSize + aOutputs[i].stackSize > tOutputSlots[i].getMaxStackSize())) {
mOutputBlocked++;
return false;
}
@@ -599,7 +735,11 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
protected boolean canOutput(FluidStack aOutput) {
- return getDrainableStack() == null || aOutput == null || (getDrainableStack().isFluidEqual(aOutput) && (getDrainableStack().amount <= 0 || getDrainableStack().amount + aOutput.amount <= getCapacity()));
+ return getDrainableStack() == null
+ || aOutput == null
+ || (getDrainableStack().isFluidEqual(aOutput)
+ && (getDrainableStack().amount <= 0
+ || getDrainableStack().amount + aOutput.amount <= getCapacity()));
}
protected ItemStack getInputAt(int aIndex) {
@@ -699,13 +839,15 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public String[] getInfoData() {
- return new String[]{
- mNEIName,
- "Progress:", (mProgresstime / 20) + " secs",
- (mMaxProgresstime / 20) + " secs",
- "Stored Energy:",
- getBaseMetaTileEntity().getStoredEU() + "EU",
- getBaseMetaTileEntity().getEUCapacity() + "EU"};
+ return new String[] {
+ mNEIName,
+ "Progress:",
+ (mProgresstime / 20) + " secs",
+ (mMaxProgresstime / 20) + " secs",
+ "Stored Energy:",
+ getBaseMetaTileEntity().getStoredEU() + "EU",
+ getBaseMetaTileEntity().getEUCapacity() + "EU"
+ };
}
@Override
@@ -717,13 +859,17 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) {
mAllowInputFromOutputSide = !mAllowInputFromOutputSide;
- GT_Utility.sendChatToPlayer(aPlayer, mAllowInputFromOutputSide ? "Input from Output Side allowed" : "Input from Output Side forbidden");
+ GT_Utility.sendChatToPlayer(
+ aPlayer,
+ mAllowInputFromOutputSide ? "Input from Output Side allowed" : "Input from Output Side forbidden");
}
}
@Override
public boolean allowCoverOnSide(byte aSide, GT_ItemStack aCoverID) {
- return (aSide != mMainFacing || GregTech_API.getCoverBehavior(aCoverID.toStack()).isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity()));
+ return (aSide != mMainFacing
+ || GregTech_API.getCoverBehavior(aCoverID.toStack())
+ .isGUIClickable(aSide, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity()));
}
@Override
@@ -733,8 +879,10 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aSide == mMainFacing || aIndex < getInputSlot() || aIndex >= getInputSlot() + mInputSlotCount || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing()))
- return false;
+ if (aSide == mMainFacing
+ || aIndex < getInputSlot()
+ || aIndex >= getInputSlot() + mInputSlotCount
+ || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing())) return false;
for (int i = getInputSlot(), j = i + mInputSlotCount; i < j; i++)
if (GT_Utility.areStacksEqual(GT_OreDictUnificator.get(aStack), mInventory[i])) return i == aIndex;
return true;
@@ -760,25 +908,31 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
return checkRecipe(false);
}
- public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId){
- return //TODO check or get a better solution
- DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids") ||
- DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS") ||
- DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation");
+ public static boolean isValidForLowGravity(GT_Recipe tRecipe, int dimId) {
+ return // TODO check or get a better solution
+ DimensionManager.getProvider(dimId).getClass().getName().contains("Orbit")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("Space")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("Asteroids")
+ || DimensionManager.getProvider(dimId).getClass().getName().endsWith("SS")
+ || DimensionManager.getProvider(dimId).getClass().getName().contains("SpaceStation");
}
-
/**
*
* @param skipOC disables OverclockedNess calculation and check - if you do you must implement your own method...
* @return
*/
- public int checkRecipe(boolean skipOC){
+ public int checkRecipe(boolean skipOC) {
GT_Recipe_Map tMap = getRecipeList();
if (tMap == null) return DID_NOT_FIND_RECIPE;
- GT_Recipe tRecipe = tMap.findRecipe(getBaseMetaTileEntity(), mLastRecipe, false, V[mTier], new FluidStack[]{getFillableStack()}, getSpecialSlot(), getAllInputs());
+ GT_Recipe tRecipe = tMap.findRecipe(
+ getBaseMetaTileEntity(),
+ mLastRecipe,
+ false,
+ V[mTier],
+ new FluidStack[] {getFillableStack()},
+ getSpecialSlot(),
+ getAllInputs());
if (tRecipe == null) return DID_NOT_FIND_RECIPE;
if (tRecipe.mCanBeBuffered) mLastRecipe = tRecipe;
@@ -788,7 +942,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
if (tRecipe.mSpecialValue == -200 && (mCleanroom == null || mCleanroom.mEfficiency == 0))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
- if (!tRecipe.isRecipeInputEqual(true, new FluidStack[]{getFillableStack()}, getAllInputs()))
+ if (!tRecipe.isRecipeInputEqual(true, new FluidStack[] {getFillableStack()}, getAllInputs()))
return FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS;
for (int i = 0; i < mOutputItems.length; i++)
if (getBaseMetaTileEntity().getRandomNumber(10000) < tRecipe.getOutputChance(i))
@@ -803,58 +957,76 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
public ITexture[] getSideFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getSideFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getFrontFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getTopFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
+ return new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1]};
}
public ITexture[] getBottomFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getBottomFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getTopFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getTopFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getSideFacingPipeActive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
public ITexture[] getSideFacingPipeInactive(byte aColor) {
- return new ITexture[]{Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1], new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)};
+ return new ITexture[] {
+ Textures.BlockIcons.MACHINE_CASINGS[mTier][aColor + 1],
+ new GT_RenderedTexture(Textures.BlockIcons.OVERLAY_PIPE_OUT)
+ };
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
index 9c6840e33c..bbc2206784 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java
@@ -1,8 +1,6 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
import gregtech.api.enums.ItemList;
-import gregtech.api.gui.GT_Container_BasicTank;
-import gregtech.api.gui.GT_GUIContainer_BasicTank;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.util.GT_Utility;
@@ -25,19 +23,35 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
/**
* @param aInvSlotCount should be 3
*/
- public GTPP_MTE_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ public GTPP_MTE_BasicTank(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ String aDescription,
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GTPP_MTE_BasicTank(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, ITexture... aTextures) {
+ public GTPP_MTE_BasicTank(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ String[] aDescription,
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
- public GTPP_MTE_BasicTank(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GTPP_MTE_BasicTank(
+ String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
-
- public GTPP_MTE_BasicTank(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+
+ public GTPP_MTE_BasicTank(
+ String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@@ -136,7 +150,8 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
if (ItemList.Display_Fluid.isStackEqual(mInventory[getStackDisplaySlot()], true, true))
mInventory[getStackDisplaySlot()] = null;
} else {
- mInventory[getStackDisplaySlot()] = GT_Utility.getFluidDisplayStack(getDisplayedFluid(), displaysStackSize());
+ mInventory[getStackDisplaySlot()] =
+ GT_Utility.getFluidDisplayStack(getDisplayedFluid(), displaysStackSize());
}
}
@@ -145,15 +160,22 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
if (tFluid != null && isFluidInputAllowed(tFluid)) {
if (getFillableStack() == null) {
if (isFluidInputAllowed(tFluid) && tFluid.amount <= getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot(),
+ GT_Utility.getContainerItem(mInventory[getInputSlot()], true),
+ 1)) {
setFillableStack(tFluid.copy());
this.onEmptyingContainerWhenEmpty();
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
}
} else {
- if (tFluid.isFluidEqual(getFillableStack()) && tFluid.amount + getFillableStack().amount <= getCapacity()) {
- if (aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), GT_Utility.getContainerItem(mInventory[getInputSlot()], true), 1)) {
+ if (tFluid.isFluidEqual(getFillableStack())
+ && tFluid.amount + getFillableStack().amount <= getCapacity()) {
+ if (aBaseMetaTileEntity.addStackToSlot(
+ getOutputSlot(),
+ GT_Utility.getContainerItem(mInventory[getInputSlot()], true),
+ 1)) {
getFillableStack().amount += tFluid.amount;
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
}
@@ -163,7 +185,8 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
}
if (doesFillContainers()) {
- ItemStack tOutput = GT_Utility.fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true);
+ ItemStack tOutput =
+ GT_Utility.fillFluidContainer(getDrainableStack(), mInventory[getInputSlot()], false, true);
if (tOutput != null && aBaseMetaTileEntity.addStackToSlot(getOutputSlot(), tOutput, 1)) {
FluidStack tFluid = GT_Utility.getFluidForFilledItem(tOutput, true);
aBaseMetaTileEntity.decrStackSize(getInputSlot(), 1);
@@ -186,8 +209,11 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
@Override
public int fill(FluidStack aFluid, boolean doFill) {
- if (aFluid == null || aFluid.getFluid().getID() <= 0 || aFluid.amount <= 0 || !canTankBeFilled() || !isFluidInputAllowed(aFluid))
- return 0;
+ if (aFluid == null
+ || aFluid.getFluid().getID() <= 0
+ || aFluid.amount <= 0
+ || !canTankBeFilled()
+ || !isFluidInputAllowed(aFluid)) return 0;
if (getFillableStack() == null || getFillableStack().getFluid().getID() <= 0) {
if (aFluid.amount <= getCapacity()) {
@@ -205,8 +231,7 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
return getCapacity();
}
- if (!getFillableStack().isFluidEqual(aFluid))
- return 0;
+ if (!getFillableStack().isFluidEqual(aFluid)) return 0;
int space = getCapacity() - getFillableStack().amount;
if (aFluid.amount <= space) {
@@ -216,8 +241,7 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
}
return aFluid.amount;
}
- if (doFill)
- getFillableStack().amount = getCapacity();
+ if (doFill) getFillableStack().amount = getCapacity();
return space;
}
@@ -231,8 +255,7 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
}
int used = maxDrain;
- if (getDrainableStack().amount < used)
- used = getDrainableStack().amount;
+ if (getDrainableStack().amount < used) used = getDrainableStack().amount;
if (doDrain) {
getDrainableStack().amount -= used;
@@ -259,8 +282,8 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
return aIndex == getInputSlot();
}
-
- protected void onEmptyingContainerWhenEmpty(){
- //Do nothing
+
+ protected void onEmptyingContainerWhenEmpty() {
+ // Do nothing
}
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java
index 8110037c46..e45588e126 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java
@@ -4,7 +4,6 @@ import static gregtech.api.enums.GT_Values.GT;
import gregtech.api.interfaces.ITexture;
import gtPlusPlus.api.objects.data.AutoMap;
-import gtPlusPlus.core.lib.CORE;
public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPower {
/**
@@ -25,17 +24,31 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo
*/
public final ITexture[][][] mTextures;
- public GTPP_MTE_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
+ public GTPP_MTE_TieredMachineBlock(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ String aDescription,
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, aInvSlotCount);
mTier = (byte) Math.max(0, Math.min(aTier, 9));
- mDescriptionArray = aDescription == null ? new String[0] : new String[]{aDescription};
+ mDescriptionArray = aDescription == null ? new String[0] : new String[] {aDescription};
mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : "";
// must always be the last call!
if (GT.isClientSide()) mTextures = getTextureSet(aTextures);
else mTextures = null;
}
- public GTPP_MTE_TieredMachineBlock(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String[] aDescription, ITexture... aTextures) {
+ public GTPP_MTE_TieredMachineBlock(
+ int aID,
+ String aName,
+ String aNameRegional,
+ int aTier,
+ int aInvSlotCount,
+ String[] aDescription,
+ ITexture... aTextures) {
super(aID, aName, aNameRegional, aInvSlotCount);
mTier = (byte) Math.max(0, Math.min(aTier, 9));
mDescriptionArray = aDescription == null ? new String[0] : aDescription;
@@ -46,15 +59,17 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo
else mTextures = null;
}
- public GTPP_MTE_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
+ public GTPP_MTE_TieredMachineBlock(
+ String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
mTier = (byte) aTier;
- mDescriptionArray = aDescription == null ? new String[0] : new String[]{aDescription};
+ mDescriptionArray = aDescription == null ? new String[0] : new String[] {aDescription};
mDescription = mDescriptionArray.length > 0 ? mDescriptionArray[0] : "";
mTextures = aTextures;
}
- public GTPP_MTE_TieredMachineBlock(String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
+ public GTPP_MTE_TieredMachineBlock(
+ String aName, int aTier, int aInvSlotCount, String[] aDescription, ITexture[][][] aTextures) {
super(aName, aInvSlotCount);
mTier = (byte) aTier;
mDescriptionArray = aDescription == null ? new String[0] : aDescription;
@@ -79,14 +94,14 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo
@Override
public String[] getDescription() {
- AutoMap<String> aTooltip = new AutoMap<String>();
- String []s1 = null;
- s1 = new String[aTooltip.size()];
- int u = 0;
- for (String s : aTooltip) {
- s1[u] = s;
- }
- return s1;
+ AutoMap<String> aTooltip = new AutoMap<String>();
+ String[] s1 = null;
+ s1 = new String[aTooltip.size()];
+ int u = 0;
+ for (String s : aTooltip) {
+ s1[u] = s;
+ }
+ return s1;
}
/**
@@ -96,4 +111,4 @@ public abstract class GTPP_MTE_TieredMachineBlock extends MetaTileEntityCustomPo
* @param aTextures is the optional Array you can give to the Constructor.
*/
public abstract ITexture[][][] getTextureSet(ITexture[] aTextures);
-} \ No newline at end of file
+}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java
index 31d24ff343..36185b638b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java
@@ -12,83 +12,79 @@ import net.minecraft.world.World;
public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase {
- public MetaTileEntityCustomPower(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
- super(aID, aBasicName, aRegionalName, aInvSlotCount);
- this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower());
- this.getBaseMetaTileEntity().setMetaTileID((short) aID);
- }
-
- public MetaTileEntityCustomPower(String aStack, int aInvSlotCount) {
- super(aStack, aInvSlotCount);
- }
-
- public long getMinimumStoredEU() {
- return 0L;
- }
-
- public boolean doesExplode() {
- return this.getBaseCustomMetaTileEntity().doesExplode();
- }
-
-
+ public MetaTileEntityCustomPower(int aID, String aBasicName, String aRegionalName, int aInvSlotCount) {
+ super(aID, aBasicName, aRegionalName, aInvSlotCount);
+ this.setBaseMetaTileEntity(Meta_GT_Proxy.constructBaseMetaTileEntityCustomPower());
+ this.getBaseMetaTileEntity().setMetaTileID((short) aID);
+ }
- public void doExplosion(long aExplosionPower) {
-
- if (!doesExplode()) {
- Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]");
- return;
- }
-
- float tStrength = aExplosionPower < GT_Values.V[0]
- ? 1.0F
- : (aExplosionPower < GT_Values.V[1]
- ? 2.0F
- : (aExplosionPower < GT_Values.V[2]
- ? 3.0F
- : (aExplosionPower < GT_Values.V[3]
- ? 4.0F
- : (aExplosionPower < GT_Values.V[4]
- ? 5.0F
- : (aExplosionPower < GT_Values.V[4] * 2L
- ? 6.0F
- : (aExplosionPower < GT_Values.V[5]
- ? 7.0F
- : (aExplosionPower < GT_Values.V[6]
- ? 8.0F
- : (aExplosionPower < GT_Values.V[7]
- ? 9.0F
- : 10.0F))))))));
- int tX = this.getBaseMetaTileEntity().getXCoord();
- short tY = this.getBaseMetaTileEntity().getYCoord();
- int tZ = this.getBaseMetaTileEntity().getZCoord();
- World tWorld = this.getBaseMetaTileEntity().getWorld();
- GT_Utility.sendSoundToPlayers(tWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(209)), 1.0F, -1.0F,
- tX, tY, tZ);
- tWorld.setBlock(tX, tY, tZ, Blocks.air);
- if (GregTech_API.sMachineExplosions) {
- tWorld.createExplosion((Entity) null, (double) tX + 0.5D, (double) tY + 0.5D, (double) tZ + 0.5D, tStrength,
- true);
- }
+ public MetaTileEntityCustomPower(String aStack, int aInvSlotCount) {
+ super(aStack, aInvSlotCount);
+ }
- }
+ public long getMinimumStoredEU() {
+ return 0L;
+ }
- @Override
- public void onExplosion() {
- if (!doesExplode()) {
- Logger.INFO("Machine tried to explode, let's stop that. xo [onExplosion]");
- return;
- }
- super.onExplosion();
- }
+ public boolean doesExplode() {
+ return this.getBaseCustomMetaTileEntity().doesExplode();
+ }
- @Override
- public boolean isElectric() {
- return true;
- }
+ public void doExplosion(long aExplosionPower) {
- @Override
- public long getEUVar() {
- return super.getEUVar();
- }
+ if (!doesExplode()) {
+ Logger.INFO("Machine tried to explode, let's stop that. xo [doExplosion]");
+ return;
+ }
+ float tStrength = aExplosionPower < GT_Values.V[0]
+ ? 1.0F
+ : (aExplosionPower < GT_Values.V[1]
+ ? 2.0F
+ : (aExplosionPower < GT_Values.V[2]
+ ? 3.0F
+ : (aExplosionPower < GT_Values.V[3]
+ ? 4.0F
+ : (aExplosionPower < GT_Values.V[4]
+ ? 5.0F
+ : (aExplosionPower < GT_Values.V[4] * 2L
+ ? 6.0F
+ : (aExplosionPower < GT_Values.V[5]
+ ? 7.0F
+ : (aExplosionPower < GT_Values.V[6]
+ ? 8.0F
+ : (aExplosionPower < GT_Values.V[7]
+ ? 9.0F
+ : 10.0F))))))));
+ int tX = this.getBaseMetaTileEntity().getXCoord();
+ short tY = this.getBaseMetaTileEntity().getYCoord();
+ int tZ = this.getBaseMetaTileEntity().getZCoord();
+ World tWorld = this.getBaseMetaTileEntity().getWorld();
+ GT_Utility.sendSoundToPlayers(
+ tWorld, (String) GregTech_API.sSoundList.get(Integer.valueOf(209)), 1.0F, -1.0F, tX, tY, tZ);
+ tWorld.setBlock(tX, tY, tZ, Blocks.air);
+ if (GregTech_API.sMachineExplosions) {
+ tWorld.createExplosion(
+ (Entity) null, (double) tX + 0.5D, (double) tY + 0.5D, (double) tZ + 0.5D, tStrength, true);
+ }
+ }
+
+ @Override
+ public void onExplosion() {
+ if (!doesExplode()) {
+ Logger.INFO("Machine tried to explode, let's stop that. xo [onExplosion]");
+ return;
+ }
+ super.onExplosion();
+ }
+
+ @Override
+ public boolean isElectric() {
+ return true;
+ }
+
+ @Override
+ public long getEUVar() {
+ return super.getEUVar();
+ }
}