Logics4 / IndividualKeepInventory

Allows you to set the keepInventory mechanic in Minecraft in a per-player way, through a permission node.
GNU General Public License v3.0
0 stars 2 forks source link

Feature request: Allow players to toggle for themselves (per-player basis) #2

Open trwnh opened 2 years ago

trwnh commented 2 years ago

First of all, thank you for this plugin, as it does what I need it to do, and seemingly no other plugins handle it quite as elegantly as yours does.

However, it is tiresome to add and remove permissions as players request them; it would be much simpler to have the players be able to send a command to enable or disable keep inventory for their own selves, rather than waiting for me to be available purely for running a single command on their behalf.

Therefore, I would very much appreciate if this plugin had an associated command for toggling state.

Logics4 commented 2 years ago

Being honest, I didn't think about adding a dedicated command that granted keepInventory when I made this plugin - probably other mechanics would grant the permission, like a role-based rankup system, for example (as sort of a reward for the player). I'm not denying your idea, though!

I'll think on what approach I prefer to take. I can either include that feature in IndividualKeepInventory, or I can make something like an "IndividualKeepInventory-Extras" plugin that adds such command. I am a bit more inclined for the latter option, but for that, I'd like to add a small API to IndividualKeepInventory first, and the Extras plugin would depend on it to check and set the keepInventory status.

trwnh commented 2 years ago

Hmm, I think a simple toggle can be included in the base plugin, while an -Extras plugin could be used for tying it to roles or other mechanisms. Although, I'm not entirely sure why it would be better to have a separate plugin for that in the first place... In any case, I wouldn't personally be interested in any mechanism other than sending a command like keepinv to toggle state.

Logics4 commented 2 years ago

Although, I'm not entirely sure why it would be better to have a separate plugin for that in the first place...

It's because I had originally designed this plugin to be a drop-in, no external plugin hard dependencies, no configuration kind of thing, just set a permission and done. It wouldn't have to track the player's status itself through a dedicated JSON file or a database, because it would be relying on the permission plugin's own database for that (as it is right now), meaning the interaction would be through a permission plugin's commands to manage the keepInventory status.

From what I'm seeing, to add this command, IndividualKeepInventory would probably have to depend on Vault so it could give permissions to players and reliably support as many permission plugins as possible (depending specifically on LuckPerms would suck if there is someone else that is using other permission plugin for any reason).

That's why I'm a bit more inclined for the -Extra plugin. It would be an optional tool, but convenient for whoever needs it. I'll see if it's the best way to approach this when I get to it, though.

trwnh commented 2 years ago

Ah, that makes sense! Thank you for the explanation. Would it be possible to have a flat-file database of players rather than using a permission-based approach? Or would that effectively be a rewrite of the plugin?