[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

@ -118,23 +118,20 @@ public class EssentialsBlockListener extends BlockListener
return;
}
if (event.getLine(0).equalsIgnoreCase("[Warp]"))
{
if (user.isAuthorized("essentials.signs.warp.create"))
if (event.getLine(1).isEmpty())
{
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
{
event.setLine(0, "§1[Warp]");
return;
}
if (event.getLine(2).equalsIgnoreCase("Free"))
} else {
Essentials.getWarps().getWarp(event.getLine(1));
if (event.getLine(2).equalsIgnoreCase("Free")) {
event.setLine(2, "§2Free");
else
event.setLine(0, "§4[Warp]");
}
event.setLine(0, "§1[Warp]");
}
}
return;
}
}

View File

@ -344,24 +344,23 @@ public class EssentialsPlayerListener extends PlayerListener
}
if (sign.getLine(0).equals("§1[Warp]"))
{
if (!sign.getLine(2).isEmpty())
{
if (sign.getLine(2).equals("§2Free"))
{
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))
{
if (user.getGroup().equalsIgnoreCase(sign.getLine(2))) {
user.teleportCooldown();
user.warpTo(sign.getLine(1));
return;
}
}
if (user.isAuthorized("essentials.signs.warp.use"))
if (user.isAuthorized("essentials.signs.warp.use") &&
user.isAuthorized("essentials.warp." + sign.getLine(1))) {
user.teleportCooldown();
user.warpTo(sign.getLine(1));
}
return;
}
}