diff options
| author | Foghrye4 <foghrye4@gmail.com> | 2017-08-10 18:50:56 +0300 |
|---|---|---|
| committer | Foghrye4 <foghrye4@gmail.com> | 2017-08-10 18:50:56 +0300 |
| commit | 877312184c472d9845e5ef1008bc538f4634059f (patch) | |
| tree | 4e098cc94296cc11f3b87e8ef64c3c568b6aeb51 /main/java/gregtech/api/objects/GT_MultiTexture.java | |
| parent | 939d2ea16679ce64d98b98c716b85f851aa576e2 (diff) | |
fix missing source folder
Diffstat (limited to 'main/java/gregtech/api/objects/GT_MultiTexture.java')
| -rw-r--r-- | main/java/gregtech/api/objects/GT_MultiTexture.java | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/main/java/gregtech/api/objects/GT_MultiTexture.java b/main/java/gregtech/api/objects/GT_MultiTexture.java new file mode 100644 index 0000000..295e511 --- /dev/null +++ b/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 |
