use of net.minecraft.server.players.ServerOpList in project Denizen-For-Bukkit by DenizenScript.
the class PlayerHelperImpl method setTemporaryOp.
@Override
public void setTemporaryOp(Player player, boolean op) {
MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
GameProfile profile = ((CraftPlayer) player).getProfile();
ServerOpList opList = server.getPlayerList().getOps();
if (op) {
int permLevel = server.getOperatorUserPermissionLevel();
opList.add(new ServerOpListEntry(profile, permLevel, opList.canBypassPlayerLimit(profile)));
} else {
opList.remove(profile);
}
player.recalculatePermissions();
}
use of net.minecraft.server.players.ServerOpList in project Denizen-For-Bukkit by DenizenScript.
the class PlayerHelperImpl method setTemporaryOp.
@Override
public void setTemporaryOp(Player player, boolean op) {
MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
GameProfile profile = ((CraftPlayer) player).getProfile();
ServerOpList opList = server.getPlayerList().getOps();
if (op) {
int permLevel = server.getOperatorUserPermissionLevel();
opList.add(new ServerOpListEntry(profile, permLevel, opList.canBypassPlayerLimit(profile)));
} else {
opList.remove(profile);
}
player.recalculatePermissions();
}
Aggregations