mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Allow dyed horse leather armor to translate (#2016)
This commit is contained in:
parent
1d8961c498
commit
2f058e05bd
1 changed files with 10 additions and 11 deletions
|
@ -35,29 +35,28 @@ import org.geysermc.connector.network.translators.item.ItemEntry;
|
||||||
@ItemRemapper
|
@ItemRemapper
|
||||||
public class LeatherArmorTranslator extends NbtItemStackTranslator {
|
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
|
@Override
|
||||||
public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemEntry itemEntry) {
|
public void translateToBedrock(GeyserSession session, CompoundTag itemTag, ItemEntry itemEntry) {
|
||||||
if (!itemTag.contains("display")) {
|
CompoundTag displayTag = itemTag.get("display");
|
||||||
|
if (displayTag == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
CompoundTag displayTag = itemTag.get("display");
|
|
||||||
if (displayTag.contains("color")) {
|
|
||||||
IntTag color = displayTag.get("color");
|
IntTag color = displayTag.get("color");
|
||||||
if (color != null) {
|
if (color != null) {
|
||||||
itemTag.put(new IntTag("customColor", color.getValue()));
|
itemTag.put(new IntTag("customColor", color.getValue()));
|
||||||
displayTag.remove("color");
|
displayTag.remove("color");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void translateToJava(CompoundTag itemTag, ItemEntry itemEntry) {
|
public void translateToJava(CompoundTag itemTag, ItemEntry itemEntry) {
|
||||||
if (!itemTag.contains("customColor")) {
|
IntTag color = itemTag.get("customColor");
|
||||||
|
if (color == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
IntTag color = itemTag.get("customColor");
|
|
||||||
CompoundTag displayTag = itemTag.get("display");
|
CompoundTag displayTag = itemTag.get("display");
|
||||||
if (displayTag == null) {
|
if (displayTag == null) {
|
||||||
displayTag = new CompoundTag("display");
|
displayTag = new CompoundTag("display");
|
||||||
|
|
Loading…
Reference in a new issue