Class ServerConfigurationManager

java.lang.Object
net.minecraft.src.ServerConfigurationManager
Direct Known Subclasses:
DedicatedPlayerList, IntegratedPlayerList

public abstract class ServerConfigurationManager extends Object
  • Field Details

    • playerEntityList

      public final List playerEntityList
      A list of player entities that exist on this server.
    • maxPlayers

      protected int maxPlayers
      The maximum number of players that can be connected at a time.
    • viewDistance

      protected int viewDistance
  • Constructor Details

    • ServerConfigurationManager

      public ServerConfigurationManager(MinecraftServer par1MinecraftServer)
  • Method Details

    • initializeConnectionToPlayer

      public void initializeConnectionToPlayer(INetworkManager par1INetworkManager, EntityPlayerMP par2EntityPlayerMP)
    • func_96456_a

      protected void func_96456_a(ServerScoreboard par1ServerScoreboard, EntityPlayerMP par2EntityPlayerMP)
    • setPlayerManager

      public void setPlayerManager(WorldServer[] par1ArrayOfWorldServer)
      Sets the NBT manager to the one for the WorldServer given.
    • func_72375_a

      public void func_72375_a(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
    • getEntityViewDistance

      public int getEntityViewDistance()
    • readPlayerDataFromFile

      public NBTTagCompound readPlayerDataFromFile(EntityPlayerMP par1EntityPlayerMP)
      called during player login. reads the player information from disk.
    • writePlayerData

      protected void writePlayerData(EntityPlayerMP par1EntityPlayerMP)
      also stores the NBTTags if this is an intergratedPlayerList
    • playerLoggedIn

      public void playerLoggedIn(EntityPlayerMP par1EntityPlayerMP)
      Called when a player successfully logs in. Reads player data from disk and inserts the player into the world.
    • serverUpdateMountedMovingPlayer

      public void serverUpdateMountedMovingPlayer(EntityPlayerMP par1EntityPlayerMP)
      FCNOTE: This is totally misnamed. It is called for all moving players, not just mounted ones
    • playerLoggedOut

      public void playerLoggedOut(EntityPlayerMP par1EntityPlayerMP)
      Called when a player disconnects from the game. Writes player data to disk and removes them from the world.
    • allowUserToConnect

      public String allowUserToConnect(SocketAddress par1SocketAddress, String par2Str)
      checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message
    • createPlayerForUser

      public EntityPlayerMP createPlayerForUser(String par1Str)
      also checks for multiple logins
    • transferPlayerToDimension

      public void transferPlayerToDimension(EntityPlayerMP par1EntityPlayerMP, int par2)
      creates and returns a respawned player based on the provided PlayerEntity. Args are the PlayerEntityMP to respawn, an INT for the dimension to respawn into (usually 0), and a boolean value that is true if the player beat the game rather than dying
    • transferEntityToWorld

      public void transferEntityToWorld(Entity par1Entity, int par2, WorldServer par3WorldServer, WorldServer par4WorldServer)
      Transfers an entity from a world to another world.
    • sendPlayerInfoToAllPlayers

      public void sendPlayerInfoToAllPlayers()
      sends 1 player per tick, but only sends a player once every 600 ticks
    • sendPacketToAllPlayers

      public void sendPacketToAllPlayers(Packet par1Packet)
      sends a packet to all players
    • sendPacketToAllPlayersInDimension

      public void sendPacketToAllPlayersInDimension(Packet par1Packet, int par2)
      Sends a packet to all players in the specified Dimension
    • getPlayerListAsString

      public String getPlayerListAsString()
      returns a string containing a comma-seperated list of player names
    • getAllUsernames

      public String[] getAllUsernames()
      Returns an array of the usernames of all the connected players.
    • getBannedPlayers

      public BanList getBannedPlayers()
    • getBannedIPs

      public BanList getBannedIPs()
    • addOp

      public void addOp(String par1Str)
      This adds a username to the ops list, then saves the op list
    • removeOp

      public void removeOp(String par1Str)
      This removes a username from the ops list, then saves the op list
    • isAllowedToLogin

      public boolean isAllowedToLogin(String par1Str)
      Determine if the player is allowed to connect based on current server settings.
    • isPlayerOpped

      public boolean isPlayerOpped(String par1Str)
      Returns true if the specified player is opped, even if they're currently offline.
    • getPlayerEntity

      public EntityPlayerMP getPlayerEntity(String par1Str)
    • findPlayers

      public List findPlayers(ChunkCoordinates par1ChunkCoordinates, int par2, int par3, int par4, int par5, int par6, int par7, Map par8Map, String par9Str, String par10Str, World par11World)
      Find all players in a specified range and narrowing down by other parameters
    • sendToAllNear

      public void sendToAllNear(double par1, double par3, double par5, double par7, int par9, Packet par10Packet)
      params: x,y,z,d,dimension. The packet is sent to all players within d distance of x,y,z (d^2<x^2+y^2+z^2)
    • sendToAllNearExcept

      public void sendToAllNearExcept(EntityPlayer par1EntityPlayer, double par2, double par4, double par6, double par8, int par10, Packet par11Packet)
      params: srcPlayer,x,y,z,d,dimension. The packet is not sent to the srcPlayer, but all other players where dx*dx+dy*dy+dz*dz<d*d
    • saveAllPlayerData

      public void saveAllPlayerData()
      Saves all of the players' current states.
    • addToWhiteList

      public void addToWhiteList(String par1Str)
      Add the specified player to the white list.
    • removeFromWhitelist

      public void removeFromWhitelist(String par1Str)
      Remove the specified player from the whitelist.
    • getWhiteListedPlayers

      public Set getWhiteListedPlayers()
      Returns the whitelisted players.
    • getOps

      public Set getOps()
    • loadWhiteList

      public void loadWhiteList()
      Either does nothing, or calls readWhiteList.
    • updateTimeAndWeatherForPlayer

      public void updateTimeAndWeatherForPlayer(EntityPlayerMP par1EntityPlayerMP, WorldServer par2WorldServer)
      Updates the time and weather for the given player to those of the given world
    • syncPlayerInventory

      public void syncPlayerInventory(EntityPlayerMP par1EntityPlayerMP)
      sends the players inventory to himself
    • getCurrentPlayerCount

      public int getCurrentPlayerCount()
      Returns the number of players currently on the server.
    • getMaxPlayers

      public int getMaxPlayers()
      Returns the maximum number of players allowed on the server.
    • getAvailablePlayerDat

      public String[] getAvailablePlayerDat()
      Returns an array of usernames for which player.dat exists for.
    • isWhiteListEnabled

      public boolean isWhiteListEnabled()
    • setWhiteListEnabled

      public void setWhiteListEnabled(boolean par1)
    • getPlayerList

      public List getPlayerList(String par1Str)
    • getViewDistance

      public int getViewDistance()
      Gets the View Distance.
    • getServerInstance

      public MinecraftServer getServerInstance()
    • getHostPlayerData

      public NBTTagCompound getHostPlayerData()
      On integrated servers, returns the host's player data to be written to level.dat.
    • setGameType

      public void setGameType(EnumGameType par1EnumGameType)
    • setCommandsAllowedForAll

      public void setCommandsAllowedForAll(boolean par1)
      Sets whether all players are allowed to use commands (cheats) on the server.
    • removeAllPlayers

      public void removeAllPlayers()
      Kicks everyone with "Server closed" as reason.
    • func_110459_a

      public void func_110459_a(ChatMessageComponent par1ChatMessageComponent, boolean par2)
    • sendChatMsg

      public void sendChatMsg(ChatMessageComponent par1ChatMessageComponent)
      Sends the given string to every player as chat message.
    • respawnPlayer

      public EntityPlayerMP respawnPlayer(EntityPlayerMP oldPlayer, int iDefaultDimension, boolean playerLeavingTheEnd)