aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities
diff options
context:
space:
mode:
authordraknyte1 <draknyte1@hotmail.com>2016-11-04 15:23:26 +1000
committerdraknyte1 <draknyte1@hotmail.com>2016-11-04 15:23:26 +1000
commit0669f5eb9d5029a8b94ec552171b0837605f7747 (patch)
tree6b40e64c04d51b7a33cf2f0b35f7232cf37c4247 /src/Java/gtPlusPlus/xmod/gregtech/common/tileentities
parent3654052fb63a571c5eaca7f20714b87c17f7e966 (diff)
downloadGT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.gz
GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.tar.bz2
GT5-Unofficial-0669f5eb9d5029a8b94ec552171b0837605f7747.zip
$ Cleaned up the entire project.
> Much neat, very nices.
Diffstat (limited to 'src/Java/gtPlusPlus/xmod/gregtech/common/tileentities')
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractGenerator.java726
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/automation/GT_MetaTileEntity_TesseractTerminal.java628
-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.java255
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityGeothermalGenerator.java156
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntityRocketFuelGenerator.java253
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/generators/GregtechMetaTileEntitySolarGenerator.java234
-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.java253
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMTE_NuclearReactor.java329
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_AlloyBlastSmelter.java434
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCentrifuge.java351
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialCokeOven.java476
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialElectrolyzer.java347
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialMacerator.java346
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialPlatePress.java284
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialSinter.java327
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWireMill.java289
-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.java528
-rw-r--r--src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_MultiTank.java602
-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, 4634 insertions, 3973 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 56f6a8d4f9..a1093d67d3 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,7 +1,5 @@
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.*;
@@ -10,6 +8,7 @@ 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;
@@ -23,516 +22,484 @@ 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(int aID, String aName, String aNameRegional, int aTier) {
+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) {
super(aID, aName, aNameRegional, aTier, 3, "");
}
- public GT_MetaTileEntity_TesseractGenerator(String aName, int aTier, String aDescription, ITexture[][][] aTextures) {
+ public GT_MetaTileEntity_TesseractGenerator(final String aName, final int aTier, final String aDescription,
+ final ITexture[][][] aTextures) {
super(aName, aTier, 3, aDescription, aTextures);
- }
-
- @Override
- public MetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
- return new GT_MetaTileEntity_TesseractGenerator(mName, mTier, mDescription, mTextures);
}
- @Override
- public boolean isTransformerUpgradable()
- {
+ 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 boolean isOverclockerUpgradable()
- {
+ public boolean allowPullStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
+ final ItemStack aStack) {
return false;
}
@Override
- public boolean isSimpleMachine()
- {
+ public boolean allowPutStack(final IGregTechTileEntity aBaseMetaTileEntity, final int aIndex, final byte aSide,
+ final ItemStack aStack) {
return false;
}
@Override
- public boolean isFacingValid(byte aFacing)
- {
- return true;
+ 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);
}
@Override
- public boolean isEnetInput()
- {
+ 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);
+ }
return true;
}
@Override
- public boolean isEnetOutput()
- {
- return false;
+ 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 isInputFacing(byte aSide)
- {
+ 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);
+ }
return true;
}
@Override
- public boolean isOutputFacing(byte aSide) {
- return aSide == getBaseMetaTileEntity().getBackFacing();
+ public boolean canTankBeEmptied() {
+ return false;
}
@Override
- public boolean isValidSlot(int aIndex)
- {
+ public boolean canTankBeFilled() {
return false;
}
@Override
- public long getMinimumStoredEU()
- {
- return getBaseMetaTileEntity().getEUCapacity() / 2;
+ 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);
}
@Override
- public long maxEUInput()
- {
- return 2048;
+ public boolean displaysItemStack() {
+ return false;
}
@Override
- public long maxEUOutput()
- {
- return 0;
+ public boolean displaysStackSize() {
+ return false;
}
@Override
- public long maxEUStore()
- {
- return 100000;
+ public boolean doesEmptyContainers() {
+ return false;
}
+ // To-Do?
@Override
- public long maxSteamStore()
- {
- return maxEUStore();
+ public boolean doesFillContainers() {
+ return false;
}
@Override
- public boolean isAccessAllowed(EntityPlayer aPlayer)
- {
- return true;
+ 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);
}
@Override
- public boolean ownerControl()
- {
- return true;
+ 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);
}
@Override
- public int getProgresstime()
- {
- return (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? 999 : 0;
+ 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);
}
@Override
- public int maxProgresstime()
- {
- return 1000;
+ 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;
}
@Override
- public void saveNBTData(NBTTagCompound aNBT)
- {
- aNBT.setInteger("mFrequency", this.mFrequency);
+ public String[] getDescription() {
+ return new String[] {
+ "Generates a Tesseract for the attached Inventory"
+ };
}
@Override
- public void loadNBTData(NBTTagCompound aNBT)
- {
- this.mFrequency = aNBT.getInteger("mFrequency");
+ 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"
+ };
}
@Override
- public void onConfigLoad(GT_Config aConfig)
- {
- TESSERACT_ENERGY_COST = 1024;
- TESSERACT_ENERGY_COST_DIMENSIONAL = 2048;
+ public String getInventoryName() {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ return "";
+ }
+ return tTileEntity.getInventoryName();
}
@Override
- public void onServerStart()
- {
- sTesseractGenerators.clear();
+ 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 onServerStop()
- {
- sTesseractGenerators.clear();
- }
-
@Override
- 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;
+ 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;
}
@Override
- 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)" : ""));
- }
+ public long getMinimumStoredEU() {
+ return this.getBaseMetaTileEntity().getEUCapacity() / 2;
}
- public boolean allowCoverOnSide(byte aSide, int aCoverID)
- {
- return aSide != getBaseMetaTileEntity().getFrontFacing();
+ @Override
+ public int getProgresstime() {
+ return CORE.sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this && this.isWorking >= 20 ? 999
+ : 0;
}
@Override
- public String[] getInfoData()
- {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation)) && (((IGregTechDeviceInformation)tTileEntity).isGivingInformation())) {
- return ((IGregTechDeviceInformation)tTileEntity).getInfoData();
+ public int getSizeInventory() {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ return 0;
}
- return new String[] { "Tesseract Generator", "Freqency:", "" + this.mFrequency, (sTesseractGenerators.get(Integer.valueOf(this.mFrequency)) == this) && (this.isWorking >= 20) ? "Active" : "Inactive" };
+ return tTileEntity.getSizeInventory();
}
@Override
- public boolean isGivingInformation()
- {
- return true;
+ public ItemStack getStackInSlot(final int aIndex) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ return null;
+ }
+ return tTileEntity.getStackInSlot(aIndex);
}
- public boolean isSendingInformation()
- {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IGregTechDeviceInformation))) {
- return ((IGregTechDeviceInformation)tTileEntity).isGivingInformation();
+ @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 false;
+ return null;
}
@Override
- public boolean isDigitalChest()
- {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
- return ((IDigitalChest)tTileEntity).isDigitalChest();
+ 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];
}
- return false;
+ return tTileEntity.getTankInfo(aSide);
}
@Override
- public ItemStack[] getStoredItemData()
- {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
- return ((IDigitalChest)tTileEntity).getStoredItemData();
- }
- return null;
+ 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)
+ };
}
@Override
- public void setItemCount(int aCount)
- {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
- ((IDigitalChest)tTileEntity).setItemCount(aCount);
- }
+ public ITexture[][][] getTextureSet(final ITexture[] aTextures) {
+ return new ITexture[0][0][0];
}
@Override
- public int getMaxItemCount()
- {
- TileEntity tTileEntity = getBaseMetaTileEntity().getTileEntityAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity != null) && (getBaseMetaTileEntity().isAllowedToWork()) && ((tTileEntity instanceof IDigitalChest))) {
- return ((IDigitalChest)tTileEntity).getMaxItemCount();
- }
- return 0;
+ public boolean isAccessAllowed(final EntityPlayer aPlayer) {
+ return true;
}
@Override
- public boolean isItemValidForSlot(int aIndex, ItemStack aStack)
- {
- IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return false;
+ 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();
}
- return tTileEntity.isItemValidForSlot(aIndex, aStack);
+ return false;
}
@Override
- 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;
+ public boolean isEnetInput() {
+ return true;
}
@Override
- 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);
- }
+ public boolean isEnetOutput() {
+ return false;
+ }
+
+ @Override
+ public boolean isFacingValid(final byte aFacing) {
return true;
}
@Override
- public boolean canExtractItem(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).canExtractItem(aIndex, aStack, aSide);
- }
+ public boolean isGivingInformation() {
return true;
}
@Override
- public int getSizeInventory()
- {
- IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.getSizeInventory();
+ public boolean isInputFacing(final byte aSide) {
+ return true;
}
@Override
- public ItemStack getStackInSlot(int aIndex)
- {
- IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
+ public boolean isItemValidForSlot(final int aIndex, final ItemStack aStack) {
+ final IInventory tTileEntity = this.getBaseMetaTileEntity()
+ .getIInventoryAtSide(this.getBaseMetaTileEntity().getBackFacing());
+ if (tTileEntity == null || !this.getBaseMetaTileEntity().isAllowedToWork()) {
+ return false;
}
- return tTileEntity.getStackInSlot(aIndex);
+ return tTileEntity.isItemValidForSlot(aIndex, aStack);
}
@Override
- public void setInventorySlotContents(int aIndex, ItemStack aStack)
- {
- IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return;
- }
- tTileEntity.setInventorySlotContents(aIndex, aStack);
+ public boolean isOutputFacing(final byte aSide) {
+ return aSide == this.getBaseMetaTileEntity().getBackFacing();
}
@Override
- public ItemStack decrStackSize(int aIndex, int aAmount)
- {
- IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
+ 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();
}
- return tTileEntity.decrStackSize(aIndex, aAmount);
+ return false;
}
@Override
- public String getInventoryName()
- {
- IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return "";
- }
- return tTileEntity.getInventoryName();
+ public boolean isSimpleMachine() {
+ return false;
}
@Override
- public int getInventoryStackLimit()
- {
- IInventory tTileEntity = getBaseMetaTileEntity().getIInventoryAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.getInventoryStackLimit();
+ public boolean isTransformerUpgradable() {
+ return true;
}
@Override
- 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);
+ 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);
}
@Override
- 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);
+ public void loadNBTData(final NBTTagCompound aNBT) {
+ this.mFrequency = aNBT.getInteger("mFrequency");
}
@Override
- public FluidTankInfo[] getTankInfo(ForgeDirection aSide)
- {
- IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return new FluidTankInfo[0];
- }
- return tTileEntity.getTankInfo(aSide);
+ public long maxEUInput() {
+ return 2048;
}
@Override
- public int fill_default(ForgeDirection aDirection, FluidStack aFluid, boolean doFill)
- {
- IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return 0;
- }
- return tTileEntity.fill(aDirection, aFluid, doFill);
+ public long maxEUOutput() {
+ return 0;
}
@Override
- public FluidStack drain(ForgeDirection aDirection, int maxDrain, boolean doDrain)
- {
- IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }
- return tTileEntity.drain(aDirection, maxDrain, doDrain);
+ public long maxEUStore() {
+ return 100000;
}
@Override
- public FluidStack drain(ForgeDirection aSide, FluidStack aFluid, boolean doDrain)
- {
- IFluidHandler tTileEntity = getBaseMetaTileEntity().getITankContainerAtSide(getBaseMetaTileEntity().getBackFacing());
- if ((tTileEntity == null) || (!getBaseMetaTileEntity().isAllowedToWork())) {
- return null;
- }