IntegratedPlayerList .java

net.minecraft.server.integrated.IntegratedPlayerList (class, 57 lines): members: hostPlayerData, allowUserToConnect, getHostPlayerData, getServerInstance.

net.minecraft.server.integratedclass57 linesserverextends ServerConfigurationManager1.8 KB

API Surface (4)

void writePlayerData(EntityPlayerMP playerIn)
String allowUserToConnect(SocketAddress address, GameProfile profile)
IntegratedServer getServerInstance()
NBTTagCompound getHostPlayerData()

Fields & Constants (1)

hostPlayerData

String literals (1)

"That name is already taken."

Code Graph: Dependencies (4)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

IntegratedPlayerList.java57 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.server.integrated;
2
3
import com.mojang.authlib.GameProfile;
4
import java.net.SocketAddress;
5
import net.minecraft.entity.player.EntityPlayerMP;
6
import net.minecraft.nbt.NBTTagCompound;
7
import net.minecraft.server.management.ServerConfigurationManager;
8
9
public class IntegratedPlayerList extends ServerConfigurationManager
10
{
11
    /**
12
     * Holds the NBT data for the host player's save file, so this can be written to level.dat.
13
     */
14
    private NBTTagCompound hostPlayerData;
15
16
    public IntegratedPlayerList(IntegratedServer server)
17
    {
18
        super(server);
19
        this.setViewDistance(10);
20
    }
21
22
    /**
23
     * also stores the NBTTags if this is an intergratedPlayerList
24
     */
25
    protected void writePlayerData(EntityPlayerMP playerIn)
26
    {
27
        if (playerIn.getName().equals(this.getServerInstance().getServerOwner()))
28
        {
29
            this.hostPlayerData = new NBTTagCompound();
30
            playerIn.writeToNBT(this.hostPlayerData);
31
        }
32
33
        super.writePlayerData(playerIn);
34
    }
35
36
    /**
37
     * checks ban-lists, then white-lists, then space for the server. Returns null on success, or an error message
38
     */
39
    public String allowUserToConnect(SocketAddress address, GameProfile profile)
40
    {
41
        return profile.getName().equalsIgnoreCase(this.getServerInstance().getServerOwner()) && this.getPlayerByUsername(profile.getName()) != null ? "That name is already taken." : super.allowUserToConnect(address, profile);
42
    }
43
44
    public IntegratedServer getServerInstance()
45
    {
46
        return (IntegratedServer)super.getServerInstance();
47
    }
48
49
    /**
50
     * On integrated servers, returns the host's player data to be written to level.dat.
51
     */
52
    public NBTTagCompound getHostPlayerData()
53
    {
54
        return this.hostPlayerData;
55
    }
56
}
57

Deobfuscated MCP 1.8.9 source of IntegratedPlayerList from Marcelektro/MavenMCP-1.8.9 (net/minecraft/server/integrated/IntegratedPlayerList.java), stored verbatim.