Class PlayerList

java.lang.Object
net.minecraft.server.players.PlayerList
Direct Known Subclasses:
DedicatedPlayerList, IntegratedPlayerList

public abstract class PlayerList extends Object
  • Field Details

    • USERBANLIST_FILE

      public static final File USERBANLIST_FILE
    • IPBANLIST_FILE

      public static final File IPBANLIST_FILE
    • OPLIST_FILE

      public static final File OPLIST_FILE
    • WHITELIST_FILE

      public static final File WHITELIST_FILE
    • CHAT_FILTERED_FULL

      public static final Component CHAT_FILTERED_FULL
    • DUPLICATE_LOGIN_DISCONNECT_MESSAGE

      public static final Component 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

      private static final SimpleDateFormat BAN_DATE_FORMAT
    • server

      private final MinecraftServer server
    • players

      private final List<ServerPlayer> players
    • playersByUUID

      private final Map<UUID,ServerPlayer> playersByUUID
      A map containing the key-value pairs for UUIDs and their EntityPlayerMP objects.
    • bans

      private final UserBanList bans
    • ipBans

      private final IpBanList ipBans
    • ops

      private final ServerOpList ops
    • whitelist

      private final UserWhiteList whitelist
    • stats

      private final Map<UUID,ServerStatsCounter> stats
    • advancements

      private final Map<UUID,PlayerAdvancements> advancements
    • playerIo

      private final PlayerDataStorage playerIo
    • doWhiteList

      private boolean doWhiteList
    • registries

      private final LayeredRegistryAccess<RegistryLayer> registries
    • maxPlayers

      protected final int maxPlayers
    • viewDistance

      private int viewDistance
    • simulationDistance

      private int simulationDistance
    • allowCommandsForAllPlayers

      private boolean allowCommandsForAllPlayers
    • ALLOW_LOGOUTIVATOR

      private static final boolean ALLOW_LOGOUTIVATOR
      See Also:
    • sendAllPlayerInfoIn

      private int sendAllPlayerInfoIn
    • playersView

      private final List<ServerPlayer> playersView
  • Constructor Details

  • Method Details

    • placeNewPlayer

      public void placeNewPlayer(Connection pConnection, ServerPlayer pPlayer, CommonListenerCookie pCookie)
    • updateEntireScoreboard

      protected void updateEntireScoreboard(ServerScoreboard pScoreboard, ServerPlayer pPlayer)
    • addWorldborderListener

      public void addWorldborderListener(ServerLevel pLevel)
    • load

      public Optional<CompoundTag> load(ServerPlayer pPlayer)
    • save

      protected void save(ServerPlayer pPlayer)
      Also stores the NBTTags if this is an IntegratedPlayerList.
    • remove

      public void remove(ServerPlayer pPlayer)
      Called when a player disconnects from the game. Writes player data to disk and removes them from the world.
    • canPlayerLogin

      @Nullable public Component canPlayerLogin(SocketAddress p_11257_, com.mojang.authlib.GameProfile p_11258_)
    • getPlayerForLogin

      public ServerPlayer getPlayerForLogin(com.mojang.authlib.GameProfile p_215625_, ClientInformation p_302018_)
    • disconnectAllPlayersWithProfile

      public boolean disconnectAllPlayersWithProfile(com.mojang.authlib.GameProfile p_295670_)
    • respawn

      public ServerPlayer respawn(ServerPlayer pPlayer, boolean pKeepInventory, Entity.RemovalReason pReason)
    • sendActivePlayerEffects

      public void sendActivePlayerEffects(ServerPlayer pPlayer)
    • sendActiveEffects

      public void sendActiveEffects(LivingEntity pEntity, ServerGamePacketListenerImpl pConnection)
    • sendPlayerPermissionLevel

      public void sendPlayerPermissionLevel(ServerPlayer pPlayer)
    • tick

      public void tick()
    • broadcastAll

      public void broadcastAll(Packet<?> pPacket)
    • broadcastAll

      public void broadcastAll(Packet<?> pPacket, ResourceKey<Level> pDimension)
    • broadcastSystemToTeam

      public void broadcastSystemToTeam(Player pPlayer, Component pMessage)
    • broadcastSystemToAllExceptTeam

      public void broadcastSystemToAllExceptTeam(Player pPlayer, Component pMessage)
    • getPlayerNamesArray

      public String[] getPlayerNamesArray()
    • getBans

      public UserBanList getBans()
    • getIpBans

      public IpBanList getIpBans()
    • op

      public void op(com.mojang.authlib.GameProfile p_11254_)
    • deop

      public void deop(com.mojang.authlib.GameProfile p_11281_)
    • sendPlayerPermissionLevel

      private void sendPlayerPermissionLevel(ServerPlayer pPlayer, int pPermLevel)
    • isWhiteListed

      public boolean isWhiteListed(com.mojang.authlib.GameProfile p_11294_)
    • isOp

      public boolean isOp(com.mojang.authlib.GameProfile p_11304_)
    • getPlayerByName

      @Nullable public ServerPlayer getPlayerByName(String pUsername)
    • 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

      public UserWhiteList getWhiteList()
    • getWhiteListNames

      public String[] getWhiteListNames()
    • getOps

      public ServerOpList getOps()
    • getOpNames

      public String[] getOpNames()
    • reloadWhiteList

      public void reloadWhiteList()
    • sendLevelInfo

      public void sendLevelInfo(ServerPlayer pPlayer, ServerLevel pLevel)
      Updates the time and weather for the given player to those of the given world
    • sendAllPlayerInfo

      public void sendAllPlayerInfo(ServerPlayer pPlayer)
      Sends the players inventory to himself.
    • getPlayerCount

      public int getPlayerCount()
    • getMaxPlayers

      public int getMaxPlayers()
    • isUsingWhitelist

      public boolean isUsingWhitelist()
    • setUsingWhiteList

      public void setUsingWhiteList(boolean pWhitelistEnabled)
    • getPlayersWithAddress

      public List<ServerPlayer> getPlayersWithAddress(String pAddress)
    • getViewDistance

      public int getViewDistance()
    • getSimulationDistance

      public int getSimulationDistance()
    • getServer

      public MinecraftServer getServer()
    • getSingleplayerData

      @Nullable public CompoundTag getSingleplayerData()
    • setAllowCommandsForAllPlayers

      public void setAllowCommandsForAllPlayers(boolean pAllowCommandsForAllPlayers)
    • removeAll

      public void removeAll()
    • broadcastSystemMessage

      public void broadcastSystemMessage(Component pMessage, boolean pBypassHiddenChat)
    • 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

      private boolean verifyChatTrusted(PlayerChatMessage pMessage)
    • getPlayerStats

      public ServerStatsCounter getPlayerStats(Player pPlayer)
    • getPlayerAdvancements

      public PlayerAdvancements getPlayerAdvancements(ServerPlayer pPlayer)
    • setViewDistance

      public void setViewDistance(int pViewDistance)
    • setSimulationDistance

      public void setSimulationDistance(int pSimulationDistance)
    • getPlayers

      public List<ServerPlayer> getPlayers()
    • getPlayer

      @Nullable public ServerPlayer getPlayer(UUID pPlayerUUID)
      Gets the ServerPlayer object representing the player with the UUID.
    • canBypassPlayerLimit

      public boolean canBypassPlayerLimit(com.mojang.authlib.GameProfile p_11298_)
    • reloadResources

      public void reloadResources()
    • isAllowCommandsForAllPlayers

      public boolean isAllowCommandsForAllPlayers()