Skip to content

Commit

Permalink
Check for empty when sending equipment changes
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH committed Jan 25, 2025
1 parent 88bbead commit d17921f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion paper-api/src/main/java/org/bukkit/entity/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,7 @@ default void sendMultiBlockChange(@NotNull Map<? extends io.papermc.paper.math.P
*
* @param entity the entity whose equipment to change
* @param items the slots to change, where the values are the items to which
* the slot should be changed. null values will set the slot to air
* the slot should be changed. null values will set the slot to air, empty map is not allowed
*/
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull Map<EquipmentSlot, ItemStack> items);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,7 @@ public void sendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemSta
public void sendEquipmentChange(LivingEntity entity, Map<EquipmentSlot, ItemStack> items) {
Preconditions.checkArgument(entity != null, "Entity cannot be null");
Preconditions.checkArgument(items != null, "items cannot be null");
Preconditions.checkArgument(!items.isEmpty(), "items cannot be empty");

if (this.getHandle().connection == null) {
return;
Expand Down

0 comments on commit d17921f

Please sign in to comment.