Add sendOpLevel API

This commit is contained in:
Mariell Hoversholm
2020-12-29 15:03:03 +01:00
parent 921d396ffa
commit 23b8639dbf
2 changed files with 36 additions and 13 deletions

View File

@@ -684,6 +684,15 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
}
// Paper end
// Paper start - Add 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 - Add sendOpLevel API
@Override
public void setCompassTarget(Location loc) {
Preconditions.checkArgument(loc != null, "Location cannot be null");