Closed hammy275 closed 2 years ago
Note, I'm changing the system massively, so we can easily add new events without having to change the plugin interface (as that would require a major version bump each time we add a new event).
Instead, IVRAPI
/VRAPI
instances now contain a method called registerVRPlayerTickHandler
, which registers a function that can take an instance of IVRPlayerTick
/VRPlayerTick
. When a new VRPlayerTick
instance is created, it calls IVRPlayerTick
on all the handlers. VRPlayerTick
instances are created in the API's CommonSubscriber
This should be similar to a Forge event, but won't actually be.
Whenever
TickEvent.PlayerTickEvent
is called, it should get all of the plugin instances (probably from a variable they're stored into at startup), we should call aVRPlayerTick
function, that is passed in all of the parameters fromTickEvent.PlayerTickEvent
.The reason we do this over a regular Forge event is so it can be easily used without requiring the API, similarly to the rest of the API.