use of net.minecraft.client.render.VertexConsumer in project meteor-client by MeteorDevelopment.
the class BannerBlockEntityRendererMixin method renderCrossbar.
private void renderCrossbar(BannerBlockEntity bannerBlockEntity, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j) {
matrixStack.push();
BlockState blockState = bannerBlockEntity.getCachedState();
matrixStack.translate(0.5D, -0.1666666716337204D, 0.5D);
float h = -blockState.get(WallBannerBlock.FACING).asRotation();
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(h));
matrixStack.translate(0.0D, -0.3125D, -0.4375D);
matrixStack.push();
matrixStack.scale(0.6666667F, -0.6666667F, -0.6666667F);
VertexConsumer vertexConsumer = ModelLoader.BANNER_BASE.getVertexConsumer(vertexConsumerProvider, RenderLayer::getEntitySolid);
this.crossbar.render(matrixStack, vertexConsumer, i, j);
matrixStack.pop();
matrixStack.pop();
}
use of net.minecraft.client.render.VertexConsumer in project KiwiClient by TangyKiwi.
the class CapeRenderer method render.
public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, AbstractClientPlayerEntity abstractClientPlayerEntity, float f, float g, float h, float j, float k, float l) {
if (!(MinecraftClient.getInstance().currentScreen instanceof MainMenu) && KiwiClient.moduleManager.getModule(Cape.class).isEnabled() && !abstractClientPlayerEntity.isInvisible() && abstractClientPlayerEntity.isPartVisible(PlayerModelPart.CAPE) && abstractClientPlayerEntity.getName().equals(MinecraftClient.getInstance().player.getName())) {
ItemStack itemStack = abstractClientPlayerEntity.getEquippedStack(EquipmentSlot.CHEST);
if (itemStack.getItem() != Items.ELYTRA) {
matrixStack.push();
matrixStack.translate(0.0D, 0.0D, 0.125D);
double d = MathHelper.lerp(h, abstractClientPlayerEntity.prevCapeX, abstractClientPlayerEntity.capeX) - MathHelper.lerp((double) h, abstractClientPlayerEntity.prevX, abstractClientPlayerEntity.getX());
double e = MathHelper.lerp(h, abstractClientPlayerEntity.prevCapeY, abstractClientPlayerEntity.capeY) - MathHelper.lerp((double) h, abstractClientPlayerEntity.prevY, abstractClientPlayerEntity.getY());
double m = MathHelper.lerp(h, abstractClientPlayerEntity.prevCapeZ, abstractClientPlayerEntity.capeZ) - MathHelper.lerp((double) h, abstractClientPlayerEntity.prevZ, abstractClientPlayerEntity.getZ());
float n = abstractClientPlayerEntity.prevBodyYaw + (abstractClientPlayerEntity.bodyYaw - abstractClientPlayerEntity.prevBodyYaw);
double o = MathHelper.sin(n * 0.017453292F);
double p = -MathHelper.cos(n * 0.017453292F);
float q = (float) e * 10.0F;
q = MathHelper.clamp(q, -6.0F, 32.0F);
float r = (float) (d * o + m * p) * 100.0F;
r = MathHelper.clamp(r, 0.0F, 150.0F);
float s = (float) (d * p - m * o) * 100.0F;
s = MathHelper.clamp(s, -20.0F, 20.0F);
if (r < 0.0F) {
r = 0.0F;
}
float t = MathHelper.lerp(h, abstractClientPlayerEntity.prevStrideDistance, abstractClientPlayerEntity.strideDistance);
q += MathHelper.sin(MathHelper.lerp(h, abstractClientPlayerEntity.prevHorizontalSpeed, abstractClientPlayerEntity.horizontalSpeed) * 6.0F) * 32.0F * t;
if (abstractClientPlayerEntity.isInSneakingPose()) {
q += 25.0F;
}
matrixStack.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(6.0F + r / 2.0F + q));
matrixStack.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(s / 2.0F));
matrixStack.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(180.0F - s / 2.0F));
VertexConsumer vertexConsumer = ItemRenderer.getArmorGlintConsumer(vertexConsumerProvider, RenderLayer.getArmorCutoutNoCull(((Cape) KiwiClient.moduleManager.getModule(Cape.class)).getCape()), false, KiwiClient.moduleManager.getModule(Cape.class).getSettings().get(1).asToggle().state);
this.getContextModel().renderCape(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV);
matrixStack.pop();
}
}
}
use of net.minecraft.client.render.VertexConsumer in project KiwiClient by TangyKiwi.
the class Deadmau5EarsRenderer method render.
public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, AbstractClientPlayerEntity abstractClientPlayerEntity, float f, float g, float h, float j, float k, float l) {
if (!(MinecraftClient.getInstance().currentScreen instanceof MainMenu) && KiwiClient.moduleManager.getModule(Deadmau5Ears.class).isEnabled() && !abstractClientPlayerEntity.isInvisible() && abstractClientPlayerEntity.getName().equals(MinecraftClient.getInstance().player.getName())) {
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderLayer.getEntitySolid(KiwiClient.EARS));
int m = LivingEntityRenderer.getOverlay(abstractClientPlayerEntity, 0.0F);
matrixStack.push();
if (abstractClientPlayerEntity.isInSneakingPose()) {
matrixStack.translate(0.0D, 0.25D, 0.0D);
}
this.getContextModel().renderEars(matrixStack, vertexConsumer, i, m);
matrixStack.pop();
}
}
use of net.minecraft.client.render.VertexConsumer in project KiwiClient by TangyKiwi.
the class ElytraRenderer method render.
public void render(MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, AbstractClientPlayerEntity livingEntity, float f, float g, float h, float j, float k, float l) {
ItemStack itemStack = livingEntity.getEquippedStack(EquipmentSlot.CHEST);
if (itemStack.getItem() == Items.ELYTRA) {
Identifier resourcelocation;
if (KiwiClient.moduleManager.getModule(Cape.class).isEnabled() && ((Cape) KiwiClient.moduleManager.getModule(Cape.class)).getCape() != null && livingEntity.isPartVisible(PlayerModelPart.CAPE) && livingEntity.getName().equals(MinecraftClient.getInstance().player.getName())) {
resourcelocation = ((Cape) KiwiClient.moduleManager.getModule(Cape.class)).getCape();
} else {
resourcelocation = SKIN;
}
matrixStack.push();
matrixStack.translate(0.0D, 0.0D, 0.125D);
this.getContextModel().copyStateTo(this.elytra);
this.elytra.setAngles(livingEntity, f, g, j, k, l);
VertexConsumer vertexConsumer = ItemRenderer.getArmorGlintConsumer(vertexConsumerProvider, RenderLayer.getArmorCutoutNoCull(resourcelocation), false, itemStack.hasGlint());
this.elytra.render(matrixStack, vertexConsumer, i, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
matrixStack.pop();
}
}
use of net.minecraft.client.render.VertexConsumer in project EmissiveMod by Traben-0.
the class MIX_BuiltinModelItemRenderer method changeElytraTexture.
@Inject(method = "render", at = @At(value = "TAIL"))
private void changeElytraTexture(ItemStack stack, ModelTransformation.Mode mode, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, CallbackInfo ci) {
// at this point trident has already rendered we just have to render alterations over it :/
if (stack.isOf(Items.TRIDENT) && ETFConfigData.enableTridents) {
if (ETFConfigData.enableCustomTextures) {
if (stack.hasCustomName()) {
String path = TridentEntityModel.TEXTURE.toString();
String name = stack.getName().getString().toLowerCase().replaceAll("[^a-z0-9/_.-]", "");
Identifier possibleId = new Identifier(path.replace(".png", "_" + name + ".png"));
if (isExistingFile(possibleId)) {
matrices.push();
matrices.scale(1.0F, -1.0F, -1.0F);
VertexConsumer block = ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, this.modelTrident.getLayer(possibleId), false, stack.hasGlint());
this.modelTrident.render(matrices, block, light, overlay, 1.0F, 1.0F, 1.0F, 1.0F);
matrices.pop();
} else {
// vanilla
matrices.push();
matrices.scale(1.0F, -1.0F, -1.0F);
VertexConsumer block = ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, this.modelTrident.getLayer(TridentEntityModel.TEXTURE), false, stack.hasGlint());
this.modelTrident.render(matrices, block, light, overlay, 1.0F, 1.0F, 1.0F, 1.0F);
matrices.pop();
}
// vanilla render
} else {
// vanilla
matrices.push();
matrices.scale(1.0F, -1.0F, -1.0F);
VertexConsumer block = ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, this.modelTrident.getLayer(TridentEntityModel.TEXTURE), false, stack.hasGlint());
this.modelTrident.render(matrices, block, light, overlay, 1.0F, 1.0F, 1.0F, 1.0F);
matrices.pop();
}
} else {
// vanilla
matrices.push();
matrices.scale(1.0F, -1.0F, -1.0F);
VertexConsumer block = ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, this.modelTrident.getLayer(TridentEntityModel.TEXTURE), false, stack.hasGlint());
this.modelTrident.render(matrices, block, light, overlay, 1.0F, 1.0F, 1.0F, 1.0F);
matrices.pop();
}
if (ETFConfigData.enableEmissiveTextures) {
String path = TridentEntityModel.TEXTURE.toString();
String name = stack.hasCustomName() ? "_" + stack.getName().getString().toLowerCase().replaceAll("[^a-z0-9/_.-]", "") : "";
String fileString = path.replace(".png", "_" + name + ".png");
if (!Texture_Emissive.containsKey(fileString)) {
for (String suffix : emissiveSuffix) {
Identifier possibleId = new Identifier(path.replace(".png", name + suffix + ".png"));
if (isExistingFile(possibleId)) {
Texture_Emissive.put(fileString, possibleId);
}
}
if (!Texture_Emissive.containsKey(fileString)) {
Texture_Emissive.put(fileString, null);
}
}
if (Texture_Emissive.get(fileString) != null) {
matrices.push();
matrices.scale(1.0F, -1.0F, -1.0F);
VertexConsumer block = vertexConsumers.getBuffer(RenderLayer.getBeaconBeam(Texture_Emissive.get(fileString), true));
this.modelTrident.render(matrices, block, 15728640, overlay, 1.0F, 1.0F, 1.0F, 1.0F);
matrices.pop();
}
}
}
}
Aggregations