当前位置: 首页>>代码示例>>Java>>正文


Java DedicatedPlayerList类代码示例

本文整理汇总了Java中net.minecraft.server.dedicated.DedicatedPlayerList的典型用法代码示例。如果您正苦于以下问题:Java DedicatedPlayerList类的具体用法?Java DedicatedPlayerList怎么用?Java DedicatedPlayerList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DedicatedPlayerList类属于net.minecraft.server.dedicated包,在下文中一共展示了DedicatedPlayerList类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: InjectDedicated

import net.minecraft.server.dedicated.DedicatedPlayerList; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:20,代码来源:ServerInjector.java

示例2: shutdown

import net.minecraft.server.dedicated.DedicatedPlayerList; //导入依赖的package包/类
/**
 * {@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();
}
 
开发者ID:BasinMC,项目名称:Basin,代码行数:22,代码来源:SinkServer.java

示例3: HookedDedicatedPlayerList

import net.minecraft.server.dedicated.DedicatedPlayerList; //导入依赖的package包/类
@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);
}
 
开发者ID:orbwoi,项目名称:UniversalRemote,代码行数:12,代码来源:HookedDedicatedPlayerList.java

示例4: getHandle

import net.minecraft.server.dedicated.DedicatedPlayerList; //导入依赖的package包/类
public DedicatedPlayerList getHandle() {
    return playerList;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:4,代码来源:CraftServer.java

示例5: func_71334_ai

import net.minecraft.server.dedicated.DedicatedPlayerList; //导入依赖的package包/类
public DedicatedPlayerList func_71334_ai() {
   return (DedicatedPlayerList)super.func_71203_ab();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:4,代码来源:DedicatedServer.java


注:本文中的net.minecraft.server.dedicated.DedicatedPlayerList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。