From 0ee7ee3523d7dc94ca30e3e4b1bb69a654dc1188 Mon Sep 17 00:00:00 2001 From: Oheers <38732412+Oheers@users.noreply.github.com> Date: Wed, 1 Jun 2022 08:00:32 +0100 Subject: [PATCH] Updating the auto-updater --- pom.xml | 2 +- .../java/com/oheers/fish/EvenMoreFish.java | 2 +- .../com/oheers/fish/config/ConfigUpdater.java | 48 +++++++++++++++++++ .../fish/config/messages/ConfigMessage.java | 2 +- src/main/resources/locales/messages_en.yml | 4 +- 5 files changed, 54 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index d8a158ee..570f59d7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.oheers.evenmorefish even-more-fish - 1.5.0.44 + 1.5.0.45 diff --git a/src/main/java/com/oheers/fish/EvenMoreFish.java b/src/main/java/com/oheers/fish/EvenMoreFish.java index dfbbfd8f..50496531 100644 --- a/src/main/java/com/oheers/fish/EvenMoreFish.java +++ b/src/main/java/com/oheers/fish/EvenMoreFish.java @@ -91,7 +91,7 @@ public class EvenMoreFish extends JavaPlugin { public static final int METRIC_ID = 11054; - public static final int MSG_CONFIG_VERSION = 10; + public static final int MSG_CONFIG_VERSION = 11; public static final int MAIN_CONFIG_VERSION = 10; public static final int COMP_CONFIG_VERSION = 1; diff --git a/src/main/java/com/oheers/fish/config/ConfigUpdater.java b/src/main/java/com/oheers/fish/config/ConfigUpdater.java index 2ad080ef..f8ae4e9a 100644 --- a/src/main/java/com/oheers/fish/config/ConfigUpdater.java +++ b/src/main/java/com/oheers/fish/config/ConfigUpdater.java @@ -61,6 +61,7 @@ private static String getMessageUpdates(int version) { case 7: update.append(MSG_UPDATE_8); case 8: update.append(MSG_UPDATE_9); case 9: update.append(MSG_UPDATE_10); + case 10: update.append(MSG_UPDATE_11); } update.append(UPDATE_ALERT); @@ -89,6 +90,7 @@ public static void clearUpdaters() { MSG_UPDATE_8 = null; MSG_UPDATE_9 = null; MSG_UPDATE_10 = null; + MSG_UPDATE_11 = null; CONFIG_UPDATE_8 = null; CONFIG_UPDATE_9 = null; @@ -97,6 +99,52 @@ public static void clearUpdaters() { private final static String UPDATE_ALERT = "\n###################### THIS IS AUTOMATICALLY UPDATED BY THE PLUGIN, IT IS RECOMMENDED TO MOVE THESE VALUES TO THEIR APPROPRIATE PLACES. ######################\n"; + private static String MSG_UPDATE_11 = "invalid-type: \"&rThat isn't a type of competition type, available types: MOST_FISH, LARGEST_FISH, SPECIFIC_FISH\"\n" + + "# Sent to all online players when not enough players are on to start a competition\n# How should the %emf_competition_place_fish_*% be formatted when there's no length on the fish?\n" + + "emf-lengthless-fish-format: \"{rarity_colour}&l{rarity} {fish}\"\n" + + "# How should %emf_competition_place_fish_*% be formatted during MOST/SPECIFIC_FISH competitions?\n" + + "emf-most-fish-format: \"{amount} fish\"\n" + + "# What should be displayed for %emf_competition_place_size_*% during the MOST_FISH competition?\n" + + "emf-size-during-most-fish: \"This is a competition for the most fish.\"\n" + + "# How the %emf_competition_time_left% variable should be formatted.\n" + + "emf-time-remaining: \"Time left until next competition: {days}d, {hours}h, {minutes}m.\"\n" + + "# Replaces the %emf_competition_time_left% variable when there's a competition already running.\n" + + "emf-time-remaining-during-comp: \"There is a competition running right now.\"\n# Sent when someone tries to use a bait in creative\n" + + "bait-survival-limited: \"&rYou must be in &nsurvival&r to apply baits to fishing rods.\"\n# When trying to place a skull-fish when this is blocked in config.yml\n" + + "place-fish-blocked: \"&rYou cannot place this fish.\"\n" + + "\n" + + "admin:\n" + + " # Opens an /emf shop for another player\n" + + " open-fish-shop: \"&rOpened a shop inventory for {player}.\"\n" + + " # When a fish is given to a player\n" + + " given-player-fish: \"&rYou have given {player} a {fish}.\"\n" + + " # When a bait is given to a player\n" + + " given-player-bait: \"&rYou have given {player} a {bait}.\"\n" + + " # When an admin runs /emf admin bait without a bait name.\n" + + " no-bait-specified: \"&rYou must specify a bait name.\"\n" + + "\n" + + " # When economy is disabled for the plugin\n" + + " economy-disabled: \"&rEvenMoreFish's economy features are disabled.\"\n" + + "\n" + + " # When the specified player can't be found when using -p: parameter.\n" + + " player-not-found: \"&r{player} could not be found.\"\n" + + " # When the specified number in -q: is not a number.\n" + + " number-format-error: \"&r{amount} is not a valid number.\"\n" + + " # When the specified number in -q: is not within the minecraft stack range (1-64)\n" + + " number-range-error: \"&r{amount} is not a number between 1-64.\"\n" + + " # When a command cannot be run from the console\n" + + " cannot-run-on-console: \"&rCommand cannot be run from console.\"\n" + + "\n" + + " # Sent when a competition is already running when using /emf admin competition start\n" + + " competition-already-running: \"&rThere's already a competition running.\"\n" + + " # When an invalid competition type is tried to be started\n" + + " competition-type-invalid: \"&rThat isn't a type of competition type, available types: MOST_FISH, LARGEST_FISH, SPECIFIC_FISH\"\n" + + "\n" + + " # When there's a spigot update available, don't translate the URL otherwise it won't direct to the correct page.\n" + + " update-available: \"&rThere is an update available: https://www.spigotmc.org/resources/evenmorefish.91310/updates\"\n" + + " # When the plugin is reloaded\n" + + " reload: \"&rSuccessfully reloaded the plugin.\""; + private static String MSG_UPDATE_10 = "# Shown when /emf toggle is run, to turn off and on respectively.\n" + "toggle-off: \"You will no longer catch custom fish.\"\n" + "toggle-on: \"You will now catch custom fish.\""; diff --git a/src/main/java/com/oheers/fish/config/messages/ConfigMessage.java b/src/main/java/com/oheers/fish/config/messages/ConfigMessage.java index 20793a0a..d95330e7 100644 --- a/src/main/java/com/oheers/fish/config/messages/ConfigMessage.java +++ b/src/main/java/com/oheers/fish/config/messages/ConfigMessage.java @@ -19,7 +19,7 @@ public enum ConfigMessage { BAIT_CAUGHT("bait-catch", "&r&l{player} &rhas caught a {bait_theme}&l{bait} &rbait!", PrefixType.DEFAULT, true, false), BAIT_USED("bait-use", "&rYou have used one of your rod's {bait_theme}&l{bait} &rbait.", PrefixType.DEFAULT, true, false), - BAIT_WRONG_GAMEMODE("bait-survival-limited", "&rYou must be in &nsurvival&c to apply baits to fishing rods.", PrefixType.ERROR, false, false), + BAIT_WRONG_GAMEMODE("bait-survival-limited", "&rYou must be in &nsurvival&r to apply baits to fishing rods.", PrefixType.ERROR, false, false), BAITS_MAXED("max-baits-reached", "&rYou have reached the maximum number of types of baits for this fishing rod.", PrefixType.DEFAULT, false, true), BAITS_MAXED_ON_ROD("max-baits-reached", "&rYou have reached the maximum number of {bait_theme}{bait} &rbait that can be applied to one rod.", PrefixType.ERROR, false, false), diff --git a/src/main/resources/locales/messages_en.yml b/src/main/resources/locales/messages_en.yml index cf16eeb0..ef356b73 100644 --- a/src/main/resources/locales/messages_en.yml +++ b/src/main/resources/locales/messages_en.yml @@ -196,6 +196,8 @@ max-bait-reached: "&rYou have reached the maximum number of {bait_theme}{bait} & bait-catch: "&r&l{player} &rhas caught a {bait_theme}&l{bait} &rbait!" # Sent when a bait is applied and a fish is caught. bait-use: "&rYou have used one of your rod's {bait_theme}&l{bait} &rbait." +# Sent when someone tries to use a bait in creative +bait-survival-limited: "&rYou must be in &nsurvival&r to apply baits to fishing rods." # Shown when /emf toggle is run, to turn off and on respectively. toggle-off: "&rYou will no longer catch custom fish." @@ -238,4 +240,4 @@ admin: # ATTENTION ATTENTION ATTENTION # DO NOT EDIT THIS VALUE UNLESS YOU'RE UPDATING THE MESSAGES. -config-version: 10 \ No newline at end of file +config-version: 11 \ No newline at end of file