[ci skip] Replace some magic values with constant references

This commit is contained in:
Nassim Jahnke
2024-01-04 14:38:26 +01:00
parent 0f3d126ce1
commit 635ece80cf
10 changed files with 17 additions and 17 deletions

View File

@@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private void processText() {
+ CompoundTag display = getTagElement("display");
+ if (display != null) {
+ if (display.contains("Name", 8)) {
+ if (display.contains("Name", net.minecraft.nbt.Tag.TAG_STRING)) {
+ String json = display.getString("Name");
+ if (json != null && json.contains("\u00A7")) {
+ try {
@@ -26,8 +26,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ }
+ }
+ if (display.contains("Lore", 9)) {
+ ListTag list = display.getList("Lore", 8);
+ if (display.contains("Lore", net.minecraft.nbt.Tag.TAG_LIST)) {
+ ListTag list = display.getList("Lore", net.minecraft.nbt.Tag.TAG_STRING);
+ for (int index = 0; index < list.size(); index++) {
+ String json = list.getString(index);
+ if (json != null && json.contains("\u00A7")) { // Only try if it has legacy in the unparsed json