Skip to content

Instantly share code, notes, and snippets.

@falseresync
Created January 18, 2023 18:31
Show Gist options
  • Save falseresync/3a23513f786b0b7d9a704de32779df8d to your computer and use it in GitHub Desktop.
Save falseresync/3a23513f786b0b7d9a704de32779df8d to your computer and use it in GitHub Desktop.
@Override
public void render(MagicCauldronBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
matrices.push();
var entry = matrices.peek();
var positionMatrix = entry.getPositionMatrix();
var normalMatrix = entry.getNormalMatrix();
var bufferBuilder = vertexConsumers.getBuffer(RenderLayer.getEntitySolid(LAVA_TEX));
bufferBuilder.vertex(positionMatrix,0, 1, 0).color(255, 255, 255,255).texture(0, 0).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(normalMatrix,0, 1, 0).next();
bufferBuilder.vertex(positionMatrix,1, 1, 0).color(255, 255, 255,255).texture(1, 0).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(normalMatrix,0, 1, 0).next();
bufferBuilder.vertex(positionMatrix,1, 1, 1).color(255, 255, 255,255).texture(1, 1).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(normalMatrix,0, 1, 0).next();
bufferBuilder.vertex(positionMatrix,0, 1, 1).color(255, 255, 255,255).texture(0, 1).overlay(OverlayTexture.DEFAULT_UV).light(LightmapTextureManager.MAX_LIGHT_COORDINATE).normal(normalMatrix,0, 1, 0).next();
matrices.pop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment