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

Added the option to disable the Per World Configuration file generation + a fast way to disabled the worlds #2985

Closed
wants to merge 9 commits into from

Conversation

xSavior-of-God
Copy link

Description

I have implemented an option to disable the creation of files (therefore the management of items) of each world, in order to avoid large quantities in case you have more worlds ... I have also implemented a blacklist of the worlds (in order to fill the gap of these files)

disable-per-world-config: false
disabled-worlds:
  - 'THIS_WORLD_IS_DISABLED'

Proposed changes

The idea is to avoid the increase of files in the folder in case of server based on multi world (SkyBlock type with SlimeWorldManager)

Checklist

  • I have fully tested the proposed changes and promise that they will not break everything into chaos.
  • I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
  • I followed the existing code standards and didn't mess up the formatting.
  • I did my best to add documentation to any public classes or methods I added.
  • I have added Nonnull and Nullable annotations to my methods to indicate their behaviour for null values
  • I added sufficient Unit Tests to cover my code.

New 2 options:
1) Disable per world config file generation;
2) Disable worlds in a fast way;
@xSavior-of-God xSavior-of-God requested a review from a team as a code owner April 23, 2021 21:49
@TheBusyBiscuit TheBusyBiscuit added the 🎈 Feature This Pull Request adds a new feature. label Apr 24, 2021
Copy link
Member

@TheBusyBiscuit TheBusyBiscuit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a heads up:

We are currently quite busy and there are 12 other Pull Requests in this repository alone.
This isn't high up on our priority list at the moment, so it will still take a while until we get to reviewing this pull request.

We will also still need to debate about this internally about potential side effects that may come from such a change.

@xSavior-of-God xSavior-of-God requested a review from a team as a May 5, 2021 16:03
@TheBusyBot TheBusyBot added the ⚡ Merge Conflicts This Pull Request has merged conflicts which need to be resolved! label May 5, 2021
@TheBusyBot TheBusyBot removed the ⚡ Merge Conflicts This Pull Request has merged conflicts which need to be resolved! label May 5, 2021
Copy link
Member

@TheBusyBiscuit TheBusyBiscuit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that it has taken us this long to get back to you.
We have had some busy weeks and lots of higher priority pull requests.

But I finally found some time to review this!

config.getConfiguration().options().header("This file is used to disable certain items in a particular world.\nYou can set any item to 'false' to disable it in the world '" + name + "'.\nYou can also disable an entire addon from Slimefun by setting the respective\nvalue of 'enabled' for that Addon.\n\nItems which are disabled in this world will not show up in the Slimefun Guide.\nYou won't be able to use these items either. Using them will result in a warning message.");
config.getConfiguration().options().copyHeader(true);
config.setDefaultValue("enabled", true);
if (!SlimefunPlugin.getCfg().getBoolean("options.disable-per-world-config")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to read this boolean everytime a World is loaded.
The value should probably be stored as a field and read via the load() method.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Comment on lines +22 to +23
disabled-worlds:
- 'THIS_WORLD_IS_DISABLED'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not a big fan of the disabled-worlds list right here as it is kinda redundant with what World Settings try to achieve which is not really comfortable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put it there in case some one decides not to use the base system, where the world file is no longer present

@TheBusyBiscuit TheBusyBiscuit self-assigned this Jun 4, 2021
@svr333 svr333 added the ⏰ Waiting for response We are waiting for a response. label Jul 17, 2021
@TheBusyBot TheBusyBot added the ⚡ Merge Conflicts This Pull Request has merged conflicts which need to be resolved! label Sep 3, 2021
@TheBusyBiscuit
Copy link
Member

Closing this as stale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎈 Feature This Pull Request adds a new feature. ⚡ Merge Conflicts This Pull Request has merged conflicts which need to be resolved! ⏰ Waiting for response We are waiting for a response.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants