Is it possible to somehow acces the packages bukkit is using for sending ant retrieving data from the client?
I need a way to send custom packages from the server. In a normal cliant mod I do that by modding the NetClientHandler, and sending a costum package with it. Can that be done with bukkit somehow?
The simplest way to do this is: Code: // Register plugin channel (in your onEnable) getServer().getMessenger().registerOutgoingPluginChannel(this, "MyMod"); //to send to the player (when you need to send them data) if (player.getListeningPluginChannels().contains("MyMod")) { player.sendPluginMessage(plugin, "MyMod", "message"); } Then, in the netClientHandler, in handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayload), add an extra check to see if par1Packet250CustomPayload.channel = "MyMod". Then, you can do whatever you like with the data in the message. To receive data from the client, I am not sure, but I think there is an event for it.
Thanks. My plan is to integrate my clientmod for custom chat with the server. And also to make a minimap sent directly from the server instead of generated from the chunks in the client recieved(it might be a mix, but the server can "see" things further away) it would be usefull in my town plugin since it would allow you to find your plot at greater distances. It is maybe stupid how I make my mod with 500 difrent functions in one thing. I am mainly making a replecemant for towny advanced. But I am also adding functions like arenas, animal protection, multiworld, portals, economy....