mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-09-12 05:08:48 +00:00
Sign lines with color only support 13 characters. Fixes the trade signs for users with names longer than 13 characters.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1513 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
5ae48481bd
commit
0c0499bbfd
|
@ -30,7 +30,7 @@ public class EssentialsEcoBlockListener extends BlockListener
|
|||
return;
|
||||
}
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
String username = user.getName().substring(0, user.getName().length() > 14 ? 14 : user.getName().length());
|
||||
String username = user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
|
||||
if (event.getBlock().getType() != Material.WALL_SIGN && event.getBlock().getType() != Material.SIGN_POST)
|
||||
{
|
||||
return;
|
||||
|
@ -101,7 +101,7 @@ public class EssentialsEcoBlockListener extends BlockListener
|
|||
return;
|
||||
}
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
String username = user.getName().substring(0, user.getName().length() > 14 ? 14 : user.getName().length());
|
||||
String username = user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
|
||||
|
||||
if ((event.getLine(0).equalsIgnoreCase("[Buy]") || event.getLine(0).equalsIgnoreCase("#1[Buy]")) && user.isAuthorized("essentials.signs.buy.create"))
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ public class EssentialsEcoPlayerListener extends PlayerListener
|
|||
return;
|
||||
}
|
||||
User user = ess.getUser(event.getPlayer());
|
||||
String username = user.getName().substring(0, user.getName().length() > 14 ? 14 : user.getName().length());
|
||||
String username = user.getName().substring(0, user.getName().length() > 13 ? 13 : user.getName().length());
|
||||
if (event.getClickedBlock().getType() != Material.WALL_SIGN && event.getClickedBlock().getType() != Material.SIGN_POST)
|
||||
{
|
||||
return;
|
||||
|
@ -91,8 +91,8 @@ public class EssentialsEcoPlayerListener extends PlayerListener
|
|||
{
|
||||
try
|
||||
{
|
||||
String[] l1 = sign.getLines()[1].split("[ :-]+");
|
||||
String[] l2 = sign.getLines()[2].split("[ :-]+");
|
||||
String[] l1 = sign.getLine(1).split("[ :-]+");
|
||||
String[] l2 = sign.getLine(2).split("[ :-]+");
|
||||
boolean m1 = l1[0].matches("[^0-9][0-9]+(\\.[0-9]+)?");
|
||||
boolean m2 = l2[0].matches("[^0-9][0-9]+(\\.[0-9]+)?");
|
||||
double q1 = Double.parseDouble(m1 ? l1[0].substring(1) : l1[0]);
|
||||
|
@ -110,7 +110,7 @@ public class EssentialsEcoPlayerListener extends PlayerListener
|
|||
ItemStack qi1 = m1 ? null : ItemDb.get(l1[1], (int)q1);
|
||||
ItemStack qi2 = m2 ? null : ItemDb.get(l2[1], (int)q2);
|
||||
|
||||
if (username.equals(sign.getLines()[3].substring(2)))
|
||||
if (username.equals(sign.getLine(3).substring(2)))
|
||||
{
|
||||
if (m1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue