diff options
author | ementalo <suror@gmx.co.uk> | 2012-01-04 11:57:00 +0000 |
---|---|---|
committer | ementalo <suror@gmx.co.uk> | 2012-01-04 11:57:00 +0000 |
commit | bbcf2ecce3b5360146b98e3cbc52d71a93dbbb88 (patch) | |
tree | 82014c969b0d1803ca53095702ee74e31de2d1a3 | |
parent | 86ea654a5d03b71cb0bfc1166cf4072b4e32083e (diff) | |
download | Essentials-bbcf2ecce3b5360146b98e3cbc52d71a93dbbb88.tar Essentials-bbcf2ecce3b5360146b98e3cbc52d71a93dbbb88.tar.gz Essentials-bbcf2ecce3b5360146b98e3cbc52d71a93dbbb88.tar.lz Essentials-bbcf2ecce3b5360146b98e3cbc52d71a93dbbb88.tar.xz Essentials-bbcf2ecce3b5360146b98e3cbc52d71a93dbbb88.zip |
Fix a few things for 3.0
Test #843 - new config option added cancelTpRequestsOnWorldChange
Test # 1255 - essentials.nogod.override permission added
Test #1311 - added ban reason in /seen
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Jails.java | 2 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/commands/Commandnick.java | 8 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java | 21 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/settings/commands/Tpa.java | 2 | ||||
-rw-r--r-- | Essentials/src/config.yml | 7 | ||||
-rw-r--r-- | Essentials/src/messages.properties | 8 | ||||
-rw-r--r-- | Essentials/src/messages_da.properties | 7 | ||||
-rw-r--r-- | Essentials/src/messages_de.properties | 9 | ||||
-rw-r--r-- | Essentials/src/messages_es.properties | 6 | ||||
-rw-r--r-- | Essentials/src/messages_fr.properties | 7 | ||||
-rw-r--r-- | Essentials/src/messages_nl.properties | 7 |
11 files changed, 58 insertions, 26 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Jails.java b/Essentials/src/com/earth2me/essentials/Jails.java index 26c1f49a8..8fc504b5c 100644 --- a/Essentials/src/com/earth2me/essentials/Jails.java +++ b/Essentials/src/com/earth2me/essentials/Jails.java @@ -120,7 +120,7 @@ public class Jails extends AsyncStorageObjectHolder<com.earth2me.essentials.sett acquireReadLock(); try { - if (!(user.getBase() instanceof OfflinePlayer)) + if (!(user.isOnline())) { Location loc = getJail(jail); user.getTeleport().now(loc, false, TeleportCause.COMMAND); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java index 58daba11e..1461fc634 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandnick.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandnick.java @@ -95,8 +95,8 @@ public class Commandnick extends EssentialsCommand } else if ("off".equalsIgnoreCase(nick) || target.getName().equalsIgnoreCase(nick)) { - target.setNickname(null); - target.setDisplayNick(); + target.getData().setNickname(null); + target.updateDisplayName(); target.sendMessage(_("nickNoMore")); } else @@ -116,8 +116,8 @@ public class Commandnick extends EssentialsCommand } } - target.setNickname(nick); - target.setDisplayNick(); + target.getData().setNickname(nick); + target.updateDisplayName(); target.sendMessage(_("nickSet", target.getDisplayName() + "ยง7.")); } } diff --git a/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java b/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java index 671875b2f..a71273044 100644 --- a/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java +++ b/Essentials/src/com/earth2me/essentials/listener/EssentialsPlayerListener.java @@ -268,8 +268,7 @@ public class EssentialsPlayerListener extends PlayerListener @Override public void onPlayerBucketEmpty(final PlayerBucketEmptyEvent event) { - @Cleanup - final IUser user = ess.getUser(event.getPlayer()); + @Cleanup final IUser user = ess.getUser(event.getPlayer()); user.acquireReadLock(); if (user.getData().hasUnlimited(event.getBucket())) { @@ -364,19 +363,25 @@ public class EssentialsPlayerListener extends PlayerListener @Override public void onPlayerChangedWorld(final PlayerChangedWorldEvent event) { - @Cleanup - final ISettings settings = ess.getSettings(); + @Cleanup final ISettings settings = ess.getSettings(); settings.acquireReadLock(); - if (!settings.getData().getWorldOptions(event.getPlayer().getLocation().getWorld().getName()).isGodmode()) + @Cleanup final IUser user = ess.getUser(event.getPlayer()); + user.acquireReadLock(); + if (!settings.getData().getWorldOptions(event.getPlayer().getLocation().getWorld().getName()).isGodmode() && !user.isAuthorized("essentials.nogod.override")) { - @Cleanup - final IUser user = ess.getUser(event.getPlayer()); - user.acquireReadLock(); if (user.getData().isGodmode()) { user.sendMessage(_("noGodWorldWarning")); } } + if (settings.getData().getCommands().getTpa().isCancelTpRequestsOnWorldChange()) + { + if (user.getTeleportRequester() != null) + { + user.requestTeleport(null, false); + user.sendMessage(_("teleportRequestsCancelledWorldChange")); + } + } } @Override diff --git a/Essentials/src/com/earth2me/essentials/settings/commands/Tpa.java b/Essentials/src/com/earth2me/essentials/settings/commands/Tpa.java index 83c9d4990..88cbc9a6b 100644 --- a/Essentials/src/com/earth2me/essentials/settings/commands/Tpa.java +++ b/Essentials/src/com/earth2me/essentials/settings/commands/Tpa.java @@ -16,4 +16,6 @@ public class Tpa implements StorageObject "Set to 0 for no timeout." }) private int timeout = 0; + @Comment({"Cancels a request made by tpa / tphere on world change to prevent cross world tp"}) + private boolean cancelTpRequestsOnWorldChange = false; } diff --git a/Essentials/src/config.yml b/Essentials/src/config.yml index 2254bdbab..d09a0f6c0 100644 --- a/Essentials/src/config.yml +++ b/Essentials/src/config.yml @@ -247,6 +247,13 @@ repair-enchanted: true #If you set this to true any plugin that uses teleport will have the previous location registered. register-back-in-listener: false +#Set timeout in seconds for players to accept tpa before request is cancelled. +#Set to 0 for no timeout +tpa-accept-cancellation: 0 + +#Cancels a request made by tpa / tpc on world change to prevent cross world tp +cancel-tp-requests-on-world-change: false + ############################################################ # +------------------------------------------------------+ # # | EssentialsHome | # diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 5b662faca..822cccc40 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -291,10 +291,12 @@ requestAcceptedFrom=\u00a77{0} accepted your teleport request. requestDenied=\u00a77Teleport request denied. requestDeniedFrom=\u00a77{0} denied your teleport request. requestSent=\u00a77Request sent to {0}\u00a77. +requestTimedOut=\u00a7cTeleport request has timed out requiredBukkit= * ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org. returnPlayerToJailError=Error occurred when trying to return player to jail. second=second seconds=seconds +seenBanReason=Reason: {0} seenOffline=Player {0} is offline since {1} seenOnline=Player {0} is online since {1} serverFull=Server is full @@ -322,6 +324,8 @@ teleportDisabled={0} has teleportation disabled. teleportHereRequest=\u00a7c{0}\u00a7c has requested that you teleport to them. teleportNewPlayerError=Failed to teleport new player teleportRequest=\u00a7c{0}\u00a7c has requested to teleport to you. +teleportRequestsCancelledWorldChange=\u00a77Pending teleport requests have been cancelled on world change. +teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporting to top. teleportationCommencing=\u00a77Teleportation commencing... teleportationDisabled=\u00a77Teleportation disabled. @@ -402,5 +406,5 @@ year=year years=years youAreHealed=\u00a77You have been healed. youHaveNewMail=\u00a7cYou have {0} messages!\u00a7f Type \u00a77/mail read\u00a7f to view your mail. -requestTimedOut=\u00a7cTeleport request has timed out -teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. + + diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties index a25d66e0e..eedb3c670 100644 --- a/Essentials/src/messages_da.properties +++ b/Essentials/src/messages_da.properties @@ -291,10 +291,12 @@ requestAcceptedFrom=\u00a77{0} accepterede din anmodning om teleport. requestDenied=\u00a77Anmodning om teleport afvist. requestDeniedFrom=\u00a77{0} afviste din anmodning om teleport. requestSent=\u00a77Anmodning sendt til {0}\u00a77. +requestTimedOut=\u00a7cTeleport request has timed out requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org. returnPlayerToJailError=En fejl opstod ved fors\u00f8g p\u00e5 at returnere spilleren til f\u00e6ngsel. second=sekund seconds=sekunder +seenBanReason=Reason: {0} seenOffline=Spilleren {0} har v\u00c3\u00a6ret offline i {1} seenOnline=Spilleren {0} har v\u00c3\u00a6ret online i {1} serverFull=Serveren er sgu fuld. Den b\u00c3\u00b8r melde sig til AA. @@ -322,6 +324,8 @@ teleportDisabled={0} har ikke teleportation aktiveret. teleportHereRequest=\u00a7c{0}\u00a7c har anmodet om, at du teleporterer dig til ham/hende. teleportNewPlayerError=Fejlede ved teleportering af ny spiller teleportRequest=\u00a7c{0}\u00a7c har anmodet om at teleportere til dig. +teleportRequestsCancelledWorldChange=\u00a77Pending teleport requests have been cancelled on world change. +teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleporterer til toppen. teleportationCommencing=\u00a77Teleport begynder... teleportationDisabled=\u00a77Teleport deaktiveret. @@ -402,5 +406,4 @@ year=\u00e5r years=\u00e5r youAreHealed=\u00a77Du er blevet healed. Halleluja! youHaveNewMail=\u00a7cDu har {0} flaskeposter!\u00a7f Type \u00a77/mail read for at se din flaskepost. -requestTimedOut=\u00a7cTeleport request has timed out -teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. + diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties index 10972eaea..976ce8436 100644 --- a/Essentials/src/messages_de.properties +++ b/Essentials/src/messages_de.properties @@ -159,7 +159,7 @@ kitError2=\u00a7cDiese Ausr\u00fcstung existiert nicht oder ist ung\u00fcltig. kitError=\u00a7cEs gibt keine g\u00fcltigen Ausr\u00fcstungen. kitErrorHelp=\u00a7cEventuell fehlt bei einem Gegenstand die Menge? kitGive=\u00a77Gebe Ausr\u00fcstung {0}. -InvFull=\u00a7cYour inventory was full, dropping items on the floor +kitInvFull=\u00a7cDein Inventar ist voll, lege Ausr\u00fcstung auf den Boden kitTimed=\u00a7cDu kannst diese Ausr\u00fcstung nicht innerhalb von {0} anfordern. kits=\u00a77Ausr\u00fcstungen: {0} lightningSmited=\u00a77Du wurdest gepeinigt. @@ -291,10 +291,12 @@ requestAcceptedFrom=\u00a77{0} hat deine Teleportierungsanfrage angenommen. requestDenied=\u00a77Teleportierungsanfrage verweigert. requestDeniedFrom=\u00a77{0} hat deine Teleportierungsanfrage abgelehnt. requestSent=\u00a77Anfrage gesendet an {0}\u00a77. +requestTimedOut=\u00a7cTeleport request has timed out requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org. returnPlayerToJailError=Fehler beim Versuch, den Spieler ins Gef\u00e4ngnis zu teleportieren. second=Sekunde seconds=Sekunden +seenBanReason=Reason: {0} seenOffline=Spieler {0} ist offline seit {1} seenOnline=Spieler {0} ist online seit {1} serverFull=Server ist voll @@ -322,6 +324,8 @@ teleportDisabled={0} verweigert die Teleportierung. teleportHereRequest=\u00a7c{0}\u00a7c fragt, ob du dich zu ihm teleportierst. teleportNewPlayerError=Fehler beim Teleportieren eines neuen Spielers teleportRequest=\u00a7c{0}\u00a7c fragt, ob er sich zu dir teleportieren darf. +teleportRequestsCancelledWorldChange=\u00a77Pending teleport requests have been cancelled on world change. +teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teleportiere nach oben. teleportationCommencing=\u00a77Teleportierung gestartet... teleportationDisabled=\u00a77Teleportierung deaktiviert. @@ -402,5 +406,4 @@ year=Jahr years=Jahre youAreHealed=\u00a77Du wurdest geheilt. youHaveNewMail=\u00a7cDu hast {0} Nachrichten!\u00a7f Schreibe \u00a77/mail read\u00a7f um deine Nachrichten anzuzeigen. -requestTimedOut=\u00a7cTeleport request has timed out -teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. + diff --git a/Essentials/src/messages_es.properties b/Essentials/src/messages_es.properties index 6275d8c4f..ca9c3c1e9 100644 --- a/Essentials/src/messages_es.properties +++ b/Essentials/src/messages_es.properties @@ -291,10 +291,12 @@ requestAcceptedFrom=\u00a77{0} acepto tu peticion de teletransporte. requestDenied=\u00a77Peticion de teletransporte denegada. requestDeniedFrom=\u00a77{0} ha denegado tu peticion de teletransporte. requestSent=\u00a77Peticion enviada a {0}\u00a77. +requestTimedOut=\u00a7cTeleport request has timed out requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org. returnPlayerToJailError=Error al intentar quitar al jugador de la carcel. second=segundo seconds=segundos +seenBanReason=Reason: {0} seenOffline=El jugador {0} esta desconectado desde {1} seenOnline=El jugador {0} lleva conectado desde {1} serverFull=Servidor lleno @@ -322,6 +324,8 @@ teleportDisabled={0} tiene desactivado los teletransportes. teleportHereRequest=\u00a7c{0}\u00a7c ha pedido que te teletransportes con el. teleportNewPlayerError=Error al teletransportar al nuevo jugador teleportRequest=\u00a7c{0}\u00a7c te ha pedido teletransportarse contigo. +teleportRequestsCancelledWorldChange=\u00a77Pending teleport requests have been cancelled on world change. +teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Teletransportandote a la cima. teleportationCommencing=\u00a77Comenzando teletransporte... teleportationDisabled=\u00a77Teletransporte desactivado. @@ -402,5 +406,3 @@ year=año years=años youAreHealed=\u00a77Has sido curado. youHaveNewMail=\u00a7cTienes {0} mensajes!\u00a7f Pon \u00a77/mail read\u00a7f para ver tus emails no leidos!. -requestTimedOut=\u00a7cTeleport request has timed out -teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties index 5a0a6b26e..39bd578da 100644 --- a/Essentials/src/messages_fr.properties +++ b/Essentials/src/messages_fr.properties @@ -291,10 +291,12 @@ requestAcceptedFrom=\u00a77{0} a accept\u00e9 votre demande de t\u00e9l\u00e9por requestDenied=\u00a77Demande de t\u00e9l\u00e9portation refus\u00e9e. requestDeniedFrom=\u00a77{0} a refus\u00e9 votre demande de t\u00e9l\u00e9portation. requestSent=\u00a77Requ\u00eate envoy\u00e9e \u00e0 {0}\u00a77. +requestTimedOut=\u00a7cTeleport request has timed out requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org. returnPlayerToJailError=Erreur survenue lors de la tentative d''emprisonner de nouveau un joueur. second=seconde seconds=secondes +seenBanReason=Reason: {0} seenOffline=Le joueur {0} est hors ligne depuis {1} seenOnline=Le joueur {0} est en ligne depuis {1} serverFull=Le serveur est plein. @@ -322,6 +324,8 @@ teleportDisabled={0} a la t\u00e9l\u00e9portation d\u00e9sactiv\u00e9. teleportHereRequest=\u00a7c{0}\u00a7c Vous a demand\u00e9 de vous t\u00e9l\u00e9porter \u00e0 lui/elle. teleportNewPlayerError=\u00c9chec de la t\u00e9l\u00e9portation du nouveau joueur. teleportRequest=\u00a7c{0}\u00a7c vous demande s''il peut se t\u00e9l\u00e9porter vers vous. +teleportRequestsCancelledWorldChange=\u00a77Pending teleport requests have been cancelled on world change. +teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77T\u00e9l\u00e9portation vers le haut. teleportationCommencing=\u00a77D\u00e9but de la t\u00e9l\u00e9portation... teleportationDisabled=\u00a77T\u00e9l\u00e9poration d\u00e9sactiv\u00e9. @@ -402,5 +406,4 @@ year=ann\u00e9e years=ann\u00e9es youAreHealed=\u00a77Vous avez \u00e9t\u00e9 soign\u00e9. youHaveNewMail=\u00a7cVous avez {0} messages ! \u00a7fEntrez \u00a77/mail read\u00a7f pour voir votre courrier. -requestTimedOut=\u00a7cTeleport request has timed out -teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. + diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties index daa6e3cca..19dd347d1 100644 --- a/Essentials/src/messages_nl.properties +++ b/Essentials/src/messages_nl.properties @@ -291,10 +291,12 @@ requestAcceptedFrom=\u00a77{0} accepted your teleport request. requestDenied=\u00a77Teleporteer aanvraag geweigerd. requestDeniedFrom=\u00a77{0} denied your teleport request. requestSent=\u00a77Aanvraag verstuurd naar {0}\u00a77. +requestTimedOut=\u00a7cTeleport request has timed out requiredBukkit=* ! * You need atleast build {0} of CraftBukkit, download it from http://ci.bukkit.org. returnPlayerToJailError=Fout opgetreden bij terugzetten van speler in gevangenis. second=seconde seconds=seconde +seenBanReason=Reason: {0} seenOffline=Speler {0} is offline vanaf {1} seenOnline=Speler {0} is online vanaf {1} serverFull=Server is vol @@ -322,6 +324,8 @@ teleportDisabled={0} heeft teleporteren uit gezet. teleportHereRequest=\u00a7c{0}\u00a7c Heeft gevraagd of hij/zij naar jou mag teleporteren. teleportNewPlayerError=Fout bij het teleporteren van nieuwe speler. teleportRequest=\u00a7c{0}\u00a7c vraagt of hij jou kan teleporteren. +teleportRequestsCancelledWorldChange=\u00a77Pending teleport requests have been cancelled on world change. +teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. teleportTop=\u00a77Bezig met teleporteren naar de top. teleportationCommencing=\u00a77Aan het beginnen met teleporteren... teleportationDisabled=\u00a77Teleportatie uitgeschakeld. @@ -402,5 +406,4 @@ year=jaar years=jaren youAreHealed=\u00a77Je bent genezen. youHaveNewMail=\u00a7cJe hebt {0} berichten!\u00a7f Type \u00a77/mail read\u00a7f om je berichten te bekijken. -requestTimedOut=\u00a7cTeleport request has timed out -teleportRequestTimeoutInfo=\u00a77This request will timeout after {0} seconds. + |