From 6fedaecd54d1dca67542115e5e90ca1014b79db6 Mon Sep 17 00:00:00 2001 From: Jake Potrebic Date: Fri, 26 Apr 2024 17:00:00 -0700 Subject: [PATCH] Fix SpawnerEntry$Equipment API --- .../java/org/bukkit/block/spawner/SpawnerEntry.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/block/spawner/SpawnerEntry.java b/paper-api/src/main/java/org/bukkit/block/spawner/SpawnerEntry.java index fc1c0435df..bc8ccd139d 100644 --- a/paper-api/src/main/java/org/bukkit/block/spawner/SpawnerEntry.java +++ b/paper-api/src/main/java/org/bukkit/block/spawner/SpawnerEntry.java @@ -120,27 +120,29 @@ public class SpawnerEntry { private final Map dropChances; public Equipment(@NotNull LootTable equipmentLootTable, @NotNull Map dropChances) { + Preconditions.checkArgument(equipmentLootTable != null, "table cannot be null"); // Paper this.equipmentLootTable = equipmentLootTable; this.dropChances = dropChances; } /** - * Set the loot table for the entity. + * Set the loot table for the spawned entity's equipment slots. *
- * To remove a loot table use null. + * To remove a loot table use the empty loot table. * * @param table this {@link org.bukkit.entity.Mob} will have. */ public void setEquipmentLootTable(@NotNull LootTable table) { + Preconditions.checkArgument(table != null, "table cannot be null"); // Paper this.equipmentLootTable = table; } /** - * Gets the loot table for the entity. + * Gets the loot table for the spawned entity's equipment. *
* - * If an entity does not have a loot table, this will return null, NOT - * an empty loot table. + * If an entity does not have a loot table, this will return an + * empty loot table. * * @return the loot table for this entity. */