-
-
Save ThexXTURBOXx/93c67403e35ac0340e8dc5fe87c6924d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.Femtopedia.XYCraftRL.client; | |
import de.Femtopedia.XYCraftRL.TileEntityGlow; | |
import net.minecraft.client.Minecraft; | |
import net.minecraft.client.renderer.VertexBuffer; | |
import net.minecraft.util.math.BlockPos; | |
import net.minecraftforge.client.model.animation.FastTESR; | |
public class GlowTESR extends FastTESR<TileEntityGlow> { | |
@Override | |
public void renderTileEntityFast(TileEntityGlow te, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer buf) { | |
for(int i = 0; i < te.layers.size(); i++) { | |
buf.setTranslation(x, y, z); | |
float cx = te.coordX.get(i); | |
float cy = te.coordY.get(i); | |
float maxx = te.maxX.get(i); | |
float maxy = te.maxY.get(i); | |
int l1 = Minecraft.getMinecraft().world.getCombinedLight(new BlockPos(x, y, z), 0); | |
int l2 = l1; | |
Minecraft.getMinecraft().renderEngine.bindTexture(te.layers.get(i)); | |
//NORTH | |
buf.pos(0, 1, 0).color(255, 255, 255, 255).tex(cx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(1, 1, 0).color(255, 255, 255, 255).tex(cx + maxx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(1, 0, 0).color(255, 255, 255, 255).tex(cx + maxx, cy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 0, 0).color(255, 255, 255, 255).tex(cx, cy).lightmap(l1, l2).endVertex(); | |
//SOUTH | |
buf.pos(1, 1, 1).color(255, 255, 255, 255).tex(cx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 1, 1).color(255, 255, 255, 255).tex(cx + maxx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 0, 1).color(255, 255, 255, 255).tex(cx + maxx, cy).lightmap(l1, l2).endVertex(); | |
buf.pos(1, 0, 1).color(255, 255, 255, 255).tex(cx, cy).lightmap(l1, l2).endVertex(); | |
//EAST | |
buf.pos(1, 1, 0).color(255, 255, 255, 255).tex(cx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(1, 1, 1).color(255, 255, 255, 255).tex(cx + maxx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(1, 0, 1).color(255, 255, 255, 255).tex(cx + maxx, cy).lightmap(l1, l2).endVertex(); | |
buf.pos(1, 0, 0).color(255, 255, 255, 255).tex(cx, cy).lightmap(l1, l2).endVertex(); | |
//WEST | |
buf.pos(0, 1, 1).color(255, 255, 255, 255).tex(cx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 1, 0).color(255, 255, 255, 255).tex(cx + maxx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 0, 0).color(255, 255, 255, 255).tex(cx + maxx, cy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 0, 1).color(255, 255, 255, 255).tex(cx, cy).lightmap(l1, l2).endVertex(); | |
//TOP | |
buf.pos(1, 1, 0).color(255, 255, 255, 255).tex(cx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 1, 0).color(255, 255, 255, 255).tex(cx + maxx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 1, 1).color(255, 255, 255, 255).tex(cx + maxx, cy).lightmap(l1, l2).endVertex(); | |
buf.pos(1, 1, 1).color(255, 255, 255, 255).tex(cx, cy).lightmap(l1, l2).endVertex(); | |
//DOWN | |
buf.pos(1, 0, 1).color(255, 255, 255, 255).tex(cx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 0, 1).color(255, 255, 255, 255).tex(cx + maxx, cy + maxy).lightmap(l1, l2).endVertex(); | |
buf.pos(0, 0, 0).color(255, 255, 255, 255).tex(cx + maxx, cy).lightmap(l1, l2).endVertex(); | |
buf.pos(1, 0, 0).color(255, 255, 255, 255).tex(cx, cy).lightmap(l1, l2).endVertex(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment