GT5-Unofficial/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicHull.java
2015-04-23 18:14:22 +02:00

99 lines
No EOL
4 KiB
Java

package gregtech.api.metatileentity.implementations;
import static gregtech.api.enums.GT_Values.V;
import gregtech.api.enums.Textures;
import gregtech.api.interfaces.ITexture;
import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public class GT_MetaTileEntity_BasicHull extends GT_MetaTileEntity_BasicTank {
public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, 1, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicHull(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) {
super(aID, aName, aNameRegional, aTier, aInvSlotCount, aDescription, aTextures);
}
public GT_MetaTileEntity_BasicHull(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) {
super(aName, aTier, aInvSlotCount, aDescription, aTextures);
}
@Override
public IMetaTileEntity newMetaEntity(IGregTechTileEntity aTileEntity) {
return new GT_MetaTileEntity_BasicHull(mName, mTier, mInventory.length, mDescription, mTextures);
}
@Override public boolean isElectric() {return true;}
@Override public boolean isEnetInput() {return true;}
@Override public boolean isEnetOutput() {return true;}
@Override public boolean isAccessAllowed(EntityPlayer aPlayer) {return true;}
@Override public boolean isInputFacing(byte aSide) {return !isOutputFacing(aSide);}
@Override public boolean isOutputFacing(byte aSide) {return aSide == getBaseMetaTileEntity().getFrontFacing();}
@Override public long getMinimumStoredEU() {return 512;}
@Override public long maxEUStore() {return 512+V[mTier]*50;}
@Override public long maxEUInput() {return V[mTier];}
@Override public long maxEUOutput() {return V[mTier];}
@Override public boolean isSimpleMachine() {return true;}
@Override public boolean isFacingValid(byte aFacing) {return true;}
@Override public boolean isValidSlot(int aIndex) {return true;}
@Override public boolean allowPutStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {return true;}
@Override public boolean allowPullStack(IGregTechTileEntity aBaseMetaTileEntity, int aIndex, byte aSide, ItemStack aStack) {return true;}
@Override
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aConnected, boolean aRedstone) {
return mTextures[Math.min(2, aSide) + (aSide==aFacing?3:0)][aColorIndex+1];
}
@Override
public ITexture[][][] getTextureSet(ITexture[] aTextures) {
ITexture[][][] rTextures = new ITexture[6][17][];
for (byte i = -1; i < 16; i++) {
rTextures[ 0][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1]};
rTextures[ 1][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1]};
rTextures[ 2][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1]};
rTextures[ 3][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
rTextures[ 4][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
rTextures[ 5][i+1] = new ITexture[] {Textures.BlockIcons.MACHINE_CASINGS[mTier][i+1], Textures.BlockIcons.OVERLAYS_ENERGY_OUT[mTier]};
}
return rTextures;
}
@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 false;
}
@Override
public boolean displaysStackSize() {
return false;
}
@Override
public int getCapacity() {
return (mTier + 1) * 1000;
}
}