mirror of
https://github.com/haselkern/Minecraft-ArmorStand.git
synced 2025-05-17 15:05:33 +00:00
Add support for 1.16 & other improvements
This commit is contained in:
parent
565427f6f1
commit
86c8bfb711
3 changed files with 95 additions and 15 deletions
BIN
images/slots.png
BIN
images/slots.png
Binary file not shown.
Before Width: | Height: | Size: 570 B After Width: | Height: | Size: 1.2 KiB |
12
index.htm
12
index.htm
|
@ -39,7 +39,9 @@
|
|||
|
||||
<div class="padding underline">
|
||||
<select id="mcversion">
|
||||
<option value="1.13">Minecraft 1.13 and above</option>
|
||||
<option value="1.16">Minecraft 1.16 and above</option>
|
||||
<option value="1.14">Minecraft 1.14 & 1.15</option>
|
||||
<option value="1.13">Minecraft 1.13</option>
|
||||
<option value="1.11">Minecraft 1.11 & 1.12</option>
|
||||
<option value="1.9">Minecraft 1.9 & 1.10</option>
|
||||
<option value="1.8">Minecraft 1.8</option>
|
||||
|
@ -124,6 +126,7 @@
|
|||
<option value="chainmail_boots">
|
||||
<option value="diamond_boots">
|
||||
<option value="golden_boots">
|
||||
<option value="netherite_boots">
|
||||
<option value="iron_boots">
|
||||
<option value="leather_boots">
|
||||
</datalist>
|
||||
|
@ -134,6 +137,7 @@
|
|||
<option value="chainmail_leggings">
|
||||
<option value="diamond_leggings">
|
||||
<option value="golden_leggings">
|
||||
<option value="netherite_leggings">
|
||||
<option value="iron_leggings">
|
||||
<option value="leather_leggings">
|
||||
</datalist>
|
||||
|
@ -144,6 +148,7 @@
|
|||
<option value="chainmail_chestplate">
|
||||
<option value="diamond_chestplate">
|
||||
<option value="golden_chestplate">
|
||||
<option value="netherite_chestplate">
|
||||
<option value="iron_chestplate">
|
||||
<option value="leather_chestplate">
|
||||
</datalist>
|
||||
|
@ -155,6 +160,7 @@
|
|||
<option value="chainmail_helmet">
|
||||
<option value="diamond_helmet">
|
||||
<option value="golden_helmet">
|
||||
<option value="netherite_helmet">
|
||||
<option value="iron_helmet">
|
||||
<option value="leather_helmet">
|
||||
</datalist>
|
||||
|
@ -224,6 +230,7 @@
|
|||
<span class="sprite" style="background-position: 0px -32px"></span>
|
||||
<span class="sprite" style="background-position: 0px -48px"></span>
|
||||
<span class="sprite" style="background-position: 0px -64px"></span>
|
||||
<span class="sprite offhand" style="background-position: 0px -80px"></span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
@ -233,6 +240,7 @@
|
|||
<span><input id="dL" type="checkbox"></input></span>
|
||||
<span><input id="dB" type="checkbox"></input></span>
|
||||
<span><input id="dW" type="checkbox"></input></span>
|
||||
<span><input id="dO" type="checkbox"></input></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="first">Replace</span>
|
||||
|
@ -241,6 +249,7 @@
|
|||
<span><input id="rL" type="checkbox"></input></span>
|
||||
<span><input id="rB" type="checkbox"></input></span>
|
||||
<span><input id="rW" type="checkbox"></input></span>
|
||||
<span><input id="rO" type="checkbox"></input></span>
|
||||
</div>
|
||||
<div>
|
||||
<span class="first">Place</span>
|
||||
|
@ -249,6 +258,7 @@
|
|||
<span><input id="pL" type="checkbox"></input></span>
|
||||
<span><input id="pB" type="checkbox"></input></span>
|
||||
<span><input id="pW" type="checkbox"></input></span>
|
||||
<span><input id="pO" type="checkbox"></input></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
96
js/main.js
96
js/main.js
|
@ -54,6 +54,10 @@ var equipColorShoes;
|
|||
var equipColorLeggings;
|
||||
var equipColorChestplate;
|
||||
var equipColorHelmet;
|
||||
var helmetList;
|
||||
var chestplateList;
|
||||
var leggingsList;
|
||||
var bootsList;
|
||||
|
||||
var customName;
|
||||
var showCustomName;
|
||||
|
@ -180,6 +184,11 @@ $(document).ready(function(){
|
|||
}
|
||||
});
|
||||
|
||||
helmetList = $("#list-helmet").find("option");
|
||||
chestplateList = $("#list-chestplate").find("option");
|
||||
leggingsList = $("#list-leggings").find("option");
|
||||
bootsList = $("#list-shoes").find("option");
|
||||
|
||||
});
|
||||
|
||||
function loadScreen() {
|
||||
|
@ -439,18 +448,45 @@ function updateUI(){
|
|||
}
|
||||
|
||||
// Show disabled slots
|
||||
if(useDisabledSlots)
|
||||
if(useDisabledSlots) {
|
||||
// Hide offhand disabled slot buttons for versions below 1.13
|
||||
switch (mcVersion) {
|
||||
case "1.13":
|
||||
case "1.11":
|
||||
case "1.9":
|
||||
case "1.8":
|
||||
$(".sprite.offhand").hide();
|
||||
$("#dO").hide();
|
||||
$("#rO").hide();
|
||||
$("#pO").hide();
|
||||
break;
|
||||
|
||||
default:
|
||||
$(".sprite.offhand").show();
|
||||
$("#dO").show();
|
||||
$("#rO").show();
|
||||
$("#pO").show();
|
||||
break;
|
||||
|
||||
}
|
||||
$("#disabledslots").slideDown();
|
||||
}
|
||||
else
|
||||
$("#disabledslots").slideUp();
|
||||
|
||||
//Hide 1.13 features for 1.12 and lower.
|
||||
if (mcVersion == "1.13") {
|
||||
$("#namecustomization").show()
|
||||
$("#centercorrected").show()
|
||||
} else {
|
||||
$("#namecustomization").hide()
|
||||
$("#centercorrected").hide()
|
||||
switch (mcVersion) {
|
||||
case "1.11":
|
||||
case "1.9":
|
||||
case "1.8":
|
||||
$("#namecustomization").hide();
|
||||
$("#centercorrected").hide();
|
||||
break;
|
||||
|
||||
default:
|
||||
$("#namecustomization").show();
|
||||
$("#centercorrected").show();
|
||||
break;
|
||||
}
|
||||
|
||||
// Generate code
|
||||
|
@ -555,6 +591,31 @@ function generateCode(){
|
|||
|
||||
tags.push("HandItems:["+hands.join(",")+"]");
|
||||
}
|
||||
|
||||
// Hide netherite armour for lower versions
|
||||
switch (mcVersion) {
|
||||
case "1.14":
|
||||
case "1.13":
|
||||
$("#list-helmet").empty().append(helmetList.filter("[value!=netherite_helmet]"));
|
||||
$("#list-chestplate").empty().append(chestplateList.filter("[value!=netherite_chestplate]"));
|
||||
$("#list-leggings").empty().append(leggingsList.filter("[value!=netherite_leggings]"));
|
||||
$("#list-shoes").empty().append(bootsList.filter("[value!=netherite_boots]"));
|
||||
break;
|
||||
case "1.11":
|
||||
case "1.9":
|
||||
case "1.8":
|
||||
$("#list-helmet").empty().append(helmetList.filter("[value!=netherite_helmet]").filter("[value!=turtle_helmet]"));
|
||||
$("#list-chestplate").empty().append(chestplateList.filter("[value!=netherite_chestplate]").filter("[value!=turtle_chestplate]"));
|
||||
$("#list-leggings").empty().append(leggingsList.filter("[value!=netherite_leggings]").filter("[value!=turtle_leggings]"));
|
||||
$("#list-shoes").empty().append(bootsList.filter("[value!=netherite_boots]").filter("[value!=turtle_boots]"));
|
||||
break;
|
||||
default:
|
||||
$("#list-helmet").empty().append(helmetList);
|
||||
$("#list-chestplate").empty().append(chestplateList);
|
||||
$("#list-leggings").empty().append(leggingsList);
|
||||
$("#list-shoes").empty().append(bootsList);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Custom name
|
||||
|
@ -750,26 +811,29 @@ function getNameObfuscated() {
|
|||
}
|
||||
|
||||
function calculateDisabledSlotsFlag() {
|
||||
var dO = $("#dO").is(":checked") ? 1 << (5) : 0;
|
||||
var dH = $("#dH").is(":checked") ? 1 << (4) : 0;
|
||||
var dC = $("#dC").is(":checked") ? 1 << (3) : 0;
|
||||
var dL = $("#dL").is(":checked") ? 1 << (2) : 0;
|
||||
var dB = $("#dB").is(":checked") ? 1 << (1) : 0;
|
||||
var dW = $("#dW").is(":checked") ? 1 << (0) : 0;
|
||||
var dR = dH + dC + dL + dB + dW;
|
||||
var dR = dO + dH + dC + dL + dB + dW;
|
||||
|
||||
var rO = $("#rO").is(":checked") ? 1 << (5 + 8) : 0;
|
||||
var rH = $("#rH").is(":checked") ? 1 << (4 + 8) : 0;
|
||||
var rC = $("#rC").is(":checked") ? 1 << (3 + 8) : 0;
|
||||
var rL = $("#rL").is(":checked") ? 1 << (2 + 8) : 0;
|
||||
var rB = $("#rB").is(":checked") ? 1 << (1 + 8) : 0;
|
||||
var rW = $("#rW").is(":checked") ? 1 << (0 + 8) : 0;
|
||||
var rR = rH + rC + rL + rB + rW;
|
||||
var rR = rO + rH + rC + rL + rB + rW;
|
||||
|
||||
var pO = $("#pO").is(":checked") ? 1 << (5 + 16) : 0;
|
||||
var pH = $("#pH").is(":checked") ? 1 << (4 + 16) : 0;
|
||||
var pC = $("#pC").is(":checked") ? 1 << (3 + 16) : 0;
|
||||
var pL = $("#pL").is(":checked") ? 1 << (2 + 16) : 0;
|
||||
var pB = $("#pB").is(":checked") ? 1 << (1 + 16) : 0;
|
||||
var pW = $("#pW").is(":checked") ? 1 << (0 + 16) : 0;
|
||||
var pR = pH + pC + pL + pB + pW;
|
||||
var pR = pO + pH + pC + pL + pB + pW;
|
||||
|
||||
var result = dR + rR + pR;
|
||||
return result;
|
||||
|
@ -943,21 +1007,24 @@ function saveData() {
|
|||
chestplate: $("#dC").is(":checked"),
|
||||
leggings: $("#dL").is(":checked"),
|
||||
boots: $("#dB").is(":checked"),
|
||||
weapons: $("#dW").is(":checked")
|
||||
weapons: $("#dW").is(":checked"),
|
||||
offhand: $("#dO").is(":checked")
|
||||
},
|
||||
replace: {
|
||||
helmet: $("#rH").is(":checked"),
|
||||
chestplate: $("#rC").is(":checked"),
|
||||
leggings: $("#rL").is(":checked"),
|
||||
boots: $("#rB").is(":checked"),
|
||||
weapons: $("#rW").is(":checked")
|
||||
weapons: $("#rW").is(":checked"),
|
||||
offhand: $("#rO").is(":checked")
|
||||
},
|
||||
place: {
|
||||
helmet: $("#pH").is(":checked"),
|
||||
chestplate: $("#pC").is(":checked"),
|
||||
leggings: $("#pL").is(":checked"),
|
||||
boots: $("#pB").is(":checked"),
|
||||
weapons: $("#pW").is(":checked")
|
||||
weapons: $("#pW").is(":checked"),
|
||||
offhand: $("#pO").is(":checked")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -1048,18 +1115,21 @@ function loadData(data) {
|
|||
//lock slot interaction
|
||||
$("input[name=usedisabledslots]").prop(`checked`, data.lock_slot_interaction.enabled);
|
||||
|
||||
$(`#dO`).prop(`checked`, data.lock_slot_interaction.remove.offhand);
|
||||
$(`#dH`).prop(`checked`, data.lock_slot_interaction.remove.helmet);
|
||||
$(`#dC`).prop(`checked`, data.lock_slot_interaction.remove.chestplate);
|
||||
$(`#dL`).prop(`checked`, data.lock_slot_interaction.remove.leggings);
|
||||
$(`#dB`).prop(`checked`, data.lock_slot_interaction.remove.boots);
|
||||
$(`#dW`).prop(`checked`, data.lock_slot_interaction.remove.weapons);
|
||||
|
||||
$(`#rO`).prop(`checked`, data.lock_slot_interaction.replace.offhand);
|
||||
$(`#rH`).prop(`checked`, data.lock_slot_interaction.replace.helmet);
|
||||
$(`#rC`).prop(`checked`, data.lock_slot_interaction.replace.chestplate);
|
||||
$(`#rL`).prop(`checked`, data.lock_slot_interaction.replace.leggings);
|
||||
$(`#rB`).prop(`checked`, data.lock_slot_interaction.replace.boots);
|
||||
$(`#rW`).prop(`checked`, data.lock_slot_interaction.replace.weapons);
|
||||
|
||||
$(`#pO`).prop(`checked`, data.lock_slot_interaction.place.offhand);
|
||||
$(`#pH`).prop(`checked`, data.lock_slot_interaction.place.helmet);
|
||||
$(`#pC`).prop(`checked`, data.lock_slot_interaction.place.chestplate);
|
||||
$(`#pL`).prop(`checked`, data.lock_slot_interaction.place.leggings);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue