From 957605d46bb3c2fba7ecc3c1d6e717657f6eeb90 Mon Sep 17 00:00:00 2001 From: GJ Date: Wed, 16 Jan 2013 14:03:07 -0500 Subject: [PATCH] More localization updates. --- .../commands/skills/AcrobaticsCommand.java | 11 +--- .../commands/skills/ArcheryCommand.java | 11 +--- .../nossr50/commands/skills/AxesCommand.java | 10 +-- .../commands/skills/ExcavationCommand.java | 8 +-- .../commands/skills/FishingCommand.java | 8 +-- .../commands/skills/HerbalismCommand.java | 8 +-- .../commands/skills/MiningCommand.java | 7 +-- .../commands/skills/RepairCommand.java | 8 +-- .../commands/skills/SwordsCommand.java | 8 +-- .../commands/skills/TamingCommand.java | 8 +-- .../commands/skills/UnarmedCommand.java | 8 +-- .../commands/skills/WoodcuttingCommand.java | 8 +-- .../nossr50/listeners/PlayerListener.java | 62 ++++--------------- .../gmail/nossr50/runnables/mcRankAsync.java | 32 ++++++---- .../com/gmail/nossr50/spout/SpoutStuff.java | 3 +- .../java/com/gmail/nossr50/util/Page.java | 2 +- .../java/com/gmail/nossr50/util/Skills.java | 4 ++ .../resources/locale/locale_cy.properties | 3 + .../resources/locale/locale_de.properties | 2 + .../resources/locale/locale_en_US.properties | 15 ++++- src/main/resources/plugin.yml | 4 +- 21 files changed, 94 insertions(+), 136 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java index 16eee9d9e..6f2735e4e 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/AcrobaticsCommand.java @@ -1,18 +1,13 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; -import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.acrobatics.Acrobatics; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class AcrobaticsCommand extends SkillCommand { - AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); - private String dodgeChance; private String dodgeChanceLucky; private String rollChance; @@ -73,8 +68,8 @@ public class AcrobaticsCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Acrobatics.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.ACROBATICS) }) })); } if (canRoll) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java index d15758407..c2ab95d58 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ArcheryCommand.java @@ -1,18 +1,13 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; -import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.archery.Archery; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class ArcheryCommand extends SkillCommand { - AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); - private String skillShotBonus; private String dazeChance; private String dazeChanceLucky; @@ -69,8 +64,8 @@ public class ArcheryCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Archery.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.ARCHERY) }) })); } if (canSkillShot) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java index a1717531f..055576ff3 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/AxesCommand.java @@ -1,18 +1,14 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; -import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.axes.Axes; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class AxesCommand extends SkillCommand { - AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); - private String critChance; private String critChanceLucky; private String bonusDamage; @@ -91,8 +87,8 @@ public class AxesCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Axes.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.AXES) }) })); } if (canSkullSplitter) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java index 61d8f877c..174583e94 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/ExcavationCommand.java @@ -1,13 +1,11 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class ExcavationCommand extends SkillCommand { AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); @@ -62,8 +60,8 @@ public class ExcavationCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Excavation.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.EXCAVATION) }) })); } if (canGigaDrill) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java index f4f793759..425999885 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/FishingCommand.java @@ -1,14 +1,12 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.gathering.Fishing; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class FishingCommand extends SkillCommand { @@ -82,8 +80,8 @@ public class FishingCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Fishing.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.FISHING) }) })); } if (canTreasureHunt) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java index 8485f13c4..8e031da90 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/HerbalismCommand.java @@ -1,14 +1,12 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class HerbalismCommand extends SkillCommand { AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); @@ -109,8 +107,8 @@ public class HerbalismCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Herbalism.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.HERBALISM) }) })); } if (canGreenTerra) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java index c5dc7bc48..c2d733183 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/MiningCommand.java @@ -1,7 +1,5 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; @@ -9,6 +7,7 @@ import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class MiningCommand extends SkillCommand { AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); @@ -144,8 +143,8 @@ public class MiningCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Mining.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.MINING) }) })); } if (canSuperBreaker) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java index 27fcac2be..7affeffbe 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/RepairCommand.java @@ -1,7 +1,5 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; @@ -10,8 +8,8 @@ import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.skills.repair.Repair; import com.gmail.nossr50.skills.repair.Repairable; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class RepairCommand extends SkillCommand { AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); @@ -102,8 +100,8 @@ public class RepairCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Repair.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.REPAIR) }) })); } player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.0"), LocaleLoader.getString("Repair.Effect.1") })); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java index 57fa8ead3..1c6f90362 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/SwordsCommand.java @@ -1,13 +1,11 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class SwordsCommand extends SkillCommand { AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); @@ -96,8 +94,8 @@ public class SwordsCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Swords.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.SWORDS) }) })); } if (canCounter) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java index 209f6fa49..ddbe482b5 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/TamingCommand.java @@ -1,14 +1,12 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class TamingCommand extends SkillCommand { AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); @@ -69,8 +67,8 @@ public class TamingCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Taming.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.TAMING) }) })); } Config configInstance = Config.getInstance(); diff --git a/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java index aa5da9927..c69c985a2 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/UnarmedCommand.java @@ -1,13 +1,11 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class UnarmedCommand extends SkillCommand { AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); @@ -98,8 +96,8 @@ public class UnarmedCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Unarmed.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.UNARMED) }) })); } if (canBerserk) { diff --git a/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java b/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java index 8f7b4d5a3..eb59f32ed 100644 --- a/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java +++ b/src/main/java/com/gmail/nossr50/commands/skills/WoodcuttingCommand.java @@ -1,14 +1,12 @@ package com.gmail.nossr50.commands.skills; -import org.bukkit.ChatColor; - import com.gmail.nossr50.commands.SkillCommand; import com.gmail.nossr50.config.AdvancedConfig; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.locale.LocaleLoader; -import com.gmail.nossr50.util.Misc; import com.gmail.nossr50.util.Permissions; +import com.gmail.nossr50.util.Skills; public class WoodcuttingCommand extends SkillCommand { AdvancedConfig advancedConfig = AdvancedConfig.getInstance(); @@ -84,8 +82,8 @@ public class WoodcuttingCommand extends SkillCommand { @Override protected void effectsDisplay() { if (lucky) { - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Misc.getCapitalized(LocaleLoader.getString("Woodcutting.SkillName")) }) })); + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); + player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc", new Object[] { Skills.localizeSkillName(SkillType.WOODCUTTING) }) })); } if (canTreeFell) { diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index 8a925ba6b..af875fdc2 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -1,6 +1,5 @@ package com.gmail.nossr50.listeners; -import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -185,19 +184,19 @@ public class PlayerListener implements Listener { //TODO: Locale ALL the things. if (Config.getInstance().getMOTDEnabled() && Permissions.motd(player)) { - String prefix = ChatColor.GOLD + "[mcMMO] "; - String perkPrefix = ChatColor.RED + "[mcMMO Perks] "; + String perkPrefix = LocaleLoader.getString("MOTD.PerksPrefix"); - player.sendMessage(prefix + ChatColor.YELLOW + "Running version " + ChatColor.DARK_AQUA + plugin.getDescription().getVersion()); //TODO: Locale + player.sendMessage(LocaleLoader.getString("MOTD.Version", new Object[] {plugin.getDescription().getVersion()})); if (Config.getInstance().getHardcoreEnabled()) { if (Config.getInstance().getHardcoreVampirismEnabled()) { - player.sendMessage(prefix + ChatColor.DARK_RED + "Hardcore & Vampirism enabled."); - player.sendMessage(prefix + ChatColor.DARK_AQUA + "Skill Death Penalty: " + ChatColor.DARK_RED + Config.getInstance().getHardcoreDeathStatPenaltyPercentage() + "% " + ChatColor.DARK_AQUA + "Vampirism Stat Leech: " + ChatColor.DARK_RED + Config.getInstance().getHardcoreVampirismStatLeechPercentage() + "%"); + player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.VampireOn")); + player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Stats", new Object[] {Config.getInstance().getHardcoreDeathStatPenaltyPercentage()})); + player.sendMessage(LocaleLoader.getString("MOTD.Vampire.Stats", new Object[] {Config.getInstance().getHardcoreVampirismStatLeechPercentage()})); } else { - player.sendMessage(prefix + ChatColor.DARK_RED + "Hardcore enabled."); - player.sendMessage(prefix + ChatColor.DARK_AQUA + "Skill Death Penalty: " + ChatColor.DARK_RED + Config.getInstance().getHardcoreDeathStatPenaltyPercentage() + "%"); + player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.VampireOff")); + player.sendMessage(LocaleLoader.getString("MOTD.Hardcore.Stats", new Object[] {Config.getInstance().getHardcoreDeathStatPenaltyPercentage()})); } } @@ -237,46 +236,11 @@ public class PlayerListener implements Listener { player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.activationtime.name"), LocaleLoader.getString("Perks.activationtime.desc", new Object[] { 4 }) })); } - if (Permissions.luckyAcrobatics(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyArchery(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyAxes(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyExcavation(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyFishing(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyHerbalism(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyMining(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyRepair(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckySwords(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyTaming(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyUnarmed(player)) { - player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); - } - else if (Permissions.luckyWoodcutting(player)) { + if (Permissions.luckyAcrobatics(player) || Permissions.luckyArchery(player) || Permissions.luckyAxes(player) || Permissions.luckyFishing(player) || Permissions.luckyHerbalism(player) || Permissions.luckyMining(player) || Permissions.luckyRepair(player) || Permissions.luckySwords(player) || Permissions.luckyTaming(player) || Permissions.luckyUnarmed(player) || Permissions.luckyWoodcutting(player)) { player.sendMessage(perkPrefix + LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Perks.lucky.name"), LocaleLoader.getString("Perks.lucky.desc.login") })); } - player.sendMessage(ChatColor.GOLD+"[mcMMO] " + ChatColor.GREEN + "http://www.mcmmo.info" + ChatColor.YELLOW + " - mcMMO Website & Forums"); //TODO: Locale - //player.sendMessage(LocaleLoader.getString("mcMMO.MOTD", new Object[] {plugin.getDescription().getVersion()})); - //player.sendMessage(LocaleLoader.getString("mcMMO.Website")); + player.sendMessage(LocaleLoader.getString("MOTD.Website", new Object[] {plugin.getDescription().getWebsite()})); } //THIS IS VERY BAD WAY TO DO THINGS, NEED BETTER WAY @@ -452,12 +416,10 @@ public class PlayerListener implements Listener { return; } - String prefix = ChatColor.GREEN + "(" + ChatColor.WHITE + playerName + ChatColor.GREEN + ") "; - plugin.getLogger().info("[P](" + partyName + ")" + "<" + playerName + "> " + chatEvent.getMessage()); for (Player member : party.getOnlineMembers()) { - member.sendMessage(prefix + chatEvent.getMessage()); + member.sendMessage(LocaleLoader.getString("Commands.Party.Chat.Prefix", new Object[] {playerName}) + chatEvent.getMessage()); } event.setCancelled(true); @@ -471,13 +433,11 @@ public class PlayerListener implements Listener { return; } - String prefix = ChatColor.AQUA + "{" + ChatColor.WHITE + playerName + ChatColor.AQUA + "} "; - plugin.getLogger().info("[A]<" + playerName + "> " + chatEvent.getMessage()); for (Player otherPlayer : plugin.getServer().getOnlinePlayers()) { if (Permissions.adminChat(otherPlayer) || otherPlayer.isOp()) { - otherPlayer.sendMessage(prefix + chatEvent.getMessage()); + otherPlayer.sendMessage(LocaleLoader.getString("Commands.AdminChat.Prefix", new Object[] {playerName}) + chatEvent.getMessage()); } } diff --git a/src/main/java/com/gmail/nossr50/runnables/mcRankAsync.java b/src/main/java/com/gmail/nossr50/runnables/mcRankAsync.java index f995e881a..f2611867a 100644 --- a/src/main/java/com/gmail/nossr50/runnables/mcRankAsync.java +++ b/src/main/java/com/gmail/nossr50/runnables/mcRankAsync.java @@ -3,22 +3,22 @@ package com.gmail.nossr50.runnables; import java.util.Map; import org.bukkit.Bukkit; -import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import com.gmail.nossr50.mcMMO; import com.gmail.nossr50.datatypes.SkillType; +import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Database; -import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.util.Skills; public class mcRankAsync implements Runnable { private Database database = mcMMO.getPlayerDatabase(); - private final String playerName; - private final CommandSender sender; + private final String playerName; + private final CommandSender sender; public mcRankAsync(String playerName, CommandSender sender) { this.playerName = playerName; - this.sender = sender; + this.sender = sender; } @Override @@ -31,13 +31,23 @@ public class mcRankAsync implements Runnable { for (SkillType skillType : SkillType.values()) { if (skillType.equals(SkillType.ALL)) continue; // We want the overall ranking to be at the bottom - sender.sendMessage(ChatColor.YELLOW + Misc.getCapitalized(skillType.name()) + ChatColor.GREEN + " - " + (skills.get(skillType.name()) == null ? ChatColor.WHITE + "Unranked" : ChatColor.GOLD + "Rank " + ChatColor.WHITE + "#" + ChatColor.GREEN + skills.get(skillType.name()))); + + if (skills.get(skillType.name()) == null) { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", new Object[] {Skills.localizeSkillName(skillType), LocaleLoader.getString("Commands.mcrank.Unranked")} )); + } + else { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Skill", new Object[] {Skills.localizeSkillName(skillType), skills.get(skillType.name())} )); + } + } + + if (skills.get("ALL") == null) { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", new Object[] {LocaleLoader.getString("Commands.mcrank.Unranked")} )); + } + else { + sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Overall", new Object[] {skills.get("ALL")} )); } - sender.sendMessage(ChatColor.YELLOW + "Overall" + ChatColor.GREEN + " - " + (skills.get("ALL") == null ? ChatColor.WHITE + "Unranked" : ChatColor.GOLD + "Rank " + ChatColor.WHITE + "#" + ChatColor.GREEN + skills.get("ALL"))); } - - - + }, 1L); } -} \ No newline at end of file +} diff --git a/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java b/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java index d48ef5728..79d5a1154 100644 --- a/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java +++ b/src/main/java/com/gmail/nossr50/spout/SpoutStuff.java @@ -26,6 +26,7 @@ import com.gmail.nossr50.datatypes.SkillType; import com.gmail.nossr50.listeners.SpoutListener; import com.gmail.nossr50.locale.LocaleLoader; import com.gmail.nossr50.util.Misc; +import com.gmail.nossr50.util.Skills; import com.gmail.nossr50.util.Users; public class SpoutStuff { @@ -548,7 +549,7 @@ public class SpoutStuff { break; } - spoutPlayer.sendNotification(LocaleLoader.getString("Spout.LevelUp.1"), LocaleLoader.getString("Spout.LevelUp.2", new Object[] {Misc.getCapitalized(LocaleLoader.getString(Misc.getCapitalized(skillType.toString()) + ".SkillName")), profile.getSkillLevel(skillType)} ), mat); + spoutPlayer.sendNotification(LocaleLoader.getString("Spout.LevelUp.1"), LocaleLoader.getString("Spout.LevelUp.2", new Object[] {Skills.localizeSkillName(skillType), profile.getSkillLevel(skillType)} ), mat); SpoutSounds.playLevelUpNoise(spoutPlayer, plugin); } diff --git a/src/main/java/com/gmail/nossr50/util/Page.java b/src/main/java/com/gmail/nossr50/util/Page.java index 3ad1da937..7c1dcf57e 100644 --- a/src/main/java/com/gmail/nossr50/util/Page.java +++ b/src/main/java/com/gmail/nossr50/util/Page.java @@ -58,7 +58,7 @@ public class Page { public static void grabGuidePageForSkill(SkillType skilltype, Player player, String[] args) { String skillName = skilltype.toString(); String capitalized = Misc.getCapitalized(skillName); - String localized = Misc.getCapitalized(LocaleLoader.getString(capitalized + ".SkillName")); + String localized = Skills.localizeSkillName(skilltype); player.sendMessage(LocaleLoader.getString("Guides.Available", new Object[] {localized, localized.toLowerCase()} )); if (args.length >= 1) { diff --git a/src/main/java/com/gmail/nossr50/util/Skills.java b/src/main/java/com/gmail/nossr50/util/Skills.java index ef4262b6d..cafd5f2a8 100644 --- a/src/main/java/com/gmail/nossr50/util/Skills.java +++ b/src/main/java/com/gmail/nossr50/util/Skills.java @@ -313,6 +313,10 @@ public class Skills { return null; } + public static String localizeSkillName(SkillType skill) { + return Misc.getCapitalized(LocaleLoader.getString(Misc.getCapitalized(skill.toString()) + ".SkillName")); + } + /** * Check if the player has any combat skill permissions. * diff --git a/src/main/resources/locale/locale_cy.properties b/src/main/resources/locale/locale_cy.properties index 07726862e..4a24becf5 100644 --- a/src/main/resources/locale/locale_cy.properties +++ b/src/main/resources/locale/locale_cy.properties @@ -350,6 +350,9 @@ Commands.Invite.Accepted=[[GREEN]] Gwahodd Derbyniwyd. Yr ydych wedi ymuno parti Commands.Invite.Success=[[GREEN]]Invite sent successfully. Commands.Leaderboards= [[RED]]- Leaderboards Commands.mcgod=[[RED]]- Toggle GodMode +Commands.mcrank.Skill=[[YELLOW]]{0}[[GREEN]] - [[GOLD]]Rank [[WHITE]]#[[GREEN]]{1} +Commands.mcrank.Overall=[[YELLOW]]Overall[[GREEN]] - [[GOLD]]Rank [[WHITE]]#[[GREEN]]{0} + Commands.mmoedit=[chwaraewr] [[RED]] - Targed addasu Commands.ModDescription=[[RED]]- Read brief mod description Commands.NoConsole=This command does not support console usage. diff --git a/src/main/resources/locale/locale_de.properties b/src/main/resources/locale/locale_de.properties index ee7f34180..26dba08cd 100644 --- a/src/main/resources/locale/locale_de.properties +++ b/src/main/resources/locale/locale_de.properties @@ -393,6 +393,8 @@ Commands.Invite.Accepted=[[GREEN]]Einladung akzeptiert. Du bist der Gruppe {0} b Commands.Invite.Success=[[GREEN]]Einladung erfolgreich versendet. Commands.Leaderboards= [[RED]]- Ranglisten Commands.mcgod=[[RED]]- GodMode umschalten +Commands.mcrank.Skill=[[YELLOW]]{0}[[GREEN]] - [[GOLD]]Rank [[WHITE]]#[[GREEN]]{1} +Commands.mcrank.Overall=[[YELLOW]]Overall[[GREEN]] - [[GOLD]]Rank [[WHITE]]#[[GREEN]]{0} Commands.mmoedit=[Spieler] [[RED]] - Ziel modifizieren Commands.ModDescription=[[RED]]- Mod-Informationen Lesen. Commands.NoConsole=Dieser Command wird nicht per Console unterst\u00FCtzt. diff --git a/src/main/resources/locale/locale_en_US.properties b/src/main/resources/locale/locale_en_US.properties index 817d22967..9b6375fd6 100644 --- a/src/main/resources/locale/locale_en_US.properties +++ b/src/main/resources/locale/locale_en_US.properties @@ -402,6 +402,8 @@ Commands.Invite.Accepted=[[GREEN]]Invite Accepted. You have joined party {0} Commands.Invite.Success=[[GREEN]]Invite sent successfully. Commands.Leaderboards= [[RED]]- Leaderboards Commands.mcgod=[[RED]]- Toggle GodMode +Commands.mcrank.Skill=[[YELLOW]]{0}[[GREEN]] - [[GOLD]]Rank [[WHITE]]#[[GREEN]]{1} +Commands.mcrank.Overall=[[YELLOW]]Overall[[GREEN]] - [[GOLD]]Rank [[WHITE]]#[[GREEN]]{0} Commands.mmoedit=[player] [[RED]] - Modify target Commands.ModDescription=[[RED]]- Read brief mod description Commands.NoConsole=This command does not support console usage. @@ -435,11 +437,9 @@ Commands.SkillInfo=/ [[RED]]- View detailed information about a skill Commands.Stats.Self=YOUR STATS Commands.Stats=[[RED]]- View your mcMMO stats Commands.ToggleAbility=[[RED]]- Toggle ability activation with right click -mcMMO.MOTD=[[BLUE]]This server is running mcMMO {0}! \n Type [[YELLOW]]/mcmmo[[BLUE]] for help. mcMMO.NoInvites=[[RED]]You have no invites at this time mcMMO.NoPermission=[[DARK_RED]]Insufficient permissions. mcMMO.NoSkillNote=[[DARK_GRAY]]If you don't have access to a skill it will not be shown here. -mcMMO.Website=[[GREEN]]http://forums.mcmmo.info[[BLUE]] - mcMMO Website ##party Commands.Party.InParty=[[GREEN]]Party: {0} @@ -569,4 +569,13 @@ Spout.Menu.ExitButton=EXIT Spout.Menu.HudButton.1=HUD Type: {0} Spout.Menu.HudButton.2=Change your HUD style! Spout.Menu.Title=[[GOLD]]~mcMMO Menu~ -Spout.Title={0}\n[[YELLOW]]P[[GOLD]]lvl[[WHITE]].[[GREEN]]{1} \ No newline at end of file +Spout.Title={0}\n[[YELLOW]]P[[GOLD]]lvl[[WHITE]].[[GREEN]]{1} + +#MOTD +MOTD.Hardcore.VampireOff=[[GOLD]][mcMMO] [[DARK_RED]]Hardcore & Vampirism enabled. +MOTD.Hardcore.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]Skill Death Penalty: [[DARK_RED]]{0}% +MOTD.Hardcore.VampireOn=[[GOLD]][mcMMO] [[DARK_RED]]Hardcore enabled. +MOTD.PerksPrefix=[[RED]][mcMMO Perks] +MOTD.Vampire.Stats=[[GOLD]][mcMMO] [[DARK_AQUA]]Vampirism Stat Leech: [[DARK_RED]]{0}% +MOTD.Version=[[GOLD]][mcMMO] Running version [[DARK_AQUA]]{0} +MOTD.Website=[[GOLD]][mcMMO] [[GREEN]]{0}[[YELLOW]] - mcMMO Website \ No newline at end of file diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 7e1b8bbf6..8ed386818 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -12,9 +12,9 @@ description: > experience. author: nossr50 -authors: [NuclearW, gmcferrin, bm01, Glitchfinder, TfT_02] +authors: [NuclearW, GJ, Glitchfinder, TfT_02, toothplck1] website: http://dev.bukkit.org/server-mods/mcmmo/ - + main: com.gmail.nossr50.mcMMO softdepend: [Spout] load: STARTUP