diff options
author | Spottedleaf <[email protected]> | 2024-06-15 22:57:01 -0700 |
---|---|---|
committer | Spottedleaf <[email protected]> | 2024-06-15 22:59:15 -0700 |
commit | f873bcee24264ea91a3350af871222b09c4ee228 (patch) | |
tree | 7fdcd274ff230fa3fa9ab4a50412479ecc798d3f | |
parent | 7240d9d81c2e0fd2a2bce4dbe4543f0016b3065e (diff) | |
download | Paper-f873bcee24264ea91a3350af871222b09c4ee228.tar.gz Paper-f873bcee24264ea91a3350af871222b09c4ee228.zip |
Fix NPE in V3808
The armor items may not exist, so we need to null check it.
-rw-r--r-- | patches/server/0992-Rewrite-dataconverter-system.patch | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/patches/server/0992-Rewrite-dataconverter-system.patch b/patches/server/0992-Rewrite-dataconverter-system.patch index e28b6c8b61..b03980be16 100644 --- a/patches/server/0992-Rewrite-dataconverter-system.patch +++ b/patches/server/0992-Rewrite-dataconverter-system.patch @@ -22111,7 +22111,7 @@ index 0000000000000000000000000000000000000000..a76916cdb7cf91b8ba5461524472b3e4 +} diff --git a/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java new file mode 100644 -index 0000000000000000000000000000000000000000..22b7bf301c8ab7cde285fa257f240986a697b83f +index 0000000000000000000000000000000000000000..78a10f89218eb0edf121f88978b4fe13e1b1bf44 --- /dev/null +++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java @@ -0,0 +1,82 @@ @@ -22161,12 +22161,12 @@ index 0000000000000000000000000000000000000000..22b7bf301c8ab7cde285fa257f240986 + + if (this.clearArmor) { + final ListType armor = data.getList("ArmorItems", ObjectType.MAP); -+ if (armor.size() > 2) { ++ if (armor != null && armor.size() > 2) { + armor.setMap(2, data.getTypeUtil().createEmptyMap()); + } + + final ListType chances = data.getList("ArmorDropChances", ObjectType.FLOAT); -+ if (chances.size() > 2) { ++ if (chances != null && chances.size() > 2) { + chances.setFloat(2, 0.085F); + } + } |