diff options
Diffstat (limited to 'src/Java/miscutil/gregtech/metatileentity/implementations/GregtechMetaTileEntity.java')
-rw-r--r-- | src/Java/miscutil/gregtech/metatileentity/implementations/GregtechMetaTileEntity.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/Java/miscutil/gregtech/metatileentity/implementations/GregtechMetaTileEntity.java b/src/Java/miscutil/gregtech/metatileentity/implementations/GregtechMetaTileEntity.java new file mode 100644 index 0000000000..c95c7ba75a --- /dev/null +++ b/src/Java/miscutil/gregtech/metatileentity/implementations/GregtechMetaTileEntity.java @@ -0,0 +1,65 @@ +package miscutil.gregtech.metatileentity.implementations; + +import static gregtech.api.enums.GT_Values.GT; +import gregtech.api.interfaces.ITexture; +import gregtech.api.metatileentity.MetaTileEntity; + +public abstract class GregtechMetaTileEntity extends MetaTileEntity { + /** + * Value between [0 - 9] to describe the Tier of this Machine. + */ + public final byte mTier; + + /** + * A simple Description. + */ + public final String mDescription; + + /** + * Contains all Textures used by this Block. + */ + public final ITexture[][][] mTextures; + + public GregtechMetaTileEntity(int aID, String aName, String aNameRegional, int aTier, int aInvSlotCount, String aDescription, ITexture... aTextures) { + super(aID, aName, aNameRegional, aInvSlotCount); + mTier = (byte)Math.max(0, Math.min(aTier, 9)); + mDescription = aDescription; + + // must always be the last call! + if (GT.isClientSide()) mTextures = getTextureSet(aTextures); else mTextures = null; + } + + public GregtechMetaTileEntity(String aName, int aTier, int aInvSlotCount, String aDescription, ITexture[][][] aTextures) { + super(aName, aInvSlotCount); + mTier = (byte)aTier; + mDescription = aDescription; + mTextures = aTextures; + } + + @Override + public byte getTileEntityBaseType() { + return (byte)(Math.min(3, mTier<=0?0:1+((mTier-1) / 4))); + } + + @Override + public long getInputTier() { + return mTier; + } + + @Override + public long getOutputTier() { + return mTier; + } + + @Override + public String[] getDescription() { + return new String[] {mDescription}; + } + + /** + * Used Client Side to get a Texture Set for this Block. + * Called after setting the Tier and the Description so that those two are accessible. + * @param aTextures is the optional Array you can give to the Constructor. + */ + public abstract ITexture[][][] getTextureSet(ITexture[] aTextures); +}
\ No newline at end of file |