Paper/patches/api/0257-Add-sendOpLevel-API.patch

29 lines
1.2 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mariell Hoversholm <proximyst@proximyst.com>
Date: Tue, 29 Dec 2020 15:02:57 +0100
Subject: [PATCH] Add sendOpLevel API
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 116c75fa16fa544723c9a430ede3a46c3599d7e8..3b24457a1d25515132613b7e4fdaa7901d00ab78 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -2417,6 +2417,17 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
*/
@Nullable
Firework boostElytra(@NotNull ItemStack firework);
+
+ /**
+ * Send a packet to the player indicating its operator status level.
+ * <p>
+ * <b>Note:</b> This will not persist across more than the current connection, and setting the player's operator
+ * status as a later point <i>will</i> override the effects of this.
+ *
+ * @param level The level to send to the player. Must be in {@code [0, 4]}.
+ * @throws IllegalArgumentException If the level is negative or greater than {@code 4} (i.e. not within {@code [0, 4]}).
+ */
+ void sendOpLevel(byte level);
// Paper end
// Spigot start