Posted May 29, 20187 yr 1. I want to send a packet in forge client when a player joins the server 2. I want spigot to send a packet when issue a spigot command. Then the forge mod reacts back with another packet. Spigot link with same things: https://www.spigotmc.org/threads/how-to-send-and-receive-packets-between-spigot-and-forge.321331/ Edited May 29, 20187 yr by SunnyLo Added spigot link
May 30, 20187 yr Author First, I'm using this class to receive packets. https://hastebin.com/amijotirif.java How do I check if the "EntityPlayerMP" to the player that is playing? Second, What should I do to receive packets in spigot? Third, What should I do to send packets in spigot?
May 30, 20187 yr 31 minutes ago, SunnyLo said: How do I check if the "EntityPlayerMP" to the player that is playing? On the server: The player in the message context IS the player that sent the packet On the client: The player that received the message IS the player that is playing... What more do you need? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 31, 20187 yr Author 11 hours ago, Draco18s said: On the server: The player in the message context IS the player that sent the packet On the client: The player that received the message IS the player that is playing... What more do you need? EntityPlayer entityPlayer = Minecraft.getMinecraft().thePlayer; if (entityPlayer == serverPlayer) { System.out.println(msg); } Like this?
May 31, 20187 yr Author 47 minutes ago, diesieben07 said: This is not a spigot forum. The real answer is: Switch to Sponge, Bukkit is dead. But if I use sponge, every player MUST install this mod, I just want this mod to be extra. Such as betterpvp mod or 5zig. Please correct me if I'm wrong Edited May 31, 20187 yr by SunnyLo
May 31, 20187 yr 7 hours ago, SunnyLo said: EntityPlayer entityPlayer = Minecraft.getMinecraft().thePlayer; if (entityPlayer == serverPlayer) { System.out.println(msg); } Like this? This check makes no fucking sense. On the server, the player that sent the packet is the only player that matters. On the client, when the client receives the packet, that player is the only player that matters. Do not perform this check. You do not need it. Just act on the context's player. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
June 1, 20187 yr Author Okay, so sponge is actually a bukkit replacement. So can spigot plugins work on sponge server? And what should I do to perform the check?
June 1, 20187 yr Author Oh yeah, I'm dump. Why I need this check. I'm new to forge, please forgive me.
June 1, 20187 yr Author It seems to be not working. know why? Code for the plugin: https://hastebin.com/avijezutus.java Code for the mod: https://hastebin.com/pajegewofi.java Edited June 1, 20187 yr by SunnyLo Updated link
June 2, 20187 yr Author 13 hours ago, diesieben07 said: You are sending the packet to the client, why are you registering it for both directions in Forge? Because I want to send packets both from spigot to forge and forge to spigot. 13 hours ago, diesieben07 said: No. No no no. Read and understand: https://mcforge.readthedocs.io/en/latest/concepts/sides/ I'll remove the thing. 13 hours ago, diesieben07 said: On the Forge side you are using readUTF8String, which expects the text to be prefixed with it's byte-length as a VarInt (look at the code if you are unsure). The format for your message must match between sending and receiving end. I've found this thread which someone ask the same thing as me. But he/you didn't show the code. Can you post an example code of using ByteArrayDataOutput? http://www.minecraftforge.net/forum/topic/59154-communication-between-forge-mod-and-bukkit-plugin/
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.