aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/GoodGenerator/Blocks/TEs/MetaTE
diff options
context:
space:
mode:
authorGlodBlock <1356392126@qq.com>2021-09-20 14:38:24 +0800
committerGlodBlock <1356392126@qq.com>2021-09-20 14:38:24 +0800
commitb7be0dd5b192b19098e8e1c7d0fbc96cb99bfd1c (patch)
treeef92338f27b6a7ceb9432a5cf4d9e91407a66cda /src/main/java/GoodGenerator/Blocks/TEs/MetaTE
parent445e8248743bf5f99fed078288d9f81038749942 (diff)
downloadGT5-Unofficial-b7be0dd5b192b19098e8e1c7d0fbc96cb99bfd1c.tar.gz
GT5-Unofficial-b7be0dd5b192b19098e8e1c7d0fbc96cb99bfd1c.tar.bz2
GT5-Unofficial-b7be0dd5b192b19098e8e1c7d0fbc96cb99bfd1c.zip
add GUI and desc text fot YOTTank
Diffstat (limited to 'src/main/java/GoodGenerator/Blocks/TEs/MetaTE')
-rw-r--r--src/main/java/GoodGenerator/Blocks/TEs/MetaTE/YottaFluidTankOutputHatch.java133
1 files changed, 0 insertions, 133 deletions
diff --git a/src/main/java/GoodGenerator/Blocks/TEs/MetaTE/YottaFluidTankOutputHatch.java b/src/main/java/GoodGenerator/Blocks/TEs/MetaTE/YottaFluidTankOutputHatch.java
deleted file mode 100644
index d53a01408e..0000000000
--- a/src/main/java/GoodGenerator/Blocks/TEs/MetaTE/YottaFluidTankOutputHatch.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package GoodGenerator.Blocks.TEs.MetaTE;
-
-import GoodGenerator.Blocks.TEs.YottaFluidTank;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch;
-import gregtech.api.render.TextureFactory;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.FluidRegistry;
-import net.minecraftforge.fluids.FluidStack;
-import net.minecraftforge.fluids.IFluidHandler;
-
-import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_PIPE_OUT;
-
-public class YottaFluidTankOutputHatch extends GT_MetaTileEntity_Hatch {
-
- private String mFluidName = "";
- private int mOutputSpeed = 0;
- private int mX, mZ, mY;
- private boolean isBound = false;
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- mFluidName = aNBT.getString("mFluidName");
- mOutputSpeed = aNBT.getInteger("mOutputSpeed");
- mX = aNBT.getInteger("mX");
- mZ = aNBT.getInteger("mZ");
- mY = aNBT.getInteger("mY");
- isBound = aNBT.getBoolean("isBound");
- super.loadNBTData(aNBT);
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- aNBT.setString("mFluidName", mFluidName);
- aNBT.setInteger("mOutputSpeed", mOutputSpeed);
- aNBT.setInteger("mX", mX);
- aNBT.setInteger("mZ", mZ);
- aNBT.setInteger("mY", mY);
- aNBT.setBoolean("isBound", isBound);
- super.saveNBTData(aNBT);
- }
-
- public YottaFluidTankOutputHatch(int aID, String aName, String aNameRegional, int aTier) {
- super(aID, aName, aNameRegional, aTier, 0, "Output Fluid From YOTTank.");
- }
-
- public YottaFluidTankOutputHatch(String aName, int aTier, String[] aDescription, ITexture[][][] aTextures) {
- super(aName, aTier, 0, aDescription, aTextures);
- }
-
- public void setFluid(FluidStack output) {
- if (output == null) {
- mFluidName = "";
- mOutputSpeed = 0;
- return;
- }
- mFluidName = output.getFluid().getName();
- mOutputSpeed = output.amount;
- }
-
- public void setControl(int x, int y, int z) {
- mX = x;
- mY = y;
- mZ = z;
- isBound = true;
- }
-
- public void unBounded() {
- isBound = false;
- }
-
- public boolean isBounded() {
- return isBound;
- }
-
- @Override
- public boolean isFacingValid(byte aFacing) {
- return true;
- }
-
- @Override
- public boolean isLiquidInput(byte aSide) {
- return false;
- }
-
- @Override
- public boolean isSimpleMachine() {
- return true;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
- if (aBaseMetaTileEntity.isServerSide()) {
- IFluidHandler tTileEntity = aBaseMetaTileEntity.getITankContainerAtSide(aBaseMetaTileEntity.getFrontFacing());
- FluidStack tOutput = FluidRegistry.getFluidStack(mFluidName, mOutputSpeed);
- IGregTechTileEntity tController = aBaseMetaTileEntity.getIGregTechTileEntity(mX, mY, mZ);
- if (tTileEntity != null && tOutput != null && tController.getMetaTileEntity() instanceof YottaFluidTank && isBound) {
- int tAmount = Math.min(tTileEntity.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tOutput, false), mOutputSpeed);
- if (tAmount > 0) {
- tOutput.amount = tAmount;
- if (((YottaFluidTank) tController).reduceFluid(tAmount))
- tTileEntity.fill(ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()), tOutput, true);
- }
- }
- if (tController == null || !(tController.getMetaTileEntity() instanceof YottaFluidTank)) isBound = false;
- }
- }
-
- @Override
- public ITexture[] getTexturesActive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)};
- }
-
- @Override
- public ITexture[] getTexturesInactive(ITexture aBaseTexture) {
- return new ITexture[]{aBaseTexture, TextureFactory.of(OVERLAY_PIPE_OUT)};
- }
-
- @Override
- public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new YottaFluidTankOutputHatch(mName, mTier, mDescriptionArray, mTextures);
- }
-}