blob: 20188e2e0146bdcf0fb8b56aba416ee96c9b3a28 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
package gregtech.common.render;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import gregtech.api.interfaces.ITexture;
import gregtech.api.util.GT_UtilityClient;
public abstract class GT_TextureBase implements ITexture {
protected boolean isDrawing = false;
@Override
public void startDrawingQuads(RenderBlocks aRenderer, float aNormalX, float aNormalY, float aNormalZ) {
if (aRenderer.useInventoryTint && (!isOldTexture() || !GT_UtilityClient.isDrawing(Tessellator.instance))) {
// Draw if we're not an old texture OR we are an old texture AND we're not already drawing
isDrawing = true;
Tessellator.instance.startDrawingQuads();
Tessellator.instance.setNormal(aNormalX, aNormalY, aNormalZ);
}
}
@Override
public void draw(RenderBlocks aRenderer) {
if (aRenderer.useInventoryTint && (!isOldTexture() || isDrawing)) {
// Draw if we're not an old texture OR we initiated the drawing
isDrawing = false;
Tessellator.instance.draw();
}
}
}
|