garbagemule / MobArena

MobArena plugin for Minecraft
GNU General Public License v3.0
193 stars 151 forks source link

Wave-local permission attachments #611

Open garbagemule opened 4 years ago

garbagemule commented 4 years ago

Feature request

Short description

It should be possible to add wave-local permission attachments, such that, for a specific wave, a list of permission attachments are added to some or all of the players in the arena when the wave starts, and removed when the wave ends.

The underlying goal of this functionality is to make the MagicSpells integration unnecessary, but this much more general solution to the problem makes it a lot more versatile.

Implementation details

A new common node for all waves, permissions, is introduced. There are two possible implementations, which are not necessarily mutually exclusive:

  1. The value is a flat list of permission attachments that are added to all players in the arena.
  2. The value is a section similar to the one for Upgrade Waves, i.e. it is possible to make class-specific permission attachments.

Note that the second implementation opens up a lot of potential in terms of wave-local variations, e.g. banning a very powerful AOE ability across the board, but allowing a very specific fast-fire, low-damage spell for a wizard-type class.

Additional info

The feature request comes from a discussion related to an incompatibility with v4.0 of the MagicSpells plugin (see #609). Implementing this feature would make the MagicSpells integration unnecessary, and by transitivity, the incompatibility is void.

garbagemule commented 4 years ago

I have a working implementation of wave-specific permissions, but because there is no concept of "wave end" in MobArena, permissions from the current wave are cleared as soon as the next wave spawns, rather than when the current wave ends. This would only work properly on arenas with clear-wave-before-next: true, so it isn't really sufficient.