aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2023-01-28 19:32:44 -0800
committerJason Mitchell <mitchej@gmail.com>2023-01-28 19:32:44 -0800
commit55f64675b42ac8d3c557cc850f78664bee006f6f (patch)
tree2afd26dd3d5e6f763119bc192b57c66a1a075922 /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom
parent0f5dfd01b877b6a1019e0671b88d07974aae68c0 (diff)
downloadGT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.tar.gz
GT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.tar.bz2
GT5-Unofficial-55f64675b42ac8d3c557cc850f78664bee006f6f.zip
[ci skip] spotlessApply with the new settings
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.java20
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java104
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java329
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java49
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_TieredMachineBlock.java37
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java54
6 files changed, 237 insertions, 356 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 b3d8b8aa8c..ba67ba6466 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
@@ -1,10 +1,11 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.util.ForgeDirection;
+
import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.xmod.gregtech.api.metatileentity.BaseCustomTileEntity;
import ic2.api.Direction;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.util.ForgeDirection;
public class BaseCustomPower_MTE extends BaseCustomTileEntity {
@@ -21,8 +22,7 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity {
if (mMetaTileEntity == null) {
Logger.INFO("Bad Tile");
}
- if (this.canAccessData()
- && this.mMetaTileEntity.isElectric()
+ if (this.canAccessData() && this.mMetaTileEntity.isElectric()
&& this.inputEnergyFrom(aSide)
&& aAmperage > 0L
&& aVoltage > 0L
@@ -37,8 +37,9 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity {
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.mAcceptedAmperes: "
+ + (this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()));
Logger.INFO("this.mMetaTileEntity.maxAmperesIn(): " + (this.mMetaTileEntity.maxAmperesIn()));
Logger.INFO("this.mAcceptedAmperes: " + (this.getInputAmperage()));
return 0L;
@@ -47,13 +48,12 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity {
public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
Logger.INFO("Draining Energy Units 4");
- if (this.canAccessData()
- && this.mMetaTileEntity.isElectric()
+ 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);
+ this.mAverageEUOutput[this.mAverageEUOutputIndex] = (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex]
+ + aVoltage * aAmperage);
return true;
} else {
return false;
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 841359c0b2..0060cba12c 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
@@ -1,5 +1,13 @@
package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
+import java.util.Collection;
+import java.util.Iterator;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.fluids.FluidStack;
+
import gregtech.api.enums.GT_Values;
import gregtech.api.enums.Textures.BlockIcons;
import gregtech.api.gui.modularui.GT_UIInfos;
@@ -10,21 +18,16 @@ 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 java.util.Collection;
-import java.util.Iterator;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
-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) {
+
+ 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) {
+ public GTPP_MTE_BasicLosslessGenerator(int aID, String aName, String aNameRegional, int aTier,
+ String[] aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, 3, aDescription, aTextures);
}
@@ -55,21 +58,11 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
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 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() {
@@ -86,23 +79,23 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
}
public ITexture[] getFront(byte aColor) {
- return new ITexture[] {BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1]};
+ 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]};
+ 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]};
+ 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]};
+ 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]};
+ return new ITexture[] { BlockIcons.MACHINE_CASINGS[this.mTier][aColor + 1] };
}
public ITexture[] getFrontActive(byte aColor) {
@@ -198,8 +191,10 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
this.mInventory[this.getStackDisplaySlot()] = new ItemStack(Blocks.fire, 1);
}
- this.mInventory[this.getStackDisplaySlot()].setStackDisplayName("Generating: "
- + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU()) + " EU");
+ this.mInventory[this.getStackDisplaySlot()].setStackDisplayName(
+ "Generating: "
+ + (aBaseMetaTileEntity.getUniversalEnergyStored() - this.getMinimumStoredEU())
+ + " EU");
}
} else {
tFuelValue = this.getFuelValue(this.mFluid);
@@ -208,9 +203,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
long tFluidAmountToUse = Math.min(
(long) (this.mFluid.amount / tConsumed),
(this.maxEUStore() - aBaseMetaTileEntity.getUniversalEnergyStored()) / (long) tFuelValue);
- if (tFluidAmountToUse > 0L
- && aBaseMetaTileEntity.increaseStoredEnergyUnits(
- tFluidAmountToUse * (long) tFuelValue, true)) {
+ 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);
}
@@ -235,8 +229,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
if (aBaseMetaTileEntity.isServerSide()) {
Logger.WARNING("Ticking Servside");
- aBaseMetaTileEntity.setActive(aBaseMetaTileEntity.isAllowedToWork()
- && aBaseMetaTileEntity.getUniversalEnergyStored()
+ aBaseMetaTileEntity.setActive(
+ aBaseMetaTileEntity.isAllowedToWork() && aBaseMetaTileEntity.getUniversalEnergyStored()
>= this.maxEUOutput() + this.getMinimumStoredEU());
}
}
@@ -264,15 +258,13 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
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()
+ 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()
+ return (int) ((long) tFuel.mSpecialValue * (long) this.getEfficiency()
* (long) this.consumedFluidPerOperation(tLiquid)
/ 100L);
}
@@ -288,11 +280,12 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
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
- });
+ 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;
@@ -301,13 +294,13 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
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_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;
@@ -315,9 +308,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
}
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);
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, aSide, aStack) && (this.getFuelValue(aStack) > 0
+ || this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
}
public int getCapacity() {
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 cb3f42b6f6..2721dc437e 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
@@ -2,6 +2,17 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
import static gregtech.api.enums.GT_Values.V;
+import java.util.Arrays;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.common.DimensionManager;
+import net.minecraftforge.common.util.ForgeDirection;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.IFluidHandler;
+
import gregtech.api.GregTech_API;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
@@ -16,79 +27,48 @@ 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.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraftforge.common.DimensionManager;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidHandler;
/**
* NEVER INCLUDE THIS FILE IN YOUR MOD!!!
* <p/>
- * This is the main construct for my Basic Machines such as the Automatic Extractor
- * Extend this class to make a simple Machine
+ * This is the main construct for my Basic Machines such as the Automatic Extractor Extend this class to make a simple
+ * Machine
*/
public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
+
/**
* return values for checkRecipe()
*/
- protected static final int DID_NOT_FIND_RECIPE = 0,
- FOUND_RECIPE_BUT_DID_NOT_MEET_REQUIREMENTS = 1,
+ 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 = "";
public GT_MetaTileEntity_MultiBlockBase mCleanroom;
/**
- * Contains the Recipe which has been previously used, or null if there was no previous Recipe, which could have been buffered
+ * 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;
/**
- * @param aOverlays 0 = SideFacingActive
- * 1 = SideFacingInactive
- * 2 = FrontFacingActive
- * 3 = FrontFacingInactive
- * 4 = TopFacingActive
- * 5 = TopFacingInactive
- * 6 = BottomFacingActive
- * 7 = BottomFacingInactive
- * ----- Not all Array Elements have to be initialised, you can also just use 8 Parameters for the Default Pipe Texture Overlays -----
- * 8 = BottomFacingPipeActive
- * 9 = BottomFacingPipeInactive
- * 10 = TopFacingPipeActive
- * 11 = TopFacingPipeInactive
- * 12 = SideFacingPipeActive
- * 13 = SideFacingPipeInactive
+ * @param aOverlays 0 = SideFacingActive 1 = SideFacingInactive 2 = FrontFacingActive 3 = FrontFacingInactive 4 =
+ * TopFacingActive 5 = TopFacingInactive 6 = BottomFacingActive 7 = BottomFacingInactive ----- Not
+ * all Array Elements have to be initialised, you can also just use 8 Parameters for the Default
+ * Pipe Texture Overlays ----- 8 = BottomFacingPipeActive 9 = BottomFacingPipeInactive 10 =
+ * TopFacingPipeActive 11 = TopFacingPipeInactive 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,
+ 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,
@@ -105,17 +85,8 @@ 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,
+ 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,
@@ -132,16 +103,8 @@ 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)];
@@ -150,16 +113,8 @@ 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)];
@@ -188,13 +143,10 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
ITexture[][][] rTextures = new ITexture[14][17][];
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]};
- }
+ 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] };
+ }
for (byte c = -1; c < 16; c++) {
if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c);
@@ -216,28 +168,16 @@ 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
@@ -262,8 +202,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean isValidSlot(int aIndex) {
- return aIndex > 0
- && super.isValidSlot(aIndex)
+ return aIndex > 0 && super.isValidSlot(aIndex)
&& aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
}
@@ -294,9 +233,7 @@ 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
@@ -387,8 +324,7 @@ 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
@@ -467,9 +403,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
if (mOutputFluid != null) aNBT.setTag("mOutputFluid", mOutputFluid.writeToNBT(new NBTTagCompound()));
if (mFluidOut != null) aNBT.setTag("mFluidOut", mFluidOut.writeToNBT(new NBTTagCompound()));
- for (int i = 0; i < mOutputItems.length; i++)
- if (mOutputItems[i] != null)
- aNBT.setTag("mOutputItem" + i, mOutputItems[i].writeToNBT(new NBTTagCompound()));
+ for (int i = 0; i < mOutputItems.length; i++) if (mOutputItems[i] != null)
+ aNBT.setTag("mOutputItem" + i, mOutputItems[i].writeToNBT(new NBTTagCompound()));
}
@Override
@@ -506,9 +441,9 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
if (mProgresstime < 0 || drainEnergyForProcess(mEUt)) {
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;
+ for (int j = 0; j < mOutputItems.length; j++) 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()))
@@ -542,8 +477,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
boolean tRemovedOutputFluid = false;
- if (doesAutoOutputFluids()
- && getDrainableStack() != null
+ if (doesAutoOutputFluids() && getDrainableStack() != null
&& aBaseMetaTileEntity.getFrontFacing() != mMainFacing
&& (tSucceeded || aTick % 20 == 0)) {
IFluidHandler tTank = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
@@ -551,28 +485,26 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
FluidStack tDrained = drain(1000, false);
if (tDrained != null) {
int tFilledAmount = tTank.fill(
- ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tDrained, false);
- if (tFilledAmount > 0)
- tTank.fill(
- ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
- drain(tFilledAmount, true),
- true);
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ tDrained,
+ false);
+ if (tFilledAmount > 0) tTank.fill(
+ ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()),
+ drain(tFilledAmount, true),
+ true);
}
}
if (getDrainableStack() == null) tRemovedOutputFluid = true;
}
- if (doesAutoOutput()
- && !isOutputEmpty()
+ if (doesAutoOutput() && !isOutputEmpty()
&& aBaseMetaTileEntity.getFrontFacing() != mMainFacing
- && (tSucceeded
- || mOutputBlocked % 300 == 1
+ && (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++) {
+ for (int i = 0, tCosts = 1; i < mOutputItems.length && tCosts > 0
+ && aBaseMetaTileEntity.isUniversalEnergyStored(128); i++) {
tCosts = GT_Utility.moveOneItemStack(
aBaseMetaTileEntity,
tTileEntity2,
@@ -588,15 +520,12 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
}
- 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
+ if (mMaxProgresstime <= 0 && aBaseMetaTileEntity.isAllowedToWork()
+ && (tRemovedOutputFluid || tSucceeded
|| aBaseMetaTileEntity.hasInventoryBeenModified()
|| aTick % 600 == 0
|| aBaseMetaTileEntity.hasWorkJustBeenEnabled())
@@ -647,8 +576,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());
}
}
}
@@ -694,32 +623,27 @@ 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
+ 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;
- }
+ mOutputBlocked++;
+ return false;
+ }
return true;
}
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) {
@@ -819,15 +743,9 @@ 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
@@ -847,9 +765,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public boolean allowCoverOnSid