#Boat Rendering Issue

12 messages · Page 1 of 1 (latest)

vapid needle
#

im trying to update my mod for 1.21.3 and boats have been causing a lot of trouble. im mostly there but the need for a custom renderer is tripping me up. heres what i have so far:

@Environment(EnvType.CLIENT)
public class WillowBoatEntityRenderer extends BoatEntityRenderer {
    public static final EntityModelLayer WILLOW_BOAT = new EntityModelLayer(Identifier.of(BlocksForBuilders.MOD_ID, "willow_boat"), "main");
    private final Identifier texture;

    public WillowBoatEntityRenderer(EntityRendererFactory.Context ctx) {
        super(ctx, WILLOW_BOAT);
        texture = Identifier.of(BlocksForBuilders.MOD_ID, "textures/entity/boat/willow.png");
    }
    public Identifier getTexture() {
        return texture;
    }
}

and in the client class:

        EntityModelLayerRegistry.registerModelLayer(WillowBoatEntityRenderer.WILLOW_BOAT, BoatEntityModel::getTexturedModelData);

as it is, the boat model will render but i cant seem to get the textures to map to it. bit out my depth here, anyone got any ideas?

tepid talon
vapid needle
tepid talon
# vapid needle sorry wdym assume a path?

You extend BoatEntityRenderer, does it assume/append the path you provide, as In prefix it, or convert it to the Minecraft namespace. Is it hardcoded at any point in BoatEntityRenderer

vapid needle
#

ahh gotchu

#

BoatEntityRenderer has this:

public BoatEntityRenderer(EntityRendererFactory.Context ctx, EntityModelLayer layer) {
        super(ctx);
        this.texture = layer.id().withPath((path) -> {
            return "textures/entity/" + path + ".png";
        });
        this.waterMaskModel = new Model.SinglePartModel(ctx.getPart(EntityModelLayers.BOAT), (id) -> {
            return RenderLayer.getWaterMask();
        });
        this.model = new BoatEntityModel(ctx.getPart(layer));
    }
vapid needle
#

I tried like making my own boatentityrenderer implementing abstractboatentityrenderer but that seemed redundant and i couldnt get that to work either lol

#

oop i seem to have got it working

#

yeah i was being dumb, issue was the path field in the entity model layer needed to match the path for the texture

#

changed it from "willow_boat" to "boat/willow" and now it works lol