Search in sources :

Example 26 with MinecraftServer

use of net.minecraft.server.v1_12_R1.MinecraftServer 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)

Example 27 with MinecraftServer

use of net.minecraft.server.v1_12_R1.MinecraftServer in project Citizens2 by CitizensDev.

the class EntityHumanNPC method initialise.

private void initialise(MinecraftServer minecraftServer) {
    Socket socket = new EmptySocket();
    NetworkManager conn = null;
    try {
        conn = new EmptyNetworkManager(EnumProtocolDirection.CLIENTBOUND);
        playerConnection = new EmptyNetHandler(minecraftServer, conn, this);
        conn.setPacketListener(playerConnection);
        socket.close();
    } catch (IOException e) {
    // swallow
    }
    AttributeInstance range = getAttributeInstance(GenericAttributes.FOLLOW_RANGE);
    if (range == null) {
        range = getAttributeMap().b(GenericAttributes.FOLLOW_RANGE);
    }
    range.setValue(Setting.DEFAULT_PATHFINDING_RANGE.asDouble());
    controllerJump = new PlayerControllerJump(this);
    controllerMove = new PlayerControllerMove(this);
    navigation = new PlayerNavigation(this, world);
    invulnerableTicks = 0;
    // the default (0) breaks step climbing
    NMS.setStepHeight(getBukkitEntity(), 1);
    setSkinFlags((byte) 0xFF);
    EmptyAdvancementDataPlayer.clear(this.getAdvancementData());
    try {
        ADVANCEMENT_DATA_PLAYER.invoke(this, new EmptyAdvancementDataPlayer(minecraftServer, CitizensAPI.getDataFolder().getParentFile(), this));
    } catch (Throwable e) {
        e.printStackTrace();
    }
}
Also used : EmptyNetworkManager(net.citizensnpcs.nms.v1_12_R1.network.EmptyNetworkManager) EmptySocket(net.citizensnpcs.nms.v1_12_R1.network.EmptySocket) EmptyNetHandler(net.citizensnpcs.nms.v1_12_R1.network.EmptyNetHandler) PlayerControllerMove(net.citizensnpcs.nms.v1_12_R1.util.PlayerControllerMove) PlayerNavigation(net.citizensnpcs.nms.v1_12_R1.util.PlayerNavigation) AttributeInstance(net.minecraft.server.v1_12_R1.AttributeInstance) PlayerControllerJump(net.citizensnpcs.nms.v1_12_R1.util.PlayerControllerJump) IOException(java.io.IOException) EmptyAdvancementDataPlayer(net.citizensnpcs.nms.v1_12_R1.util.EmptyAdvancementDataPlayer) NetworkManager(net.minecraft.server.v1_12_R1.NetworkManager) EmptyNetworkManager(net.citizensnpcs.nms.v1_12_R1.network.EmptyNetworkManager) EmptySocket(net.citizensnpcs.nms.v1_12_R1.network.EmptySocket) Socket(java.net.Socket)

Example 28 with MinecraftServer

use of net.minecraft.server.v1_12_R1.MinecraftServer in project EasyPayments by EasyDonate.

the class VersionedInterceptorFactory method createFeedbackInterceptor.

@Override
@NotNull
public FeedbackInterceptor createFeedbackInterceptor() {
    MinecraftServer minecraftServer = ((CraftServer) Bukkit.getServer()).getServer();
    InterceptedCommandListener commandListener = new InterceptedCommandListener(minecraftServer, permissionLevel, executorName);
    return new InterceptedProxiedSender(commandListener, commandListener);
}
Also used : CraftServer(org.bukkit.craftbukkit.v1_12_R1.CraftServer) MinecraftServer(net.minecraft.server.v1_12_R1.MinecraftServer) NotNull(org.jetbrains.annotations.NotNull)

Example 29 with MinecraftServer

use of net.minecraft.server.v1_12_R1.MinecraftServer in project EasyPayments by EasyDonate.

the class VersionedInterceptorFactory method createFeedbackInterceptor.

@Override
@NotNull
public FeedbackInterceptor createFeedbackInterceptor() {
    MinecraftServer minecraftServer = ((CraftServer) Bukkit.getServer()).getServer();
    InterceptedCommandListener commandListener = new InterceptedCommandListener(minecraftServer, permissionLevel, executorName);
    return new InterceptedProxiedSender(commandListener, commandListener);
}
Also used : CraftServer(org.bukkit.craftbukkit.v1_9_R2.CraftServer) MinecraftServer(net.minecraft.server.v1_9_R2.MinecraftServer) NotNull(org.jetbrains.annotations.NotNull)

Example 30 with MinecraftServer

use of net.minecraft.server.v1_12_R1.MinecraftServer in project EasyPayments by EasyDonate.

the class VersionedInterceptorFactory method createFeedbackInterceptor.

@Override
@NotNull
public FeedbackInterceptor createFeedbackInterceptor() {
    MinecraftServer minecraftServer = ((CraftServer) Bukkit.getServer()).getServer();
    InterceptedCommandListener commandListener = new InterceptedCommandListener(minecraftServer, permissionLevel, executorName);
    return new InterceptedProxiedSender(commandListener, commandListener);
}
Also used : CraftServer(org.bukkit.craftbukkit.v1_8_R1.CraftServer) MinecraftServer(net.minecraft.server.v1_8_R1.MinecraftServer) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

GameProfile (com.mojang.authlib.GameProfile)23 OfflinePlayer (org.bukkit.OfflinePlayer)15 Player (org.bukkit.entity.Player)15 NotNull (org.jetbrains.annotations.NotNull)15 Property (com.mojang.authlib.properties.Property)4 PlayerProfile (net.aufdemrand.denizen.nms.util.PlayerProfile)4 MinecraftServer (net.minecraft.server.v1_10_R1.MinecraftServer)4 MinecraftServer (net.minecraft.server.v1_11_R1.MinecraftServer)4 MinecraftServer (net.minecraft.server.v1_8_R3.MinecraftServer)4 CraftServer (org.bukkit.craftbukkit.v1_10_R1.CraftServer)4 CraftServer (org.bukkit.craftbukkit.v1_8_R3.CraftServer)4 MinecraftServer (net.minecraft.server.v1_16_R1.MinecraftServer)3 MinecraftServer (net.minecraft.server.v1_16_R3.MinecraftServer)3 MinecraftServer (net.minecraft.server.v1_9_R2.MinecraftServer)3 CraftServer (org.bukkit.craftbukkit.v1_11_R1.CraftServer)3 CraftServer (org.bukkit.craftbukkit.v1_9_R2.CraftServer)3 MinecraftServer (net.minecraft.server.v1_12_R1.MinecraftServer)2 MinecraftServer (net.minecraft.server.v1_13_R2.MinecraftServer)2 MinecraftServer (net.minecraft.server.v1_14_R1.MinecraftServer)2 MinecraftServer (net.minecraft.server.v1_16_R2.MinecraftServer)2