Java 类net.minecraft.server.dedicated.DedicatedPlayerList 实例源码

项目:UniversalRemote    文件:ServerInjector.java   
@SideOnly(Side.SERVER)
public static void InjectDedicated(MinecraftServer server)
{
    PlayerList playerList = server.getPlayerList();

    try {
        if (playerList instanceof DedicatedPlayerList)
        {
            server.setPlayerList(new HookedDedicatedPlayerList((DedicatedPlayerList)playerList));
        }
        else
        {
            // uh ho...
            Util.logger.error("Unable to inject custom PlayerList into server due to unknown type! PlayerList was of type {}.", playerList.getClass().toString());
        }
    } catch (IllegalAccessException | NoSuchFieldException | SecurityException e) {
        Util.logger.logException("Exception trying to inject custom PlayerList into server!", e);
    }
}
项目:Basin    文件:SinkServer.java   
/**
 * {@inheritDoc}
 */
@Override
public void shutdown(@Nullable String reason) {
  // TODO Fire shutdown event here, once I add it. :)
  this.server.logInfo("Server Shutdown: " + reason);

  DedicatedPlayerList playerList = this.server.getPlayerList();

  if (playerList != null) {
    playerList.getPlayers().forEach((p) -> p.connection.disconnect(reason));
  }

  // de-register all services (this isn't required as our framework should clean up when the
  // bundle shuts down but we'll do it anyways)
  // TODO: Move into bundle shutdown callback of sorts
  this.serverExport.unput();

  this.server.stopServer();
}
项目:Sink    文件:SinkServer.java   
/**
 * {@inheritDoc}
 */
@Override
public void shutdown(@Nullable String reason) {
  // TODO Fire shutdown event here, once I add it. :)
  this.server.logInfo("Server Shutdown: " + reason);

  DedicatedPlayerList playerList = this.server.getPlayerList();

  if (playerList != null) {
    playerList.getPlayers().forEach((p) -> p.connection.disconnect(reason));
  }

  // de-register all services (this isn't required as our framework should clean up when the
  // bundle shuts down but we'll do it anyways)
  // TODO: Move into bundle shutdown callback of sorts
  this.serverExport.unput();

  this.server.stopServer();
}
项目:UniversalRemote    文件:HookedDedicatedPlayerList.java   
@SuppressWarnings("unchecked")
public HookedDedicatedPlayerList(DedicatedPlayerList oldList) throws IllegalAccessException, NoSuchFieldException, SecurityException {
    super(oldList.getServerInstance());

    InjectionHandler.copyAllFieldsFromEx(this, oldList, DedicatedPlayerList.class);

    mcServer = InjectionHandler.readFieldOfType(PlayerList.class, this, MinecraftServer.class);
    gameType = InjectionHandler.readFieldOfType(PlayerList.class, this, GameType.class);
    playerEntityList = InjectionHandler.readFieldOfType(PlayerList.class, this, List.class);
    uuidToPlayerMap = InjectionHandler.readFieldOfType(PlayerList.class, this, Map.class);
}
项目:Uranium    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:ThermosRebased    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:Thermos    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:KCauldron    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:CauldronGit    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:Cauldron-Old    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:Cauldron-Reloaded    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:FFoKC    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:Cauldron    文件:CraftServer.java   
public DedicatedPlayerList getHandle() {
    return playerList;
}
项目:RuneCraftery    文件:DedicatedServer.java   
public DedicatedPlayerList func_71334_ai() {
   return (DedicatedPlayerList)super.func_71203_ab();
}