mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-19 17:15:23 +01:00
Fix NPE in V3808
The armor items may not exist, so we need to null check it.
This commit is contained in:
parent
fe7043e19e
commit
122c9d3843
@ -22083,7 +22083,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
|
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
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..22b7bf301c8ab7cde285fa257f240986a697b83f
|
index 0000000000000000000000000000000000000000..78a10f89218eb0edf121f88978b4fe13e1b1bf44
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java
|
+++ b/src/main/java/ca/spottedleaf/dataconverter/minecraft/versions/V3808.java
|
||||||
@@ -0,0 +1,82 @@
|
@@ -0,0 +1,82 @@
|
||||||
@ -22133,12 +22133,12 @@ index 0000000000000000000000000000000000000000..22b7bf301c8ab7cde285fa257f240986
|
|||||||
+
|
+
|
||||||
+ if (this.clearArmor) {
|
+ if (this.clearArmor) {
|
||||||
+ final ListType armor = data.getList("ArmorItems", ObjectType.MAP);
|
+ final ListType armor = data.getList("ArmorItems", ObjectType.MAP);
|
||||||
+ if (armor.size() > 2) {
|
+ if (armor != null && armor.size() > 2) {
|
||||||
+ armor.setMap(2, data.getTypeUtil().createEmptyMap());
|
+ armor.setMap(2, data.getTypeUtil().createEmptyMap());
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
+ final ListType chances = data.getList("ArmorDropChances", ObjectType.FLOAT);
|
+ final ListType chances = data.getList("ArmorDropChances", ObjectType.FLOAT);
|
||||||
+ if (chances.size() > 2) {
|
+ if (chances != null && chances.size() > 2) {
|
||||||
+ chances.setFloat(2, 0.085F);
|
+ chances.setFloat(2, 0.085F);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
Loading…
Reference in New Issue
Block a user