Java 类net.minecraft.network.NetworkManager 实例源码

项目:CustomWorldGen    文件:ServerPinger.java   
public void clearPendingNetworks()
{
    synchronized (this.pingDestinations)
    {
        Iterator<NetworkManager> iterator = this.pingDestinations.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                iterator.remove();
                networkmanager.closeChannel(new TextComponentString("Cancelled"));
            }
        }
    }
}
项目:DecompiledMinecraft    文件:OldServerPinger.java   
public void pingPendingNetworks()
{
    synchronized (this.pingDestinations)
    {
        Iterator<NetworkManager> iterator = this.pingDestinations.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                networkmanager.processReceivedPackets();
            }
            else
            {
                iterator.remove();
                networkmanager.checkDisconnected();
            }
        }
    }
}
项目:DecompiledMinecraft    文件:OldServerPinger.java   
public void clearPendingNetworks()
{
    synchronized (this.pingDestinations)
    {
        Iterator<NetworkManager> iterator = this.pingDestinations.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                iterator.remove();
                networkmanager.closeChannel(new ChatComponentText("Cancelled"));
            }
        }
    }
}
项目:Backmemed    文件:ServerPinger.java   
public void pingPendingNetworks()
{
    synchronized (this.pingDestinations)
    {
        Iterator<NetworkManager> iterator = this.pingDestinations.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                networkmanager.processReceivedPackets();
            }
            else
            {
                iterator.remove();
                networkmanager.checkDisconnected();
            }
        }
    }
}
项目:BaseClient    文件:RealmsServerStatusPinger.java   
public void removeAll()
{
    synchronized (this.connections)
    {
        Iterator<NetworkManager> iterator = this.connections.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                iterator.remove();
                networkmanager.closeChannel(new ChatComponentText("Cancelled"));
            }
        }
    }
}
项目:BaseClient    文件:OldServerPinger.java   
public void clearPendingNetworks()
{
    synchronized (this.pingDestinations)
    {
        Iterator<NetworkManager> iterator = this.pingDestinations.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                iterator.remove();
                networkmanager.closeChannel(new ChatComponentText("Cancelled"));
            }
        }
    }
}
项目:BaseClient    文件:RealmsServerStatusPinger.java   
public void tick()
{
    synchronized (this.connections)
    {
        Iterator<NetworkManager> iterator = this.connections.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                networkmanager.processReceivedPackets();
            }
            else
            {
                iterator.remove();
                networkmanager.checkDisconnected();
            }
        }
    }
}
项目:Backmemed    文件:ServerPinger.java   
public void clearPendingNetworks()
{
    synchronized (this.pingDestinations)
    {
        Iterator<NetworkManager> iterator = this.pingDestinations.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                iterator.remove();
                networkmanager.closeChannel(new TextComponentString("Cancelled"));
            }
        }
    }
}
项目:BaseClient    文件:OldServerPinger.java   
public void pingPendingNetworks()
{
    synchronized (this.pingDestinations)
    {
        Iterator<NetworkManager> iterator = this.pingDestinations.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                networkmanager.processReceivedPackets();
            }
            else
            {
                iterator.remove();
                networkmanager.checkDisconnected();
            }
        }
    }
}
项目:BaseClient    文件:OldServerPinger.java   
public void clearPendingNetworks()
{
    synchronized (this.pingDestinations)
    {
        Iterator<NetworkManager> iterator = this.pingDestinations.iterator();

        while (iterator.hasNext())
        {
            NetworkManager networkmanager = (NetworkManager)iterator.next();

            if (networkmanager.isChannelOpen())
            {
                iterator.remove();
                networkmanager.closeChannel(new ChatComponentText("Cancelled"));
            }
        }
    }
}
项目:pnc-repressurized    文件:EntityDrone.java   
private void initializeFakePlayer() {
    fakePlayer = new DroneFakePlayer(
            (WorldServer) world,
            new GameProfile(UUID.fromString(getOwnerUUID()), playerName),
            this);
    fakePlayer.connection = new NetHandlerPlayServer(FMLCommonHandler.instance().getMinecraftServerInstance(), new NetworkManager(EnumPacketDirection.SERVERBOUND), fakePlayer);
    fakePlayer.inventory = new InventoryFakePlayer(fakePlayer);
}
项目:GeneralLaymansAestheticSpyingScreen    文件:TileEntityGlassBase.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    onChunkUnload();
    readFromNBT(pkt.getNbtCompound());
    onLoad();
}
项目:GeneralLaymansAestheticSpyingScreen    文件:TileEntityGlassTerminal.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    onChunkUnload();
    readFromNBT(pkt.getNbtCompound());
    onLoad();
}
项目:Backmemed    文件:NetHandlerPlayClient.java   
public NetHandlerPlayClient(Minecraft mcIn, GuiScreen p_i46300_2_, NetworkManager networkManagerIn, GameProfile profileIn)
{
    this.gameController = mcIn;
    this.guiScreenServer = p_i46300_2_;
    this.netManager = networkManagerIn;
    this.profile = profileIn;
}
项目:CreeperHostGui    文件:GuiProgressDisconnected.java   
public GuiProgressDisconnected(GuiScreen screen, String reasonLocalizationKey, ITextComponent chatComp, NetworkManager lastNetworkManager)
{
    this.parentScreen = screen;
    this.ourReason = I18n.format(reasonLocalizationKey);
    this.ourMessage = chatComp;
    this.lastNetworkManager = lastNetworkManager;
    this.lastConnectAttempt = System.currentTimeMillis();
    if (lastNetworkManager != null)
    {
        InetSocketAddress address = (InetSocketAddress) lastNetworkManager.getRemoteAddress();
        ip = address.getHostName() + ":" + address.getPort();
    }
}
项目:DecompiledMinecraft    文件:MessageDeserializer.java   
protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List<Object> p_decode_3_) throws IOException, InstantiationException, IllegalAccessException, Exception
{
    if (p_decode_2_.readableBytes() != 0)
    {
        PacketBuffer packetbuffer = new PacketBuffer(p_decode_2_);
        int i = packetbuffer.readVarIntFromBuffer();
        Packet packet = ((EnumConnectionState)p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getPacket(this.direction, i);

        if (packet == null)
        {
            throw new IOException("Bad packet id " + i);
        }
        else
        {
            packet.readPacketData(packetbuffer);

            if (packetbuffer.readableBytes() > 0)
            {
                throw new IOException("Packet " + ((EnumConnectionState)p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getId() + "/" + i + " (" + packet.getClass().getSimpleName() + ") was larger than I expected, found " + packetbuffer.readableBytes() + " bytes extra whilst reading packet " + i);
            }
            else
            {
                p_decode_3_.add(packet);

                if (logger.isDebugEnabled())
                {
                    logger.debug(RECEIVED_PACKET_MARKER, " IN: [{}:{}] {}", new Object[] {p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), Integer.valueOf(i), packet.getClass().getName()});
                }
            }
        }
    }
}
项目:DecompiledMinecraft    文件:MessageDeserializer.java   
protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List<Object> p_decode_3_) throws IOException, InstantiationException, IllegalAccessException, Exception
{
    if (p_decode_2_.readableBytes() != 0)
    {
        PacketBuffer packetbuffer = new PacketBuffer(p_decode_2_);
        int i = packetbuffer.readVarIntFromBuffer();
        Packet packet = ((EnumConnectionState)p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getPacket(this.direction, i);

        if (packet == null)
        {
            throw new IOException("Bad packet id " + i);
        }
        else
        {
            packet.readPacketData(packetbuffer);

            if (packetbuffer.readableBytes() > 0)
            {
                throw new IOException("Packet " + ((EnumConnectionState)p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getId() + "/" + i + " (" + packet.getClass().getSimpleName() + ") was larger than I expected, found " + packetbuffer.readableBytes() + " bytes extra whilst reading packet " + i);
            }
            else
            {
                p_decode_3_.add(packet);

                if (logger.isDebugEnabled())
                {
                    logger.debug(RECEIVED_PACKET_MARKER, " IN: [{}:{}] {}", new Object[] {p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), Integer.valueOf(i), packet.getClass().getName()});
                }
            }
        }
    }
}
项目:PacketControl    文件:PacketControlService.java   
@Override
public void sendPacket(Packet packet, PlayerConnection connection) {
    if(connection instanceof NetworkManager) {
        ((NetworkManager)connection).sendPacket((net.minecraft.network.Packet)packet);
    } else if(connection instanceof NetHandlerPlayServer) {
        ((NetHandlerPlayServer)connection).sendPacket((net.minecraft.network.Packet)packet);
    } else {
        sendPacket(packet, connection.getPlayer());
    }
}
项目:PurificatiMagicae    文件:TileCodeStorage.java   
@Override
@SideOnly(Side.CLIENT)
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt)
{
    super.onDataPacket(net, pkt);
    setOpened(pkt.getNbtCompound().getBoolean("opened"));
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
public NetHandlerPlayClient(Minecraft mcIn, GuiScreen p_i46300_2_, NetworkManager p_i46300_3_, GameProfile p_i46300_4_)
{
    this.gameController = mcIn;
    this.guiScreenServer = p_i46300_2_;
    this.netManager = p_i46300_3_;
    this.profile = p_i46300_4_;
}
项目:BaseClient    文件:MessageSerializer.java   
protected void encode(ChannelHandlerContext p_encode_1_, Packet p_encode_2_, ByteBuf p_encode_3_) throws IOException, Exception
{
    Integer integer = ((EnumConnectionState)p_encode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getPacketId(this.direction, p_encode_2_);

    if (logger.isDebugEnabled())
    {
        logger.debug(RECEIVED_PACKET_MARKER, "OUT: [{}:{}] {}", new Object[] {p_encode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), integer, p_encode_2_.getClass().getName()});
    }

    if (integer == null)
    {
        throw new IOException("Can\'t serialize unregistered packet");
    }
    else
    {
        PacketBuffer packetbuffer = new PacketBuffer(p_encode_3_);
        packetbuffer.writeVarIntToBuffer(integer.intValue());

        try
        {
            p_encode_2_.writePacketData(packetbuffer);
        }
        catch (Throwable throwable)
        {
            logger.error((Object)throwable);
        }
    }
}
项目:BaseClient    文件:MessageDeserializer.java   
protected void decode(ChannelHandlerContext p_decode_1_, ByteBuf p_decode_2_, List<Object> p_decode_3_) throws IOException, InstantiationException, IllegalAccessException, Exception
{
    if (p_decode_2_.readableBytes() != 0)
    {
        PacketBuffer packetbuffer = new PacketBuffer(p_decode_2_);
        int i = packetbuffer.readVarIntFromBuffer();
        Packet packet = ((EnumConnectionState)p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getPacket(this.direction, i);

        if (packet == null)
        {
            throw new IOException("Bad packet id " + i);
        }
        else
        {
            packet.readPacketData(packetbuffer);

            if (packetbuffer.readableBytes() > 0)
            {
                throw new IOException("Packet " + ((EnumConnectionState)p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getId() + "/" + i + " (" + packet.getClass().getSimpleName() + ") was larger than I expected, found " + packetbuffer.readableBytes() + " bytes extra whilst reading packet " + i);
            }
            else
            {
                p_decode_3_.add(packet);

                if (logger.isDebugEnabled())
                {
                    logger.debug(RECEIVED_PACKET_MARKER, " IN: [{}:{}] {}", new Object[] {p_decode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), Integer.valueOf(i), packet.getClass().getName()});
                }
            }
        }
    }
}
项目:BaseClient    文件:NetHandlerPlayClient.java   
public NetHandlerPlayClient(Minecraft mcIn, GuiScreen p_i46300_2_, NetworkManager p_i46300_3_,
        GameProfile p_i46300_4_) {
    this.gameController = mcIn;
    this.guiScreenServer = p_i46300_2_;
    this.netManager = p_i46300_3_;
    this.profile = p_i46300_4_;
}
项目:Zombe-Modpack    文件:NetHandlerPlayClient.java   
public NetHandlerPlayClient(Minecraft mcIn, GuiScreen p_i46300_2_, NetworkManager networkManagerIn, GameProfile profileIn)
{
    this.gameController = mcIn;
    this.guiScreenServer = p_i46300_2_;
    this.netManager = networkManagerIn;
    this.profile = profileIn;
}
项目:BaseClient    文件:MessageSerializer.java   
protected void encode(ChannelHandlerContext p_encode_1_, Packet p_encode_2_, ByteBuf p_encode_3_) throws IOException, Exception
{
    Integer integer = ((EnumConnectionState)p_encode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get()).getPacketId(this.direction, p_encode_2_);

    if (logger.isDebugEnabled())
    {
        logger.debug(RECEIVED_PACKET_MARKER, "OUT: [{}:{}] {}", new Object[] {p_encode_1_.channel().attr(NetworkManager.attrKeyConnectionState).get(), integer, p_encode_2_.getClass().getName()});
    }

    if (integer == null)
    {
        throw new IOException("Can\'t serialize unregistered packet");
    }
    else
    {
        PacketBuffer packetbuffer = new PacketBuffer(p_encode_3_);
        packetbuffer.writeVarIntToBuffer(integer.intValue());

        try
        {
            p_encode_2_.writePacketData(packetbuffer);
        }
        catch (Throwable throwable)
        {
            logger.error((Object)throwable);
        }
    }
}
项目:Backmemed    文件:NetHandlerStatusServer.java   
public NetHandlerStatusServer(MinecraftServer serverIn, NetworkManager netManager)
{
    this.server = serverIn;
    this.networkManager = netManager;
}
项目:pnc-repressurized    文件:TileEntityDroneInterface.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    handleUpdateTag(pkt.getNbtCompound());
}
项目:SimpleTubes    文件:TileTube.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    super.onDataPacket(net, pkt);
    handleUpdateTag(pkt.getNbtCompound());
}
项目:pnc-repressurized    文件:TileEntityBase.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    super.onDataPacket(net, pkt);
    PacketDescription packet = new PacketDescription(pkt.getNbtCompound());
    packet.handleClientSide(packet, PneumaticCraftRepressurized.proxy.getPlayer());
}
项目:CustomWorldGen    文件:FMLServerHandler.java   
@Override
public NetworkManager getClientToServerNetworkManager()
{
    throw new RuntimeException("Missing");
}
项目:HeroUtils    文件:TileEntityCookieJar.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    NBTTagCompound tagCom = pkt.getNbtCompound();
    readUpdateTag(tagCom);
}
项目:Soot    文件:TileEntityEmberBurst.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    readFromNBT(pkt.getNbtCompound());
}
项目:Soot    文件:TileEntityEmberFunnel.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    readFromNBT(pkt.getNbtCompound());
}
项目:ExSartagine    文件:TileEntityCooker.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    this.readFromNBT(pkt.getNbtCompound());
}
项目:CustomWorldGen    文件:FMLNetworkEvent.java   
public ClientDisconnectionFromServerEvent(NetworkManager manager)
{
    super((INetHandlerPlayClient) manager.getNetHandler(), INetHandlerPlayClient.class, manager);
}
项目:ExSartagine    文件:TileEntityRangeExtension.java   
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    this.readFromNBT(pkt.getNbtCompound());
}
项目:MobBlocker    文件:TileEntityChunkProtector.java   
/**
 * Handles data packets
 */
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
    this.readFromNBT(packet.getNbtCompound());
}
项目:Bewitchment    文件:TileMod.java   
@SideOnly(Side.CLIENT)
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
    super.onDataPacket(net, packet);
    readDataNBT(packet.getNbtCompound());
}
项目:Bewitchment    文件:TileFluidInventory.java   
@SideOnly(Side.CLIENT)
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
    readFromNBT(pkt.getNbtCompound());
}
项目:Bewitchment    文件:TileItemInventory.java   
@SideOnly(Side.CLIENT)
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity packet) {
    super.onDataPacket(net, packet);
    readDataNBT(packet.getNbtCompound());
}