aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/api/0457-Fix-SpawnerEntry-Equipment-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/api/0457-Fix-SpawnerEntry-Equipment-API.patch')
-rw-r--r--patches/api/0457-Fix-SpawnerEntry-Equipment-API.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/patches/api/0457-Fix-SpawnerEntry-Equipment-API.patch b/patches/api/0457-Fix-SpawnerEntry-Equipment-API.patch
new file mode 100644
index 0000000000..e170eabd17
--- /dev/null
+++ b/patches/api/0457-Fix-SpawnerEntry-Equipment-API.patch
@@ -0,0 +1,45 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jake Potrebic <[email protected]>
+Date: Fri, 26 Apr 2024 17:00:00 -0700
+Subject: [PATCH] Fix SpawnerEntry$Equipment API
+
+
+diff --git a/src/main/java/org/bukkit/block/spawner/SpawnerEntry.java b/src/main/java/org/bukkit/block/spawner/SpawnerEntry.java
+index fc1c0435dfea121923eb1fe0182880752f321143..bc8ccd139df6072f9744cfb85ad0070369600aa1 100644
+--- a/src/main/java/org/bukkit/block/spawner/SpawnerEntry.java
++++ b/src/main/java/org/bukkit/block/spawner/SpawnerEntry.java
+@@ -120,27 +120,29 @@ public class SpawnerEntry {
+ private final Map<EquipmentSlot, Float> dropChances;
+
+ public Equipment(@NotNull LootTable equipmentLootTable, @NotNull Map<EquipmentSlot, Float> 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.
+ * <br>
+- * 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.
+ * <br>
+ *
+- * 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.
+ */