Search in sources :

Example 1 with OpListEntry

use of net.minecraft.server.v1_10_R1.OpListEntry in project Denizen-For-Bukkit by DenizenScript.

the class PlayerHelper_v1_11_R1 method setTemporaryOp.

@Override
public void setTemporaryOp(Player player, boolean op) {
    MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
    GameProfile profile = ((CraftPlayer) player).getProfile();
    OpList opList = server.getPlayerList().getOPs();
    if (op) {
        int permLevel = server.q();
        opList.add(new OpListEntry(profile, permLevel, opList.b(profile)));
    } else {
        opList.remove(profile);
    }
    player.recalculatePermissions();
}
Also used : OpList(net.minecraft.server.v1_11_R1.OpList) GameProfile(com.mojang.authlib.GameProfile) CraftPlayer(org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer) CraftServer(org.bukkit.craftbukkit.v1_11_R1.CraftServer) OpListEntry(net.minecraft.server.v1_11_R1.OpListEntry) MinecraftServer(net.minecraft.server.v1_11_R1.MinecraftServer)

Example 2 with OpListEntry

use of net.minecraft.server.v1_10_R1.OpListEntry in project Denizen-For-Bukkit by DenizenScript.

the class PlayerHelper_v1_10_R1 method setTemporaryOp.

@Override
public void setTemporaryOp(Player player, boolean op) {
    MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
    GameProfile profile = ((CraftPlayer) player).getProfile();
    OpList opList = server.getPlayerList().getOPs();
    if (op) {
        int permLevel = server.q();
        opList.add(new OpListEntry(profile, permLevel, opList.b(profile)));
    } else {
        opList.remove(profile);
    }
    player.recalculatePermissions();
}
Also used : OpList(net.minecraft.server.v1_10_R1.OpList) GameProfile(com.mojang.authlib.GameProfile) CraftPlayer(org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer) CraftServer(org.bukkit.craftbukkit.v1_10_R1.CraftServer) OpListEntry(net.minecraft.server.v1_10_R1.OpListEntry) MinecraftServer(net.minecraft.server.v1_10_R1.MinecraftServer)

Example 3 with OpListEntry

use of net.minecraft.server.v1_10_R1.OpListEntry in project Denizen-For-Bukkit by DenizenScript.

the class PlayerHelper_v1_8_R3 method setTemporaryOp.

@Override
public void setTemporaryOp(Player player, boolean op) {
    MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
    GameProfile profile = ((CraftPlayer) player).getProfile();
    OpList opList = server.getPlayerList().getOPs();
    if (op) {
        int permLevel = server.p();
        opList.add(new OpListEntry(profile, permLevel, opList.b(profile)));
    } else {
        opList.remove(profile);
    }
    player.recalculatePermissions();
}
Also used : OpList(net.minecraft.server.v1_8_R3.OpList) GameProfile(com.mojang.authlib.GameProfile) CraftPlayer(org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer) CraftServer(org.bukkit.craftbukkit.v1_8_R3.CraftServer) OpListEntry(net.minecraft.server.v1_8_R3.OpListEntry) MinecraftServer(net.minecraft.server.v1_8_R3.MinecraftServer)

Example 4 with OpListEntry

use of net.minecraft.server.v1_10_R1.OpListEntry in project Denizen-For-Bukkit by DenizenScript.

the class PlayerHelper_v1_9_R2 method setTemporaryOp.

@Override
public void setTemporaryOp(Player player, boolean op) {
    MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
    GameProfile profile = ((CraftPlayer) player).getProfile();
    OpList opList = server.getPlayerList().getOPs();
    if (op) {
        int permLevel = server.q();
        opList.add(new OpListEntry(profile, permLevel, opList.b(profile)));
    } else {
        opList.remove(profile);
    }
    player.recalculatePermissions();
}
Also used : OpList(net.minecraft.server.v1_9_R2.OpList) GameProfile(com.mojang.authlib.GameProfile) CraftPlayer(org.bukkit.craftbukkit.v1_9_R2.entity.CraftPlayer) CraftServer(org.bukkit.craftbukkit.v1_9_R2.CraftServer) OpListEntry(net.minecraft.server.v1_9_R2.OpListEntry) MinecraftServer(net.minecraft.server.v1_9_R2.MinecraftServer)

Aggregations

GameProfile (com.mojang.authlib.GameProfile)4 MinecraftServer (net.minecraft.server.v1_10_R1.MinecraftServer)1 OpList (net.minecraft.server.v1_10_R1.OpList)1 OpListEntry (net.minecraft.server.v1_10_R1.OpListEntry)1 MinecraftServer (net.minecraft.server.v1_11_R1.MinecraftServer)1 OpList (net.minecraft.server.v1_11_R1.OpList)1 OpListEntry (net.minecraft.server.v1_11_R1.OpListEntry)1 MinecraftServer (net.minecraft.server.v1_8_R3.MinecraftServer)1 OpList (net.minecraft.server.v1_8_R3.OpList)1 OpListEntry (net.minecraft.server.v1_8_R3.OpListEntry)1 MinecraftServer (net.minecraft.server.v1_9_R2.MinecraftServer)1 OpList (net.minecraft.server.v1_9_R2.OpList)1 OpListEntry (net.minecraft.server.v1_9_R2.OpListEntry)1 CraftServer (org.bukkit.craftbukkit.v1_10_R1.CraftServer)1 CraftPlayer (org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer)1 CraftServer (org.bukkit.craftbukkit.v1_11_R1.CraftServer)1 CraftPlayer (org.bukkit.craftbukkit.v1_11_R1.entity.CraftPlayer)1 CraftServer (org.bukkit.craftbukkit.v1_8_R3.CraftServer)1 CraftPlayer (org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer)1 CraftServer (org.bukkit.craftbukkit.v1_9_R2.CraftServer)1