loadTextures({
    "base": "skarlet:mallet",
    "christmas": "skarlet:mallet_christmas"
});

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

var model;
var cancelAnimations = false;

function init(renderer) {
    model = utils.createModel(renderer, "skarlet:mallet", "base");
    renderer.setModel(model);

    utils.addPlayerAnimation(renderer, "skarlet:mallet_holding").setData((entity, data) => data.load(1,1)).setCondition(entity => (!entity.isPunching())).priority = 10;
}

function render(renderer, entity, glProxy, renderType, scopeTimer, recoil, isLeftSide) {
    if (entity.isWearingFullSuit() && entity.getWornChestplate().suitType() == "skarlet:harley_quinn/christmas") {
        model.texture.set("christmas");
    } else {
        model.texture.set("base");
    }
	cancelAnimations = false;
    if (renderType === "EQUIPPED_FIRST_PERSON") {
        glProxy.scale(1.5);
        glProxy.translate(0.05, 0.2, -0.025);
        //glProxy.rotate(-5, 1, 0, 0);
    } else if (renderType === "ENTITY") {
        glProxy.scale(1.5);
        glProxy.rotate(90, 1, 0, 0);
        glProxy.rotate(90, 0, 1, 0);
        glProxy.translate(0.5, 0.5, 0.0);
    } else if (renderType === "INVENTORY") {
        glProxy.scale(0.8);
        glProxy.rotate(-45, 0, 1, 0);
        glProxy.rotate(-30, 0, 0, 1);
        glProxy.rotate(180, 0, 1, 0);
        glProxy.translate(0.0, 0.3, 0.8);
        glProxy.rotate(45, 1, 0, 0);
    } else if (renderType === "EQUIPPED") {
        glProxy.scale(1.5);
        glProxy.translate(0.05, 0.2, -0.025);
        glProxy.rotate(-5, 1, 0, 0);
    }
}
