Fix SpawnerEntry$Equipment API

This commit is contained in:
Jake Potrebic 2024-04-26 17:00:00 -07:00
parent 6f0bb7dc5f
commit 6fedaecd54

View File

@ -120,27 +120,29 @@ public class SpawnerEntry {
private final Map<EquipmentSlot, Float> dropChances; private final Map<EquipmentSlot, Float> dropChances;
public Equipment(@NotNull LootTable equipmentLootTable, @NotNull 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.equipmentLootTable = equipmentLootTable;
this.dropChances = dropChances; this.dropChances = dropChances;
} }
/** /**
* Set the loot table for the entity. * Set the loot table for the spawned entity's equipment slots.
* <br> * <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. * @param table this {@link org.bukkit.entity.Mob} will have.
*/ */
public void setEquipmentLootTable(@NotNull LootTable table) { public void setEquipmentLootTable(@NotNull LootTable table) {
Preconditions.checkArgument(table != null, "table cannot be null"); // Paper
this.equipmentLootTable = table; this.equipmentLootTable = table;
} }
/** /**
* Gets the loot table for the entity. * Gets the loot table for the spawned entity's equipment.
* <br> * <br>
* *
* If an entity does not have a loot table, this will return null, NOT * If an entity does not have a loot table, this will return an
* an empty loot table. * empty loot table.
* *
* @return the loot table for this entity. * @return the loot table for this entity.
*/ */