use of net.minecraft.client.render.VertexConsumer in project wildmod by Osmiooo.
the class WardenEntitySoulsFeatureRenderer method render.
@Override
public void render(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, WardenEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
if (entity.shouldRender) {
String string = Formatting.strip(entity.getName().getString());
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(this.SOULS);
if ("Osmiooo".equals(string)) {
vertexConsumer = vertexConsumers.getBuffer(this.SECRET_SOULS);
}
this.getContextModel().render(matrices, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, calcBeats(entity), calcBeats(entity), calcBeats(entity), 1.0f);
}
}
use of net.minecraft.client.render.VertexConsumer in project EmissiveMod by Traben-0.
the class MIX_TridentEntityRenderer method changeEmissiveTexture.
@Inject(method = "render(Lnet/minecraft/entity/projectile/TridentEntity;FFLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/model/TridentEntityModel;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;IIFFFF)V", shift = At.Shift.AFTER))
private void changeEmissiveTexture(TridentEntity tridentEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, CallbackInfo ci) {
if (ETFConfigData.enableTridents && ETFConfigData.enableEmissiveTextures) {
UUID id = tridentEntity.getUuid();
String path = TridentEntityModel.TEXTURE.toString();
String name = UUID_TridentName.get(id) != null ? "_" + UUID_TridentName.get(id).toLowerCase().replaceAll("[^a-z0-9/_.-]", "") : "";
String fileString = UUID_TridentName.get(id) != null ? path.replace(".png", "_" + name + ".png") : path;
if (!Texture_Emissive.containsKey(fileString)) {
for (String suffix : emissiveSuffix) {
Identifier possibleId = new Identifier(fileString.replace(".png", 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) {
VertexConsumer vertexConsumer = vertexConsumerProvider.getBuffer(RenderLayer.getBeaconBeam(Texture_Emissive.get(fileString), true));
this.model.render(matrixStack, vertexConsumer, 15728640, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
}
}
}
use of net.minecraft.client.render.VertexConsumer in project VisualOverhaul by TeamMidnightDust.
the class FurnaceBlockEntityRenderer method render.
public void render(E blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) {
if (VOConfig.furnace && blockEntity != null) {
BlockState blockState = blockEntity.getCachedState();
int lightAtBlock = WorldRenderer.getLightmapCoordinates(Objects.requireNonNull(blockEntity.getWorld()), blockEntity.getPos().offset(blockState.get(AbstractFurnaceBlock.FACING)));
ItemStack item1 = blockEntity.getStack(0);
ItemStack item2 = blockEntity.getStack(1);
float angle = (blockState.get(AbstractFurnaceBlock.FACING)).asRotation();
if (!item1.isEmpty()) {
matrices.push();
matrices.translate(0.5f, 0.58f, 0.5f);
if (blockEntity.getCachedState().getBlock().equals(Blocks.SMOKER))
matrices.translate(0f, -0.06f, 0f);
if (blockEntity.getCachedState().getBlock().equals(Blocks.BLAST_FURNACE))
matrices.translate(0f, -0.25f, 0f);
matrices.scale(1f, 1f, 1f);
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(angle * 3 + 180));
matrices.translate(0.0f, 0.0f, -0.4f);
matrices.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90));
MinecraftClient.getInstance().getItemRenderer().renderItem(item1, ModelTransformation.Mode.GROUND, lightAtBlock, overlay, matrices, vertexConsumers, 0);
matrices.pop();
}
if (!item2.isEmpty() && !item2.isIn(ItemTags.LOGS_THAT_BURN) && !item2.isIn(ItemTags.PLANKS)) {
matrices.push();
matrices.translate(0.5f, 0.08f, 0.5f);
if (blockEntity.getCachedState().getBlock().equals(Blocks.SMOKER))
matrices.translate(0f, 0.06f, 0f);
if (blockEntity.getCachedState().getBlock().equals(Blocks.BLAST_FURNACE))
matrices.translate(0f, 0.24f, 0f);
matrices.scale(1f, 1f, 1f);
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(angle * 3 + 180));
matrices.translate(0.0f, 0.0f, -0.4f);
matrices.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(90));
MinecraftClient.getInstance().getItemRenderer().renderItem(item2, ModelTransformation.Mode.GROUND, lightAtBlock, overlay, matrices, vertexConsumers, 0);
matrices.pop();
} else if (!item2.isEmpty()) {
matrices.push();
BlockState state = Block.getBlockFromItem(item2.getItem()).getDefaultState();
Sprite texture = MinecraftClient.getInstance().getBlockRenderManager().getModel(state).getParticleSprite();
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutoutNoCull(spriteToTexture(texture)));
matrices.translate(0.5f, -1.3f, 0.5f);
if (blockEntity.getCachedState().getBlock().equals(Blocks.SMOKER))
matrices.translate(0f, 0.06f, 0f);
if (blockEntity.getCachedState().getBlock().equals(Blocks.BLAST_FURNACE))
matrices.translate(0f, 0.2f, 0f);
matrices.scale(1f, 1f, 1f);
matrices.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(angle * 3 + 180));
planks.getPart().render(matrices, vertexConsumer, lightAtBlock, overlay);
matrices.pop();
}
}
}
use of net.minecraft.client.render.VertexConsumer in project winterly by tyap-lyap.
the class SantaHatRenderer method render.
@Override
public void render(BipedEntityModel<?> contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
WinterlyModels.SANTA_HAT_MODEL.hat.copyTransform(contextModel.head);
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(WinterlyMod.locate("textures/entity/" + texture + ".png")));
WinterlyModels.SANTA_HAT_MODEL.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
}
use of net.minecraft.client.render.VertexConsumer in project winterly by tyap-lyap.
the class ScarfRenderer method render.
@Override
public void render(BipedEntityModel<?> contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
WinterlyModels.SCARF_MODEL.scarf.copyTransform(contextModel.body);
VertexConsumer vertexConsumer = vertexConsumers.getBuffer(RenderLayer.getEntityCutout(WinterlyMod.locate("textures/entity/" + texture + ".png")));
WinterlyModels.SCARF_MODEL.render(matrices, vertexConsumer, light, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
}
Aggregations