Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Fix banner items
Dieser Commit ist enthalten in:
Ursprung
5d19697004
Commit
7ad59b7cb0
@ -281,13 +281,21 @@ public class InventoryPackets {
|
||||
// NBT Changes
|
||||
if (tag != null) {
|
||||
// Invert shield color id
|
||||
if (item.getId() == 442) {
|
||||
if (item.getId() == 442 || item.getId() == 425) {
|
||||
if (tag.get("BlockEntityTag") instanceof CompoundTag) {
|
||||
CompoundTag blockEntityTag = tag.get("BlockEntityTag");
|
||||
if (blockEntityTag.get("Base") instanceof IntTag) {
|
||||
IntTag base = blockEntityTag.get("Base");
|
||||
base.setValue(15 - base.getValue());
|
||||
}
|
||||
if (blockEntityTag.get("Patterns") instanceof ListTag) {
|
||||
for (Tag pattern : (ListTag) blockEntityTag.get("Patterns")) {
|
||||
if (pattern instanceof CompoundTag) {
|
||||
IntTag c = ((CompoundTag) pattern).get("Color");
|
||||
c.setValue(15 - c.getValue()); // Invert color id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Display Name now uses JSON
|
||||
@ -426,15 +434,24 @@ public class InventoryPackets {
|
||||
}
|
||||
}
|
||||
|
||||
if (item.getId() == 442) { // shield
|
||||
if (item.getId() == 442 || item.getId() == 425) { // shield / banner
|
||||
if (tag.get("BlockEntityTag") instanceof CompoundTag) {
|
||||
CompoundTag blockEntityTag = tag.get("BlockEntityTag");
|
||||
if (blockEntityTag.get("Base") instanceof IntTag) {
|
||||
IntTag base = blockEntityTag.get("Base");
|
||||
base.setValue(15 - base.getValue()); // invert color id
|
||||
}
|
||||
if (blockEntityTag.get("Patterns") instanceof ListTag) {
|
||||
for (Tag pattern : (ListTag) blockEntityTag.get("Patterns")) {
|
||||
if (pattern instanceof CompoundTag) {
|
||||
IntTag c = ((CompoundTag) pattern).get("Color");
|
||||
c.setValue(15 - c.getValue()); // Invert color id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Display Name now uses JSON
|
||||
if (tag.get("display") instanceof CompoundTag) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren