mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-16 23:55:28 +01:00
Teleport check cleanup
This commit is contained in:
parent
e752538568
commit
518b013a63
@ -154,7 +154,7 @@ public interface ISettings extends IConf
|
||||
|
||||
boolean getRepairEnchanted();
|
||||
|
||||
boolean getIsWorldTeleportPermissions();
|
||||
boolean isWorldTeleportPermissions();
|
||||
|
||||
boolean registerBackInListener();
|
||||
|
||||
|
@ -678,7 +678,7 @@ public class Settings implements ISettings
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getIsWorldTeleportPermissions()
|
||||
public boolean isWorldTeleportPermissions()
|
||||
{
|
||||
return config.getBoolean("world-teleport-permissions", false);
|
||||
}
|
||||
|
@ -250,7 +250,7 @@ public class User extends UserData implements Comparable<User>, IReplyTo, IUser
|
||||
return teleportRequester;
|
||||
}
|
||||
|
||||
public boolean isTeleportRequestHere()
|
||||
public boolean isTpRequestHere()
|
||||
{
|
||||
return teleportRequestHere;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ public class Commandtp extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
||||
}
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + player.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName()));
|
||||
@ -49,7 +49,7 @@ public class Commandtp extends EssentialsCommand
|
||||
user.sendMessage(_("teleporting"));
|
||||
final User target = getPlayer(server, args, 0);
|
||||
final User toPlayer = getPlayer(server, args, 1);
|
||||
if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
|
||||
if (target.getWorld() != toPlayer.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + toPlayer.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + toPlayer.getWorld().getName()));
|
||||
|
@ -25,7 +25,7 @@ public class Commandtpa extends EssentialsCommand
|
||||
{
|
||||
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
||||
}
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + player.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName()));
|
||||
|
@ -19,16 +19,14 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
{
|
||||
|
||||
final User target = user.getTeleportRequest();
|
||||
if (target == null
|
||||
|| !target.isOnline()
|
||||
|| (user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpahere"))
|
||||
|| (!user.isTeleportRequestHere() && !target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
|
||||
)
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
|
||||
if (args.length > 0 && !target.getName().contains(args[0]))
|
||||
|
||||
if (target == null || !target.isOnline()
|
||||
|| (args.length > 0 && !target.getName().contains(args[0]))
|
||||
|| (user.isTpRequestHere() && !target.isAuthorized("essentials.tpahere"))
|
||||
|| (!user.isTpRequestHere() && ((!target.isAuthorized("essentials.tpa") && !target.isAuthorized("essentials.tpaall"))
|
||||
|| (user.getWorld() != target.getWorld()
|
||||
&& ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + target.getWorld().getName())))))
|
||||
{
|
||||
throw new Exception(_("noPendingRequest"));
|
||||
}
|
||||
@ -41,7 +39,7 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
}
|
||||
|
||||
final Trade charge = new Trade(this.getName(), ess);
|
||||
if (user.isTeleportRequestHere())
|
||||
if (user.isTpRequestHere())
|
||||
{
|
||||
charge.isAffordableFor(user);
|
||||
}
|
||||
@ -52,7 +50,7 @@ public class Commandtpaccept extends EssentialsCommand
|
||||
user.sendMessage(_("requestAccepted"));
|
||||
target.sendMessage(_("requestAcceptedFrom", user.getDisplayName()));
|
||||
|
||||
if (user.isTeleportRequestHere())
|
||||
if (user.isTpRequestHere())
|
||||
{
|
||||
user.getTeleport().teleport(target, charge, TeleportCause.COMMAND);
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class Commandtpo extends EssentialsCommand
|
||||
// Verify permission
|
||||
if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
|
||||
{
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
|
||||
if (user.getWorld() != player.getWorld() && ess.getSettings().isWorldTeleportPermissions()
|
||||
&& !user.isAuthorized("essentials.world." + player.getWorld().getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName()));
|
||||
|
@ -54,7 +54,7 @@ public class Commandworld extends EssentialsCommand
|
||||
}
|
||||
}
|
||||
|
||||
if (ess.getSettings().getIsWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + world.getName()))
|
||||
if (ess.getSettings().isWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + world.getName()))
|
||||
{
|
||||
throw new Exception(_("noPerm", "essentials.world." + world.getName()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user