use of net.minecraft.client.renderer.IRenderTypeBuffer in project AgriCraft by AgriCraft.
the class BotanyPotsPlantRenderer method renderPlant.
public void renderPlant(IAgriPlant plant, IAgriGrowthStage stage, IAgriWeed weed, IAgriGrowthStage weedStage, MatrixStack matrix, IRenderTypeBuffer buffer, int light, int overlay, Direction... preferredSides) {
if (buffer instanceof IRenderTypeBuffer.Impl) {
ITessellator tessellator = this.getTessellator((IRenderTypeBuffer.Impl) buffer);
tessellator.pushMatrix();
tessellator.setBrightness(light);
tessellator.setOverlay(overlay);
tessellator.applyTransformation(matrix.getLast().getMatrix());
tessellator.startDrawingQuads();
tessellator.addQuads(this.fetchQuads(plant, stage, preferredSides));
tessellator.addQuads(this.fetchQuads(weed, weedStage, preferredSides));
tessellator.draw();
tessellator.popMatrix();
}
}
use of net.minecraft.client.renderer.IRenderTypeBuffer in project AgriCraft by AgriCraft.
the class TileEntitySprinklerRenderer method render.
@Override
public void render(TileEntitySprinkler tile, float partialTicks, MatrixStack transforms, IRenderTypeBuffer buffer, int light, int overlay) {
if (buffer instanceof IRenderTypeBuffer.Impl) {
// Apply transformation
transforms.push();
transforms.translate(0.5, 0, 0.5);
transforms.rotate(Vector3f.YP.rotationDegrees(tile.getAngle(partialTicks)));
transforms.translate(-0.5, 0, -0.5);
// Fetch tessellator and start drawing
ITessellator tessellator = this.getTessellator((IRenderTypeBuffer.Impl) buffer);
tessellator.startDrawingQuads();
// Configure tessellator
tessellator.pushMatrix();
tessellator.applyTransformation(transforms.getLast().getMatrix());
tessellator.setBrightness(light).setOverlay(overlay);
// Draw
this.drawGeometry(tessellator);
// End drawing
tessellator.popMatrix().draw();
transforms.pop();
}
}
Aggregations