loadTextures({
    "base": "gowhp:kratos/draupnirspear",
    "base_lights": "gowhp:kratos/draupnirspear_lights"
});

var utils = implement("fisktag:external/utils");

var model;
var cancelAnimations = false;

function init(renderer) {
    model = utils.createModel(renderer, "gowhp:draupnirspear", "base", "base_lights");
    renderer.setModel(model);

    utils.addPlayerAnimationWithData(renderer, "fisktag:dual_hand", "fiskheroes:aiming_timer");

    utils.addPlayerAnimation(renderer, "gowhp:sprint_kratos")
        .setData((entity, data) => data.load(1.0))
        .setCondition(entity => (entity.isSprinting()));
}

function render(renderer, entity, glProxy, renderType, isLeftSide) {
    cancelAnimations = false;
    if (renderType === "EQUIPPED_FIRST_PERSON") {
        glProxy.translate(0.0, 2.5, 0.0);
    }
    if (renderType === "ENTITY") {
        glProxy.translate(0.0, -2.7, 0.00);
        glProxy.scale(1.0);
    }
    if (renderType === "INVENTORY") {
        glProxy.translate(0.0, 0.0, -0.05);
        glProxy.scale(0.5);
    }
    glProxy.translate(0.0, -0.6, -0.1);
    glProxy.rotate(90.0, 0.0, 1.0, 0.0);
    glProxy.scale(1.0);
}
