If both ProjectileEvent
and ChatEvent
have a sender ID and an invalid
flag, why not create a base class they both inherit from? Then you could make a generic version of getProjectileHits
and getChatPosts
, rather than having two mostly identical functions.
Also, all these methods and variables should be static
.
What about messages not sent by the local player? I maintain it would be better to track this server-side, especially aince you could also track the sender's ID
This could probably be a dedicated clear()
method.
Forgive the typos, I typed this on my my phone while in bed.
Oh, one last thing! On RJ, does events.chat.posts
include the <username>
in messages? Because as it is, this PR does. (I really need to find an old enough version of Bukkit and try out RJ…
OK, I have a few more requests (I promise, this is the last time!):
events.clear
should also clearpollChatPosts
([like in RJ](https://github.com/zhuowei/RaspberryJuice/blob/e8ef1bcd5aa07a…
Yes, there's already a Base64 encoder in the skin
mod. It shouldn't be too difficult to create misc/base64.cpp
and add an encoder.
Oh my, that is cursed. And correct me if I'm wrong, but you still wouldn't be able to type ,
s right, it would just replace them with ;
?
Pretty sure it's still recursive. MC calls Gui::addMessage
which gets re-routed to Gui_addMessage_injection
which calls the original which then calls Gui::addMessage
which gets re-routed to…
Uh, the recursion check is actually pretty important...
You can use std::unordered_map::contains
Wait a minute, if the API call is delineated by ,
. Does that mean setting a sign to text including ,
is impossible?
\
also has to be replaced with \\
. Also maybe escaping chat messages should be its own function, since it's done twice?
Wait why? Does ItemEntity
not have an ID on Java or RJ?
Gui::addMessage
calls itself recursively when wrapping, make sure to only store the parameters of the top call. (Also should this be converted to Unicode?)