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

@@ -36,16 +36,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
? (org.bukkit.entity.Firework) entity.getBukkitEntity()
: null;
}
+
// Paper end
+ // Paper start - sendOpLevel API
+ @Override
+ public void sendOpLevel(byte level) {
+ Preconditions.checkArgument(level >= 0 && level <= 4, "Level must be within [0, 4]");
+
+ this.getHandle().getServer().getPlayerList().sendPlayerPermissionLevel(this.getHandle(), level, false);
+ }
// Paper end
+ // Paper end - sendOpLevel API
+
@Override
public void setCompassTarget(Location loc) {
Preconditions.checkArgument(loc != null, "Location cannot be null");