[trunk] Warp signs

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1095 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-04-03 01:12:55 +00:00
parent d9f3208d43
commit fef58aeb18
2 changed files with 32 additions and 36 deletions

View File

@ -119,22 +119,19 @@ public class EssentialsBlockListener extends BlockListener
}
if (event.getLine(0).equalsIgnoreCase("[Warp]"))
{
if (user.isAuthorized("essentials.signs.warp.create"))
if (event.getLine(1).isEmpty())
{
event.setLine(0, "§4[Warp]");
event.setLine(1, "§dWarp name here!");
return;
} else
{
event.setLine(0, "§1[Warp]");
return;
}
if (event.getLine(2).equalsIgnoreCase("Free"))
event.setLine(2, "§2Free");
else
event.setLine(0, "§4[Warp]");
event.setLine(0, "§4[Warp]");
if (user.isAuthorized("essentials.signs.warp.create")) {
if (event.getLine(1).isEmpty()) {
event.setLine(1, "§dWarp name here!");
return;
} else {
Essentials.getWarps().getWarp(event.getLine(1));
if (event.getLine(2).equalsIgnoreCase("Free")) {
event.setLine(2, "§2Free");
}
event.setLine(0, "§1[Warp]");
}
}
return;
}
}

View File

@ -339,30 +339,29 @@ public class EssentialsPlayerListener extends PlayerListener
}
if (sign.getLine(0).equals("§1[Balance]") && user.isAuthorized("essentials.signs.balance.use"))
{
user.sendMessage("§7Balance: $" + user.getMoney());
user.sendMessage("§7Balance: $" + user.getMoney());
return;
}
if (sign.getLine(0).equals("§1[Warp]"))
{
if (!sign.getLine(2).isEmpty())
{
if (sign.getLine(2).equals("§2Free"))
{
user.teleportCooldown();
user.warpTo(sign.getLine(1));
return;
}
if (user.getGroup() == sign.getLine(2))
{
user.teleportCooldown();
user.warpTo(sign.getLine(1));
return;
}
}
if (user.isAuthorized("essentials.signs.warp.use"))
user.teleportCooldown();
user.warpTo(sign.getLine(1));
return;
if (!sign.getLine(2).isEmpty()) {
if (sign.getLine(2).equals("§2Free")) {
user.teleportCooldown();
user.warpTo(sign.getLine(1));
return;
}
if (user.getGroup().equalsIgnoreCase(sign.getLine(2))) {
user.teleportCooldown();
user.warpTo(sign.getLine(1));
return;
}
}
if (user.isAuthorized("essentials.signs.warp.use") &&
user.isAuthorized("essentials.warp." + sign.getLine(1))) {
user.teleportCooldown();
user.warpTo(sign.getLine(1));
}
return;
}
}
catch (Throwable ex)