aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations
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/implementations
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/implementations')
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java53
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java10
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java97
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java9
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_AirIntake_Extreme.java1
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ControlCore.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DynamoBuffer.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_ElementalDataOrbHolder.java22
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Energy_RTG.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_FluidGenerator.java21
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_InputBattery.java17
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Muffler_Adv.java14
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Naquadah.java20
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_OutputBattery.java17
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Plasma.java20
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Reservoir.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusInput.java14
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Steam_BusOutput.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_Turbine.java35
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_TurbineProvider.java11
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Input.java1
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_SuperBus_Output.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntityFluid.java19
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GregtechMetaPipeEntity_Cable.java13
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/CustomMetaTileBase.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java17
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaPipeEntityBase_Cable.java214
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMetaTransformerHiAmp.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_MultiBlockBase.java35
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GregtechMeta_SteamMultiBase.java8
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java25
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaBoilerBase.java41
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechMetaSolarGenerator.java22
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechRocketFuelGeneratorBase.java27
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaSafeBlockBase.java84
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/machines/GregtechMetaTreeFarmerBase.java32
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_Catalysts.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_MillingBalls.java3
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/nbthandlers/GT_MetaTileEntity_Hatch_NbtConsumable.java9
40 files changed, 540 insertions, 425 deletions
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java
index efaae574c1..3d78c7e6a6 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicBreaker.java
@@ -4,6 +4,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
+import net.minecraftforge.common.util.ForgeDirection;
import com.gtnewhorizons.modularui.api.screen.ModularWindow;
import com.gtnewhorizons.modularui.api.screen.UIBuildContext;
@@ -47,6 +48,7 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock
super(aName, aTier, aSlotCount, aDescription, aTextures);
}
+ @Override
public String[] getDescription() {
final String[] desc = new String[6];
int tTier = this.mTier;
@@ -71,6 +73,7 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock
return desc;
}
+ @Override
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[2][17][];
@@ -87,11 +90,12 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock
return rTextures;
}
- public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex,
- boolean aActive, boolean aRedstone) {
- return this.mTextures[aSide == aFacing ? 1 : 0][aColorIndex + 1];
+ public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, ForgeDirection side, ForgeDirection facing,
+ int aColorIndex, boolean aActive, boolean aRedstone) {
+ return this.mTextures[side == facing ? 1 : 0][aColorIndex + 1];
}
+ @Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_BasicBreaker(
this.mName,
@@ -101,103 +105,126 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock
this.mInventory.length);
}
+ @Override
public boolean isSimpleMachine() {
return false;
}
+ @Override
public boolean isElectric() {
return true;
}
+ @Override
public boolean isValidSlot(int aIndex) {
return true;
}
- public boolean isFacingValid(byte aFacing) {
+ public boolean isFacingValid(ForgeDirection facing) {
return true;
}
+ @Override
public boolean isEnetInput() {
return true;
}
+ @Override
public boolean isEnetOutput() {
return true;
}
- public boolean isInputFacing(byte aSide) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ public boolean isInputFacing(ForgeDirection side) {
+ return side != this.getBaseMetaTileEntity().getFrontFacing();
}
- public boolean isOutputFacing(byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getFrontFacing();
+ public boolean isOutputFacing(ForgeDirection side) {
+ return side == this.getBaseMetaTileEntity().getFrontFacing();
}
+ @Override
public boolean isTeleporterCompatible() {
return false;
}
+ @Override
public long getMinimumStoredEU() {
return GT_Values.V[this.mTier] * 16L * 16;
}
+ @Override
public long maxEUStore() {
return GT_Values.V[this.mTier] * 64L * 16;
}
+ @Override
public long maxEUInput() {
return GT_Values.V[this.mTier] * 16;
}
+ @Override
public long maxEUOutput() {
return GT_Values.V[this.mTier];
}
+ @Override
public long maxAmperesIn() {
return 16;
}
+ @Override
public long maxAmperesOut() {
return 16;
}
+ @Override
public int rechargerSlotStartIndex() {
return 0;
}
+ @Override
public int dechargerSlotStartIndex() {
return 0;
}
+ @Override
public int rechargerSlotCount() {
return 0;
}
+ @Override
public int dechargerSlotCount() {
return 0;
}
+ @Override
public int getProgresstime() {
return (int) this.getBaseMetaTileEntity().getUniversalEnergyStored();
}
+ @Override
public int maxProgresstime() {
return (int) this.getBaseMetaTileEntity().getUniversalEnergyCapacity();
}
+ @Override
public boolean isAccessAllowed(EntityPlayer aPlayer) {
return true;
}
+ @Override
public void saveNBTData(NBTTagCompound aNBT) {}
+ @Override
public void loadNBTData(NBTTagCompound aNBT) {}
+ @Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
return true;
}
+ @Override
public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
super.onPostTick(aBaseMetaTileEntity, aTick);
if (aBaseMetaTileEntity.isServerSide()) {
@@ -212,14 +239,17 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock
}
}
- public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
+ ItemStack aStack) {
return false;
}
- public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {
+ public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, ForgeDirection side,
+ ItemStack aStack) {
return true;
}
+ @Override
public int getInventoryStackLimit() {
return 1;
}
@@ -271,14 +301,17 @@ public class GT_MetaTileEntity_BasicBreaker extends GTPP_MTE_TieredMachineBlock
return new long[] { tStored, tScale };
}
+ @Override
public String[] getInfoData() {
return new String[] { "Tile Type: " + this.getTileEntityBaseType() };
}
+ @Override
public boolean isGivingInformation() {
return true;
}
+ @Override
public boolean doesExplode() {
return true;
}
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java
index c376abf4ed..d87c53e3b0 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Dehydrator.java
@@ -3,6 +3,8 @@ package gtPlusPlus.xmod.gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.Textures.BlockIcons.MACHINE_CASINGS;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
+import net.minecraftforge.common.util.ForgeDirection;
+
import gregtech.api.enums.SoundResource;
import gregtech.api.enums.Textures;
import gregtech.api.enums.Textures.BlockIcons.CustomIcon;
@@ -86,11 +88,9 @@ public class GT_MetaTileEntity_Dehydrator extends GT_MetaTileEntity_BasicMachine
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return super.getTexture(aBaseMetaTileEntity, aSide, aFacing, aColorIndex, aActive, 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(final IGregTechTileEntity aBaseMetaTileEntity, final ForgeDirection side,
+ final ForgeDirection facing, final int aColorIndex, final boolean aActive, final boolean aRedstone) {
+ return super.getTexture(aBaseMetaTileEntity, side, facing, aColorIndex, aActive, aRedstone);
}
@Override
diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java
index 8b39d1da32..c6d5c4ba5b 100644
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java
+++ b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java
@@ -47,7 +47,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
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 = "";
/**
@@ -94,10 +95,10 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
mNEIName = aNEIName;
}
- public boolean setMainFacing(byte aDirection) {
- mMainFacing = aDirection;
+ public boolean setMainFacing(ForgeDirection direction) {
+ mMainFacing = direction;
if (getBaseMetaTileEntity().getFrontFacing() == mMainFacing) {
- getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aDirection));
+ getBaseMetaTileEntity().setFrontFacing(direction.getOpposite());
}
onFacingChange();
onMachineBlockUpdate();
@@ -134,16 +135,19 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
@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
@@ -173,8 +177,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
@Override
- public boolean isFacingValid(byte aFacing) {
- return mMainFacing > 1 || aFacing > 1;
+ public boolean isFacingValid(ForgeDirection facing) {
+ return mMainFacing.offsetY == 0 || facing.offsetY == 0;
}
@Override
@@ -183,12 +187,12 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
@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;
}
@@ -198,13 +202,13 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
@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
@@ -352,7 +356,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@Override
public void initDefaultModes(NBTTagCompound aNBT) {
- mMainFacing = -1;
+ mMainFacing = ForgeDirection.UNKNOWN;
}
@Override
@@ -363,7 +367,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
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()));
@@ -381,7 +385,7 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
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"));
@@ -456,14 +460,9 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
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;
@@ -551,10 +550,10 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
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());
}
@@ -661,12 +660,12 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
@Override
public void onValueUpdate(byte aValue) {
- mMainFacing = aValue;
+ mMainFacing = ForgeDirection.getOrientation(aValue);
}
@Override
public byte getUpdateData() {
- return (byte) mMainFacing;
+ return (byte) mMainFacing.ordinal();
}
@Override
@@ -743,8 +742,8 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
@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,
@@ -754,21 +753,23 @@ public abstract class GT_MetaTileEntity_DeluxeMachine extends GT_MetaTileEntity_
}
@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/implementations/GT_MetaTileEntity_DeluxeTank.java b/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java
index f57293f03c..0298fe866d 100644
--- a/