Paper/patches/api/0288-add-get-set-drop-chance-to-EntityEquipment.patch
Nassim Jahnke 17f71ac87b
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5904)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
70d24eb8 SPIGOT-6587: Update documentation/error of drop chance API

CraftBukkit Changes:
470050ad SPIGOT-6587: Update documentation/error of drop chance API
1c39efa3 Fix Inventory#getViewers on the player inventory not returning the player first time their inventory is opened
d161627d Fix PrepareItemCraftEvent#isRepair
aa1fae73 SPIGOT-6586: EntityChangeBlockEvent for falling block does not cancel properly
8a04072e SPIGOT-6583: Throwing eggs doesn't make sounds

Spigot Changes:
f773da84 Remove redundant patch
cd367234 Rebuild patches
2021-06-20 21:25:59 +02:00

44 lines
1.5 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Thu, 22 Apr 2021 00:28:20 -0700
Subject: [PATCH] add get-set drop chance to EntityEquipment
diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java
index e85c4208f3536277fcd0f8a0f0b4841c4e073b2c..d0abfc3211a7ec451d83e59c7e39cfc7cc47f43e 100644
--- a/src/main/java/org/bukkit/inventory/EntityEquipment.java
+++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java
@@ -406,4 +406,32 @@ public interface EntityEquipment {
*/
@Nullable
Entity getHolder();
+ // Paper start
+ /**
+ * Gets the drop chance of specified slot.
+ *
+ * <ul>
+ * <li>A drop chance of 0.0F will never drop
+ * <li>A drop chance of 1.0F will always drop
+ * </ul>
+ *
+ * @param slot the slot to get the drop chance of
+ * @return the drop chance for the slot
+ */
+ float getDropChance(@NotNull EquipmentSlot slot);
+
+ /**
+ * Sets the drop chance of the specified slot.
+ *
+ * <ul>
+ * <li>A drop chance of 0.0F will never drop
+ * <li>A drop chance of 1.0F will always drop
+ * </ul>
+ *
+ * @param slot the slot to set the drop chance of
+ * @param chance the drop chance for the slot
+ * @throws UnsupportedOperationException when called on players
+ */
+ void setDropChance(@NotNull EquipmentSlot slot, float chance);
+ // Paper end
}