mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-11 10:12:06 -07:00
Fix NPE in V3808
The armor items may not exist, so we need to null check it.
This commit is contained in:
@@ -22161,12 +22161,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
+ 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);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
|
Reference in New Issue
Block a user