本文整理汇总了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);
}
}
示例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();
}
示例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);
}
示例4: getHandle
import net.minecraft.server.dedicated.DedicatedPlayerList; //导入依赖的package包/类
public DedicatedPlayerList getHandle() {
return playerList;
}
示例5: func_71334_ai
import net.minecraft.server.dedicated.DedicatedPlayerList; //导入依赖的package包/类
public DedicatedPlayerList func_71334_ai() {
return (DedicatedPlayerList)super.func_71203_ab();
}