From 8ff0274c8f58dfd83ec82c34ed9b34d63580f60a Mon Sep 17 00:00:00 2001 From: nossr50 Date: Sat, 11 Jul 2026 00:39:16 -0700 Subject: [PATCH] Rename levelupcommands.yml to level_up_commands.yml Matches the file's own root key and the fishing_treasures.yml naming style. The file has not shipped in a release yet, so no migration is needed. --- Changelog.txt | 4 ++-- .../nossr50/commands/levelup/LevelUpCommandManager.java | 2 +- .../com/gmail/nossr50/config/CommandOnLevelUpConfig.java | 4 ++-- .../{levelupcommands.yml => level_up_commands.yml} | 0 .../gmail/nossr50/config/CommandOnLevelUpConfigTest.java | 6 +++--- 5 files changed, 8 insertions(+), 8 deletions(-) rename src/main/resources/{levelupcommands.yml => level_up_commands.yml} (100%) diff --git a/Changelog.txt b/Changelog.txt index 3ca7e2e39..54fdfaea9 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -92,7 +92,7 @@ Version 2.3.000 Fixed the outdated-server startup warning naming Minecraft 1.20.4 instead of the required 1.20.5 Fixed an error when /mmodebug was used before the player's data finished loading (Thanks Warriorrrr) Added 'Feedback.ActionBarNotifications.SubSkillUnlocked.SendToActionBar' to advanced.yml, an opt-in to show skill rank unlock messages on the action bar (See notes) - Added new config file levelupcommands.yml to set up level up commands (See notes) + Added new config file level_up_commands.yml to set up level up commands (See notes) Added 'ExploitFix.AcrobaticsDodgeXpFarming' to experience.yml (See notes) Added 'Skills.Mining.BlastMining.RemoteDetonationDistance' to advanced.yml (See notes) Added 'General.PlaceholderAPI.Leaderboards.Max_Tracked_Rank' to config.yml @@ -185,7 +185,7 @@ Version 2.3.000 During an event, joining players are told about active per-skill rates alongside the global rate. -- Level up commands -- - Level up commands are configured in the new levelupcommands.yml file; each entry lists the commands to run plus a trigger, either skills with levels or power_levels, and an optional run_as of CONSOLE (default) or PLAYER. The shipped example entries are disabled by default. + Level up commands are configured in the new level_up_commands.yml file; each entry lists the commands to run plus a trigger, either skills with levels or power_levels, and an optional run_as of CONSOLE (default) or PLAYER. The shipped example entries are disabled by default. Level up commands support placeholders: {@player}, {@skill}, {@level}, {@power_level}, and current-level placeholders like {@mining_level}. Commands run once per milestone reached, even when several levels are gained at once. (API) LevelUpCommandAPI registrations return an id that can be used to unregister them later; registrations made by other plugins survive mcMMO config reloads. diff --git a/src/main/java/com/gmail/nossr50/commands/levelup/LevelUpCommandManager.java b/src/main/java/com/gmail/nossr50/commands/levelup/LevelUpCommandManager.java index 8bfde80cb..1a96a95ae 100644 --- a/src/main/java/com/gmail/nossr50/commands/levelup/LevelUpCommandManager.java +++ b/src/main/java/com/gmail/nossr50/commands/levelup/LevelUpCommandManager.java @@ -19,7 +19,7 @@ import org.jetbrains.annotations.Nullable; /** * Registry of everything that reacts to level ups: commands loaded from - * {@code levelupcommands.yml} and commands or handlers registered by other plugins through + * {@code level_up_commands.yml} and commands or handlers registered by other plugins through * {@link com.gmail.nossr50.api.LevelUpCommandAPI}. Each registration gets a {@link UUID} that * can later be used to remove it. Config reloads clear only config-sourced registrations. *

diff --git a/src/main/java/com/gmail/nossr50/config/CommandOnLevelUpConfig.java b/src/main/java/com/gmail/nossr50/config/CommandOnLevelUpConfig.java index 52e3d3251..0f8c31296 100644 --- a/src/main/java/com/gmail/nossr50/config/CommandOnLevelUpConfig.java +++ b/src/main/java/com/gmail/nossr50/config/CommandOnLevelUpConfig.java @@ -18,7 +18,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; /** - * Loads {@code levelupcommands.yml} and registers each valid entry with the + * Loads {@code level_up_commands.yml} and registers each valid entry with the * {@link LevelUpCommandManager} as a {@link RegistrationSource#CONFIG} registration. Loading * clears previous config registrations first, so reloading this config never disturbs * registrations other plugins added through the API. @@ -35,7 +35,7 @@ public class CommandOnLevelUpConfig extends BukkitConfig { public static final String ALL_SKILLS = "all"; public CommandOnLevelUpConfig(@NotNull File dataFolder) { - super("levelupcommands.yml", dataFolder); + super("level_up_commands.yml", dataFolder); // TODO: loadKeys() should really get called in super loadKeys(); } diff --git a/src/main/resources/levelupcommands.yml b/src/main/resources/level_up_commands.yml similarity index 100% rename from src/main/resources/levelupcommands.yml rename to src/main/resources/level_up_commands.yml diff --git a/src/test/java/com/gmail/nossr50/config/CommandOnLevelUpConfigTest.java b/src/test/java/com/gmail/nossr50/config/CommandOnLevelUpConfigTest.java index 9599c771c..52fd378d6 100644 --- a/src/test/java/com/gmail/nossr50/config/CommandOnLevelUpConfigTest.java +++ b/src/test/java/com/gmail/nossr50/config/CommandOnLevelUpConfigTest.java @@ -26,7 +26,7 @@ import org.junit.jupiter.api.Test; /** * Parsing tests for {@link CommandOnLevelUpConfig}. The loader is the bridge between what - * server owners write in levelupcommands.yml and what actually fires, so malformed entries + * server owners write in level_up_commands.yml and what actually fires, so malformed entries * must be skipped with warnings instead of half-registering. */ class CommandOnLevelUpConfigTest extends MMOTestEnvironment { @@ -245,9 +245,9 @@ class CommandOnLevelUpConfigTest extends MMOTestEnvironment { } private void loadConfig(@NotNull String yaml) throws IOException { - final File configFile = new File(testDataFolder, "levelupcommands.yml"); + final File configFile = new File(testDataFolder, "level_up_commands.yml"); Files.writeString(configFile.toPath(), yaml); - when(mcMMO.p.getResource("levelupcommands.yml")).thenAnswer(invocation -> + when(mcMMO.p.getResource("level_up_commands.yml")).thenAnswer(invocation -> new ByteArrayInputStream(yaml.getBytes(StandardCharsets.UTF_8))); new CommandOnLevelUpConfig(testDataFolder); }