aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiozune <miozune@gmail.com>2023-05-08 18:28:16 +0900
committerGitHub <noreply@github.com>2023-05-08 11:28:16 +0200
commitd4c24c4d666f21d3132cf355e6e15b425c0f4369 (patch)
treeb557671642b155deb546e75a8b0e8d7d4e154bc7 /src
parent410b4d15111cd0d53adfbd302907b80b6a45c3c3 (diff)
downloadGT5-Unofficial-d4c24c4d666f21d3132cf355e6e15b425c0f4369.tar.gz
GT5-Unofficial-d4c24c4d666f21d3132cf355e6e15b425c0f4369.tar.bz2
GT5-Unofficial-d4c24c4d666f21d3132cf355e6e15b425c0f4369.zip
Remove unused code & migrate to FluidSlotWidget (#619)
* Remove unused code & migrate to FluidSlotWidget * Update dependencies.gradle --------- Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java4
-rw-r--r--src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java2
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java349
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java911
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicTank.java268
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeMachine.java906
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_DeluxeTank.java362
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/GT_MetaTileEntity_Hatch_CustomFluidBase.java7
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/implementations/base/generators/GregtechDoubleFuelGeneratorBase.java477
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_ChemicalReactor.java571
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_CompactFusionReactor.java693
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntity_PocketFusion.java696
-rw-r--r--src/main/java/gtPlusPlus/xmod/gregtech/registration/gregtech/GregtechFluidReactor.java18
13 files changed, 4 insertions, 5260 deletions
diff --git a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
index ac061c44fd..bf98c7d633 100644
--- a/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
+++ b/src/main/java/gtPlusPlus/api/objects/minecraft/BTF_FluidTank.java
@@ -78,10 +78,6 @@ public class BTF_FluidTank extends FluidTank {
return this.mFluid;
}
- public FluidStack getDisplayedFluid() {
- return this.getDrainableStack();
- }
-
public boolean isFluidChangingAllowed() {
return true;
}
diff --git a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
index f893486d4f..a326c7e693 100644
--- a/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
+++ b/src/main/java/gtPlusPlus/core/handler/COMPAT_HANDLER.java
@@ -54,7 +54,6 @@ import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechCyclotron;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechDehydrator;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechEnergyBuffer;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFactoryGradeReplacementMultis;
-import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechFluidReactor;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeneratorsULV;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechGeothermalThermalGenerator;
import gtPlusPlus.xmod.gregtech.registration.gregtech.GregtechHiAmpTransformer;
@@ -204,7 +203,6 @@ public class COMPAT_HANDLER {
GregtechSolarTower.run();
GregtechLargeTurbinesAndHeatExchanger.run();
GregtechPowerBreakers.run();
- GregtechFluidReactor.run();
GregtechAlgaeContent.run();
GregtechIndustrialAlloySmelter.run();
GregtechIsaMill.run();
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
deleted file mode 100644
index 25a1cc3cca..0000000000
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicLosslessGenerator.java
+++ /dev/null
@@ -1,349 +0,0 @@
-package gtPlusPlus.xmod.gregtech.api.metatileentity.custom.power;
-
-import java.util.Collection;
-
-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;
-import gregtech.api.enums.Textures.BlockIcons;
-import gregtech.api.gui.modularui.GT_UIInfos;
-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;
-
-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);
- }
-
- @Override
- 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;
- }
-
- @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);
- desc[this.mDescriptionArray.length] = "Fuel Efficiency: " + this.getEfficiency() + "%";
- return desc;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- Logger.WARNING("Right Clicked");
- GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, 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(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(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;
- 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());
-
- for (GT_Recipe tFuel : tRecipeList) {
- 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;
- }
- }
-
- @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;
- }
-
- @Override
- public boolean useModularUI() {
- return true;
- }
-}
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
deleted file mode 100644
index 4bb30d102c..0000000000
--- a/src/main/java/gtPlusPlus/xmod/gregtech/api/metatileentity/custom/power/GTPP_MTE_BasicMachine.java
+++ /dev/null
@@ -1,911 +0,0 @@
-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;
-import gregtech.api.gui.modularui.GT_UIInfos;
-import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
-import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_MultiBlockBase;
-import gregtech.api.objects.GT_ItemStack;
-import gregtech.api.objects.GT_RenderedTexture;
-import gregtech.api.util.GT_OreDictUnificator;
-import gregtech.api.util.GT_Recipe;
-import gregtech.api.util.GT_Recipe.GT_Recipe_Map;
-import gregtech.api.util.GT_Utility;
-
-/**
- * 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
- */
-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,
- 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 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;
- /**
- * 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
- */
- 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;
- mGUIName = aGUIName;
- 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);
- mInputSlotCount = Math.max(0, aInputSlotCount);
- mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
- mAmperage = aAmperage;
- 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) {
- super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures);
- mInputSlotCount = Math.max(0, aInputSlotCount);
- mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
- mAmperage = aAmperage;
- 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) {
- super(aName, aTier, OTHER_SLOT_COUNT + aInputSlotCount + aOutputSlotCount + 1, aDescription, aTextures);
- mInputSlotCount = Math.max(0, aInputSlotCount);
- mOutputItems = new ItemStack[Math.max(0, aOutputSlotCount)];
- mAmperage = aAmperage;
- mGUIName = aGUIName;
- mNEIName = aNEIName;
- }
-
- protected boolean isValidMainFacing(ForgeDirection side) {
- return side.offsetY == 0;
- }
-
- public boolean setMainFacing(ForgeDirection side) {
- if (!isValidMainFacing(side)) return false;
- mMainFacing = side;
- if (getBaseMetaTileEntity().getFrontFacing() == mMainFacing) {
- getBaseMetaTileEntity().setFrontFacing(side.getOpposite());
- }
- onFacingChange();
- onMachineBlockUpdate();
- return true;
- }
-
- @Override
- public ITexture[][][] getTextureSet(ITexture[] aTextures) {
- 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 (byte c = -1; c < 16; c++) {
- if (rTextures[0][c + 1] == null) rTextures[0][c + 1] = getSideFacingActive(c);
- if (rTextures[1][c + 1] == null) rTextures[1][c + 1] = getSideFacingInactive(c);
- if (rTextures[2][c + 1] == null) rTextures[2][c + 1] = getFrontFacingActive(c);
- if (rTextures[3][c + 1] == null) rTextures[3][c + 1] = getFrontFacingInactive(c);
- if (rTextures[4][c + 1] == null) rTextures[4][c + 1] = getTopFacingActive(c);
- if (rTextures[5][c + 1] == null) rTextures[5][c + 1] = getTopFacingInactive(c);
- if (rTextures[6][c + 1] == null) rTextures[6][c + 1] = getBottomFacingActive(c);
- if (rTextures[7][c + 1] == null) rTextures[7][c + 1] = getBottomFacingInactive(c);
- if (rTextures[8][c + 1] == null) rTextures[8][c + 1] = getBottomFacingPipeActive(c);
- if (rTextures[9][c + 1] == null) rTextures[9][c + 1] = getBottomFacingPipeInactive(c);
- if (rTextures[10][c + 1] == null) rTextures[10][c + 1] = getTopFacingPipeActive(c);
- if (rTextures[11][c + 1] == null) rTextures[11][c + 1] = getTopFacingPipeInactive(c);
- if (rTextures[12][c + 1] == null) rTextures[12][c + 1] = getSideFacingPipeActive(c);
- if (rTextures[13][c + 1] == null) rTextures[13][c + 1] = getSideFacingPipeInactive(c);
- }
- return rTextures;
- }
-
- @Override
- 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
- public boolean isSimpleMachine() {
- return false;
- }
-
- @Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isTransformerUpgradable() {
- return false;
- }
-
- @Override
- public boolean isElectric() {
- return true;
- }
-
- @Override
- public boolean isValidSlot(int aIndex) {
- return aIndex > 0 && super.isValidSlot(aIndex)
- && aIndex != OTHER_SLOT_COUNT + mInputSlotCount + mOutputItems.length;
- }
-
- @Override
- public boolean isFacingValid(ForgeDirection facing) {
- return mMainFacing.offsetY == 0 || facing.offsetY == 0;
- }
-
- @Override
- public boolean isEnetInput() {
- return true;
- }
-
- @Override
- public boolean isInputFacing(ForgeDirection side) {
- return side != mMainFacing;
- }
-
- @Override
- public boolean isOutputFacing(ForgeDirection side) {
- return false;
- }
-
- @Override
- public boolean isTeleporterCompatible() {
- return false;
- }
-
- @Override
- public boolean isLiquidInput(ForgeDirection side) {
- return side != mMainFacing && (mAllowInputFromOutputSide || side != getBaseMetaTileEntity().getFrontFacing());
- }
-
- @Override
- public boolean isLiquidOutput(ForgeDirection side) {
- return side != mMainFacing;
- }
-
- @Override
- public long getMinimumStoredEU() {
- return V[mTier] * 16;
- }
-
- @Override
- public long maxEUStore() {
- return V[mTier] * 64;
- }
-
- @Override
- public long maxEUInput() {
- return V[mTier];
- }
-
- @Override
- public long maxSteamStore() {
- return maxEUStore();
- }
-
- @Override
- public long maxAmperesIn() {
- return (mEUt * 2) / V[mTier] + 1;
- }
-
- @Override
- public int getInputSlot() {
- return OTHER_SLOT_COUNT;
- }
-
- @Override
- public int getOutputSlot() {
- return OTHER_SLOT_COUNT + mInputSlotCount;
- }
-
- @Override
- public int getStackDisplaySlot() {
- return 2;
- }
-
- @Override
- public int rechargerSlotStartIndex() {
- return 1;
- }
-
- @Override
- public int dechargerSlotStartIndex() {
- return 1;
- }
-
- @Override
- public int rechargerSlotCount() {
- return mCharge ? 1 : 0;
- }
-
- @Override
- public int dechargerSlotCount() {
- return mDecharge ? 1 : 0;
- }
-
- @Override
- public boolean isAccessAllowed(EntityPlayer aPlayer) {
- return true;
- }
-
- @Override
- public int getProgresstime() {
- return mProgresstime;
- }
-
- @Override
- public int maxProgresstime() {
- return mMaxProgresstime;
- }
-
- @Override
- public int increaseProgress(int aProgress) {
- mProgresstime += aProgress;
- return mMaxProgresstime - mProgresstime;
- }
-
- @Override
- public boolean isFluidInputAllowed(FluidStack aFluid) {
- return getFillableStack() != null || (getRecipeList() != null && getRecipeList().containsInput(aFluid));
- }
-
- @Override
- public boolean isFluidChangingAllowed() {
- return true;
- }
-
- @Override
- public boolean doesFillContainers() {
- return false;
- }
-
- @Override
- public boolean doesEmptyContainers() {
- return false;
- }
-
- @Override
- public boolean canTankBeFilled() {
- return true;
- }
-
- @Override
- public boolean canTankBeEmptied() {
- return true;
- }
-
- @Override
- public boolean displaysItemStack() {
- return true;
- }
-
- @Override
- public boolean displaysStackSize() {
- return true;
- }
-
- @Override
- public FluidStack getDisplayedFluid() {
- return displaysOutputFluid() ? getDrainableStack() : null;
- }
-
- @Override
- public FluidStack getDrainableStack() {
- return mFluidOut;
- }
-
- @Override
- public FluidStack setDrainableStack(FluidStack aFluid) {
- mFluidOut = aFluid;
- return mFluidOut;
- }
-
- @Override
- public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
- GT_UIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);
- return true;
- }
-
- @Override
- public void initDefaultModes(NBTTagCompound aNBT) {
- mMainFacing = ForgeDirection.UNKNOWN;
- }
-
- @Override
- public void saveNBTData(NBTTagCompound aNBT) {
- super.saveNBTData(aNBT);
- aNBT.setBoolean("mFluidTransfer", mFluidTransfer);
- aNBT.setBoolean("mItemTransfer", mItemTransfer);
- aNBT.setBoolean("mHasBeenUpdated", mHasBeenUpdated);
- aNBT.setBoolean("mAllowInputFromOutputSide", mAllowInputFromOutputSide);
- aNBT.setInteger("mEUt", mEUt);
- aNBT.setInteger("mMainFacing", mMainFacing.ordinal());
- aNBT.setInteger("mProgresstime", mProgresstime);
- aNBT.setInteger("mMaxProgresstime", mMaxProgresstime);
- 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()));
- }
-
- @Override
- public void loadNBTData(NBTTagCompound aNBT) {
- super.loadNBTData(aNBT);
- mFluidTransfer = aNBT.getBoolean("mFluidTransfer");
- mItemTransfer = aNBT.getBoolean("mItemTransfer");
- mHasBeenUpdated = aNBT.getBoolean("mHasBeenUpdated");
- mAllowInputFromOutputSide = aNBT.getBoolean("mAllowInputFromOutputSide");
- mEUt = aNBT.getInteger("mEUt");
- mMainFacing = ForgeDirection.getOrientation(aNBT.getInteger("mMainFacing"));
- mProgresstime = aNBT.getInteger("mProgresstime");
- mMaxProgresstime = aNBT.getInteger("mMaxProgresstime");
- mOutputFluid = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mOutputFluid"));
- mFluidOut = FluidStack.loadFluidStackFromNBT(aNBT.getCompoundTag("mFluidOut"));
-
- for (int i = 0; i < mOutputItems.length; i++) mOutputItems[i] = GT_Utility.loadItem(aNBT, "mOutputItem" + i);
- }
-
- @Override
- public void onPostTick(IGregTechTileEntity aBaseMetaTileEntity, long aTick) {
- super.onPostTick(aBaseMetaTileEntity, aTick);
-
- if (aBaseMetaTileEntity.isServerSide()) {
- mCharge = aBas