Good evening!
Sorry, I am not able to make it work
Currently, I am using this piece of code to register the packet:
private static final SimpleChannel HANDLER = NetworkRegistry.ChannelBuilder
.named(new ResourceLocation("namespace", "path"))
.clientAcceptedVersions(NetworkRegistry.ABSENT::equals) //not sure about this, since I cant send a version on bukkit side
.serverAcceptedVersions(NetworkRegistry.ABSENT::equals) //not sure about this, since I cant define a version on bukkit side
.networkProtocolVersion(() -> "1")
.simpleChannel();
....
HANDLER.registerMessage(0, CustomPacket.class, CustomPacket::encode, CustomPacket::decode, CustomPacket.Handler::handle); //is the 0 the id? the parameter name is "index", so I am not sure
On Bukkit/Spigot side I am sending this:
player.sendPluginMessage(pluginInstance, "namespace:path", "0|CustomPacket|Something".getBytes(java.nio.charset.Charset.forName("UTF-8")));
What am I doing wrong?
Thanks in advance for any awnsers