BentoBox
BentoBox copied to clipboard
Ability to Whitelist Worlds for Addon Commands
Description
Is your feature request related to a problem?
I have multiple worlds on my server using BentoBox: SkyBlock_Islands, SkyBlock_Islands_nether, SkyBlock_Islands_the_end, and SkyBlock_spawn. When typing commands for addons such as Bank, Biomes, Challenges, Level, Likes, and Warps when a player is in a world other than the islands world, such as the spawn world, it gives the error "You are not in the right world to do this". This is expected because I specified the BSkyblock world as the island world (SkyBlock_Islands) and not the spawn world (SkyBlock_spawn).
Describe the solution you'd like us to implement.
I would like an option to be able to specify worlds where players can use addon commands outside of the island world. This would still affect their island like normal, but they can just access them anywhere for convenience. For example, when buying things in another world, it's inconvenient for players to have to teleport back to their island to view their bank balance and then back to the shop for buy.
Describe alternatives you've considered.
I could use MyCommand to create custom commands, but having a built-in feature would be much easier. I could also just put my spawn in the islands world, but I already have it set up this way and would prefer to keep it.
Additional context
N/A
Please let me know if I am forgetting anything, I apologize if I did anything wrong.
Yeah, this is tricky. The reason for the world limiting was more to do with underlying code limitations. Indeed, the ideal goal would be that you can use any command in any world and BentoBox will understand what you mean by the context, e.g. commands using the /island
command should refer to the BSkyBlock world. The issue is that this context is not always passed through the whole code flow and instead the user's location is used. So, before any feature that enables commands to run outside of the world, we need enable run-anywhere commands. This will require the following:
- [x] Step 1 - enable the underlying Panel API to have the command context of which game mode initiated the GUI. This will apply the changes made by clicking on the GUI to the island or world that the command referred to and not the user's world. Make sure that it's all backwards compatible.
- [x] Step 2 - change the BentoBox admin and user settings commands so they don't check for world and work globally.
- [ ] Step 3 - go through the addons one by one and use the new API and remove assumptions around user locations.
- [ ] Step 4 - add some kind of global filtering system to allow/prevent usage of global commands per this ticket.
It might not be possible to get to Step 4, but I have a PR for Step 1/2 and Step 3 should be possible once the BentoBox API is updated.
Ah okay, I definitely appreciate you looking into this, it sounds like a lot of work, thank you.
It's somewhat overdue. I think what I've done is safe to include in 1.16.0 and will enable Step 3 of the process.