From eb2f2e3552af6c1c8292b97309ab3f7b1e0406f8 Mon Sep 17 00:00:00 2001 From: Tigerpanzer_02 <37453987+Tigerpanzer02@users.noreply.github.com> Date: Sat, 13 Jan 2024 02:43:09 +0100 Subject: [PATCH] Fetch latest minigamesbox --- build.gradle.kts | 2 +- .../plugily/projects/villagedefense/Main.java | 12 +++++++- src/main/resources/config.yml | 28 +++++++++++-------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index dc7b59c80..1ab024e20 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -38,7 +38,7 @@ repositories { dependencies { - implementation("plugily.projects:MiniGamesBox-Classic:1.3.3-SNAPSHOT3") { isTransitive = false } + implementation("plugily.projects:MiniGamesBox-Classic:1.3.6") { isTransitive = false } compileOnly("org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT") compileOnly("org.jetbrains:annotations:24.0.1") compileOnly(files("lib/spigot/1.8.8-R0.1.jar")) diff --git a/src/main/java/plugily/projects/villagedefense/Main.java b/src/main/java/plugily/projects/villagedefense/Main.java index 78a313d2a..057f6e77d 100644 --- a/src/main/java/plugily/projects/villagedefense/Main.java +++ b/src/main/java/plugily/projects/villagedefense/Main.java @@ -26,6 +26,7 @@ import plugily.projects.minigamesbox.classic.PluginMain; import plugily.projects.minigamesbox.classic.handlers.setup.SetupInventory; import plugily.projects.minigamesbox.classic.handlers.setup.categories.PluginSetupCategoryManager; +import plugily.projects.minigamesbox.classic.kits.basekits.Kit; import plugily.projects.minigamesbox.classic.utils.configuration.ConfigUtils; import plugily.projects.minigamesbox.classic.utils.services.metrics.Metrics; import plugily.projects.minigamesbox.classic.utils.version.ServerVersion; @@ -122,8 +123,12 @@ public void initializePluginClasses() { } public void addKits() { + if (!getConfigPreferences().getOption("KITS")) { + // Kits are disabled, no kits will be loaded + return; + } long start = System.currentTimeMillis(); - getDebugger().debug("Adding kits..."); + getDebugger().performance("Kit", "Adding kits..."); addFileName("kits/archer"); addFileName("kits/knight"); addFileName("kits/naked"); @@ -137,6 +142,11 @@ public void addKits() { return itemStack; }); getKitRegistry().registerKits(optionalConfigurations); + getDebugger().debug(Level.INFO, "Kits loaded: "); + for (Kit kit : getKitRegistry().getKits()) { + getDebugger().debug(kit.getName()); + } + getKitRegistry().setDefaultKit("knight"); getDebugger().debug("Kit adding finished took {0}ms", System.currentTimeMillis() - start); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 5eedef387..a62d5280d 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -34,6 +34,16 @@ Bungee-Mode: false Inventory-Manager: true +# Kits configuration +# A server restart is required for changes to apply +Kit: + # Should we load kits? + Enabled: true + # What is the default kit for players? + # This should be the same name as the file name of the kits file in the kits folder + Default: "knight" + + Commands: # Commands which can be used in game, remove all of them to disable (only works if Block.In-Game.Commands = true) Whitelist: @@ -83,16 +93,14 @@ Database: false # Should we enable in game rewards? See rewards.yml for more... # You should also check out our script engine tutorial for rewards! https://tutorial.plugily.xyz -Rewards: true - - -# Enable in game (eg. '[KIT][LEVEL] Tigerpanzer_02: hey') special formatting? -# Formatting is configurable in language.yml -# You can use PlaceholderAPI placeholders in chat format! -Plugin-Chat-Format: true +Rewards: false Chat: + # Enable in game (eg. '[KIT][LEVEL] Tigerpanzer_02: hey') special formatting? + # Formatting is configurable in language.yml + # You can use PlaceholderAPI placeholders in chat format! + Format: true Separate: # Should we enable a separate arena chat for players inside a arena # Useful on multi arena servers that don't want the same chat for all players on the server @@ -126,10 +134,6 @@ Holidays: true Powerups: false -# Should the plugin enable kits which can be found in kits.yml -Kits: true - - # Should we create leaderboards out of the stats? Leaderboard: true @@ -259,4 +263,4 @@ Update-Notifier: # You edited it, huh? Next time hurt yourself! Do-Not-Edit: File-Version: 1 - Core-Version: 2 \ No newline at end of file + Core-Version: 3 \ No newline at end of file