Fixed localizeAndFormat, MIGHT have caused issues otherwise, not sure.

This commit is contained in:
Vexatos committed 2014-08-18 14:59:02 +02:00
1 parent 88ddc9a85a
commit 80b652dd2c
8 files changed
+13 -16

No files matched your search

@@ -78,7 +78,7 @@ public class CommandBeekeepingMode extends CommandMC {
public void processCommand(ICommandSender sender, String[] arguments) {
if (arguments.length <= 0)
throw new WrongUsageException(StringUtil.localize("chat.help",this.getCommandUsage(sender)));
throw new WrongUsageException(StringUtil.localizeAndFormat("chat.help", this.getCommandUsage(sender)));
if (arguments[0].matches("list"))
listModes(sender, arguments);
@@ -104,7 +104,7 @@ public class CommandBeekeepingMode extends CommandMC {
saveStatistics(sender, arguments);
} else if (arguments[0].matches("help")) {
sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.0", this.getCommandName()));
sendChatMessage(sender, StringUtil.localizeAndFormat("chat.bees.command.help.0", this.getCommandName()));
sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.1"));
sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.2"));
sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.3"));
@@ -271,7 +271,7 @@ public class GuiBeealyzer extends GuiAlyzer {
if (bee.getGeneration() >= 0) {
newLine();
displayText = StringUtil.localize("gui.beealyzer.generations", bee.getGeneration());
displayText = StringUtil.localizeAndFormat("gui.beealyzer.generations", bee.getGeneration());
// offset = (int)(((158 - fontRendererObj.getStringWidth(origin)) / 2)*(1/factor));
drawCenteredLine(displayText, 8, 158, fontColor.get("gui.beealyzer.binomial"));
}
@@ -78,7 +78,7 @@ public class CommandTreekeepingMode extends CommandMC {
public void processCommand(ICommandSender sender, String[] arguments) {
if (arguments.length <= 0)
throw new WrongUsageException(StringUtil.localize("chat.help",this.getCommandUsage(sender)));
throw new WrongUsageException(StringUtil.localizeAndFormat("chat.help", this.getCommandUsage(sender)));
if (arguments[0].matches("list"))
listModes(sender, arguments);
@@ -104,7 +104,7 @@ public class CommandTreekeepingMode extends CommandMC {
saveStatistics(sender, arguments);
} else if (arguments[0].matches("help")) {
sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.0", this.getCommandName()));
sendChatMessage(sender, StringUtil.localizeAndFormat("chat.trees.command.help.0", this.getCommandName()));
sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.1"));
sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.2"));
sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.3"));
@@ -53,7 +53,7 @@ public class CommandForestry extends CommandMC {
public void processCommand(ICommandSender sender, String[] arguments) {
if (arguments.length <= 0)
throw new WrongUsageException(StringUtil.localize("chat.help",this.getCommandUsage(sender)));
throw new WrongUsageException(StringUtil.localizeAndFormat("chat.help", this.getCommandUsage(sender)));
if (arguments[0].matches("version")) {
commandVersion(sender, arguments);
@@ -62,7 +62,7 @@ public class CommandForestry extends CommandMC {
commandPlugins(sender, arguments);
return;
} else if (arguments[0].matches("help")) {
sendChatMessage(sender, StringUtil.localize("chat.command.help.0", this.getCommandName()));
sendChatMessage(sender, StringUtil.localizeAndFormat("chat.command.help.0", this.getCommandName()));
sendChatMessage(sender, StringUtil.localize("chat.command.help.1"));
sendChatMessage(sender, StringUtil.localize("chat.command.help.2"));
sendChatMessage(sender, StringUtil.localize("chat.command.help.3"));
@@ -123,7 +123,7 @@ public class CommandForestry extends CommandMC {
}
if (found == null)
throw new CommandException(StringUtil.localize("chat.plugins.error",arguments[2]));
throw new CommandException(StringUtil.localizeAndFormat("chat.plugins.error", arguments[2]));
String entry = "\u00A7c";
if (found.isAvailable())
@@ -233,7 +233,7 @@ public class ItemResearchNote extends ItemForestry {
@Override
public String getItemStackDisplayName(ItemStack itemstack) {
ResearchNote note = new ResearchNote(itemstack.getTagCompound());
return StringUtil.localize(getUnlocalizedName(itemstack) + ".name", note.researcher);
return StringUtil.localizeAndFormat(getUnlocalizedName(itemstack) + ".name", note.researcher);
}
@SuppressWarnings("rawtypes")
@@ -22,7 +22,7 @@ public class StringUtil {
return StatCollector.translateToLocal(key).replace("\\n", "\n").replace("@", "%").replace("\\%", "@");
}
public static String localize(String key, Object... args) {
public static String localizeAndFormat(String key, Object... args) {
String text = StringUtil.localize(key);
try {
+2 -5
View File
@@ -18,11 +18,8 @@ import net.minecraft.command.ICommandSender;
import net.minecraft.command.WrongUsageException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import com.mojang.authlib.GameProfile;
import forestry.api.mail.ITradeStation;
import forestry.api.mail.PostManager;
import forestry.api.mail.TradeStationInfo;
@@ -56,7 +53,7 @@ public class CommandMail extends CommandMC {
@Override
public void processCommand(ICommandSender sender, String[] arguments) {
if (arguments.length <= 0)
throw new WrongUsageException(StringUtil.localize("chat.help",this.getCommandUsage(sender)));
throw new WrongUsageException(StringUtil.localizeAndFormat("chat.help", this.getCommandUsage(sender)));
if (arguments[0].matches("trades")) {
commandTrades(sender, arguments);
@@ -65,7 +62,7 @@ public class CommandMail extends CommandMC {
commandVirtualize(sender, arguments);
return;
} else if (arguments[0].matches("help")) {
sendChatMessage(sender, StringUtil.localize("chat.mail.command.help.0", this.getCommandName()));
sendChatMessage(sender, StringUtil.localizeAndFormat("chat.mail.command.help.0", this.getCommandName()));
sendChatMessage(sender, StringUtil.localize("chat.mail.command.help.1"));
sendChatMessage(sender, StringUtil.localize("chat.mail.command.help.2"));
sendChatMessage(sender, StringUtil.localize("chat.mail.command.help.3"));