BentoBox icon indicating copy to clipboard operation
BentoBox copied to clipboard

Custom Protected Dimension

Open BONNe opened this issue 2 years ago • 3 comments

Is your feature request related to a problem?

BentoBox API is very flexible with adding 3 main dimensions: overworld, nether and the end. However, there is no easy way how to add another custom dimension with different mechanics.

F.e. someone would want to implement a mining dimension for skyblock where protection is still based on the island.

Describe the solution you'd like.

In general, the code for islands already supports this system. The only missing link is IslandWorldManager that is limited to 3 worlds: overworld, nether and the end.

I would like an extra map that would allow defining custom dimensions.

In an ideal world, it could be defined by any plugin/addon, but it would be a good start to implement it via GameModeAddon.

Describe alternatives you've considered.

We already can use hacky implementations, where we manually check if a player can do something on the original island, but it would be nice to have a proper implementation within an API.

Agreements

  • [X] I have searched for and ensured there isn't already an open issue regarding this.
  • [X] I have ensured the feature I'm requesting isn't already in the latest supported BentoBox build or Addons.

Other

No response

BONNe avatar Oct 22 '21 08:10 BONNe

I agree to that. Most of the code already supports that. And afaik, dimensions can be added by datapacks, which server owners seem to use in combination with plugins nowadays.

Poslovitch avatar Oct 22 '21 13:10 Poslovitch

I started working on this but I fell down a rabbit hole. Right now, throughout the code, the GameModeAddon's overworld is used as a shorthand for the GameMode itself because it is assumed that the game mode only has one overworld, and any nether or end will map to it by a simple removal of _nether or _the_end. So, you will find Util.getWorld(world) used throughout the code to perform that conversion. Pretty much anywhere that there is a map with World as a key, it is the Overworld that is being used. To add to the confusion the Util.getWorld(world) method is called sometimes just to covert nether or ends to an overworld not for this purpose. By adding other worlds to the game mode, we now have to make sure the code is aware of the game mode and be able to ask "Is this world covered by this game mode". We still need to store/know the primary game overworld/nether/end as well, and we also have to keep it all backwards compatible with current addon code.

I've made a start in the other-worlds branch, but it's bit like pealing an onion - always another layer to check.

tastybento avatar Oct 23 '21 23:10 tastybento

ToDo

  • [ ] IslandCache - will need a method to convert worlds to game mode and maybe refactor to store maps using GameModeAddon as the key rather than overworld

tastybento avatar Oct 23 '21 23:10 tastybento