mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Fix NPE if banner had no patterns
This commit is contained in:
parent
3aa7b2ddad
commit
79906fae0a
1 changed files with 7 additions and 6 deletions
|
@ -41,13 +41,14 @@ public class BannerBlockEntityTranslator extends BlockEntityTranslator {
|
||||||
List<Tag<?>> tags = new ArrayList<>();
|
List<Tag<?>> tags = new ArrayList<>();
|
||||||
ListTag patterns = tag.get("Patterns");
|
ListTag patterns = tag.get("Patterns");
|
||||||
List<com.nukkitx.nbt.tag.CompoundTag> tagsList = new ArrayList<>();
|
List<com.nukkitx.nbt.tag.CompoundTag> tagsList = new ArrayList<>();
|
||||||
for (com.github.steveice10.opennbt.tag.builtin.Tag patternTag : patterns.getValue()) {
|
if (tag.contains("Patterns")) {
|
||||||
tagsList.add(getPattern((CompoundTag) patternTag));
|
for (com.github.steveice10.opennbt.tag.builtin.Tag patternTag : patterns.getValue()) {
|
||||||
|
tagsList.add(getPattern((CompoundTag) patternTag));
|
||||||
|
}
|
||||||
|
com.nukkitx.nbt.tag.ListTag<com.nukkitx.nbt.tag.CompoundTag> bedrockPatterns =
|
||||||
|
new com.nukkitx.nbt.tag.ListTag<>("Patterns", com.nukkitx.nbt.tag.CompoundTag.class, tagsList);
|
||||||
|
tags.add(bedrockPatterns);
|
||||||
}
|
}
|
||||||
com.nukkitx.nbt.tag.ListTag<com.nukkitx.nbt.tag.CompoundTag> bedrockPatterns =
|
|
||||||
new com.nukkitx.nbt.tag.ListTag<>("Patterns", com.nukkitx.nbt.tag.CompoundTag.class, tagsList);
|
|
||||||
tags.add(bedrockPatterns);
|
|
||||||
|
|
||||||
if (tag.contains("CustomName")) {
|
if (tag.contains("CustomName")) {
|
||||||
tags.add(new StringTag("CustomName", (String) tag.get("CustomName").getValue()));
|
tags.add(new StringTag("CustomName", (String) tag.get("CustomName").getValue()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue