Fixed LPInjector registering to the Core
Stop MCChatListener from having multiple active instances
MinecraftChatModule.state instead of all the flags
Showing MinecraftChatModule enable/disable on Discord
/discord reset --> restart
Wait for each shutdown message to send on shutdown (although it hasn't really been an issue so far)
This means using Mono<?> in a lot of places
Also added a contract (IntelliJ) to warn if not subscribed
Faking getOnlinePlayers() is unnecessary and causes too much trouble
Today's work
Using the custom event to detect player /stop as now restarts can come from there too (btw it defaults to stop unless a command is ran)
Added support for advancements in 1.16:
- Now each player gets effectively a reference to the player list for advancements, and since I simply call the method on the original object, it will pass that on, instead of my mock
- I tried calling the method that sends the reference on the mock in that case, but that just results in Mockito's version being called which means infinite recursion or something like that (I didn't get a StackOverflowError actually but the server didn't respond)
- I tried implementing the method myself but actually I never tested it because at that point I was convinced I can call the original the right way
- I had an educated guess that the mock is a subclass of the original class, so I just need to call super.method() right?
- But how do you call that reflectively? Apparently Method.invoke() will always respect overriden methods; but thanks to StackOverflow I found out about MethodHandles, and it has the perfect thing I need, findSpecial / unreflectSpecial
- Only problem is, kind of like how you can only use super.method() inside the class, you can only use the 'special' methods inside the class... So how could I make it run inside the mocked class? I have no idea since I can only supply an Answer object which has no connection to it, but apparently all the lookup() method actually does is call a constructor with the caller's class - so let's call the constructor! Which is, of course private
- So now I have a reflection call creating a Lookup object which can get a handle to the method without checking any overrides and then using that handle to call the original method with the 'this' parameter being the mock
#128
Using VanillaCommandListener14 for 1.15 as well
Using a mock for the DiscordPlayerSender too, to reduce the amount of code
Made the mocks stub-only, which should lower memory usage
The problem was that for some reason I created a field that was already present in the parent class and it just happened to be pretty much never used before the PL update
Also updated EssentialsX dependency
Fixed join messages appearing in addition to custom ones (#119)
For real this time
Not saying the game role color is the default one (#118)
Fixed role listing (#80)