mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Make some itemstacks nonnull
This commit is contained in:
parent
94231dffb8
commit
d18cd1513e
1 changed files with 4 additions and 4 deletions
|
@ -155,13 +155,13 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i
|
|||
case OFF_HAND:
|
||||
return this.getItemInOffHand();
|
||||
case FEET:
|
||||
return this.getBoots();
|
||||
return java.util.Objects.requireNonNullElseGet(this.getBoots(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull
|
||||
case LEGS:
|
||||
return this.getLeggings();
|
||||
return java.util.Objects.requireNonNullElseGet(this.getLeggings(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull
|
||||
case CHEST:
|
||||
return this.getChestplate();
|
||||
return java.util.Objects.requireNonNullElseGet(this.getChestplate(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull
|
||||
case HEAD:
|
||||
return this.getHelmet();
|
||||
return java.util.Objects.requireNonNullElseGet(this.getHelmet(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull
|
||||
default:
|
||||
throw new IllegalArgumentException("Could not get slot " + slot + " - not a valid slot for PlayerInventory");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue