Java 类net.minecraft.server.management.ServerConfigurationManager 实例源码

项目:Thermos    文件:ThermiteTeleportationHandler.java   
public static void transferEntityToDimension(Entity ent, int dim, ServerConfigurationManager manager, Environment environ) {

        if (ent instanceof EntityPlayerMP) {
            transferPlayerToDimension((EntityPlayerMP) ent, dim, manager, environ);
            return;
        }
        WorldServer worldserver = manager.getServerInstance().worldServerForDimension(ent.dimension);
        ent.dimension = dim;
        WorldServer worldserver1 = manager.getServerInstance().worldServerForDimension(ent.dimension);
        worldserver.removePlayerEntityDangerously(ent);
        if (ent.riddenByEntity != null) {
            ent.riddenByEntity.mountEntity(null);
        }
        if (ent.ridingEntity != null) {
            ent.mountEntity(null);
        }
        ent.isDead = false;
        transferEntityToWorld(ent, worldserver, worldserver1);
    }
项目:NeptuneMod    文件:MixinServerConfigurationManager.java   
@Redirect(method = "playerLoggedOut",
        at = @At(value = "INVOKE", target = "Lnet/minecraft/server/management/ServerConfigurationManager;"
                + "sendPacketToAllPlayers(Lnet/minecraft/network/Packet;)V"))
public void firePlayerListData(ServerConfigurationManager manager, net.minecraft.network.Packet packetIn, EntityPlayerMP playerIn) {
    PlayerListData playerListData = ((Player) playerIn).getPlayerListData(PlayerListAction.REMOVE_PLAYER);
    for (EntityPlayerMP playerMP : manager.playerEntityList) {
        PlayerListHook playerListHook = new PlayerListHook(playerListData.copy(), (Player) playerMP);
        if (!playerListHook.call().isCanceled()) {
            S38PacketPlayerListItem packet = new S38PacketPlayerListItem();
            packet.action = S38PacketPlayerListItem.Action.valueOf(PlayerListAction.REMOVE_PLAYER.name());
            WorldSettings.GameType gameType =
                    WorldSettings.GameType.getByID(playerListHook.getData().getMode().getId());
            IChatComponent iChatComponent = playerListHook.getData().displayNameSet() ?
                    (IChatComponent) playerListHook.getData().getDisplayName() : null;
            packet.players.add(packet.new AddPlayerData(playerListHook.getData()
                    .getProfile(), playerListHook.getData().getPing(), gameType, iChatComponent));
            playerMP.playerNetServerHandler.sendPacket(packet);
        }
    }
}
项目:E-Mobile    文件:TeleportUtils.java   
public static void teleportPlayerToDimension(EntityPlayerMP player, int dimension, ServerConfigurationManager manager) {
    int oldDim = player.dimension;
    WorldServer worldserver = manager.getServerInstance().worldServerForDimension(player.dimension);
    player.dimension = dimension;
    WorldServer worldserver1 = manager.getServerInstance().worldServerForDimension(player.dimension);
    player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, player.worldObj.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
    worldserver.removePlayerEntityDangerously(player);
    player.isDead = false;
    teleportEntityToWorld(player, worldserver, worldserver1);
    manager.func_72375_a(player, worldserver);
    player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
    player.theItemInWorldManager.setWorld(worldserver1);
    manager.updateTimeAndWeatherForPlayer(player, worldserver1);
    manager.syncPlayerInventory(player);
    Iterator<PotionEffect> iterator = player.getActivePotionEffects().iterator();

    while (iterator.hasNext()) {
        PotionEffect potioneffect = iterator.next();
        player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
    }
    FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldDim, dimension);
}
项目:TheCorruptedSector    文件:TeleportUtils.java   
public static void teleportPlayerToDimension(EntityPlayerMP player, int dimension, ServerConfigurationManager manager) {
    int oldDim = player.dimension;
    WorldServer worldserver = manager.getServerInstance().worldServerForDimension(player.dimension);
    player.dimension = dimension;
    WorldServer worldserver1 = manager.getServerInstance().worldServerForDimension(player.dimension);
    player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, player.worldObj.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
    worldserver.removePlayerEntityDangerously(player);
    player.isDead = false;
    teleportEntityToWorld(player, worldserver, worldserver1);
    manager.func_72375_a(player, worldserver);
    player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
    player.theItemInWorldManager.setWorld(worldserver1);
    manager.updateTimeAndWeatherForPlayer(player, worldserver1);
    manager.syncPlayerInventory(player);
    Iterator<PotionEffect> iterator = player.getActivePotionEffects().iterator();

    while (iterator.hasNext()) {
        PotionEffect potioneffect = iterator.next();
        player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
    }
    FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldDim, dimension);
}
项目:MoarPeripherals    文件:TileChatBox.java   
private String[] getPlayerUsernames() {
    ServerConfigurationManager scm = MinecraftServer.getServer().getConfigurationManager();
    String[] playerNames = scm.getAllUsernames();

    if (rangeSay == 0) {
        return new String[0];
    } else if (rangeSay > 0) {
        List<String> names = Lists.newArrayList();
        for (String s : playerNames) {
            if (entityInRange(scm.func_152612_a(s), rangeSay)) {
                names.add(s);
            }
        }
        return names.toArray(new String[names.size()]);
    }

    return playerNames;
}
项目:MyEssentials-Core    文件:PlayerUtils.java   
/**
 * Transfers a player to a new dimension preserving potion effects and motion.
 */
public static void transferPlayerToDimension(EntityPlayerMP player, int dim) {
    ServerConfigurationManager configManager = player.mcServer.getConfigurationManager();
    int oldDimension = player.dimension;

    WorldServer oldWorldServer = configManager.getServerInstance().worldServerForDimension(oldDimension);
    WorldServer newWorldServer = configManager.getServerInstance().worldServerForDimension(dim);

    player.dimension = dim;
    player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, player.worldObj.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
    oldWorldServer.removePlayerEntityDangerously(player);
    player.isDead = false;

    transferPlayerToWorld(player, oldWorldServer, newWorldServer);
    configManager.func_72375_a(player, oldWorldServer);
    player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
    player.theItemInWorldManager.setWorld(newWorldServer);
    configManager.updateTimeAndWeatherForPlayer(player, newWorldServer);
    configManager.syncPlayerInventory(player);
    for (PotionEffect potioneffect : (Iterable<PotionEffect>) player.getActivePotionEffects()) {
        player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
    }
    FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, oldDimension, dim);
}
项目:TRHS_Club_Mod_2016    文件:NetworkDispatcher.java   
public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)
{
    super(Packet.class, false);
    this.manager = manager;
    this.scm = scm;
    this.side = Side.SERVER;
    this.handshakeChannel = new EmbeddedChannel(new HandshakeInjector(this), new ChannelRegistrationHandler(), new FMLHandshakeCodec(), new HandshakeMessageHandler<FMLHandshakeServerState>(FMLHandshakeServerState.class));
    this.handshakeChannel.attr(FML_DISPATCHER).set(this);
    this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT);
    this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
    this.handshakeChannel.attr(IS_LOCAL).set(manager.func_150731_c());
}
项目:OpenTechnology    文件:TileEntityPIB.java   
private void checkPlayer(){
    if(name != null && !name.isEmpty()){
        ServerConfigurationManager configurationManager = MinecraftServer.getServer().getConfigurationManager();
        EntityPlayer player = configurationManager.func_152612_a(name);
        if(player != null)
            target = player;
    }
}
项目:Factorization    文件:PacketProxyingPlayer.java   
public PacketProxyingPlayer(final DimensionSliceEntity dimensionSlice, World shadowWorld) {
    super(MinecraftServer.getServer(), (WorldServer) shadowWorld, proxyProfile, new ItemInWorldManager(shadowWorld));
    invulnerable = true;
    isImmuneToFire = true;
    this.dimensionSlice = new WeakReference<DimensionSliceEntity>(dimensionSlice);
    Coord c = dimensionSlice.getCenter();
    {
        Chunk chunk = c.getChunk();
        int chunkX = c.x >> 4, chunkZ = c.z >> 4;
        if (chunk.xPosition != chunkX || chunk.zPosition != chunkZ) {
            Core.logSevere("Getting chunk at chunk coordinates " + chunkX + "," + chunkZ + " returned chunk with *wrong* coordinates: " + chunk.xPosition + "," + chunk.zPosition);
        }
    }
    c.y = -8; // lurk in the void; we should catch most mod's packets.
    DeltaCoord size = dimensionSlice.getMaxCorner().difference(dimensionSlice.getMinCorner());
    size.y = 0;
    int width = Math.abs(size.x);
    int depth = Math.abs(size.z);
    double blockRadius = Math.max(width, depth) / 2;
    int chunkRadius = (int) ((blockRadius / 16) + 2);
    chunkRadius = Math.max(3, chunkRadius);
    c.setAsEntityLocation(this);
    preinitWrapping();
    ServerConfigurationManager scm = MinecraftServer.getServer().getConfigurationManager();
    if (useShortViewRadius) {
        int orig = savePlayerViewRadius();
        restorePlayerViewRadius(chunkRadius);
        try {
            scm.preparePlayer(this, null /* previous world; allowed to be null */);
        } finally {
            restorePlayerViewRadius(orig);
            // altho the server might just crash anyways. Then again, there might be a handler higher up.
        }
    } else {
        scm.preparePlayer(this, null /* previous world; allowed to be null */);
    }
    initWrapping();
}
项目:Factorization    文件:TransportAreaUpdater.java   
void transferEntity(Entity ent, World newWorld, Vec3 newPosition) {
    if (ent instanceof IFzdsCustomTeleport) {
        ((IFzdsCustomTeleport) ent).transferEntity(dse, dse.worldObj, newPosition);
        return;
    }
    if (ent instanceof EntityPlayerMP) {
        if (!dse.can(DeltaCapability.TRANSFER_PLAYERS)) {
            return;
        }
        EntityPlayerMP player = (EntityPlayerMP) ent;
        MinecraftServer ms = MinecraftServer.getServer();
        ServerConfigurationManager manager = ms.getConfigurationManager();
        DSTeleporter tp = new DSTeleporter((WorldServer) newWorld);
        tp.preciseDestination = newPosition;
        manager.transferPlayerToDimension(player, newWorld.provider.getDimensionId(), tp);
    } else {
        //Inspired by Entity.travelToDimension
        ent.worldObj.removeEntity(ent); //setEntityDead
        ent.isDead = false;

        Entity phoenix = EntityList.createEntityByName(EntityList.getEntityString(ent), newWorld); //Like a phoenix rising from the ashes!
        if (phoenix == null) {
            return; //Or not.
        }
        phoenix.copyDataFromOld(ent);
        phoenix.timeUntilPortal = phoenix.getPortalCooldown();
        ent.isDead = true;
        phoenix.setPosition(newPosition.xCoord, newPosition.yCoord, newPosition.zCoord);
        newWorld.spawnEntityInWorld(phoenix);
    }
}
项目:Factorization    文件:StatUtil.java   
public static StatisticsFile getStatsFile(EntityPlayer player) {
    MinecraftServer server = MinecraftServer.getServer();
    if (server == null) return null;
    ServerConfigurationManager cm = server.getConfigurationManager();
    if (cm == null) return null;
    return cm.getPlayerStatsFile(player);
}
项目:CauldronGit    文件:NetworkDispatcher.java   
public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)
{
    super(Packet.class, false);
    this.manager = manager;
    this.scm = scm;
    this.side = Side.SERVER;
    this.handshakeChannel = new EmbeddedChannel(new HandshakeInjector(this), new ChannelRegistrationHandler(), new FMLHandshakeCodec(), new HandshakeMessageHandler<FMLHandshakeServerState>(FMLHandshakeServerState.class));
    this.handshakeChannel.attr(FML_DISPATCHER).set(this);
    this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT);
    this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
    this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel());
}
项目:YetAnotherBackupMod2    文件:WorldHelper.java   
public static void disableWorldSaving()
{
    LogHelper.info("Saving worlds and turning world auto-save off");

    MinecraftServer server = MinecraftServer.getServer();
    ServerConfigurationManager server_config_manager = MinecraftServer.getServer().getConfigurationManager();
    int server_count = server.worldServers.length;
    saveFlags = new HashMap<>();

    server_config_manager.saveAllPlayerData();
    LogHelper.info("Player data saved");

    for (int i = 0; i < server_count; i++)
    {
        WorldServer world_server = server.worldServers[i];
        saveFlags.put(world_server, world_server.levelSaving);

        world_server.levelSaving = false;

        try
        {
            world_server.saveAllChunks(true, null);
            world_server.saveChunkData();

            LogHelper.debug("Saved world %s", world_server.toString());
        }
        catch (MinecraftException ex)
        {
            LogHelper.error("Error saving world %s: %s", world_server.toString(), ex.getMessage());
            ex.printStackTrace();
        }
    }

    LogHelper.info("Worlds saved");
    LogHelper.info("World auto-save turned off");
    ChatHelper.sendLocalizedServerChatMsg("yabm2.backup.general.autosave_off");
}
项目:YetAnotherBackupMod2    文件:ChatHelper.java   
public static boolean sendServerChatMsg(IChatComponent chat_component)
{
    ServerConfigurationManager manager = MinecraftServer.getServer().getConfigurationManager();

    if (manager == null)
    {
        return false;
    }

    manager.sendChatMsg(chat_component);
    return true;
}
项目:NeptuneCommon    文件:MixinServerConfigurationManager.java   
@Overwrite
public void playerLoggedOut(EntityPlayerMP playerIn) {
    playerIn.triggerAchievement(StatList.leaveGameStat);
    this.writePlayerData(playerIn);
    WorldServer worldserver = playerIn.getServerForPlayer();

    if (playerIn.ridingEntity != null) {
        worldserver.removePlayerEntityDangerously(playerIn.ridingEntity);
        ServerConfigurationManager.logger.debug("removing player mount");
    }

    worldserver.removeEntity(playerIn);
    worldserver.getPlayerManager().removePlayer(playerIn);
    this.playerEntityList.remove(playerIn);
    this.uuidToPlayerMap.remove(playerIn.getUniqueID());
    this.playerStatFiles.remove(playerIn.getUniqueID());

    // Neptune: start
    PlayerListData playerListData = ((Player) playerIn).getPlayerListData(PlayerListAction.REMOVE_PLAYER);
    for (int i = 0; i < playerEntityList.size(); i++) {
        EntityPlayerMP playerMP = (EntityPlayerMP) this.playerEntityList.get(i);
        PlayerListHook playerListHook = new PlayerListHook(playerListData.copy(), (Player) playerMP);
        if (!playerListHook.call().isCanceled()) {
            S38PacketPlayerListItem packet = new S38PacketPlayerListItem();
            packet.action = S38PacketPlayerListItem.Action.valueOf(PlayerListAction.REMOVE_PLAYER.name());
            WorldSettings.GameType gameType =
                    WorldSettings.GameType.getByID(playerListHook.getData().getMode().getId());
            IChatComponent iChatComponent = playerListHook.getData().displayNameSet() ? ((NeptuneChatComponent)
                    playerListHook.getData().getDisplayName()).getHandle() : null;
            packet.players.add(packet.new AddPlayerData(playerListHook.getData()
                    .getProfile(), playerListHook.getData().getPing(), gameType, iChatComponent));
            playerMP.playerNetServerHandler.sendPacket(packet);
        }
    }
    // Neptune: end
    //this.sendPacketToAllPlayers(new S38PacketPlayerListItem(S38PacketPlayerListItem.Action.REMOVE_PLAYER, new
    // EntityPlayerMP[] {playerIn})); // Neptune: replaced by above code
}
项目:betterbeginnings-MC1.7    文件:ChatUtil.java   
public static void sendChatToServer(String message)
{
    ServerConfigurationManager config = MinecraftServer.getServer().getConfigurationManager();
    for (Object aPlayerEntityList : config.playerEntityList)
    {
        EntityPlayer player = (EntityPlayer)aPlayerEntityList;
        player.addChatComponentMessage(new ChatComponentText(message));
    }
}
项目:NeptuneMod    文件:MixinServerConfigurationManager.java   
@Redirect(method = "initializeConnectionToPlayer",
        at = @At(value = "INVOKE", target = "Lnet/minecraft/server/management/ServerConfigurationManager;"
                + "sendChatMsg(Lnet/minecraft/util/IChatComponent;)V"))
public void fireConnectionHook(ServerConfigurationManager manager, IChatComponent component, NetworkManager netManager, EntityPlayerMP playerIn) {
    ConnectionHook hook = (ConnectionHook)
            new ConnectionHook(
                    (Player) playerIn, component.getUnformattedTextForChat(), false // TODO: check first time
            ).call();
    if (!hook.isHidden()) {
        manager.sendChatMsg(component);
    }
}
项目:RecallResurrection    文件:RecallTransporter.java   
public static void transferPlayerToDimension(EntityPlayerMP player, int newDim, Coord6D dest)
{
    int j = player.dimension;
    ServerConfigurationManager manager = MinecraftServer.getServer().getConfigurationManager();
    WorldServer oldServer = MinecraftServer.getServer().worldServerForDimension(player.dimension);
    player.dimension = newDim;
    WorldServer newServer = MinecraftServer.getServer().worldServerForDimension(player.dimension);

    // Let's load the chunk for the player. That would probably be swell.
    Chunk c = newServer.getChunkFromBlockCoords((int)Math.floor(dest.x), (int)Math.floor(dest.y));
    int cX = c.xPosition;
    int cZ = c.zPosition;
    newServer.getChunkProvider().loadChunk(cX, cZ);

    player.playerNetServerHandler.sendPacket(new S07PacketRespawn(player.dimension, player.worldObj.difficultySetting, player.worldObj.getWorldInfo().getTerrainType(), player.theItemInWorldManager.getGameType()));
    oldServer.removePlayerEntityDangerously(player);
    player.isDead = false;
    transferEntityToWorld(player, j, oldServer, newServer, dest);
    manager.func_72375_a(player, oldServer);
    player.playerNetServerHandler.setPlayerLocation(player.posX, player.posY, player.posZ, player.rotationYaw, player.rotationPitch);
    player.theItemInWorldManager.setWorld(newServer);
    manager.updateTimeAndWeatherForPlayer(player, newServer);
    manager.syncPlayerInventory(player);
    Iterator iterator = player.getActivePotionEffects().iterator();

    while (iterator.hasNext())
    {
        PotionEffect potioneffect = (PotionEffect)iterator.next();
        player.playerNetServerHandler.sendPacket(new S1DPacketEntityEffect(player.getEntityId(), potioneffect));
    }
    FMLCommonHandler.instance().firePlayerChangedDimensionEvent(player, j, newDim);
}
项目:RoboticMinions    文件:VanillaPacketHelper.java   
public static void sendToAllInRange(int dimension, int x, int y, int z, int range, Packet packet) {
    ServerConfigurationManager manager = MinecraftServer.getServer().getConfigurationManager();

    for (Object obj : manager.playerEntityList) {
        EntityPlayerMP player = (EntityPlayerMP) obj;

        if (player.getEntityWorld().provider.dimensionId == dimension && player.getDistance(x, y, z) <= range) {
            player.playerNetServerHandler.sendPacket(packet);
        }
    }
}
项目:Chisel    文件:PacketHandler.java   
public void sendToPlayers(double posX,double posY,double posZ,int dimension,double distance,PacketData data) {
    ServerConfigurationManager mgr = MinecraftServer.getServer().getConfigurationManager();
    for (int j = 0; j < mgr.playerEntityList.size(); ++j) {
        EntityPlayerMP p = (EntityPlayerMP) mgr.playerEntityList.get(j);

        if (p.dimension != dimension) continue;
        if (! General.isInRange(distance, p.posX, p.posY, p.posZ, posX, posY, posZ)) continue;

        sendToPlayer(p,data);
    }
}
项目:YetAnotherBackupMod    文件:ChatHelper.java   
public static boolean sendServerChatMsg(IChatComponent chat_component)
{
    ServerConfigurationManager manager = MinecraftServer.getServer().getConfigurationManager();

    if (manager == null)
    {
        return false;
    }

    manager.sendChatMsg(chat_component);
    return true;
}
项目:MoarPeripherals    文件:TileChatBox.java   
@LuaFunction
public boolean tell(String username, String message) throws Exception {
    Preconditions.checkArgument(count++ <= ConfigData.chatSayRate, ERROR_TOO_MANY, ConfigData.chatSayRate);

    ServerConfigurationManager scm = MinecraftServer.getServer().getConfigurationManager();

    if (rangeTell == 0 || (rangeTell > 0 && !entityInRange(scm.func_152612_a(username), rangeTell))) {
        return false;
    }

    ChatUtil.sendChatToPlayer(username, buildMessage(message, true));
    return true;
}
项目:MoarPeripherals    文件:TileChatBoxAdmin.java   
@LuaFunction
public boolean say(String message) throws Exception {
    ServerConfigurationManager scm = MinecraftServer.getServer().getConfigurationManager();
    String[] playerNames = scm.getAllUsernames();
    if (playerNames.length == 0) {
        return false;
    }

    ChatUtil.sendChatToPlayer(playerNames, buildMessage(message, false));
    return true;
}
项目:MoarPeripherals    文件:TileChatBoxAdmin.java   
@LuaFunction
public boolean tell(String username, String message) throws Exception {
    ServerConfigurationManager scm = MinecraftServer.getServer().getConfigurationManager();

    // check existence of the player
    if (scm.func_152612_a(username) == null) {
        return false;
    }

    ChatUtil.sendChatToPlayer(username, buildMessage(message, true));
    return true;
}
项目:Cauldron    文件:NetworkDispatcher.java   
public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)
{
    super(Packet.class, false);
    this.manager = manager;
    this.scm = scm;
    this.side = Side.SERVER;
    this.handshakeChannel = new EmbeddedChannel(new HandshakeInjector(this), new ChannelRegistrationHandler(), new FMLHandshakeCodec(), new HandshakeMessageHandler<FMLHandshakeServerState>(FMLHandshakeServerState.class));
    this.handshakeChannel.attr(FML_DISPATCHER).set(this);
    this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT);
    this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
    this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel());
}
项目:Cauldron    文件:NetworkDispatcher.java   
public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)
{
    super(Packet.class, false);
    this.manager = manager;
    this.scm = scm;
    this.side = Side.SERVER;
    this.handshakeChannel = new EmbeddedChannel(new HandshakeInjector(this), new ChannelRegistrationHandler(), new FMLHandshakeCodec(), new HandshakeMessageHandler<FMLHandshakeServerState>(FMLHandshakeServerState.class));
    this.handshakeChannel.attr(FML_DISPATCHER).set(this);
    this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT);
    this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
    this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel());
}
项目:Cauldron    文件:NetworkDispatcher.java   
public NetworkDispatcher(NetworkManager manager, ServerConfigurationManager scm)
{
    super(Packet.class, false);
    this.manager = manager;
    this.scm = scm;
    this.side = Side.SERVER;
    this.handshakeChannel = new EmbeddedChannel(new HandshakeInjector(this), new ChannelRegistrationHandler(), new FMLHandshakeCodec(), new HandshakeMessageHandler<FMLHandshakeServerState>(FMLHandshakeServerState.class));
    this.handshakeChannel.attr(FML_DISPATCHER).set(this);
    this.handshakeChannel.attr(NetworkRegistry.CHANNEL_SOURCE).set(Side.CLIENT);
    this.handshakeChannel.attr(NetworkRegistry.FML_CHANNEL).set("FML|HS");
    this.handshakeChannel.attr(IS_LOCAL).set(manager.isLocalChannel());
}
项目:nailed    文件:NailedWorldEditPlatform.java   
@Override
public Collection<Actor> getConnectedUsers() {
    List<Actor> users = new ArrayList<Actor>();
    ServerConfigurationManager scm = server.getConfigurationManager();
    for(String name : scm.getAllUsernames()){
        EntityPlayerMP entity = scm.getPlayerByUsername(name);
        if(entity != null){
            users.add(new WorldEditPlayer(NailedPlatform.instance().getPlayerFromEntity(entity)));
        }
    }
    return users;
}
项目:RuneCraftery    文件:FMLNetworkHandler.java   
/**
 * @param netLoginHandler
 * @param server
 * @param address
 * @param userName
 * @return if the user can carry on
 */
private boolean handleVanillaLoginKick(NetLoginHandler netLoginHandler, MinecraftServer server, SocketAddress address, String userName)
{
    // Vanilla reasons first
    ServerConfigurationManager playerList = server.func_71203_ab();
    String kickReason = playerList.func_72399_a(address, userName);

    if (kickReason != null)
    {
        netLoginHandler.completeConnection(kickReason);
    }
    return kickReason == null;
}
项目:RuneCraftery    文件:NetLoginHandler.java   
public void func_72467_a(Packet254ServerPing p_72467_1_) {
   try {
      ServerConfigurationManager var2 = this.field_72534_f.func_71203_ab();
      String var3 = null;
      if(p_72467_1_.func_140050_d()) {
         var3 = this.field_72534_f.func_71273_Y() + "\u00a7" + var2.func_72394_k() + "\u00a7" + var2.func_72352_l();
      } else {
         List var4 = Arrays.asList(new Serializable[]{Integer.valueOf(1), Integer.valueOf(78), this.field_72534_f.func_71249_w(), this.field_72534_f.func_71273_Y(), Integer.valueOf(var2.func_72394_k()), Integer.valueOf(var2.func_72352_l())});

         Object var6;
         for(Iterator var5 = var4.iterator(); var5.hasNext(); var3 = var3 + var6.toString().replaceAll("\u0000", "")) {
            var6 = var5.next();
            if(var3 == null) {
               var3 = "\u00a7";
            } else {
               var3 = var3 + "\u0000";
            }
         }
      }

      InetAddress var8 = null;
      if(this.field_72538_b.func_74452_g() != null) {
         var8 = this.field_72538_b.func_74452_g().getInetAddress();
      }

      this.field_72538_b.func_74429_a(new Packet255KickDisconnect(var3));
      this.field_72538_b.func_74423_d();
      if(var8 != null && this.field_72534_f.func_71212_ac() instanceof DedicatedServerListenThread) {
         ((DedicatedServerListenThread)this.field_72534_f.func_71212_ac()).func_71761_a(var8);
      }

      this.field_72539_c = true;
   } catch (Exception var7) {
      var7.printStackTrace();
   }

}
项目:RuneCraftery    文件:FMLNetworkHandler.java   
/**
 * @param netLoginHandler
 * @param server
 * @param address
 * @param userName
 * @return if the user can carry on
 */
