Skip to content

Commit

Permalink
Allow dyed horse leather armor to translate (GeyserMC#2016)
Browse files Browse the repository at this point in the history
  • Loading branch information
Camotoy authored Mar 14, 2021
1 parent 1d8961c commit 2f058e0
Showing 1 changed file with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,28 @@
@ItemRemapper
public class LeatherArmorTranslator extends NbtItemStackTranslator {

private static final String[] ITEMS = new String[]{"minecraft:leather_helmet", "minecraft:leather_chestplate", "minecraft:leather_leggings", "minecraft:leather_boots"};
private static final String[] ITEMS = new String[]{"minecraft:leather_helmet", "minecraft:leather_chestplate",
"minecraft:leather_leggings", "minecraft:leather_boots", "minecraft:leather_horse_armor"};

@Override
public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemEntry itemEntry) {
if (!itemTag.contains("display")) {
CompoundTag displayTag = itemTag.get("display");
if (displayTag == null) {
return;
}
CompoundTag displayTag = itemTag.get("display");
if (displayTag.contains("color")) {
IntTag color = displayTag.get("color");
if (color != null) {
itemTag.put(new IntTag("customColor", color.getValue()));
displayTag.remove("color");
}
IntTag color = displayTag.get("color");
if (color != null) {
itemTag.put(new IntTag("customColor", color.getValue()));
displayTag.remove("color");
}
}

@Override
public void translateToJava(CompoundTag itemTag, ItemEntry itemEntry) {
if (!itemTag.contains("customColor")) {
IntTag color = itemTag.get("customColor");
if (color == null) {
return;
}
IntTag color = itemTag.get("customColor");
CompoundTag displayTag = itemTag.get("display");
if (displayTag == null) {
displayTag = new CompoundTag("display");
Expand Down

0 comments on commit 2f058e0

Please sign in to comment.