diff options
author | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:46:52 -0400 |
---|---|---|
committer | Shawn Buckley <shawntbuckley@gmail.com> | 2015-10-21 20:46:52 -0400 |
commit | 1185424fa7c692f9932623b965a99392d969e3c5 (patch) | |
tree | 39e19727dac27a4eff09a036fc27a1ee827d18a7 /src/main/java/gregtech/api/objects/GT_MultiTexture.java | |
parent | 9d85f43d5642c7683ad2877c66c6fc70b5be8928 (diff) | |
download | GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.tar.gz GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.tar.bz2 GT5-Unofficial-1185424fa7c692f9932623b965a99392d969e3c5.zip |
Move source files
Diffstat (limited to 'src/main/java/gregtech/api/objects/GT_MultiTexture.java')
-rw-r--r-- | src/main/java/gregtech/api/objects/GT_MultiTexture.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/objects/GT_MultiTexture.java b/src/main/java/gregtech/api/objects/GT_MultiTexture.java new file mode 100644 index 0000000000..295e51112c --- /dev/null +++ b/src/main/java/gregtech/api/objects/GT_MultiTexture.java @@ -0,0 +1,53 @@ +package gregtech.api.objects; + +import gregtech.api.interfaces.ITexture; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; + +/** + * Lets Multiple ITextures Render overlay over each other. + * + * I should have done this much earlier... + */ +public class GT_MultiTexture implements ITexture { + private final ITexture[] mTextures; + + public GT_MultiTexture(ITexture... aTextures) { + mTextures = aTextures; + } + + @Override + public void renderXPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderXPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderXNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderXNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderYPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderYPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderYNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderYNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderZPos(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderZPos(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public void renderZNeg(RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ) { + for (ITexture tTexture : mTextures) if (tTexture != null && tTexture.isValidTexture()) tTexture.renderZNeg(aRenderer, aBlock, aX, aY, aZ); + } + + @Override + public boolean isValidTexture() { + return true; + } +}
\ No newline at end of file |