The native API handles player object and IDs consistently like this:
whenever the API is called, you pass the player ID
whenever an event handler is called, it receives the player object
This is currently not done in the same way in HHM, but I am instead using the player ID everywhere. The idea behind that was to force room.getPlayer() to be called which could be extended and return a different player object than the native room.getPlayer. Injecting that logic into the event dispatching process what not possible until recently, when pre- and post-event handler hooks were introduced.
In short, the following changes are necessary:
follow the native API when it comes to player objects / IDs. This means that the command plugin will in the future pass player obejcts and no longer player IDs to its handlers!
inject player objects into all native and non-native events using pre-event handler hooks and overriding the event arguments
The native API handles player object and IDs consistently like this:
This is currently not done in the same way in HHM, but I am instead using the player ID everywhere. The idea behind that was to force
room.getPlayer()
to be called which could be extended and return a different player object than the nativeroom.getPlayer
. Injecting that logic into the event dispatching process what not possible until recently, when pre- and post-event handler hooks were introduced.In short, the following changes are necessary: