BentoBoxWorld / BentoBox

Expandable Minecraft server plugin for island-type games like SkyBlock or AcidIsland.
https://bentobox.world
Eclipse Public License 2.0
328 stars 137 forks source link

Ability to Whitelist Worlds for Addon Commands #1673

Open meowsome opened 3 years ago

meowsome commented 3 years ago

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.

tastybento commented 3 years ago

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:

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.

meowsome commented 3 years ago

Ah okay, I definitely appreciate you looking into this, it sounds like a lot of work, thank you.

tastybento commented 3 years ago

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.