mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 09:34:42 +00:00
begin work
This commit is contained in:
commit
db2ad29b52
124 files changed
+11799
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package com.glodblock.github.util;
|
||||
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public final class RenderUtil {
|
||||
|
||||
public static void renderItemIcon(IIcon icon, double size, double z, float nx, float ny, float nz) {
|
||||
renderItemIcon(icon, 0.0D, 0.0D, size, size, z, nx, ny, nz);
|
||||
}
|
||||
|
||||
public static void renderItemIcon(IIcon icon, double xStart, double yStart, double xEnd, double yEnd, double z, float nx, float ny, float nz) {
|
||||
if (icon == null) {
|
||||
return;
|
||||
}
|
||||
Tessellator.instance.startDrawingQuads();
|
||||
Tessellator.instance.setNormal(nx, ny, nz);
|
||||
if (nz > 0.0F) {
|
||||
Tessellator.instance.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV());
|
||||
Tessellator.instance.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV());
|
||||
Tessellator.instance.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV());
|
||||
Tessellator.instance.addVertexWithUV(xStart, yEnd, z, icon.getMinU(), icon.getMaxV());
|
||||
} else {
|
||||
Tessellator.instance.addVertexWithUV(xStart, yEnd, z, icon.getMinU(), icon.getMaxV());
|
||||
Tessellator.instance.addVertexWithUV(xEnd, yEnd, z, icon.getMaxU(), icon.getMaxV());
|
||||
Tessellator.instance.addVertexWithUV(xEnd, yStart, z, icon.getMaxU(), icon.getMinV());
|
||||
Tessellator.instance.addVertexWithUV(xStart, yStart, z, icon.getMinU(), icon.getMinV());
|
||||
}
|
||||
Tessellator.instance.draw();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user