Search in sources :

Example 1 with BannerContext

use of net.moddingplayground.frame.api.bannerpatterns.v0.BannerContext in project frame-fabric by moddingplayground.

the class BannerBlockEntityRendererMixin method frame_renderBannerPattern.

@Unique
private static void frame_renderBannerPattern(FrameBannerPatternData data, MatrixStack stack, VertexConsumerProvider vertices, ModelPart part, int light, int overlay, boolean banner) {
    BannerContext context = BannerContext.from(banner);
    FrameBannerPattern pattern = data.pattern();
    Identifier id = pattern.getSpriteId(context);
    SpriteIdentifier spriteId = FRAME_SPRITE_IDS.apply(context.getAtlas(), id);
    DyeColor color = data.color();
    float[] colors = color.getColorComponents();
    part.render(stack, spriteId.getVertexConsumer(vertices, RenderLayer::getEntityNoOutline), light, overlay, colors[0], colors[1], colors[2], 1.0f);
}
Also used : SpriteIdentifier(net.minecraft.client.util.SpriteIdentifier) BannerContext(net.moddingplayground.frame.api.bannerpatterns.v0.BannerContext) SpriteIdentifier(net.minecraft.client.util.SpriteIdentifier) Identifier(net.minecraft.util.Identifier) FrameBannerPattern(net.moddingplayground.frame.api.bannerpatterns.v0.FrameBannerPattern) DyeColor(net.minecraft.util.DyeColor) Unique(org.spongepowered.asm.mixin.Unique)

Aggregations

SpriteIdentifier (net.minecraft.client.util.SpriteIdentifier)1 DyeColor (net.minecraft.util.DyeColor)1 Identifier (net.minecraft.util.Identifier)1 BannerContext (net.moddingplayground.frame.api.bannerpatterns.v0.BannerContext)1 FrameBannerPattern (net.moddingplayground.frame.api.bannerpatterns.v0.FrameBannerPattern)1 Unique (org.spongepowered.asm.mixin.Unique)1