diff --git a/dist/js/calculator.js b/dist/js/calculator.js index 65fa151..d5c3e35 100644 --- a/dist/js/calculator.js +++ b/dist/js/calculator.js @@ -46,7 +46,7 @@ function buildJSON(supportsCMD, item, namespace, models) { }; } } else { - //Insert not damaged item + //Insert not damaged item (in default namespace) json['overrides'][0] = { 'predicate': { 'damaged': 0, @@ -57,19 +57,16 @@ function buildJSON(supportsCMD, item, namespace, models) { //Insert damaged models for (let i = 0; i < models.length; i++) { - const model = models[i]; - const damage = (i + 1) / (itemDamages[item] - 1); - json['overrides'][i + 1] = { 'predicate': { 'damaged': 0, - 'damage': damage + 'damage': (i + 1) / (itemDamages[item] - 1) }, - 'model': namespace + model + 'model': namespace + 'item/' + models[i] }; } - //Insert fully damaged item + //Insert fully damaged item (in default namespace) json['overrides'][models.length + 1] = { 'predicate': { 'damaged': 1, diff --git a/dist/js/calculator.min.js b/dist/js/calculator.min.js index a523c76..764d59b 100644 --- a/dist/js/calculator.min.js +++ b/dist/js/calculator.min.js @@ -1 +1 @@ -const itemDamages={leather_helmet:55,leather_chestplate:80,leather_leggings:75,leather_boots:65,netherite_hoe:2031,diamond_axe:1561,diamond_hoe:1561,shears:238};function buildJSON(supportsCMD,item,namespace,models){namespace=namespace==="minecraft"?"":namespace+":";const json={};json["parent"]="item/handheld";json["textures"]={layer0:"item/"+item,layer1:"item/"+item+"_overlay"};json["overrides"]=[];if(supportsCMD){for(let i=0;i