mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-08-18 03:05:10 +00:00
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.
This commit is contained in:
@ -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.
|
||||
|
||||
|
||||
@ -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.
|
||||
* <p>
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user