Switch to the new I18n class and format cleanup of all classes

This commit is contained in:
snowleo 2011-11-21 02:55:26 +01:00
parent 19f5a2340d
commit 220d68f375
207 changed files with 1247 additions and 1306 deletions

View file

@ -1,7 +1,8 @@
package com.earth2me.essentials.commands;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.Locale;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@ -23,7 +24,7 @@ public class Commanditem extends EssentialsCommand
}
final ItemStack stack = ess.getItemDb().get(args[0]);
final String itemname = stack.getType().toString().toLowerCase().replace("_", "");
final String itemname = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace("_", "");
if (ess.getSettings().permissionBasedItemSpawn()
? (!user.isAuthorized("essentials.itemspawn.item-all")
&& !user.isAuthorized("essentials.itemspawn.item-" + itemname)
@ -31,7 +32,7 @@ public class Commanditem extends EssentialsCommand
: (!user.isAuthorized("essentials.itemspawn.exempt")
&& !user.canSpawnItem(stack.getTypeId())))
{
throw new Exception(Util.format("cantSpawnItem", itemname));
throw new Exception(_("cantSpawnItem", itemname));
}
if (args.length > 1 && Integer.parseInt(args[1]) > 0)
@ -41,11 +42,11 @@ public class Commanditem extends EssentialsCommand
if (stack.getType() == Material.AIR)
{
throw new Exception(Util.format("cantSpawnItem", "Air"));
throw new Exception(_("cantSpawnItem", "Air"));
}
final String displayName = stack.getType().toString().toLowerCase().replace('_', ' ');
user.sendMessage(Util.format("itemSpawn", stack.getAmount(), displayName));
final String displayName = stack.getType().toString().toLowerCase(Locale.ENGLISH).replace('_', ' ');
user.sendMessage(_("itemSpawn", stack.getAmount(), displayName));
user.getInventory().addItem(stack);
user.updateInventory();
}