use of net.minecraft.client.render.item.ItemRenderer in project artifality by PinkGoosik.
the class BalloonRenderer method render.
@Override
public void render(ItemStack stack, SlotReference slotReference, EntityModel<? extends LivingEntity> contextModel, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, LivingEntity entity, float limbAngle, float limbDistance, float tickDelta, float animationProgress, float headYaw, float headPitch) {
ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
matrices.push();
if (entity.isInSneakingPose())
matrices.translate(0D, -1.25D, 0D);
else
matrices.translate(0D, -1.5D, 0D);
matrices.scale(0.8F, 0.8F, 0.8F);
matrices.multiply(Vec3f.POSITIVE_X.getDegreesQuaternion(180.0F));
String modelId = "artifality:balloon_in_hand#inventory";
itemRenderer.renderItem(stack, ModelTransformation.Mode.FIXED, false, matrices, vertexConsumers, light, OverlayTexture.DEFAULT_UV, itemRenderer.getModels().getModelManager().getModel(new ModelIdentifier(modelId)));
matrices.pop();
}
Aggregations