From 6245b6a3eaf1ce475f6624da97ab3f04dcfd35f8 Mon Sep 17 00:00:00 2001 From: Draknyte1 Date: Mon, 29 Feb 2016 19:33:00 +1000 Subject: V0.9.2 Release - Removed dev features and some messy code to push a 0.9.2 snapshop codebase. --- .../base/GregtechMetaTileEntity.java | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaTileEntity.java (limited to 'src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaTileEntity.java') diff --git a/src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaTileEntity.java b/src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaTileEntity.java new file mode 100644 index 0000000000..bc3d2f4967 --- /dev/null +++ b/src/Java/miscutil/gregtech/metatileentity/implementations/base/GregtechMetaTileEntity.java @@ -0,0 +1,67 @@ +package miscutil.gregtech.metatileentity.implementations.base; + +import static gregtech.api.enums.GT_Values.GT; +import gregtech.api.interfaces.ITexture; +import gregtech.api.metatileentity.MetaTileEntity; +import net.minecraft.util.EnumChatFormatting; + +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, "Added by: " + EnumChatFormatting.DARK_GREEN+"Alkalus"}; + } + + /** + * 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 -- cgit