Examples of FMLEmbeddedChannel


Examples of cpw.mods.fml.common.network.FMLEmbeddedChannel

        if (side == Side.CLIENT)
        {
            addClientHandlers();
        }

        FMLEmbeddedChannel serverChannel = channelPair.get(Side.SERVER);
        serverChannel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(OutboundTarget.NOWHERE);
        String handlerName = serverChannel.findChannelHandlerNameForType(ForgeRuntimeCodec.class);
        serverChannel.pipeline().addAfter(handlerName, "ServerToClientConnection", new ServerToClientConnectionEstablishedHandler());
    }
View Full Code Here

Examples of cpw.mods.fml.common.network.FMLEmbeddedChannel

    }

    @SideOnly(Side.CLIENT)
    private static void addClientHandlers()
    {
        FMLEmbeddedChannel clientChannel = channelPair.get(Side.CLIENT);
        String handlerName = clientChannel.findChannelHandlerNameForType(ForgeRuntimeCodec.class);
        clientChannel.pipeline().addAfter(handlerName, "DimensionHandler", new DimensionMessageHandler());
        clientChannel.pipeline().addAfter(handlerName, "FluidIdRegistryHandler", new FluidIdRegistryMessageHandler());
    }
View Full Code Here

Examples of cpw.mods.fml.common.network.FMLEmbeddedChannel

  }

  public static void createChannels() {
    channels = NetworkRegistry.INSTANCE.newChannel(networkChannelName, new PacketHandler());
    for(Side side:Side.values()) {
      FMLEmbeddedChannel channel = channels.get(side);
      String type = channel.findChannelHandlerNameForType(PacketHandler.class);
      channel.pipeline().addAfter(type, PacketInboundHandler.class.getName(), new PacketInboundHandler());
    }
  }
View Full Code Here

Examples of cpw.mods.fml.common.network.FMLEmbeddedChannel

     * @param side the side for the handler
     */
    public <REQ extends IMessage, REPLY extends IMessage> void registerMessage(IMessageHandler<? super REQ, ? extends REPLY> messageHandler, Class<REQ> requestMessageType, int discriminator, Side side)
    {
        packetCodec.addDiscriminator(discriminator, requestMessageType);
        FMLEmbeddedChannel channel = channels.get(side);
        String type = channel.findChannelHandlerNameForType(SimpleIndexedCodec.class);
        if (side == Side.SERVER)
        {
            addServerHandlerAfter(channel, type, messageHandler, requestMessageType);
        }
        else
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.