Updates documentation in EntityEquipment.java (#9992)

* Updates documentation in EntityEquopment.java to reflect behavior mentioned in issue #9867

* rebase and squash patches

---------

Co-authored-by: schwaa96 <schwaa96@mi.fu-berlin.de>
This commit is contained in:
waterlily1 2023-12-02 21:29:47 +01:00 committed by GitHub
parent 2182d47792
commit 9993eb9d16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 129 additions and 7 deletions

View file

@ -866,7 +866,7 @@ index 0cc6e29a5af28e95f87f415d6b2424d4622a6f34..c0b749a5bbf4980d01fed74768bb6190
* @param z the z location in the chunk from 0-15 inclusive * @param z the z location in the chunk from 0-15 inclusive
* @return Biome value * @return Biome value
diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java
index d5b50a4a954fed35d37f03f1a277cc173ca106df..c69904f3ee7f3a41d6cebcd401abf8385dfbf868 100644 index d5b50a4a954fed35d37f03f1a277cc173ca106df..16bca8e40ff029cca94bbfd435db1cf22b50ab7e 100644
--- a/src/main/java/org/bukkit/inventory/EntityEquipment.java --- a/src/main/java/org/bukkit/inventory/EntityEquipment.java
+++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java +++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java
@@ -37,9 +37,23 @@ public interface EntityEquipment { @@ -37,9 +37,23 @@ public interface EntityEquipment {
@ -1079,6 +1079,126 @@ index d5b50a4a954fed35d37f03f1a277cc173ca106df..c69904f3ee7f3a41d6cebcd401abf838
/** /**
* Sets the entities armor to the provided array of ItemStacks * Sets the entities armor to the provided array of ItemStacks
@@ -247,7 +354,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop killed by anything
* </ul>
*
* @return chance of the currently held item being dropped (1 for non-{@link Mob})
@@ -260,7 +368,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @param chance the chance of the main hand item being dropped
@@ -274,7 +383,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @return chance of the off hand item being dropped (1 for non-{@link Mob})
@@ -287,7 +397,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @param chance the chance of off hand item being dropped
@@ -300,7 +411,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @return the chance of the helmet being dropped (1 for non-{@link Mob})
@@ -312,7 +424,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @param chance of the helmet being dropped
@@ -326,7 +439,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @return the chance of the chest plate being dropped (1 for non-{@link Mob})
@@ -339,7 +453,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @param chance of the chest plate being dropped
@@ -353,7 +468,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @return the chance of the leggings being dropped (1 for non-{@link Mob})
@@ -366,7 +482,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @param chance chance of the leggings being dropped
@@ -379,7 +496,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @return the chance of the boots being dropped (1 for non-{@link Mob})
@@ -391,7 +509,8 @@ public interface EntityEquipment {
*
* <ul>
* <li>A drop chance of 0.0F will never drop
- * <li>A drop chance of 1.0F will always drop
+ * <li>A drop chance of exactly 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
* </ul>
*
* @param chance of the boots being dropped
diff --git a/src/main/java/org/bukkit/inventory/ItemFlag.java b/src/main/java/org/bukkit/inventory/ItemFlag.java diff --git a/src/main/java/org/bukkit/inventory/ItemFlag.java b/src/main/java/org/bukkit/inventory/ItemFlag.java
index 42fcc31147934fd4ed6484b0729e938e7ae2f8e2..4e637420b9a39b822be19367a16da93f236549b3 100644 index 42fcc31147934fd4ed6484b0729e938e7ae2f8e2..4e637420b9a39b822be19367a16da93f236549b3 100644
--- a/src/main/java/org/bukkit/inventory/ItemFlag.java --- a/src/main/java/org/bukkit/inventory/ItemFlag.java

View file

@ -1314,10 +1314,10 @@ index df81bac9ecff697f98941e5c8490e10391e90090..a32977ba3ba60a1c9aee6e469d5d6cd1
/** /**
* Get the current recipe formed on the crafting inventory, if any. * Get the current recipe formed on the crafting inventory, if any.
diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java
index c69904f3ee7f3a41d6cebcd401abf8385dfbf868..62c1c3f01fd58db39f635eee415fcbc19fb36ec9 100644 index 16bca8e40ff029cca94bbfd435db1cf22b50ab7e..2b11217153d6d6d8246d332e7fbbf32810d7e7b8 100644
--- a/src/main/java/org/bukkit/inventory/EntityEquipment.java --- a/src/main/java/org/bukkit/inventory/EntityEquipment.java
+++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java +++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java
@@ -511,6 +511,6 @@ public interface EntityEquipment { @@ -523,6 +523,6 @@ public interface EntityEquipment {
* *
* @return the entity this EntityEquipment belongs to * @return the entity this EntityEquipment belongs to
*/ */

View file

@ -5,10 +5,10 @@ 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 diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java
index 62c1c3f01fd58db39f635eee415fcbc19fb36ec9..fddffa6f415048c4a1eda049178c6d34d8519337 100644 index 2b11217153d6d6d8246d332e7fbbf32810d7e7b8..bbc1aa3a317fd0a0a0060b30aae42567cda471ca 100644
--- a/src/main/java/org/bukkit/inventory/EntityEquipment.java --- a/src/main/java/org/bukkit/inventory/EntityEquipment.java
+++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java +++ b/src/main/java/org/bukkit/inventory/EntityEquipment.java
@@ -513,4 +513,32 @@ public interface EntityEquipment { @@ -525,4 +525,34 @@ public interface EntityEquipment {
*/ */
@NotNull // Paper @NotNull // Paper
Entity getHolder(); Entity getHolder();
@ -18,7 +18,8 @@ index 62c1c3f01fd58db39f635eee415fcbc19fb36ec9..fddffa6f415048c4a1eda049178c6d34
+ * + *
+ * <ul> + * <ul>
+ * <li>A drop chance of 0.0F will never drop + * <li>A drop chance of 0.0F will never drop
+ * <li>A drop chance of 1.0F will always drop + * <li>A drop chance of 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
+ * </ul> + * </ul>
+ * + *
+ * @param slot the slot to get the drop chance of + * @param slot the slot to get the drop chance of
@ -31,7 +32,8 @@ index 62c1c3f01fd58db39f635eee415fcbc19fb36ec9..fddffa6f415048c4a1eda049178c6d34
+ * + *
+ * <ul> + * <ul>
+ * <li>A drop chance of 0.0F will never drop + * <li>A drop chance of 0.0F will never drop
+ * <li>A drop chance of 1.0F will always drop + * <li>A drop chance of 1.0F will always drop if killed by a player
+ * <li>A drop chance of greater than 1.0F will always drop if killed by anything
+ * </ul> + * </ul>
+ * + *
+ * @param slot the slot to set the drop chance of + * @param slot the slot to set the drop chance of