Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Biomes settings #940

Closed
Nedjii opened this issue Sep 11, 2019 · 11 comments
Closed

Biomes settings #940

Nedjii opened this issue Sep 11, 2019 · 11 comments
Assignees
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Bug
Milestone

Comments

@Nedjii
Copy link

Nedjii commented Sep 11, 2019

Hello, we can define who can change the biome of the island in /is settings but we can't define by default who has the permission to do that in the config,
regards.

@tastybento tastybento transferred this issue from BentoBoxWorld/BSkyBlock Sep 12, 2019
@tastybento
Copy link
Member

No, that's correct. Perms are preset. Here's a list for BSkyBlock:

permissions:
  bskyblock.biomes:
    description: Player can use biomes command that opens GUI.
    default: true
  bskyblock.biomes.info:
    description: Player can use biomes info command.
    default: true
  bskyblock.biomes.set:
    description: Player can use biomes set command.
    default: true

@Nedjii
Copy link
Author

Nedjii commented Sep 12, 2019

I'm not talking about vault permissions but island rank permission, who can or cannot change something on the is, most of settings in the /is settings can be defined by default in the config, the setting for the biome change isn't in the config. We can change it using the /is settings GUI but we can't st by default which role on the island can do this.

@BONNe BONNe reopened this Sep 12, 2019
@tastybento
Copy link
Member

tastybento commented Sep 12, 2019

Okay. Biomes addon registers two flags with BentoBox, a world setting flag called BIOMES_WORLD_PROTECTION and an advanced protection flag called BIOMES_ISLAND_PROTECTION. You should just be able to add BIOMES_ISLAND_PROTECTION manually to the default setting section of config.yml. Note, it'll only affect new islands.

@tastybento tastybento self-assigned this Sep 12, 2019
@Nedjii
Copy link
Author

Nedjii commented Sep 13, 2019

I'm talking about "default-island-flags:" and not "flags".
You can't define which role can change the island biome by default in the config using numbers 50, 900 etc.

@BONNe
Copy link
Member

BONNe commented Sep 13, 2019

You should just be able to add BIOMES_ISLAND_PROTECTION manually to the default setting section of config.yml. Note, it'll only affect new islands.

By config.yml tasty meant not biomes addon config, but BSkyBlock config.

@Nedjii
Copy link
Author

Nedjii commented Sep 13, 2019

I'm aware, there is still no way in this config to define which role can change the island biome by default.

@BONNe
Copy link
Member

BONNe commented Sep 13, 2019

  default-island-flags:
    BIOMES_ISLAND_PROTECTION: 500

@BONNe BONNe closed this as completed Sep 13, 2019
@BONNe BONNe reopened this Sep 13, 2019
@Nedjii
Copy link
Author

Nedjii commented Sep 13, 2019

I already tried to put 900 and that changed nothing, it's still member as by default.

@tastybento tastybento transferred this issue from BentoBoxWorld/Biomes Sep 14, 2019
@tastybento tastybento added Status: Under investigation Investigating the interest and the feasability of the issue. Type: Bug labels Sep 14, 2019
@tastybento tastybento added this to the 1.8.0 milestone Sep 14, 2019
@tastybento
Copy link
Member

Yes, the default setting is not being accepted. I'll investigate.

@tastybento
Copy link
Member

To fix we need GameModeAddons to reload their settings after all addons have loaded. Although there is an event that can be listened for, it is better to have a new BentoBox API in the GameModeAddon class that will be called explicitly. This will then enable the game mode addon to reload settings and accept the flag.

Here is why: it is due to timing:

  1. When the server starts, BentoBox loads BSkyBlock. During this time, if any flags are loaded from config.yml by BSkyBlock that are unknown, they are discarded. Further, BSkyBlock then saves the config.yml and the flag is completely lost.
  2. BentoBox then loads Biomes - this is dependent on BSkyBlock so it cannot be loaded before it.
  3. Biomes register the flags.

With the new API, the following occurs:

  1. When the server starts, BentoBox loads BSkyBlock
  2. BSkyBlock loads config.yml. Addon flags will be lost temporarily. BSkyBlock will not save the config at this point.
  3. BentoBox then loads Biomes - this is dependent on BSkyBlock so it cannot be loaded before it.
  4. Biomes register the flags.
  5. BentoBox finishes loading all the addons and calls the new GameModeAddon#allLoaded() method.
  6. BSkyBlock reloads config.yml and this time the Biomes flag is known and kept.
  7. BSkyBlock saves config.yml and the flag is kept.

tastybento added a commit to BentoBoxWorld/BSkyBlock that referenced this issue Sep 14, 2019
@tastybento
Copy link
Member

That should fix it. @BONNe Could you review and confirm?

@Poslovitch Poslovitch added Status: Done This issue has been completed or answered. This pull request has been merged. and removed Status: Under investigation Investigating the interest and the feasability of the issue. labels Sep 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Done This issue has been completed or answered. This pull request has been merged. Type: Bug
Projects
None yet
Development

No branches or pull requests

4 participants