So I want a modded client to tell the server to place blocks from the player. From what I can read, this was done, at some point, by sending a packet containing the information about where the block was to be placed. This seems simple enough. Digging through the source, I don't appear to be able to find anything remotely like this and it's looking like what is sent in terms of the protocol is "the player is here", "the player is looking there", "the player has right-clicked". I.e. much lower-level stuff. Does this make sense or am I barking up the wrong tree?
You are on the right track, here is the official forge documentation on how to send packages. Also a word of caution: Make sure to implement strict checks on the server (for example make sure that the player is near the position where it want the block to be placed etc), to combat hacked clients.
Thanks. This will be to work with a vanilla server (or at least not be a server based mod) so I'm wanting to use the base protocol. I found a mod called paver hack which works similarly to what I want to do but there is no source so I'm not sure if its methods are still possible (it works by moving the player so possibly).
Next step is probably to add a bunch of debugging to the network layer. Unless that's an option I can turn on anyway.
Thanks. This will be to work with a vanilla server (or at least not be a server based mod) so I'm wanting to use the base protocol. I found a mod called paver hack which works similarly to what I want to do but there is no source so I'm not sure if its methods are still possible (it works by moving the player so possibly).
Next step is probably to add a bunch of debugging to the network layer. Unless that's an option I can turn on anyway.
Hmm, then I must confess that I misunderstood your original post. Custom packages will only work if your server is also modded. I have never done a client-only mod, so I am afraid I can offer no advice.
I basically have it figured out. The client sends a CPlayerTryUseItemOnBlockPacket. This makes things a little tricky as instead of just "place a block here", I have to work out which part of an existing block I'm applying the new block to. Nothing too complicated though. I already have the item slot changer worked out. and moving around.
So I want a modded client to tell the server to place blocks from the player. From what I can read, this was done, at some point, by sending a packet containing the information about where the block was to be placed. This seems simple enough. Digging through the source, I don't appear to be able to find anything remotely like this and it's looking like what is sent in terms of the protocol is "the player is here", "the player is looking there", "the player has right-clicked". I.e. much lower-level stuff. Does this make sense or am I barking up the wrong tree?
You are on the right track, here is the official forge documentation on how to send packages. Also a word of caution: Make sure to implement strict checks on the server (for example make sure that the player is near the position where it want the block to be placed etc), to combat hacked clients.
Thanks. This will be to work with a vanilla server (or at least not be a server based mod) so I'm wanting to use the base protocol. I found a mod called paver hack which works similarly to what I want to do but there is no source so I'm not sure if its methods are still possible (it works by moving the player so possibly).
Next step is probably to add a bunch of debugging to the network layer. Unless that's an option I can turn on anyway.
Hmm, then I must confess that I misunderstood your original post. Custom packages will only work if your server is also modded. I have never done a client-only mod, so I am afraid I can offer no advice.
I basically have it figured out. The client sends a CPlayerTryUseItemOnBlockPacket. This makes things a little tricky as instead of just "place a block here", I have to work out which part of an existing block I'm applying the new block to. Nothing too complicated though. I already have the item slot changer worked out. and moving around.