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

Add kits subfolder to allow for multiple kit files #4407

Merged
merged 17 commits into from
Oct 2, 2021

Conversation

GenSecrets
Copy link
Contributor

Information

Details

Proposed feature:

Add to the existing kits system (not overhaul) and allow for server owners to have the option of separating kits out into individual files for storage or organization purposes. The separated kits would be stored in a folder aptly named "kits", inside of the Essentials data folder (Essentials/kits)

  • Kit files follow same format as the kits.yml
  • The kits.yml has not been changed, must still stay in the main Essentials directory
  • A config option has been added to config.yml called "use-kits-subfolder" which defaults to false. Can be set to true if server owner wishes for the folder to be created and parsed. If false, any files in the folder will not be read by the plugin (or loaded, to save memory).
  • Plugin will skip all files that aren't .yml files, and if the yml files do not contain a "kits" section, it will throw an error in the console and alert the server owner to which file is incorrectly defined

The driving factor behind this is that our large server network has held a custom fork of ESSX for this for years, and the sole reason of us updating our own fork is simply for a kits subfolder. I ran a count and of all parsed kits we have around 1400 it seems, and the kits file would be absolutely tremendous and a nightmare to sort through. It still is sometimes cause it's still tens of thousands of lines long on its own. However in the kits folder we keep them organized based on many factors; kits based on classes, spells, food, donor items, etc, you name it. 208 files and counting in the folder. We are looking to get rid of how many custom plugins or forks we're having to constantly maintain and upkeep at the slightest server version change so I'm creating this PR because I know it will help us tremendously and if it's helped us (and my brain for sake of organization) then I know it's bound to help someone else.

Note: I'm no pro with Configurate, so should something in the format have the chance to be better optimized, please do advise. Thanks!

Environments tested:

OS:
Developed on Windows (x64, using IntelliJ Idea, jdk 1.16)
Tested on Linux (amd64, 8 cores, 1.8.0 java built 11)

Java version:
16.0.2

  • 16 Paper version (1.16.5, git-Paper-783)
  • Airplane (1.16.5, git-Airplane-9f0a29b)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

  • If a player wishes to enable this, they can turn it on in config.yml via enabling the new option "use-kits-subfolder" and setting it to "true" (default is false). Once true, it will create a kits folder as seen in the picture below
    image

@GenSecrets
Copy link
Contributor Author

This would in part resolve some (but not all) of #3944

@JRoy JRoy added module: main Issues or PRs for the main Essentials module type: enhancement Features and feature requests. labels Jul 30, 2021
JRoy
JRoy previously approved these changes Aug 2, 2021
@JRoy JRoy added this to the 2.19.0 milestone Aug 2, 2021
mdcfe
mdcfe previously requested changes Aug 2, 2021
@JRoy JRoy dismissed stale reviews from themself via f53108e August 2, 2021 16:01
JRoy
JRoy previously approved these changes Aug 2, 2021
@JRoy JRoy requested a review from mdcfe August 6, 2021 19:26
@JRoy JRoy dismissed mdcfe’s stale review August 6, 2021 19:26

re-review pending

@mdcfe mdcfe modified the milestones: 2.19.0, 2.19.1 Aug 19, 2021
# Conflicts:
#	Essentials/src/main/java/com/earth2me/essentials/Kits.java
@JRoy JRoy changed the title Add ability to optionally separate kits into multiple kit files, housed in a kits subfolder. Add kits subfolder to allow for multiple kit files Oct 2, 2021
@JRoy JRoy merged commit ef8bcc8 into EssentialsX:2.x Oct 2, 2021
@JRoy
Copy link
Member

JRoy commented Oct 2, 2021

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: main Issues or PRs for the main Essentials module type: enhancement Features and feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants