aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities
diff options
context:
space:
mode:
authorDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
committerDraknyte1 <Draknyte1@hotmail.com>2016-11-06 19:32:27 +1000
commitcbe0e497be8e466c380a5b4fa781b314ede9ada3 (patch)
treeb85848b432adf458e3abda466ee46d9dfc3e454b /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities
parentc40416b036c0e89451e1558253ccf07bbee028d0 (diff)
downloadGT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.gz
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.tar.bz2
GT5-Unofficial-cbe0e497be8e466c380a5b4fa781b314ede9ada3.zip
Revert "$ Cleaned up the entire project."
This reverts commit 0669f5eb9d5029a8b94ec552171b0837605f7747. # Conflicts: # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java # src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java Revert "% Cleaned up Imports." This reverts commit 3654052fb63a571c5eaca7f20714b87c17f7e966.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java736
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java634
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GT_MetaTileEntity_Boiler_Solar.java267
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityDoubleFuelGeneratorBase.java261
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java162
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java259
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java233
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySuperCondensor.java212
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/basic/GregtechMetaTileEntityChunkLoader.java252
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java354
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java445
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java360
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java486
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java355
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java353
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java290
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java336
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java294
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IronBlastFurnace.java778
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MassFabricator.java547
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java609
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_PowerSubStationController.java274
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/storage/GT_MetaTileEntity_TieredTank.java258
23 files changed, 4063 insertions, 4692 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
index a1093d67d3..0338871482 100644
--- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
+++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java
@@ -1,14 +1,16 @@
package gtPlusPlus.xmod.gregtech.common.tileentities.automation;
+import static gtPlusPlus.core.lib.CORE.sTesseractGenerators;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
-import gregtech.api.interfaces.tileentity.*;
+import gregtech.api.interfaces.tileentity.IDigitalChest;
+import gregtech.api.interfaces.tileentity.IGregTechDeviceInformation;
+import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank;
import gregtech.api.objects.GT_RenderedTexture;
import gregtech.api.util.GT_Config;
import gregtech.api.util.GT_Utility;
-import gtPlusPlus.core.lib.CORE;
import gtPlusPlus.core.util.Utils;
import gtPlusPlus.core.util.player.PlayerUtils;
import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock;
@@ -20,486 +22,521 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.common.util.ForgeDirection;
-import net.minecraftforge.fluids.*;
-
-public class GT_MetaTileEntity_TesseractGenerator extends GT_MetaTileEntity_BasicTank {
- public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
- public static int TESSERACT_ENERGY_COST = 1024;
- public byte isWorking = 0;
- public int oFrequency = 0;
- public int mNeededEnergy = 0;
- public int mFrequency = 0;
-
- public GT_MetaTileEntity_TesseractGenerator(final int aID, final String aName, final String aNameRegional,
- final int aTier) {
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidStack;
+import net.minecraftforge.fluids.FluidTankInfo;
+import net.minecraftforge.fluids.IFluidHandler;
+
+public class GT_MetaTileEntity_TesseractGenerator
+extends GT_MetaTileEntity_BasicTank
+{
+ public static int TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
+ public static int TESSERACT_ENERGY_COST = 1024;
+ public byte isWorking = 0;
+ public int oFrequency = 0;
+ public int mNeededEnergy = 0;
+ public int mFrequency = 0;
+
+ public GT_MetaTileEntity_TesseractGenerator(int aID, String aName, String aNameRegional, int aTier) {
super(aID, aName, aNameRegional, aTier, 3, "");
}
- public GT_MetaTileEntity_TesseractGenerator(final String aName, final int aTier, final String aDescription,
- final ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TesseractGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, 3, aDescription, aTextures);
- }
+ }
- public boolean addEnergyConsumption(final GT_MetaTileEntity_TesseractTerminal aTerminal) {
- if (!this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- this.mNeededEnergy += aTerminal.getBaseMetaTileEntity().getWorld() == this.getBaseMetaTileEntity().getWorld()
- ? GT_MetaTileEntity_TesseractGenerator.TESSERACT_ENERGY_COST
- : GT_MetaTileEntity_TesseractGenerator.TESSERACT_ENERGY_COST_DIMENSIONAL;
- return true;
- }
-
- public boolean allowCoverOnSide(final byte aSide, final int aCoverID) {
- return aSide != this.getBaseMetaTileEntity().getFrontFacing();
+ @Override
+ public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
+ return new GT_MetaTileEntity_TesseractGenerator(mName, mTier, mDescription, mTextures);
}
@Override
- public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
- return false;
+ public boolean isTransformerUpgradable()
+ {
+ return true;
}
@Override
- public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
- final ItemStack aStack) {
+ public boolean isOverclockerUpgradable()
+ {
return false;
}
@Override
- public boolean canDrain(final ForgeDirection aSide, final Fluid aFluid) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- return tTileEntity.canDrain(aSide, aFluid);
+ public boolean isSimpleMachine()
+ {
+ return false;
}
@Override
- public boolean canExtractItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- if (tTileEntity instanceof ISidedInventory) {
- return ((ISidedInventory) tTileEntity).canExtractItem(aIndex, aStack, aSide);
- }
+ public boolean isFacingValid(byte aFacing)
+ {
return true;
}
@Override
- public boolean canFill(final ForgeDirection aSide, final Fluid aFluid) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- return tTileEntity.canFill(aSide, aFluid);
- }
-
- @Override
- public boolean canInsertItem(final int aIndex, final ItemStack aStack, final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return false;
- }
- if (tTileEntity instanceof ISidedInventory) {
- return ((ISidedInventory) tTileEntity).canInsertItem(aIndex, aStack, aSide);
- }
+ public boolean isEnetInput()
+ {
return true;
}
@Override
- public boolean canTankBeEmptied() {
+ public boolean isEnetOutput()
+ {
return false;
}
@Override
- public boolean canTankBeFilled() {
- return false;
+ public boolean isInputFacing(byte aSide)
+ {
+ return true;
}
@Override
- public ItemStack decrStackSize(final int aIndex, final int aAmount) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.decrStackSize(aIndex, aAmount);
+ public boolean isOutputFacing(byte aSide) {
+ return aSide == getBaseMetaTileEntity().getBackFacing();
}
@Override
- public boolean displaysItemStack() {
+ public boolean isValidSlot(int aIndex)
+ {
return false;
}
@Override
- public boolean displaysStackSize() {
- return false;
+ public long getMinimumStoredEU()
+ {
+ return getBaseMetaTileEntity().getEUCapacity() / 2;
}
@Override
- public boolean doesEmptyContainers() {
- return false;
+ public long maxEUInput()
+ {
+ return 2048;
}
- // To-Do?
@Override
- public boolean doesFillContainers() {
- return false;
+ public long maxEUOutput()
+ {
+ return 0;
}
@Override
- public FluidStack drain(final ForgeDirection aSide, final FluidStack aFluid, final boolean doDrain) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.drain(aSide, aFluid, doDrain);
+ public long maxEUStore()
+ {
+ return 100000;
}
@Override
- public FluidStack drain(final ForgeDirection aDirection, final int maxDrain, final boolean doDrain) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
- }
- return tTileEntity.drain(aDirection, maxDrain, doDrain);
+ public long maxSteamStore()
+ {
+ return maxEUStore();
}
@Override
- public int fill_default(final ForgeDirection aDirection, final FluidStack aFluid, final boolean doFill) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
- }
- return tTileEntity.fill(aDirection, aFluid, doFill);
+ public boolean isAccessAllowed(EntityPlayer aPlayer)
+ {
+ return true;
}
@Override
- public int[] getAccessibleSlotsFromSide(final int aSide) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return new int[0];
- }
- if (tTileEntity instanceof ISidedInventory) {
- return ((ISidedInventory) tTileEntity).getAccessibleSlotsFromSide(aSide);
- }
- final int[] rArray = new int[this.getSizeInventory()];
- for (int i = 0; i < this.getSizeInventory(); i++) {
- rArray[i] = i;
- }
- return rArray;
+ public boolean ownerControl()
+ {
+ return true;
}
@Override
- public String[] getDescription() {
- return new String[] {
- "Generates a Tesseract for the attached Inventory"
- };
+ public int getProgresstime()
+ {
+ return (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? 999 : 0;
}
@Override
- public String[] getInfoData() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IGregTechDeviceInformation
- && ((IGregTechDeviceInformation) tTileEntity).isGivingInformation()) {
- return ((IGregTechDeviceInformation) tTileEntity).getInfoData();
- }
- return new String[] {
- "Tesseract Generator", "Freqency:", "" + this.mFrequency,
- CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this && this.isWorking >= 20
- ? "Active" : "Inactive"
- };
+ public int maxProgresstime()
+ {
+ return 1000;
}
@Override
- public String getInventoryName() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return "";
- }
- return tTileEntity.getInventoryName();
+ public void saveNBTData(NBTTagCompound aNBT)
+ {
+ aNBT.setInteger("mFrequency", this.mFrequency);
}
@Override
- public int getInventoryStackLimit() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
- }
- return tTileEntity.getInventoryStackLimit();
+ public void loadNBTData(NBTTagCompound aNBT)
+ {
+ this.mFrequency = aNBT.getInteger("mFrequency");
}
@Override
- public int getMaxItemCount() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IDigitalChest) {
- return ((IDigitalChest) tTileEntity).getMaxItemCount();
- }
- return 0;
+ public void onConfigLoad(GT_Config aConfig)
+ {
+ TESSERACT_ENERGY_COST = 1024;
+ TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
}
@Override
- public long getMinimumStoredEU() {
- return this.getBaseMetaTileEntity().getEUCapacity() / 2;
+ public void onServerStart()
+ {
+ sTesseractGenerators.clear();
}
- @Override
- public int getProgresstime() {
- return CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this && this.isWorking >= 20 ? 999
- : 0;
+ public void onServerStop()
+ {
+ sTesseractGenerators.clear();
}
-
+
@Override
- public int getSizeInventory() {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return 0;
- }
- return tTileEntity.getSizeInventory();
+ public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer, byte aSide, float aX, float aY, float aZ){
+ if (aSide == getBaseMetaTileEntity().getFrontFacing()){
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F))){
+ case 0:
+ Utils.LOG_INFO("Freq. -1 | " + this.mFrequency);
+ this.mFrequency -= 1;
+ break;
+ case 1:
+ Utils.LOG_INFO("Freq. +1 | " + this.mFrequency);
+ this.mFrequency += 1;
+ default:
+ //Utils.LOG_INFO("Did not click the correct place.");
+ break;
+ }
+ PlayerUtils.messagePlayer(aPlayer, "Frequency: " + this.mFrequency);
+ PlayerUtils.messagePlayer(aPlayer, ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null) && (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this) ? EnumChatFormatting.RED + " (Occupied)" : ""));
+ }
+ return true;
}
@Override
- public ItemStack getStackInSlot(final int aIndex) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return null;
+ public void onScrewdriverRightClick(byte aSide, EntityPlayer aPlayer, float aX, float aY, float aZ)
+ {
+ if (aSide == getBaseMetaTileEntity().getFrontFacing())
+ {
+ float[] tCoords = GT_Utility.getClickedFacingCoords(aSide, aX, aY, aZ);
+ switch ((byte)((byte)(int)(tCoords[0] * 2.0F) + 2 * (byte)(int)(tCoords[1] * 2.0F)))
+ {
+ case 0:
+ this.mFrequency -= 64;
+ break;
+ case 1:
+ this.mFrequency += 64;
+ break;
+ case 2:
+ this.mFrequency -= 512;
+ break;
+ case 3:
+ this.mFrequency += 512;
+ }
+ GT_Utility.sendChatToPlayer(aPlayer, "Frequency: " + this.mFrequency + ((sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != null) && (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) != this) ? EnumChatFormatting.RED + " (Occupied)" : ""));
}
- return tTileEntity.getStackInSlot(aIndex);
}
- @Override
- public ItemStack[] getStoredItemData() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IDigitalChest) {
- return ((IDigitalChest) tTileEntity).getStoredItemData();
- }
- return null;
+ public boolean allowCoverOnSide(byte aSide, int aCoverID)
+ {
+ return aSide != getBaseMetaTileEntity().getFrontFacing();
}
@Override
- public FluidTankInfo[] getTankInfo(final ForgeDirection aSide) {
- final IFluidHandler tTileEntity = this.getBaseMetaTileEntity()
- .getITankContainerAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
- return new FluidTankInfo[0];
+ public String[] getInfoData()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation)tTileEntity).isGivingInformation())) {
+ return ((IGregTechDeviceInformation)tTileEntity).getInfoData();
}
- return tTileEntity.getTankInfo(aSide);
+ return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? "Active" : "Inactive" };
}
@Override
- public ITexture[] getTexture(final IGregTechTileEntity aBaseMetaTileEntity, final byte aSide, final byte aFacing,
- final byte aColorIndex, final boolean aActive, final boolean aRedstone) {
- return aSide == aFacing ? new ITexture[] {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Screen_Frequency)
- } : new ITexture[] {
- new GT_RenderedTexture(TexturesGtBlock.Casing_Machine_Dimensional),
- new GT_RenderedTexture(Textures.BlockIcons.VOID)
- };
+ public boolean isGivingInformation()
+ {
+ return true;
}
- @Override
- public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
- return new ITexture[0][0][0];
+ public boolean isSendingInformation()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation))) {
+ return ((IGregTechDeviceInformation)tTileEntity).isGivingInformation();
+ }
+ return false;
}
@Override
- public boolean isAccessAllowed(final EntityPlayer aPlayer) {
- return true;
+ public boolean isDigitalChest()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).isDigitalChest();
+ }
+ return false;
}
@Override
- public boolean isDigitalChest() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IDigitalChest) {
- return ((IDigitalChest) tTileEntity).isDigitalChest();
+ public ItemStack[] getStoredItemData()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).getStoredItemData();
}
- return false;
+ return null;
}
@Override
- public boolean isEnetInput() {
- return true;
+ public void setItemCount(int aCount)
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ ((IDigitalChest)tTileEntity).setItemCount(aCount);
+ }
}
@Override
- public boolean isEnetOutput() {
- return false;
+ public int getMaxItemCount()
+ {
+ TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
+ return ((IDigitalChest)tTileEntity).getMaxItemCount();
+ }
+ return 0;
}
@Override
- public boolean isFacingValid(final byte aFacing) {
- return true;
+ public boolean isItemValidForSlot(int aIndex, ItemStack aStack)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.isItemValidForSlot(aIndex, aStack);
}
@Override
- public boolean isGivingInformation() {
- return true;
+ public int[] getAccessibleSlotsFromSide(int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new int[0];
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).getAccessibleSlotsFromSide(aSide);
+ }
+ int[] rArray = new int[getSizeInventory()];
+ for (int i = 0; i < getSizeInventory(); i++) {
+ rArray[i] = i;
+ }
+ return rArray;
}
@Override
- public boolean isInputFacing(final byte aSide) {
+ public boolean canInsertItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).canInsertItem(aIndex, aStack, aSide);
+ }
return true;
}
@Override
- public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
- final IInventory tTileEntity = this.getBaseMetaTileEntity()
- .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ public boolean canExtractItem(int aIndex, ItemStack aStack, int aSide)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
return false;
}
- return tTileEntity.isItemValidForSlot(aIndex, aStack);
+ if ((tTileEntity instanceof ISidedInventory)) {
+ return ((ISidedInventory)tTileEntity).canExtractItem(aIndex, aStack, aSide);
+ }
+ return true;
}
@Override
- public boolean isOutputFacing(final byte aSide) {
- return aSide == this.getBaseMetaTileEntity().getBackFacing();
+ public int getSizeInventory()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getSizeInventory();
}
@Override
- public boolean isOverclockerUpgradable() {
- return false;
- }
-
- public boolean isSendingInformation() {
- final TileEntity tTileEntity = this.getBaseMetaTileEntity()
- .getTileEntityAtSide(this.getBaseMetaTileEntity().getBackFacing());
- if (tTileEntity != null && this.getBaseMetaTileEntity().isAllowedToWork()
- && tTileEntity instanceof IGregTechDeviceInformation) {
- return ((IGregTechDeviceInformation) tTileEntity).isGivingInformation();
+ public ItemStack getStackInSlot(int aIndex)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
}
- return false;
+ return tTileEntity.getStackInSlot(aIndex);
}
@Override
- public boolean isSimpleMachine() {
- return false;
+ public void setInventorySlotContents(int aIndex, ItemStack aStack)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return;
+ }
+ tTileEntity.setInventorySlotContents(aIndex, aStack);
}
@Override
- public boolean isTransformerUpgradable() {
- return true;
+ public ItemStack decrStackSize(int aIndex, int aAmount)
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return null;
+ }
+ return tTileEntity.decrStackSize(aIndex, aAmount);
}
@Override
- public boolean isValidSlot(final int aIndex) {
- return false;
- }
-
- public boolean isValidTesseractGenerator(final String aOwnerName, final boolean aWorkIrrelevant) {
- return this.getBaseMetaTileEntity() != null && !this.getBaseMetaTileEntity().isInvalidTileEntity()
- && this.getBaseMetaTileEntity().isAllowedToWork()
- && (aOwnerName == null || this.getBaseMetaTileEntity().getOwnerName().equals(aOwnerName))
- && (aWorkIrrelevant || this.isWorking >= 20);
+ public String getInventoryName()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return "";
+ }
+ return tTileEntity.getInventoryName();
}
@Override
- public void loadNBTData(final NBTTagCompound aNBT) {
- this.mFrequency = aNBT.getInteger("mFrequency");
+ public int getInventoryStackLimit()
+ {
+ IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return 0;
+ }
+ return tTileEntity.getInventoryStackLimit();
}
@Override
- public long maxEUInput() {
- return 2048;
+ public boolean canFill(ForgeDirection aSide, Fluid aFluid)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canFill(aSide, aFluid);
}
@Override
- public long maxEUOutput() {
- return 0;
+ public boolean canDrain(ForgeDirection aSide, Fluid aFluid)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return false;
+ }
+ return tTileEntity.canDrain(aSide, aFluid);
}
@Override
- public long maxEUStore() {
- return 100000;
+ public FluidTankInfo[] getTankInfo(ForgeDirection aSide)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
+ return new FluidTankInfo[0];
+ }
+ return tTileEntity.getTankInfo(aSide);
}
@Override
- public int maxProgresstime() {
- return 1000;
+ public int fill_default(ForgeDirection aDirection, FluidStack aFluid, boolean doFill)
+ {
+ IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
+ if ((tTileEntity == null) || (