1
0
Fork 0
mirror of https://github.com/haselkern/Minecraft-ArmorStand.git synced 2025-12-07 14:14:06 +00:00

Support the new dyed_color format for 1.21.5+ (#60)

Fixes #59
This commit is contained in:
thelennylord 2025-12-03 23:48:36 +05:30 committed by GitHub
parent 7bd46b4528
commit 7fa0529ed4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -755,8 +755,15 @@ function generateArmorItems() {
if (isLeatherArmor(armorID)) {
const element = $(`#${armorID.substring(8) + "_color"}`);
const color = getDecimalRGB(element.css("background-color"));
if (mcVersion >= MC_VERSION.v1_20_5) {
if (mcVersion >= MC_VERSION.v1_21_5) {
// In 1.21.5+, the format has now changed
// dyed_color={rgb:12345}] -> dyed_color=12345
// It can also be in the RGB array format: dyed_color=[0.5, 1.0, 0.2]
data.components = {
dyed_color: color
};
} else if (mcVersion >= MC_VERSION.v1_20_5) {
data.components = {
dyed_color: { rgb: color }
};