8000 Check for empty when sending equipment changes (#12008) · PaperMC/Paper@336ea9d · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 336ea9d

Browse files
authored
Check for empty when sending equipment changes (#12008)
1 parent 88bbead commit 336ea9d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

paper-api/src/main/java/org/bukkit/entity/Player.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ default void sendMultiBlockChange(@NotNull Map<? extends io.papermc.paper.math.P
10631063
*
10641064
* @param entity the entity whose equipment to change
10651065
* @param items the slots to change, where the values are the items to which
1066-
* the slot should be changed. null values will set the slot to air
1066+
* the slot should be changed. null values will set the slot to air, empty map is not allowed
10671067
*/
10681068
public void sendEquipmentChange(@NotNull LivingEntity entity, @NotNull Map<EquipmentSlot, ItemStack> items);
10691069

paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,7 @@ public void sendEquipmentChange(LivingEntity entity, EquipmentSlot slot, ItemSta
11611161
public void sendEquipmentChange(LivingEntity entity, Map<EquipmentSlot, ItemStack> items) {
11621162
Preconditions.checkArgument(entity != null, "Entity cannot be null");
11631163
Preconditions.checkArgument(items != null, "items cannot be null");
1164+
Preconditions.checkArgument(!items.isEmpty(), "items cannot be empty");
11641165

11651166
if (this.getHandle().connection == null) {
11661167
return;

0 commit comments

Comments
 (0)
0