Jump to content

LK520

Members
  • Posts

    2
  • Joined

  • Last visited

LK520's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. This is what the console outputs: [20:07:10.225] [Netty Client IO #0/DEBUG] [ne.mi.fm.ne.FMLHandshakeHandler/FMLHANDSHAKE]: Starting new vanilla network connection. [20:07:10.491] [Netty Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:loginwrapper' : Vanilla acceptance test: ACCEPTED [20:07:10.491] [Netty Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:handshake' : Vanilla acceptance test: ACCEPTED [20:07:10.491] [Netty Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'fml:play' : Vanilla acceptance test: ACCEPTED [20:07:10.491] [Netty Client IO #0/DEBUG] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channel 'space:a' : Vanilla acceptance test: REJECTED [20:07:10.492] [Netty Client IO #0/ERROR] [ne.mi.fm.ne.NetworkRegistry/NETREGISTRY]: Channels [space:a] rejected vanilla connections
  2. public ExampleMod() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); MinecraftForge.EVENT_BUS.register(this); EventNetworkChannel channel = NetworkRegistry.ChannelBuilder .named(new ResourceLocation("space", "a")) .clientAcceptedVersions(PROTOCOL_VERSION::equals) .serverAcceptedVersions(PROTOCOL_VERSION::equals) .networkProtocolVersion(() -> PROTOCOL_VERSION) .eventNetworkChannel(); channel.registerObject(this); channel.addListener(this::onClientPacket); } public void onClientPacket(NetworkEvent.ClientCustomPayloadEvent evt){ byte[] b = new byte[evt.getPayload().readableBytes()]; evt.getPayload().getBytes(0, b); System.out.println(b); //String s = new String(b,"utf-8"); } I tried to use this method to receive pluginmessage from the server, but it doesn't work
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.