Class PlayerList
java.lang.Object
net.minecraft.server.players.PlayerList
- All Implemented Interfaces:
IPlayerListExtension
- Direct Known Subclasses:
DedicatedPlayerList, IntegratedPlayerList
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<UUID, PlayerAdvancements> private booleanprivate static final SimpleDateFormatprivate final UserBanListstatic final Componentstatic final Componentstatic final Fileprivate final IpBanListprivate static final org.slf4j.Loggerstatic final Fileprivate final ServerOpListprivate final PlayerDataStorageprivate final List<ServerPlayer> private final Map<UUID, ServerPlayer> A map containing the key-value pairs for UUIDs and their EntityPlayerMP objects.private final List<ServerPlayer> private final LayeredRegistryAccess<RegistryLayer> private static final intprivate intprivate final MinecraftServerprivate intprivate final Map<UUID, ServerStatsCounter> static final Fileprivate intprivate final UserWhiteListstatic final File -
Constructor Summary
ConstructorsConstructorDescriptionPlayerList(MinecraftServer server, LayeredRegistryAccess<RegistryLayer> registries, PlayerDataStorage playerIo, NotificationService notificationService) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidbroadcast(@Nullable Player except, double x, double y, double z, double range, ResourceKey<Level> dimension, Packet<?> packet) voidbroadcastAll(Packet<?> packet) voidbroadcastAll(Packet<?> packet, ResourceKey<Level> dimension) private voidbroadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> isFiltered, @Nullable ServerPlayer senderPlayer, ChatType.Bound chatType) voidbroadcastChatMessage(PlayerChatMessage message, CommandSourceStack sender, ChatType.Bound chatType) voidbroadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound chatType) voidbroadcastSystemMessage(Component message, boolean overlay) voidbroadcastSystemMessage(Component message, Function<ServerPlayer, Component> playerMessages, boolean overlay) voidbroadcastSystemToAllExceptTeam(Player player, Component message) voidbroadcastSystemToTeam(Player player, Component message) booleancanBypassPlayerLimit(NameAndId nameAndId) @Nullable ComponentcanPlayerLogin(SocketAddress address, NameAndId nameAndId) voidbooleandisconnectAllPlayersWithProfile(UUID playerId) getBans()intString[]getOps()@Nullable ServerPlayer@Nullable ServerPlayerGets the ServerPlayer object representing the player with the UUID.getPlayerAdvancements(ServerPlayer player) @Nullable ServerPlayergetPlayerByName(String name) intString[]getPlayerStats(Player player) intintString[]booleanbooleanbooleanbooleanisWhiteListed(NameAndId nameAndId) loadPlayerData(NameAndId nameAndId) private PathlocateStatsFile(com.mojang.authlib.GameProfile gameProfile) voidvoidop(NameAndId nameAndId, Optional<LevelBasedPermissionSet> permissions, Optional<Boolean> canBypassPlayerLimit) voidplaceNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie cookie) voidvoidvoidremove(ServerPlayer player) Called when a player disconnects from the game.voidrespawn(ServerPlayer serverPlayer, boolean keepAllPlayerData, Entity.RemovalReason removalReason) protected voidsave(ServerPlayer player) Also stores the NBTTags if this is an IntegratedPlayerList.voidsaveAll()voidsendActiveEffects(LivingEntity livingEntity, ServerGamePacketListenerImpl connection) voidsendActivePlayerEffects(ServerPlayer player) voidsendAllPlayerInfo(ServerPlayer player) Sends the players inventory to himself.voidsendLevelInfo(ServerPlayer player, ServerLevel level) Updates the time and weather for the given player to those of the given worldvoidprivate voidsendPlayerPermissionLevel(ServerPlayer player, LevelBasedPermissionSet permissions) voidsetAllowCommandsForAllPlayers(boolean allowCommands) voidsetSimulationDistance(int simulationDistance) voidsetViewDistance(int viewDistance) voidtick()protected voidupdateEntireScoreboard(ServerScoreboard scoreboard, ServerPlayer player) private booleanverifyChatTrusted(PlayerChatMessage message) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IPlayerListExtension
broadcast, broadcast, broadcastAll, broadcastAll, self
-
Field Details
-
USERBANLIST_FILE
-
IPBANLIST_FILE
-
OPLIST_FILE
-
WHITELIST_FILE
-
CHAT_FILTERED_FULL
-
DUPLICATE_LOGIN_DISCONNECT_MESSAGE
-
LOGGER
private static final org.slf4j.Logger LOGGER -
SEND_PLAYER_INFO_INTERVAL
private static final int SEND_PLAYER_INFO_INTERVAL- See Also:
-
BAN_DATE_FORMAT
-
server
-
players
-
playersByUUID
A map containing the key-value pairs for UUIDs and their EntityPlayerMP objects. -
bans
-
ipBans
-
ops
-
whitelist
-
stats
-
advancements
-
playerIo
-
registries
-
viewDistance
private int viewDistance -
simulationDistance
private int simulationDistance -
allowCommandsForAllPlayers
private boolean allowCommandsForAllPlayers -
sendAllPlayerInfoIn
private int sendAllPlayerInfoIn -
playersView
-
-
Constructor Details
-
PlayerList
public PlayerList(MinecraftServer server, LayeredRegistryAccess<RegistryLayer> registries, PlayerDataStorage playerIo, NotificationService notificationService)
-
-
Method Details
-
placeNewPlayer
-
updateEntireScoreboard
-
addWorldborderListener
-
loadPlayerData
-
save
Also stores the NBTTags if this is an IntegratedPlayerList. -
remove
Called when a player disconnects from the game. Writes player data to disk and removes them from the world. -
canPlayerLogin
-
disconnectAllPlayersWithProfile
-
respawn
public ServerPlayer respawn(ServerPlayer serverPlayer, boolean keepAllPlayerData, Entity.RemovalReason removalReason) -
sendActivePlayerEffects
-
sendActiveEffects
-
sendPlayerPermissionLevel
-
tick
public void tick() -
broadcastAll
-
broadcastAll
-
broadcastSystemToTeam
-
broadcastSystemToAllExceptTeam
-
getPlayerNamesArray
-
getBans
-
getIpBans
-
op
-
op
public void op(NameAndId nameAndId, Optional<LevelBasedPermissionSet> permissions, Optional<Boolean> canBypassPlayerLimit) -
deop
-
sendPlayerPermissionLevel
-
isWhiteListed
-
isOp
-
getPlayerByName
-
broadcast
public void broadcast(@Nullable Player except, double x, double y, double z, double range, ResourceKey<Level> dimension, Packet<?> packet) -
saveAll
public void saveAll() -
getWhiteList
-
getWhiteListNames
-
getOps
-
getOpNames
-
reloadWhiteList
public void reloadWhiteList() -
sendLevelInfo
Updates the time and weather for the given player to those of the given world -
sendAllPlayerInfo
Sends the players inventory to himself. -
getPlayerCount
public int getPlayerCount() -
getMaxPlayers
public int getMaxPlayers() -
isUsingWhitelist
public boolean isUsingWhitelist() -
getPlayersWithAddress
-
getViewDistance
public int getViewDistance() -
getSimulationDistance
public int getSimulationDistance() -
getServer
-
setAllowCommandsForAllPlayers
public void setAllowCommandsForAllPlayers(boolean allowCommands) -
removeAll
public void removeAll() -
broadcastSystemMessage
-
broadcastSystemMessage
public void broadcastSystemMessage(Component message, Function<ServerPlayer, Component> playerMessages, boolean overlay) -
broadcastChatMessage
public void broadcastChatMessage(PlayerChatMessage message, CommandSourceStack sender, ChatType.Bound chatType) -
broadcastChatMessage
public void broadcastChatMessage(PlayerChatMessage message, ServerPlayer sender, ChatType.Bound chatType) -
broadcastChatMessage
private void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> isFiltered, @Nullable ServerPlayer senderPlayer, ChatType.Bound chatType) -
verifyChatTrusted
-
getPlayerStats
-
locateStatsFile
-
getPlayerAdvancements
-
setViewDistance
public void setViewDistance(int viewDistance) -
setSimulationDistance
public void setSimulationDistance(int simulationDistance) -
getPlayers
-
getPlayer
Gets the ServerPlayer object representing the player with the UUID. -
getPlayer
-
canBypassPlayerLimit
-
reloadResources
public void reloadResources() -
isAllowCommandsForAllPlayers
public boolean isAllowCommandsForAllPlayers() -
getPlayerIo
-