All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.parzivail.util.client.render.EmptyBlockEntityRenderer Maven / Gradle / Ivy

There is a newer version: 0.0.114+1.20.2
Show newest version
package com.parzivail.util.client.render;

import F;
import I;
import net.minecraft.class_1921;
import net.minecraft.class_1937;
import net.minecraft.class_2338;
import net.minecraft.class_238;
import net.minecraft.class_2586;
import net.minecraft.class_265;
import net.minecraft.class_310;
import net.minecraft.class_327;
import net.minecraft.class_4587;
import net.minecraft.class_4588;
import net.minecraft.class_4597;
import net.minecraft.class_5614;
import net.minecraft.class_761;
import net.minecraft.class_827;
import org.joml.Matrix4f;

public class EmptyBlockEntityRenderer implements class_827
{
	public EmptyBlockEntityRenderer(class_5614.class_5615 ctx)
	{
	}

	@Override
	public void method_3569(T blockEntity, float tickDelta, class_4587 matrices, class_4597 vertexConsumers, int light, int overlay)
	{
		var minecraft = class_310.method_1551();
		if (!minecraft.method_53526().method_53536())
			return;

		var world = blockEntity.method_10997();
		var pos = blockEntity.method_11016();
		var shape = world.method_8320(pos).method_26218(world, pos);

		matrices.method_22903();

		matrices.method_46416(0.5f, 0.5f, 0.5f);

		var f = 0.025f;
		var n = blockEntity.getClass().getSimpleName();

		matrices.method_22907(minecraft.method_1561().method_24197());
		matrices.method_22905(-f, -f, f);

		var textMatrix = matrices.method_23760().method_23761();

		var g = minecraft.field_1690.method_19343(0.25F);
		var k = (int)(g * 255.0F) << 24;
		var textRenderer = minecraft.field_1772;
		var h = (float)(-textRenderer.method_1727(n) / 2);

		textRenderer.method_27521(n, h, 0, 0x20ffffff, false, textMatrix, vertexConsumers, class_327.class_6415.field_33994, k, light);
		textRenderer.method_27521(n, h, 0, -1, false, textMatrix, vertexConsumers, class_327.class_6415.field_33993, 0, light);

		matrices.method_22909();

		var vertexConsumer = vertexConsumers.getBuffer(class_1921.method_23594());

		for (var box : shape.method_1090())
			class_761.method_22982(matrices, vertexConsumer, box, 1.0F, 1.0F, 1.0F, 1.0F);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy