aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2023-05-01 02:45:56 -0700
committerGitHub <noreply@github.com>2023-05-01 11:45:56 +0200
commitb2c8cfb4ec8b82337a95f51364277964ec968b52 (patch)
treed4cf94acc93249cd649b33ec13c5b0d75f1f75db /src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom
parentd2eda84e457d549ad9a51f40e9dd159147a141f8 (diff)
downloadGT5-Unofficial-b2c8cfb4ec8b82337a95f51364277964ec968b52.tar.gz
GT5-Unofficial-b2c8cfb4ec8b82337a95f51364277964ec968b52.tar.bz2
GT5-Unofficial-b2c8cfb4ec8b82337a95f51364277964ec968b52.zip
ForgeDirection (#608)
* ForgeDirection WIP * Fix GTPP_Render_MachineBlock Fix handling of getTexture with facing mask for pipes Kill a bunch of magic numbers * spotlessApply (#612) Co-authored-by: GitHub GTNH Actions <> * Bump bw/tt deps --------- Co-authored-by: Léa Gris <lea.gris@noiraude.net> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java50
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java103
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java7
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/MetaTileEntityCustomPower.java2
5 files changed, 106 insertions, 77 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 ba67ba6466..079a9946d1 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
@@ -14,26 +14,27 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity {
Logger.INFO("Created new BaseCustomPower_MTE");
}
+ @Override
public boolean doesExplode() {
return false;
}
- public long injectEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ public long injectEnergyUnits(ForgeDirection side, long aVoltage, long aAmperage) {
if (mMetaTileEntity == null) {
Logger.INFO("Bad Tile");
}
if (this.canAccessData() && this.mMetaTileEntity.isElectric()
- && this.inputEnergyFrom(aSide)
+ && this.inputEnergyFrom(side)
&& aAmperage > 0L
&& aVoltage > 0L
&& this.getStoredEU() < this.getEUCapacity()
&& this.mMetaTileEntity.maxAmperesIn() >= this.getInputAmperage()) {
Logger.INFO("Injecting Energy Units");
- return super.injectEnergyUnits(aSide, aVoltage, aAmperage);
+ return super.injectEnergyUnits(side, aVoltage, aAmperage);
} else {
Logger.INFO("canAccessData(): " + canAccessData());
Logger.INFO("isElectric(): " + this.mMetaTileEntity.isElectric());
- Logger.INFO("InputEnergyFromSide(" + aSide + "): " + this.inputEnergyFrom(aSide));
+ Logger.INFO("InputEnergyFromSide(" + side + "): " + this.inputEnergyFrom(side));
Logger.INFO("aAmperage: " + aAmperage);
Logger.INFO("aVoltage: " + aVoltage);
Logger.INFO("this.getStoredEU() < this.getEUCapacity(): " + (this.getStoredEU() < this.getEUCapacity()));
@@ -46,10 +47,10 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity {
}
}
- public boolean drainEnergyUnits(byte aSide, long aVoltage, long aAmperage) {
+ public boolean drainEnergyUnits(ForgeDirection side, long aVoltage, long aAmperage) {
Logger.INFO("Draining Energy Units 4");
if (this.canAccessData() && this.mMetaTileEntity.isElectric()
- && this.outputsEnergyTo(aSide)
+ && this.outputsEnergyTo(side)
&& this.getStoredEU() - aVoltage * aAmperage >= this.mMetaTileEntity.getMinimumStoredEU()) {
if (this.decreaseStoredEU(aVoltage * aAmperage, false)) {
this.mAverageEUOutput[this.mAverageEUOutputIndex] = (int) ((long) this.mAverageEUOutput[this.mAverageEUOutputIndex]
@@ -77,16 +78,16 @@ public class BaseCustomPower_MTE extends BaseCustomTileEntity {
}
@Override
- public boolean inputEnergyFrom(byte aSide) {
+ public boolean inputEnergyFrom(ForgeDirection side) {
// TODO Auto-generated method stub
- return super.inputEnergyFrom(aSide);
+ return super.inputEnergyFrom(side);
}
@Override
- public boolean outputsEnergyTo(byte aSide) {
+ public boolean outputsEnergyTo(ForgeDirection side) {
Logger.INFO("Draining Energy Units 2");
// TODO Auto-generated method stub
- return super.outputsEnergyTo(aSide);
+ return super.outputsEnergyTo(side);
}
@Override
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 0060cba12c..25a1cc3cca 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,11 +1,11 @@
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.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.GT_Values;
@@ -39,6 +39,7 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
super(aName, aTier, 3, aDescription, aTextures);
}
+ @Override
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[10][17][];
@@ -58,13 +59,17 @@ 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];
+ @Override
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
+ int aColorIndex, boolean aActive, boolean aRedstone) {
+ return this.mTextures[(aActive ? 5 : 0)
+ + (side == facing ? 0
+ : (side == facing.getOpposite() ? 1
+ : (side == ForgeDirection.DOWN ? 2 : (side == ForgeDirection.UP ? 3 : 4))))][aColorIndex
+ + 1];
}
+ @Override
public String[] getDescription() {
String[] desc = new String[this.mDescriptionArray.length + 1];
System.arraycopy(this.mDescriptionArray, 0, desc, 0, this.mDescriptionArray.length);
@@ -72,6 +77,7 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
return desc;
}
+ @Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
Logger.WARNING("Right Clicked");
GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
@@ -118,68 +124,82 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
return this.getSides(aColor);
}
- public boolean isFacingValid(byte aSide) {
- return aSide > 1;
+ public boolean isFacingValid(ForgeDirection side) {
+ return side.offsetY == 0;
}
+ @Override
public boolean isSimpleMachine() {
return false;
}
+ @Override
public boolean isValidSlot(int aIndex) {
return aIndex < 2;
}
+ @Override
public boolean isEnetOutput() {
return true;
}
- public boolean isOutputFacing(byte aSide) {
+ public boolean isOutputFacing(ForgeDirection side) {
return true;
}
+ @Override
public boolean isAccessAllowed(EntityPlayer aPlayer) {
return true;
}
+ @Override
public long maxEUOutput() {
return this.getBaseMetaTileEntity().isAllowedToWork() ? GT_Values.V[this.mTier] : 0L;
}
+ @Override
public long maxEUStore() {
return Math.max(this.getEUVar(), GT_Values.V[this.mTier] * 40L + this.getMinimumStoredEU());
}
+ @Override
public boolean doesFillContainers() {
return this.getBaseMetaTileEntity().isAllowedToWork();
}
+ @Override
public boolean doesEmptyContainers() {
return this.getBaseMetaTileEntity().isAllowedToWork();
}
+ @Override
public boolean canTankBeFilled() {
return this.getBaseMetaTileEntity().isAllowedToWork();
}
+ @Override
public boolean canTankBeEmptied() {
return this.getBaseMetaTileEntity().isAllowedToWork();
}
+ @Override
public boolean displaysItemStack() {
return true;
}
+ @Override
public boolean displaysStackSize() {
return false;
}
+ @Override
public boolean isFluidInputAllowed(FluidStack aFluid) {
int aVal = this.getFuelValue(aFluid);
Logger.WARNING("Fuel Value: " + aVal);
return aVal > 0;
}
+ @Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
if (aBaseMetaTileEntity.isServerSide() && aBaseMetaTileEntity.isAllowedToWork() && aTick % 10L == 0L) {
int tFuelValue;
@@ -250,10 +270,8 @@ public abstract class GTPP_MTE_BasicLosslessGenerator extends GTPP_MTE_BasicTank
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();
+ for (GT_Recipe tFuel : tRecipeList) {
FluidStack tLiquid;
if ((tLiquid = GT_Utility.getFluidForFilledItem(tFuel.getRepresentativeInput(0), true)) != null
&& aLiquid.isFluidEqual(tLiquid)) {
@@ -307,15 +325,19 @@ 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
+ @Override
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
+ ItemStack aStack) {
+ return super.allowPutStack(aBaseMetaTileEntity, aIndex, side, aStack) && (this.getFuelValue(aStack) > 0
|| this.getFuelValue(GT_Utility.getFluidForFilledItem(aStack, true)) > 0);
}
+ @Override
public int getCapacity() {
return 16000;
}
+ @Override
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 6a3856aba3..4bb30d102c 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
@@ -46,7 +46,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
public final int mInputSlotCount, mAmperage;
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 int mProgresstime = 0, mMaxProgresstime = 0, mEUt = 0, mOutputBlocked = 0;
+ public ForgeDirection mMainFacing = ForgeDirection.UNKNOWN;
public FluidStack mOutputFluid;
public String mGUIName = "", mNEIName = "";
public GT_MetaTileEntity_MultiBlockBase mCleanroom;
@@ -122,15 +123,15 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
mNEIName = aNEIName;
}
- protected boolean isValidMainFacing(byte aSide) {
- return aSide > 1;
+ protected boolean isValidMainFacing(ForgeDirection side) {
+ return side.offsetY == 0;
}
- public boolean setMainFacing(byte aSide) {
- if (!isValidMainFacing(aSide)) return false;
- mMainFacing = aSide;
+ public boolean setMainFacing(ForgeDirection side) {
+ if (!isValidMainFacing(side)) return false;
+ mMainFacing = side;
if (getBaseMetaTileEntity().getFrontFacing() == mMainFacing) {
- getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide));
+ getBaseMetaTileEntity().setFrontFacing(side.getOpposite());
}
onFacingChange();
onMachineBlockUpdate();
@@ -167,16 +168,19 @@ 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, ForgeDirection side, ForgeDirection facing,
+ int aColorIndex, boolean aActive, boolean aRedstone) {
+ return mTextures[mMainFacing.offsetY != 0
+ ? side == facing ? aActive ? 2 : 3
+ : side == ForgeDirection.DOWN ? aActive ? 6 : 7
+ : side == ForgeDirection.UP ? aActive ? 4 : 5 : aActive ? 0 : 1
+ : side == mMainFacing ? aActive ? 2 : 3
+ : (showPipeFacing() && side == facing)
+ ? side == ForgeDirection.DOWN ? aActive ? 8 : 9
+ : side == ForgeDirection.UP ? aActive ? 10 : 11 : aActive ? 12 : 13
+ : side == ForgeDirection.DOWN ? aActive ? 6 : 7
+ : side == ForgeDirection.UP ? aActive ? 4 : 5 : aActive ? 0 : 1][aColorIndex
+ + 1];
}
@Override
@@ -206,8 +210,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
@Override
- public boolean isFacingValid(byte aFacing) {
- return mMainFacing > 1 || aFacing > 1;
+ public boolean isFacingValid(ForgeDirection facing) {
+ return mMainFacing.offsetY == 0 || facing.offsetY == 0;
}
@Override
@@ -216,12 +220,12 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
@Override
- public boolean isInputFacing(byte aSide) {
- return aSide != mMainFacing;
+ public boolean isInputFacing(ForgeDirection side) {
+ return side != mMainFacing;
}
@Override
- public boolean isOutputFacing(byte aSide) {
+ public boolean isOutputFacing(ForgeDirection side) {
return false;
}
@@ -231,13 +235,13 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
@Override
- public boolean isLiquidInput(byte aSide) {
- return aSide != mMainFacing && (mAllowInputFromOutputSide || aSide != getBaseMetaTileEntity().getFrontFacing());
+ public boolean isLiquidInput(ForgeDirection side) {
+ return side != mMainFacing && (mAllowInputFromOutputSide || side != getBaseMetaTileEntity().getFrontFacing());
}
@Override
- public boolean isLiquidOutput(byte aSide) {
- return aSide != mMainFacing;
+ public boolean isLiquidOutput(ForgeDirection side) {
+ return side != mMainFacing;
}
@Override
@@ -385,7 +389,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public void initDefaultModes(NBTTagCompound aNBT) {
- mMainFacing = -1;
+ mMainFacing = ForgeDirection.UNKNOWN;
}
@Override
@@ -396,7 +400,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
aNBT.setBoolean("mHasBeenUpdated", mHasBeenUpdated);
aNBT.setBoolean("mAllowInputFromOutputSide", mAllowInputFromOutputSide);
aNBT.setInteger("mEUt", mEUt);
- aNBT.setInteger("mMainFacing", mMainFacing);
+ aNBT.setInteger("mMainFacing", mMainFacing.ordinal());
aNBT.setInteger("mProgresstime", mProgresstime);
aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
if (mOutputFluid != null) aNBT.setTag("mOutputFluid", mOutputFluid.writeToNBT(new NBTTagCompound()));
@@ -414,7 +418,7 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
mHasBeenUpdated = aNBT.getBoolean("mHasBeenUpdated");
mAllowInputFromOutputSide = aNBT.getBoolean("mAllowInputFromOutputSide");
mEUt = aNBT.getInteger("mEUt");
- mMainFacing = aNBT.getInteger("mMainFacing");
+ mMainFacing = ForgeDirection.getOrientation(aNBT.getInteger("mMainFacing"));
mProgresstime = aNBT.getInteger("mProgresstime");
mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
mOutputFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid"));
@@ -477,14 +481,9 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
if (tTank != null) {
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);
+ int tFilledAmount = tTank.fill(aBaseMetaTileEntity.getBackFacing(), tDrained, false);
+ if (tFilledAmount > 0)
+ tTank.fill(aBaseMetaTileEntity.getBackFacing(), drain(tFilledAmount, true), true);
}
}
if (getDrainableStack() == null) tRemovedOutputFluid = true;
@@ -555,10 +554,10 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
protected void doDisplayThings() {
- if (mMainFacing < 2 && getBaseMetaTileEntity().getFrontFacing() > 1) {
+ if (mMainFacing.offsetY != 0 && getBaseMetaTileEntity().getFrontFacing().offsetY == 0) {
mMainFacing = getBaseMetaTileEntity().getFrontFacing();
}
- if (mMainFacing >= 2 && !mHasBeenUpdated) {
+ if (mMainFacing.offsetY == 0 && !mHasBeenUpdated) {
mHasBeenUpdated = true;
getBaseMetaTileEntity().setFrontFacing(getBaseMetaTileEntity().getBackFacing());
}
@@ -665,12 +664,12 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
@Override
public void onValueUpdate(byte aValue) {
- mMainFacing = aValue;
+ mMainFacing = ForgeDirection.getOrientation(aValue);
}
@Override
public byte getUpdateData() {
- return (byte) mMainFacing;
+ return (byte) mMainFacing.ordinal();
}
@Override
@@ -747,8 +746,8 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
@Override
- public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ) {
- if (aSide == getBaseMetaTileEntity().getFrontFacing() || aSide == mMainFacing) {
+ public void onScrewdriverRightClick(ForgeDirection side, EntityPlayer aPlayer, float aX, float aY, float aZ) {
+ if (side == getBaseMetaTileEntity().getFrontFacing() || side == mMainFacing) {
mAllowInputFromOutputSide = !mAllowInputFromOutputSide;
GT_Utility.sendChatToPlayer(
aPlayer,
@@ -757,21 +756,23 @@ public abstract class GTPP_MTE_BasicMachine extends GTPP_MTE_BasicTank {
}
@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()));
+ public boolean allowCoverOnSide(ForgeDirection side, GT_ItemStack aCoverID) {
+ return (side != mMainFacing || GregTech_API.getCoverBehavior(aCoverID.toStack())
+ .isGUIClickable(side, GT_Utility.stackToInt(aCoverID.toStack()), 0, getBaseMetaTileEntity()));
}
@Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- return aSide != mMainFacing && aIndex >= getOutputSlot() && aIndex < getOutputSlot() + mOutputItems.length;
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
+ ItemStack aStack) {
+ return side != mMainFacing && aIndex >= getOutputSlot() && aIndex < getOutputSlot() + mOutputItems.length;
}
@Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
- if (aSide == mMainFacing || aIndex < getInputSlot()
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
+ ItemStack aStack) {
+ if (side == mMainFacing || aIndex < getInputSlot()
|| aIndex >= getInputSlot() + mInputSlotCount
- || (!mAllowInputFromOutputSide && aSide == aBaseMetaTileEntity.getFrontFacing()))
+ || (!mAllowInputFromOutputSide && side == 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;
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 679b007111..42f775fd29 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
@@ -2,6 +2,7 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.FluidStack;
import gregtech.api.enums.ItemList;
@@ -250,12 +251,14 @@ public abstract class GTPP_MTE_BasicTank extends GTPP_MTE_TieredMachineBlock {
}
@Override
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
+ ItemStack aStack) {
return aIndex == getOutputSlot();
}
@Override
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
+ ItemStack aStack) {
return aIndex == getInputSlot();
}
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 e2b5d1eafc..cc5f1eff85 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
@@ -23,6 +23,7 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase {
super(aStack, aInvSlotCount);
}
+ @Override
public long getMinimumStoredEU() {
return 0L;
}
@@ -31,6 +32,7 @@ public abstract class MetaTileEntityCustomPower extends CustomMetaTileBase {
return this.getBaseCustomMetaTileEntity().doesExplode();
}
+ @Override
public void doExplosion(long aExplosionPower) {
if (!doesExplode()) {