use of net.minecraft.server.PlayerManager in project dynmap by webbukkit.
the class FabricServer method isPlayerBanned.
@Override
public boolean isPlayerBanned(String pid) {
PlayerManager scm = server.getPlayerManager();
BannedPlayerList bl = scm.getUserBanList();
try {
return bl.contains(getProfileByName(pid).get());
} catch (NoSuchElementException e) {
/* If this profile doesn't exist, default to "banned" for good measure. */
return true;
}
}
use of net.minecraft.server.PlayerManager in project dynmap by webbukkit.
the class FabricServer method isPlayerBanned.
@Override
public boolean isPlayerBanned(String pid) {
PlayerManager scm = server.getPlayerManager();
BannedPlayerList bl = scm.getUserBanList();
try {
return bl.contains(getProfileByName(pid).get());
} catch (NoSuchElementException e) {
/* If this profile doesn't exist, default to "banned" for good measure. */
return true;
}
}
use of net.minecraft.server.PlayerManager in project FastAsyncWorldEdit by IntellectualSites.
the class FabricPlatform method getConnectedUsers.
@Override
public Collection<Actor> getConnectedUsers() {
List<Actor> users = new ArrayList<>();
PlayerManager scm = server.getPlayerManager();
for (ServerPlayerEntity entity : scm.getPlayerList()) {
if (entity != null) {
users.add(new FabricPlayer(entity));
}
}
return users;
}
use of net.minecraft.server.PlayerManager in project pingspam by BasiqueEvangelist.
the class ServerNetworkLogic method sendServerAnnouncement.
public static void sendServerAnnouncement(ServerPlayerEntity player, ClientConnection conn) {
if (!ServerPlayNetworking.canSend(player, PingSpamPackets.ANNOUNCE))
return;
PlayerManager manager = player.server.getPlayerManager();
PacketByteBuf newBuf = PacketByteBufs.create();
newBuf.writeBoolean(Permissions.check(player, "pingspam.ping.everyone", 2));
newBuf.writeBoolean(Permissions.check(player, "pingspam.ping.online", 2));
newBuf.writeBoolean(Permissions.check(player, "pingspam.ping.offline", 2));
newBuf.writeBoolean(Permissions.check(player, "pingspam.ping.player", true));
List<String> possibleNames = NameLogic.listValidNames(manager);
newBuf.writeVarInt(possibleNames.size());
for (String possibleName : possibleNames) {
newBuf.writeString(possibleName);
}
conn.send(ServerPlayNetworking.createS2CPacket(PingSpamPackets.ANNOUNCE, newBuf));
}
use of net.minecraft.server.PlayerManager in project dynmap by webbukkit.
the class FabricServer method checkPlayerPermission.
@Override
public boolean checkPlayerPermission(String player, String perm) {
PlayerManager scm = server.getPlayerManager();
if (scm == null)
return false;
BannedPlayerList bl = scm.getUserBanList();
if (bl == null)
return false;
if (bl.contains(getProfileByName(player))) {
return false;
}
return plugin.hasOfflinePermission(player, perm);
}
Aggregations