3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-03 14:50:19 +01:00

Disabled attempted rendering of the globe pattern

Dieser Commit ist enthalten in:
rtm516 2020-04-27 02:01:15 -05:00 committet von RednedEpic
Ursprung 3163ab8ddc
Commit fc17b7cc7a

Datei anzeigen

@ -56,7 +56,10 @@ public class BannerBlockEntityTranslator extends BlockEntityTranslator implement
List<com.nukkitx.nbt.tag.CompoundTag> tagsList = new ArrayList<>(); List<com.nukkitx.nbt.tag.CompoundTag> tagsList = new ArrayList<>();
if (tag.contains("Patterns")) { if (tag.contains("Patterns")) {
for (com.github.steveice10.opennbt.tag.builtin.Tag patternTag : patterns.getValue()) { for (com.github.steveice10.opennbt.tag.builtin.Tag patternTag : patterns.getValue()) {
tagsList.add(getPattern((CompoundTag) patternTag)); com.nukkitx.nbt.tag.CompoundTag newPatternTag = getPattern((CompoundTag) patternTag);
if (newPatternTag != null) {
tagsList.add(newPatternTag);
}
} }
com.nukkitx.nbt.tag.ListTag<com.nukkitx.nbt.tag.CompoundTag> 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); new com.nukkitx.nbt.tag.ListTag<>("Patterns", com.nukkitx.nbt.tag.CompoundTag.class, tagsList);
@ -82,10 +85,24 @@ public class BannerBlockEntityTranslator extends BlockEntityTranslator implement
return tagBuilder.buildRootTag(); return tagBuilder.buildRootTag();
} }
/**
* Convert the Java edition pattern nbt to Bedrock edition, null if the pattern doesn't exist
*
* @param pattern Java edition pattern nbt
* @return The Bedrock edition format pattern nbt
*/
protected com.nukkitx.nbt.tag.CompoundTag getPattern(CompoundTag pattern) { protected com.nukkitx.nbt.tag.CompoundTag getPattern(CompoundTag pattern) {
String patternName = (String) pattern.get("Pattern").getValue();
// Return null if its the globe pattern as it doesn't exist on bedrock
if (patternName.equals("glb")) {
return null;
}
return CompoundTagBuilder.builder() return CompoundTagBuilder.builder()
.intTag("Color", 15 - (int) pattern.get("Color").getValue()) .intTag("Color", 15 - (int) pattern.get("Color").getValue())
.stringTag("Pattern", (String) pattern.get("Pattern").getValue()) .stringTag("Pattern", (String) pattern.get("Pattern").getValue())
.stringTag("Pattern", patternName)
.buildRootTag(); .buildRootTag();
} }
} }