Deprecate Player#boostElytra (#9899)

The Paper method was chosen for deprecation because it was more
restrictive in that it has an isGliding check.
This commit is contained in:
Tamion
2023-11-04 21:20:13 +01:00
parent 0609eeadec
commit 5a34a7c895
6 changed files with 35 additions and 53 deletions

View File

@@ -22,9 +22,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ * @return The {@link Firework} boosting the Player or null if the spawning of the entity was cancelled
+ * @throws IllegalArgumentException if {@link #isGliding()} is false
+ * or if the {@code firework} isn't a {@link Material#FIREWORK_ROCKET}
+ * @deprecated use {@link HumanEntity#fireworkBoost(ItemStack)} instead. Note that this method <b>does not</b>
+ * check if the player is gliding or not.
+ */
+ @Nullable
+ Firework boostElytra(@NotNull ItemStack firework);
+ default Firework boostElytra(@NotNull ItemStack firework) {
+ com.google.common.base.Preconditions.checkState(this.isGliding(), "Player must be gliding");
+ return this.fireworkBoost(firework);
+ }
// Paper end
// Spigot start