diff options
author | snowleo <schneeleo@gmail.com> | 2012-09-02 19:41:30 +0200 |
---|---|---|
committer | snowleo <schneeleo@gmail.com> | 2012-09-02 19:41:30 +0200 |
commit | 10b161ce09e910804ab16d3f7f5b2152228359ee (patch) | |
tree | 42fd4e8f54f1e503cacc5cb9b11d65b619a17e1e /EssentialsSigns/src | |
parent | 3676881efdb85357e8606eb76a6e6b0b35838086 (diff) | |
download | Essentials-10b161ce09e910804ab16d3f7f5b2152228359ee.tar Essentials-10b161ce09e910804ab16d3f7f5b2152228359ee.tar.gz Essentials-10b161ce09e910804ab16d3f7f5b2152228359ee.tar.lz Essentials-10b161ce09e910804ab16d3f7f5b2152228359ee.tar.xz Essentials-10b161ce09e910804ab16d3f7f5b2152228359ee.zip |
Move format methods from Util to FormatUtil
Diffstat (limited to 'EssentialsSigns/src')
5 files changed, 13 insertions, 8 deletions
diff --git a/EssentialsSigns/src/net/ess3/signs/EssentialsSign.java b/EssentialsSigns/src/net/ess3/signs/EssentialsSign.java index e0698b680..ad48074fb 100644 --- a/EssentialsSigns/src/net/ess3/signs/EssentialsSign.java +++ b/EssentialsSigns/src/net/ess3/signs/EssentialsSign.java @@ -10,6 +10,7 @@ import net.ess3.api.IUser; import java.util.HashSet; import java.util.Locale; import java.util.Set; +import net.ess3.utils.FormatUtil; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; @@ -268,7 +269,7 @@ public class EssentialsSign final Double money = trade.getMoney(); if (money != null) { - sign.setLine(index, Util.shortCurrency(money, ess)); + sign.setLine(index, FormatUtil.shortCurrency(money, ess)); } } diff --git a/EssentialsSigns/src/net/ess3/signs/SignBalance.java b/EssentialsSigns/src/net/ess3/signs/SignBalance.java index 35a1648ae..81cac977a 100644 --- a/EssentialsSigns/src/net/ess3/signs/SignBalance.java +++ b/EssentialsSigns/src/net/ess3/signs/SignBalance.java @@ -3,6 +3,7 @@ package net.ess3.signs; import static net.ess3.I18n._; import net.ess3.api.IEssentials; import net.ess3.api.IUser; +import net.ess3.utils.FormatUtil; import net.ess3.utils.Util; @@ -16,7 +17,7 @@ public class SignBalance extends EssentialsSign @Override protected boolean onSignInteract(final ISign sign, final IUser player, final String username, final IEssentials ess) throws SignException { - player.sendMessage(_("balance", Util.displayCurrency(player.getMoney(), ess))); + player.sendMessage(_("balance", FormatUtil.displayCurrency(player.getMoney(), ess))); return true; } } diff --git a/EssentialsSigns/src/net/ess3/signs/SignBlockListener.java b/EssentialsSigns/src/net/ess3/signs/SignBlockListener.java index f44f086c9..ac44e0a61 100644 --- a/EssentialsSigns/src/net/ess3/signs/SignBlockListener.java +++ b/EssentialsSigns/src/net/ess3/signs/SignBlockListener.java @@ -6,6 +6,7 @@ import net.ess3.api.IUser; import net.ess3.utils.Util; import java.util.logging.Level; import java.util.logging.Logger; +import net.ess3.utils.FormatUtil; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Sign; @@ -91,7 +92,7 @@ public class SignBlockListener implements Listener for (int i = 0; i < 4; i++) { - event.setLine(i, Util.formatString(user, "essentials.signs", event.getLine(i))); + event.setLine(i, FormatUtil.formatString(user, "essentials.signs", event.getLine(i))); } for (Signs signs : Signs.values()) diff --git a/EssentialsSigns/src/net/ess3/signs/SignProtection.java b/EssentialsSigns/src/net/ess3/signs/SignProtection.java index e87002fd4..00eb73619 100644 --- a/EssentialsSigns/src/net/ess3/signs/SignProtection.java +++ b/EssentialsSigns/src/net/ess3/signs/SignProtection.java @@ -7,6 +7,7 @@ import net.ess3.api.IUser; import net.ess3.economy.Trade; import net.ess3.utils.Util; import java.util.*; +import net.ess3.utils.FormatUtil; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; @@ -147,7 +148,7 @@ public class SignProtection extends EssentialsSign { return SignProtectionState.OWNER; } - if (Util.stripFormat(sign.getLine(3)).equalsIgnoreCase(username)) + if (FormatUtil.stripFormat(sign.getLine(3)).equalsIgnoreCase(username)) { return SignProtectionState.OWNER; } diff --git a/EssentialsSigns/src/net/ess3/signs/SignTrade.java b/EssentialsSigns/src/net/ess3/signs/SignTrade.java index 0993a5498..d8a08982c 100644 --- a/EssentialsSigns/src/net/ess3/signs/SignTrade.java +++ b/EssentialsSigns/src/net/ess3/signs/SignTrade.java @@ -6,6 +6,7 @@ import net.ess3.economy.Trade; import net.ess3.utils.Util; import net.ess3.api.IEssentials; import net.ess3.api.IUser; +import net.ess3.utils.FormatUtil; import org.bukkit.inventory.ItemStack; //TODO: Sell Enchantment on Trade signs? @@ -140,11 +141,11 @@ public class SignTrade extends EssentialsSign final Double money = getMoney(split[0]); if (money != null) { - if (Util.shortCurrency(money, ess).length() * 2 > 15) + if (FormatUtil.shortCurrency(money, ess).length() * 2 > 15) { throw new SignException("Line can be too long!"); } - sign.setLine(index, Util.shortCurrency(money, ess) + ":0"); + sign.setLine(index, FormatUtil.shortCurrency(money, ess) + ":0"); return; } } @@ -160,7 +161,7 @@ public class SignTrade extends EssentialsSign { throw new SignException(_("moreThanZero")); } - sign.setLine(index, Util.shortCurrency(money, ess) + ":" + Util.shortCurrency(amount, ess).substring(1)); + sign.setLine(index, FormatUtil.shortCurrency(money, ess) + ":" + FormatUtil.shortCurrency(amount, ess).substring(1)); return; } } @@ -318,7 +319,7 @@ public class SignTrade extends EssentialsSign final Double amount = getDouble(split[1]); if (money != null && amount != null) { - final String newline = Util.shortCurrency(money, ess) + ":" + Util.shortCurrency(amount + value, ess).substring(1); + final String newline = FormatUtil.shortCurrency(money, ess) + ":" + FormatUtil.shortCurrency(amount + value, ess).substring(1); if (newline.length() > 15) { throw new SignException("This sign is full: Line too long!"); |