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();
}
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();
}
}
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);
}
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);
}
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);
}
Aggregations