-
Notifications
You must be signed in to change notification settings - Fork 418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Built-In Support for Command Blocks #891
base: master
Are you sure you want to change the base?
Conversation
src/main/java/cn/nukkit/Player.java
Outdated
import cn.nukkit.network.protocol.TextPacket; | ||
import cn.nukkit.network.protocol.TransferPacket; | ||
import cn.nukkit.network.protocol.UpdateAttributesPacket; | ||
import cn.nukkit.network.protocol.UpdateBlockPacket; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you revert this? Maybe change your formatting settings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I totally see the point... sorry, my IDE's auto-formatting screwed it up. Will see what I can do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted old commit, pushed new one without formatting issues. Looking forward to your reviews... ;)
Could this with any chance be done without reformatting the files? |
Why not to use vanilla UI? |
I'll have to admit that there are still things to improve, and I'm committed to continue work on it. Command output, control for first tick and rate, etc. Any hints to how to do two-column layout in UI? |
How do we proceed with this PR? |
Try using proxypass you can easily find what packets are used for command blocks with BDS |
Had a look to ProxyPass lately. It's throwing a load of exceptions for me, if I proxy a connection between vanilla 1.12.1 server on Ubuntu 18.04 and Win 10 client to find out what I need - to extract packets regarding command blocks. Maybe I'll post an issue, maybe I'm doing something wrong on my side. |
It's possible the encoding/decoding methods on the packet could be wrong as I only took a short amount of time reverse engineering the packet since it's not game critical. Could you post the exceptions thrown by ProxyPass here? |
@SupremeMortal, sure, here we go. My goal is to find packets related to any interaction with command blocks. However, I face these problems: On the instant of interacting with a command block I find no visible occurrence of corresponding entries in the log. Actually, I see no information on decoded packets at all (...and this is where I think I'm doing something wrong, maybe configuration issue, maybe wrong log level?). From the logs I merely get messages like this....
...and exceptions like this...
This one here pops up on startup, though I think it's rather a warning. The real errors pop up later.
|
Darn... just had a look into the generated session folder to find the desired packet.log... |
I fixed the first exception you in the latest version of ProxyPass. The netty exception is normal because it's trying multiple mechanisms to load the native library. |
Thanks a lot! Meanwhile I'm finding my way into the relevant protocol parts. |
Ok, thanks to ProxyPass I managed to study packet sequences how to trigger opening Vanilla UI for command blocks on client side and handle command block update packets on server side. I'll wire this up with the code I had before - effectively I'll rewrite most stuff, but that's worth it. First try was a dirty hack, but a good learning experience... Thanks for helping with reviews and hints, @Creeperface01 @SupremeMortal @PetteriM1. Will take a while though, since my wife is currently delivering our first child... ;) |
Adds built-in support for command blocks.
@a
and@p
in commandsImplementation introduces an extension of PluginManager, allowing to register built-in event listeners. This modification is a hack necessary to enable the registration of listeners not being part of a plug-in, but rather being built-in. A particular new listener was introduced to realize callbacks to PlayerFormRespondedEvent caused by command block configuration form updates.
Command Blocks including data and NBT are in general enabled for copy/paste/schematic operations in FAWE. However, a small patch for FAWE is necessary for this to work. This patch already exists, a pull request is on the way: boy0001/FastAsyncWorldedit#1332