RedstoneFuture / missilewars

MissileWars is a famous, fun and fast minigame spigot-plugin for Minecraft
https://www.spigotmc.org/resources/62947
GNU General Public License v3.0
13 stars 9 forks source link

Clean up the messages.yml, Using of variables #40

Closed RedstoneFuture closed 1 year ago

RedstoneFuture commented 2 years ago

Clean up the messages.yml / Using of message categories

The advantage here is that the admin knows better what these settings are when setting them up. It becomes altogether clearer.

Example: OLD

game_starts_new_in: Game starts new in &e%seconds% &7seconds
game_ends_in_minutes: Game ends in &e%minutes% &7minutes
game_ends_in_seconds: Game ends in &e%seconds% &7seconds
game_starts_in: Game starts in &e%seconds% &7seconds
not_enough_players: '&cThere are not enough players online'
teams_unequal: '&cThe teams are unequal distributed'
game_starts: '&aThe game starts'
fall_protection: '&cFall protection inactive in %seconds% seconds'
fall_protection_inactive: '&cFall protection inactive'
fall_protection_deactivated: '&cFall protection deactivated by sneaking'

NEW:

lobby:
  not_enough_players: '&cThere are not enough players online'
  teams_unequal: '&cThe teams are unequal distributed'
game_timer:
  game_starts_new_in: Game starts new in &e%seconds% &7seconds
  starts: '&aThe game starts'
  game_ends_in_minutes: Game ends in &e%minutes% &7minutes
  game_ends_in_seconds: Game ends in &e%seconds% &7seconds
endgame_timer:
  game_starts_in: Game starts in &e%seconds% &7seconds
fall_protection:
  timer: '&cFall protection inactive in %seconds% seconds'
  inactive: '&cFall protection inactive'
  deactivated: '&cFall protection deactivated by sneaking'

Using of variables for the settings in the messages.yml as for the config.yml:

The advantage here is that you no longer have to read the config within the plugin. In addition, you can also see which messages are no longer used in the plugin.

    public static boolean isContactAuth() {
        return cfg.getBoolean("contact_auth_server");
    }

https://github.com/RedstoneFuture/missilewars/blob/a2ff87644e7391db045ef5a34cba336548838cc1/missilewars-plugin/src/main/java/de/butzlabben/missilewars/Config.java#L180-L182

daniel-naegele commented 1 year ago

Approved