Open dktapps opened 2 years ago
Maybe pocketmine/world/levelevent
?
Or in this case, the "level" and the "world" are the same thing? :/
Then the event class will be called WorldLevelEventEvent
:D
Well, or WorldLevelEvent
I think the name is too generic. What we're really dealing with is combination sfx + vfx events. We need a name that reflects that.
I think the name is too generic. What we're really dealing with is combination sfx + vfx events. We need a name that reflects that.
Here are some options:
SoundParticleEffect
SoundParticleFusion
SoundParticle
Then the package name will be pocketmine/world/soundparticle
Description
In many places, Minecraft uses so-called "level events" to trigger certain sound or visual effects. This is useful because some effects are quite complex (involving many particles, and/or arranged in particular ways), and it would be a colossal pain in the ass to have to reverse-engineer the logic for these things, as well as being wasteful for bandwidth usage.
However, the PocketMine-MP API currently doesn't have any place for these sound+particle combination events. This has forced the direct use of packets in various places, and in other cases the misclassification of certain things (e.g. BlockBreakParticle).
In addition, there are various graphical events (block crack animations, weather change) which are neither sound or particle, and yet still need to be broadcasted.
We need an API for these things that properly describes what they do. However...
We already have an events system, so
WorldEvent
is too ambiguous, because it could be conflated with the actualWorldEvent
(you know, the one from whichChunkLoadEvent
and friends inherit from). However, if we could unchain the event registration system from plugins, we could implement these events as actual events, allowing plugins to cancel or modify them, and allowing NetworkSessions to subscribe to (until now, plugin-exclusive) events.Alternative methods
Add something like
pocketmine/world/soundAndParticle/
package? meh...