mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-26 02:58:03 +01:00
New permission: essentials.tp.others - Allows players to /tp <p1> <p2> replaces old reused permission.
New permission usage: if world-teleport-permissions is true in the config, TP commands will now check for essentials.world.<worldname> when a tp would switch worlds.
This commit is contained in:
parent
e4ce814c2f
commit
762105d692
@ -30,6 +30,11 @@ public class Commandtp extends EssentialsCommand
|
|||||||
{
|
{
|
||||||
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
throw new Exception(_("teleportDisabled", player.getDisplayName()));
|
||||||
}
|
}
|
||||||
|
if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
|
||||||
|
&& !user.isAuthorized("essentials.world." + player.getWorld().getName()))
|
||||||
|
{
|
||||||
|
throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName()));
|
||||||
|
}
|
||||||
user.sendMessage(_("teleporting"));
|
user.sendMessage(_("teleporting"));
|
||||||
final Trade charge = new Trade(this.getName(), ess);
|
final Trade charge = new Trade(this.getName(), ess);
|
||||||
charge.isAffordableFor(user);
|
charge.isAffordableFor(user);
|
||||||
@ -37,9 +42,9 @@ public class Commandtp extends EssentialsCommand
|
|||||||
throw new NoChargeException();
|
throw new NoChargeException();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (!user.isAuthorized("essentials.tpohere"))
|
if (!user.isAuthorized("essentials.tp.others"))
|
||||||
{
|
{
|
||||||
throw new Exception(_("needTpohere"));
|
throw new Exception(_("noPerm", "essentials.tp.others"));
|
||||||
}
|
}
|
||||||
user.sendMessage(_("teleporting"));
|
user.sendMessage(_("teleporting"));
|
||||||
final User target = getPlayer(server, args, 0);
|
final User target = getPlayer(server, args, 0);
|
||||||
|
@ -36,6 +36,11 @@ public class Commandtpa extends EssentialsCommand
|
|||||||
player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
|
player.sendMessage(_("teleportRequestTimeoutInfo", ess.getSettings().getTpaAcceptCancellation()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
|
||||||
|
&& !user.isAuthorized("essentials.world." + player.getWorld().getName()))
|
||||||
|
{
|
||||||
|
throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName()));
|
||||||
|
}
|
||||||
user.sendMessage(_("requestSent", player.getDisplayName()));
|
user.sendMessage(_("requestSent", player.getDisplayName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,11 @@ public class Commandtpo extends EssentialsCommand
|
|||||||
// Verify permission
|
// Verify permission
|
||||||
if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
|
if (!player.isHidden() || user.isAuthorized("essentials.teleport.hidden"))
|
||||||
{
|
{
|
||||||
|
if (user.getWorld() != player.getWorld() && ess.getSettings().getIsWorldTeleportPermissions()
|
||||||
|
&& !user.isAuthorized("essentials.world." + player.getWorld().getName()))
|
||||||
|
{
|
||||||
|
throw new Exception(_("noPerm", "essentials.world." + player.getWorld().getName()));
|
||||||
|
}
|
||||||
user.getTeleport().now(player, false, TeleportCause.COMMAND);
|
user.getTeleport().now(player, false, TeleportCause.COMMAND);
|
||||||
user.sendMessage(_("teleporting"));
|
user.sendMessage(_("teleporting"));
|
||||||
}
|
}
|
||||||
|
@ -54,13 +54,9 @@ public class Commandworld extends EssentialsCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ess.getSettings().getIsWorldTeleportPermissions())
|
if (ess.getSettings().getIsWorldTeleportPermissions() && !user.isAuthorized("essentials.world." + world.getName()))
|
||||||
{
|
{
|
||||||
if (!user.isAuthorized("essentials.world." + world.getName()))
|
throw new Exception(_("noPerm", "essentials.world." + world.getName()));
|
||||||
{
|
|
||||||
user.sendMessage(_("invalidWorld")); //TODO: Make a "world teleport denied" translation
|
|
||||||
throw new NoChargeException();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double factor;
|
double factor;
|
||||||
|
@ -250,7 +250,7 @@ death-messages: true
|
|||||||
no-god-in-worlds:
|
no-god-in-worlds:
|
||||||
# - world_nether
|
# - world_nether
|
||||||
|
|
||||||
# Set to true to enable per-world permissions for teleporting with /world
|
# Set to true to enable per-world permissions for teleporting with /world, /tp ,/tpa and /tpo.
|
||||||
# Give someone permission to teleport to a world with essentials.world.<worldname>
|
# Give someone permission to teleport to a world with essentials.world.<worldname>
|
||||||
world-teleport-permissions: false
|
world-teleport-permissions: false
|
||||||
|
|
||||||
|
@ -205,7 +205,6 @@ mutedPlayer=Player {0} muted.
|
|||||||
mutedPlayerFor=Player {0} muted for {1}.
|
mutedPlayerFor=Player {0} muted for {1}.
|
||||||
mutedUserSpeaks={0} tried to speak, but is muted.
|
mutedUserSpeaks={0} tried to speak, but is muted.
|
||||||
nearbyPlayers=Players nearby: {0}
|
nearbyPlayers=Players nearby: {0}
|
||||||
needTpohere=You need access to /tpohere to teleport other players.
|
|
||||||
negativeBalanceError=User is not allowed to have a negative balance.
|
negativeBalanceError=User is not allowed to have a negative balance.
|
||||||
nickChanged=Nickname changed.
|
nickChanged=Nickname changed.
|
||||||
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
|
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
|
||||||
|
@ -205,7 +205,6 @@ mutedPlayer=Spiller {0} muted.
|
|||||||
mutedPlayerFor=Spiller {0} muted i {1}.
|
mutedPlayerFor=Spiller {0} muted i {1}.
|
||||||
mutedUserSpeaks={0} pr\u00f8vede at snakke, men er muted.
|
mutedUserSpeaks={0} pr\u00f8vede at snakke, men er muted.
|
||||||
nearbyPlayers=Spillere i n\u00c3\u00a6rheden: {0}
|
nearbyPlayers=Spillere i n\u00c3\u00a6rheden: {0}
|
||||||
needTpohere=Du skal have adgang til /tpohere for at teleportere andre spillere.
|
|
||||||
negativeBalanceError=Brugeren har ikke tilladelse til at have en negativ saldo.
|
negativeBalanceError=Brugeren har ikke tilladelse til at have en negativ saldo.
|
||||||
nickChanged=Nickname \u00e6ndret.
|
nickChanged=Nickname \u00e6ndret.
|
||||||
nickDisplayName=\u00a77Du bliver n\u00c3\u00b8dt til at aktivere change-displayname i Essentials config.
|
nickDisplayName=\u00a77Du bliver n\u00c3\u00b8dt til at aktivere change-displayname i Essentials config.
|
||||||
|
@ -205,7 +205,6 @@ mutedPlayer=Player {0} ist nun stumm.
|
|||||||
mutedPlayerFor=Player {0} ist nun stumm f\u00fcr {1}.
|
mutedPlayerFor=Player {0} ist nun stumm f\u00fcr {1}.
|
||||||
mutedUserSpeaks={0} versuchte zu sprechen, aber ist stumm geschaltet.
|
mutedUserSpeaks={0} versuchte zu sprechen, aber ist stumm geschaltet.
|
||||||
nearbyPlayers=Players nearby: {0}
|
nearbyPlayers=Players nearby: {0}
|
||||||
needTpohere=Du brauchst Zugriff auf /tpohere um andere Spieler teleportieren zu k\u00f6nnen.
|
|
||||||
negativeBalanceError=Spieler darf keine Schulden machen.
|
negativeBalanceError=Spieler darf keine Schulden machen.
|
||||||
nickChanged=Nickname ge\u00e4ndert.
|
nickChanged=Nickname ge\u00e4ndert.
|
||||||
nickDisplayName=\u00a77Du musst \u00a7fchange-displayname\u00a7c in der Essentials-Config aktivieren.
|
nickDisplayName=\u00a77Du musst \u00a7fchange-displayname\u00a7c in der Essentials-Config aktivieren.
|
||||||
|
@ -205,7 +205,6 @@ mutedPlayer=Player {0} muted.
|
|||||||
mutedPlayerFor=Player {0} muted for {1}.
|
mutedPlayerFor=Player {0} muted for {1}.
|
||||||
mutedUserSpeaks={0} tried to speak, but is muted.
|
mutedUserSpeaks={0} tried to speak, but is muted.
|
||||||
nearbyPlayers=Players nearby: {0}
|
nearbyPlayers=Players nearby: {0}
|
||||||
needTpohere=You need access to /tpohere to teleport other players.
|
|
||||||
negativeBalanceError=User is not allowed to have a negative balance.
|
negativeBalanceError=User is not allowed to have a negative balance.
|
||||||
nickChanged=Nickname changed.
|
nickChanged=Nickname changed.
|
||||||
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
|
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
|
||||||
|
@ -205,7 +205,6 @@ mutedPlayer=Player {0} silenciado.
|
|||||||
mutedPlayerFor=Player {0} silenciado durante {1}.
|
mutedPlayerFor=Player {0} silenciado durante {1}.
|
||||||
mutedUserSpeaks={0} intento hablar, pero esta silenciado.
|
mutedUserSpeaks={0} intento hablar, pero esta silenciado.
|
||||||
nearbyPlayers=Players nearby: {0}
|
nearbyPlayers=Players nearby: {0}
|
||||||
needTpohere=Necesitas acceso a /tpohere para teletransportar a otros jugadores.
|
|
||||||
negativeBalanceError=El usuario no tiene permitido tener un saldo negativo.
|
negativeBalanceError=El usuario no tiene permitido tener un saldo negativo.
|
||||||
nickChanged=Nombre de jugador cambiado.
|
nickChanged=Nombre de jugador cambiado.
|
||||||
nickDisplayName=\u00a77Tienes que habilitar cambio de nombre de usuario en la configuracion de Essentials.
|
nickDisplayName=\u00a77Tienes que habilitar cambio de nombre de usuario en la configuracion de Essentials.
|
||||||
|
@ -205,7 +205,6 @@ mutedPlayer=Le joueur {0} est d\u00e9sormais muet.
|
|||||||
mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}.
|
mutedPlayerFor={0} a \u00e9t\u00e9 muet pour {1}.
|
||||||
mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet.
|
mutedUserSpeaks={0} a essay\u00e9 de parler mais est muet.
|
||||||
nearbyPlayers=Joueurs dans les environs : {0}
|
nearbyPlayers=Joueurs dans les environs : {0}
|
||||||
needTpohere=Vous avez besoin de l'acc\u00c3\u00a8s \u00e0 /tpohere pour t\u00e9l\u00e9porter d'autres joueurs.
|
|
||||||
negativeBalanceError=L'utilisateur n'est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif.
|
negativeBalanceError=L'utilisateur n'est pas autoris\u00e9 \u00e0 avoir un solde n\u00e9gatif.
|
||||||
nickChanged=surnom modifi\u00e9.
|
nickChanged=surnom modifi\u00e9.
|
||||||
nickDisplayName=\u00a77Vous devez activer change-displayname dans la configuration Essentials.
|
nickDisplayName=\u00a77Vous devez activer change-displayname dans la configuration Essentials.
|
||||||
|
@ -205,7 +205,6 @@ mutedPlayer=Speler {0} gemute.
|
|||||||
mutedPlayerFor=Speler {0} is gemute voor {1}.
|
mutedPlayerFor=Speler {0} is gemute voor {1}.
|
||||||
mutedUserSpeaks={0} probeerde te praten, maar is gemute.
|
mutedUserSpeaks={0} probeerde te praten, maar is gemute.
|
||||||
nearbyPlayers=Players nearby: {0}
|
nearbyPlayers=Players nearby: {0}
|
||||||
needTpohere=Je moet toegang krijgen tot /tpohere om naar andere spelers te teleporteren.
|
|
||||||
negativeBalanceError=Speler is niet toegestaan om een negatief saldo te hebben.
|
negativeBalanceError=Speler is niet toegestaan om een negatief saldo te hebben.
|
||||||
nickChanged=Nickname veranderd.
|
nickChanged=Nickname veranderd.
|
||||||
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
|
nickDisplayName=\u00a77You have to enable change-displayname in Essentials config.
|
||||||
|
Loading…
Reference in New Issue
Block a user