GT5-Unofficial/src/main/java/gregtech/api/objects/GT_MultiTexture.java

59 lines
2.1 KiB
Java
Raw Normal View History

2015-04-23 16:14:22 +00:00
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.
2015-10-22 02:06:25 +00:00
* <p/>
2015-04-23 16:14:22 +00:00
* I should have done this much earlier...
*/
public class GT_MultiTexture implements ITexture {
2015-10-22 02:06:25 +00:00
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;
}
2015-04-23 16:14:22 +00:00
}