Package net.minecraft.server.players
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 pServer, LayeredRegistryAccess<RegistryLayer> pRegistries, PlayerDataStorage pPlayerIo, NotificationService pNotificationService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWorldborderListener(ServerLevel pLevel) voidbroadcast(Player pExcept, double pX, double pY, double pZ, double pRadius, ResourceKey<Level> pDimension, Packet<?> pPacket) voidbroadcastAll(Packet<?> pPacket) voidbroadcastAll(Packet<?> pPacket, ResourceKey<Level> pDimension) private voidbroadcastChatMessage(PlayerChatMessage pMessage, Predicate<ServerPlayer> pShouldFilterMessageTo, ServerPlayer pSender, ChatType.Bound pBoundChatType) voidbroadcastChatMessage(PlayerChatMessage pMessage, CommandSourceStack pSender, ChatType.Bound pBoundChatType) voidbroadcastChatMessage(PlayerChatMessage pMessage, ServerPlayer pSender, ChatType.Bound pBoundChatType) voidbroadcastSystemMessage(Component pMessage, boolean pBypassHiddenChat) voidbroadcastSystemMessage(Component pServerMessage, Function<ServerPlayer, Component> pPlayerMessageFactory, boolean pBypassHiddenChat) voidbroadcastSystemToAllExceptTeam(Player pPlayer, Component pMessage) voidbroadcastSystemToTeam(Player pPlayer, Component pMessage) booleancanBypassPlayerLimit(NameAndId pNameAndId) canPlayerLogin(SocketAddress pAddress, NameAndId pNameAndId) voidbooleangetBans()intString[]getOps()Gets the ServerPlayer object representing the player with the UUID.getPlayerAdvancements(ServerPlayer pPlayer) getPlayerByName(String pUsername) intString[]getPlayerStats(Player pPlayer) getPlayersWithAddress(String pAddress) intintString[]booleanbooleanbooleanbooleanisWhiteListed(NameAndId pNameAndId) loadPlayerData(NameAndId pNameAndId) voidvoidop(NameAndId pNameAndId, Optional<Integer> pPermissionLevel, Optional<Boolean> pCanBypassPlayerLimit) voidplaceNewPlayer(Connection pConnection, ServerPlayer pPlayer, CommonListenerCookie pCookie) voidvoidvoidremove(ServerPlayer pPlayer) Called when a player disconnects from the game.voidrespawn(ServerPlayer pPlayer, boolean pKeepInventory, Entity.RemovalReason pReason) protected voidsave(ServerPlayer pPlayer) Also stores the NBTTags if this is an IntegratedPlayerList.voidsaveAll()voidsendActiveEffects(LivingEntity pEntity, ServerGamePacketListenerImpl pConnection) voidsendActivePlayerEffects(ServerPlayer pPlayer) voidsendAllPlayerInfo(ServerPlayer pPlayer) Sends the players inventory to himself.voidsendLevelInfo(ServerPlayer pPlayer, ServerLevel pLevel) Updates the time and weather for the given player to those of the given worldvoidsendPlayerPermissionLevel(ServerPlayer pPlayer) private voidsendPlayerPermissionLevel(ServerPlayer pPlayer, int pPermLevel) voidsetAllowCommandsForAllPlayers(boolean pAllowCommandsForAllPlayers) voidsetSimulationDistance(int pSimulationDistance) voidsetViewDistance(int pViewDistance) voidtick()protected voidupdateEntireScoreboard(ServerScoreboard pScoreboard, ServerPlayer pPlayer) private booleanverifyChatTrusted(PlayerChatMessage pMessage) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.common.extensions.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 pServer, LayeredRegistryAccess<RegistryLayer> pRegistries, PlayerDataStorage pPlayerIo, NotificationService pNotificationService)
-
-
Method Details
-
placeNewPlayer
public void placeNewPlayer(Connection pConnection, ServerPlayer pPlayer, CommonListenerCookie pCookie) -
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 pPlayer, boolean pKeepInventory, Entity.RemovalReason pReason) -
sendActivePlayerEffects
-
sendActiveEffects
-
sendPlayerPermissionLevel
-
tick
public void tick() -
broadcastAll
-
broadcastAll
-
broadcastSystemToTeam
-
broadcastSystemToAllExceptTeam
-
getPlayerNamesArray
-
getBans
-
getIpBans
-
op
-
op
-
deop
-
sendPlayerPermissionLevel
-
isWhiteListed
-
isOp
-
getPlayerByName
-
broadcast
public void broadcast(@Nullable Player pExcept, double pX, double pY, double pZ, double pRadius, ResourceKey<Level> pDimension, Packet<?> pPacket) -
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
-
getSingleplayerData
-
setAllowCommandsForAllPlayers
public void setAllowCommandsForAllPlayers(boolean pAllowCommandsForAllPlayers) -
removeAll
public void removeAll() -
broadcastSystemMessage
-
broadcastSystemMessage
public void broadcastSystemMessage(Component pServerMessage, Function<ServerPlayer, Component> pPlayerMessageFactory, boolean pBypassHiddenChat) -
broadcastChatMessage
public void broadcastChatMessage(PlayerChatMessage pMessage, CommandSourceStack pSender, ChatType.Bound pBoundChatType) -
broadcastChatMessage
public void broadcastChatMessage(PlayerChatMessage pMessage, ServerPlayer pSender, ChatType.Bound pBoundChatType) -
broadcastChatMessage
private void broadcastChatMessage(PlayerChatMessage pMessage, Predicate<ServerPlayer> pShouldFilterMessageTo, @Nullable ServerPlayer pSender, ChatType.Bound pBoundChatType) -
verifyChatTrusted
-
getPlayerStats
-
getPlayerAdvancements
-
setViewDistance
public void setViewDistance(int pViewDistance) -
setSimulationDistance
public void setSimulationDistance(int pSimulationDistance) -
getPlayers
-
getPlayer
Gets the ServerPlayer object representing the player with the UUID. -
getPlayer
-
canBypassPlayerLimit
-
reloadResources
public void reloadResources() -
isAllowCommandsForAllPlayers
public boolean isAllowCommandsForAllPlayers() -
getPlayerIo
-