Start of major localization update.

This commit is contained in:
GJ
2013-01-16 09:08:45 -05:00
parent 5d0e85452a
commit faa22002e3
11 changed files with 59 additions and 30 deletions

View File

@ -1,11 +1,11 @@
package com.gmail.nossr50.util;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.PlayerProfile;
import com.gmail.nossr50.datatypes.SkillType;
import com.gmail.nossr50.locale.LocaleLoader;
public abstract class Hardcore {
@ -37,7 +37,7 @@ public abstract class Hardcore {
playerProfile.modifySkill(skillType, playerSkillLevel - levelsLost);
}
player.sendMessage(ChatColor.GOLD + "[mcMMO] " + ChatColor.DARK_RED + "You've lost " + ChatColor.BLUE + totalLost + ChatColor.DARK_RED + " from death.");
player.sendMessage(LocaleLoader.getString("Hardcore.Player.Loss", new Object[] {totalLost}));
}
public static void invokeVampirism(Player killer, Player victim) {
@ -72,12 +72,12 @@ public abstract class Hardcore {
}
if (totalStolen > 0) {
killer.sendMessage(ChatColor.GOLD + "[mcMMO] " + ChatColor.DARK_AQUA + "You've stolen " + ChatColor.BLUE + totalStolen + ChatColor.DARK_AQUA + " levels from that player.");
victim.sendMessage(ChatColor.GOLD + "[mcMMO] " + ChatColor.YELLOW + killer.getName() + ChatColor.DARK_RED + " has stolen " + ChatColor.BLUE + totalStolen + ChatColor.DARK_RED + " levels from you!");
killer.sendMessage(LocaleLoader.getString("Vampirism.Killer.Success", new Object[] {totalStolen, victim.getName()} ));
victim.sendMessage(LocaleLoader.getString("Vampirism.Victim.Success", new Object[] {killer.getName(), totalStolen} ));
}
else {
killer.sendMessage(ChatColor.GOLD + "[mcMMO] " + ChatColor.GRAY + "That player was too unskilled to grant you any knowledge.");
victim.sendMessage(ChatColor.GOLD + "[mcMMO] " + ChatColor.YELLOW + killer.getName() + ChatColor.GRAY + " was unable to steal knowledge from you!");
killer.sendMessage(LocaleLoader.getString("Vampirism.Killer.Failure", new Object[] {victim.getName()} ));
victim.sendMessage(LocaleLoader.getString("Vampirism.Victim.Failure", new Object[] {killer.getName()} ));
}
}
}

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.util;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
@ -30,9 +29,10 @@ public class Item {
ItemStack inHand = player.getItemInHand();
Block block = player.getLocation().getBlock();
int amount = inHand.getAmount();
long recentlyHurt = profile.getRecentlyHurt();
if (Permissions.chimaeraWing(player) && inHand.getTypeId() == Config.getInstance().getChimaeraItemId()) {
if (Skills.cooldownOver(profile.getRecentlyHurt(), 60, player) && amount >= Config.getInstance().getChimaeraCost()) {
if (Skills.cooldownOver(recentlyHurt, 60, player) && amount >= Config.getInstance().getChimaeraCost()) {
player.setItemInHand(new ItemStack(Config.getInstance().getChimaeraItemId(), amount - Config.getInstance().getChimaeraCost()));
for (int y = 1; block.getY() + y < player.getWorld().getMaxHeight(); y++) {
@ -52,11 +52,11 @@ public class Item {
player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Pass"));
}
else if (!Skills.cooldownOver(profile.getRecentlyHurt(), 60, player) && amount >= Config.getInstance().getChimaeraCost()) {
player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(profile.getRecentlyHurt(), 60, player)}));
else if (!Skills.cooldownOver(recentlyHurt, 60, player) && amount >= Config.getInstance().getChimaeraCost()) {
player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(recentlyHurt, 60, player)}));
}
else if (amount <= Config.getInstance().getChimaeraCost()) {
player.sendMessage(LocaleLoader.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + Misc.prettyItemString(Config.getInstance().getChimaeraItemId()));
player.sendMessage(LocaleLoader.getString("Skills.NeedMore", new Object[] { Misc.prettyItemString(Config.getInstance().getChimaeraItemId()) }));
}
}
}

View File

@ -136,7 +136,7 @@ public class Skills {
if (ability.getPermissions(player) && tool.inHand(inHand) && !profile.getToolPreparationMode(tool)) {
if (skill != SkillType.WOODCUTTING && skill != SkillType.AXES) {
if (!profile.getAbilityMode(ability) && !cooldownOver(profile.getSkillDATS(ability) * Misc.TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) {
player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(profile.getSkillDATS(ability) * Misc.TIME_CONVERSION_FACTOR, ability.getCooldown(), player) + "s)");
player.sendMessage(LocaleLoader.getString("Skills.TooTired", new Object[] { calculateTimeLeft(profile.getSkillDATS(ability) * Misc.TIME_CONVERSION_FACTOR, ability.getCooldown(), player) }));
return;
}
}
@ -408,7 +408,7 @@ public class Skills {
*/
if (type == SkillType.WOODCUTTING || type == SkillType.AXES) {
if (!profile.getAbilityMode(ability) && !cooldownOver(profile.getSkillDATS(ability) * Misc.TIME_CONVERSION_FACTOR, ability.getCooldown(), player)) {
player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(profile.getSkillDATS(ability) * Misc.TIME_CONVERSION_FACTOR, ability.getCooldown(), player) + "s)");
player.sendMessage(LocaleLoader.getString("Skills.TooTired", new Object[] { calculateTimeLeft(profile.getSkillDATS(ability) * Misc.TIME_CONVERSION_FACTOR, ability.getCooldown(), player) }));
return;
}
}