private boolean handleVanillaLoginKick(NetLoginHandler netLoginHandler, MinecraftServer server, SocketAddress address, String userName)
{
    // Vanilla reasons first
    ServerConfigurationManager playerList = server.getConfigurationManager();
    String kickReason = playerList.allowUserToConnect(address, userName);

    if (kickReason != null)
    {
        netLoginHandler.completeConnection(kickReason);
    }
    return kickReason == null;
}
项目:BetterNutritionMod    文件:FMLNetworkHandler.java   
/**
 * @param netLoginHandler
 * @param server
 * @param address
 * @param userName
 * @return if the user can carry on
 */
private boolean handleVanillaLoginKick(NetLoginHandler netLoginHandler, MinecraftServer server, SocketAddress address, String userName)
{
    // Vanilla reasons first
    ServerConfigurationManager playerList = server.getConfigurationManager();
    String kickReason = playerList.allowUserToConnect(address, userName);

    if (kickReason != null)
    {
        netLoginHandler.completeConnection(kickReason);
    }
    return kickReason == null;
}
项目:PneumaticCraft    文件:WorldPlayersInServerSensor.java   
@Override
public int getRedstoneValue(World world, int x, int y, int z, int sensorRange, String textBoxText){
    ServerConfigurationManager serverManager = FMLCommonHandler.instance().getMinecraftServerInstance().getConfigurationManager();
    if(textBoxText.equals("")) {
        return Math.min(15, serverManager.playerEntityList.size());
    } else {
        String[] userNames = serverManager.getAllUsernames();
        for(String userName : userNames) {
            if(userName.equalsIgnoreCase(textBoxText)) return 15;
        }
        return 0;
    }
}
项目:Nucleum-Omnium    文件:CustomPacket.java   
public void sendToAllInDim(int dim)
{
    ServerConfigurationManager mcscm = MinecraftServer.getServer().getConfigurationManager();
    for (int j = 0; j < mcscm.playerEntityList.size(); ++j)
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP) mcscm.playerEntityList.get(j);

        if (Players.getPlayerData(entityplayermp).hasNucleum && entityplayermp.dimension == dim)
        {
            send(entityplayermp);
        }
    }
}
项目:Nucleum-Omnium    文件:CustomPacket.java   
public void sendToAll()
{
    ServerConfigurationManager mcscm = MinecraftServer.getServer().getConfigurationManager();
    for (int j = 0; j < mcscm.playerEntityList.size(); ++j)
    {
        EntityPlayerMP entityplayermp = (EntityPlayerMP) mcscm.playerEntityList.get(j);

        if (Players.getPlayerData(entityplayermp).hasNucleum)
        {
            send(entityplayermp);
        }
    }
}
项目:MobSpawnControls2    文件:SpawnConfiguration.java   
public boolean canPlayerEdit(EntityPlayer p) {
    if (settings.canEdit() && p instanceof EntityPlayerMP) {
        EntityPlayerMP mp = (EntityPlayerMP) p;
        if (mp.mcServer == null || mp.getCommandSenderName() == null)
            return false;

        // New method of checking whether the player is opped using GameProfile.
        ServerConfigurationManager configManager    = mp.mcServer.getConfigurationManager();
        EntityPlayerMP player                       = configManager.func_152612_a(mp.getCommandSenderName());
        GameProfile profile                         = player.getGameProfile();

        return !mp.mcServer.isDedicatedServer() || configManager.func_152596_g(profile);
    }
    return false;
}
项目:DecompiledMinecraft    文件:MinecraftServer.java   
public ServerConfigurationManager getConfigurationManager()
{
    return this.serverConfigManager;
}
项目:DecompiledMinecraft    文件:MinecraftServer.java   
public void setConfigManager(ServerConfigurationManager configManager)
{
    this.serverConfigManager = configManager;
}
项目:DecompiledMinecraft    文件:MinecraftServer.java   
public ServerConfigurationManager getConfigurationManager()
{
    return this.serverConfigManager;
}
项目:DecompiledMinecraft    文件:MinecraftServer.java   
public void setConfigManager(ServerConfigurationManager configManager)
{
    this.serverConfigManager = configManager;
}