summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <schneeleo@gmail.com>2011-07-16 01:33:33 +0200
committersnowleo <schneeleo@gmail.com>2011-07-16 01:33:33 +0200
commit3c28dabfad99de93a4fa7251dc3f1c5f9ac13340 (patch)
treee80ab74f33b593bca8f1be13f57daddd98bfa24e
parenta38fe6acd4f5f6d7143c818653e9e02209f312db (diff)
parentf104c2e8f6bd471388f84e67009faeb0d6a779bf (diff)
downloadEssentials-3c28dabfad99de93a4fa7251dc3f1c5f9ac13340.tar
Essentials-3c28dabfad99de93a4fa7251dc3f1c5f9ac13340.tar.gz
Essentials-3c28dabfad99de93a4fa7251dc3f1c5f9ac13340.tar.lz
Essentials-3c28dabfad99de93a4fa7251dc3f1c5f9ac13340.tar.xz
Essentials-3c28dabfad99de93a4fa7251dc3f1c5f9ac13340.zip
Merge branch 'master' of https://github.com/essentials/Essentials
-rw-r--r--Essentials/src/com/earth2me/essentials/OfflinePlayer.java2
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandban.java34
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandkick.java16
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunban.java4
-rw-r--r--Essentials/src/messages.properties4
-rw-r--r--Essentials/src/messages_da.properties2
-rw-r--r--Essentials/src/messages_de.properties2
-rw-r--r--Essentials/src/messages_en.properties2
-rw-r--r--Essentials/src/messages_fr.properties2
-rw-r--r--Essentials/src/messages_nl.properties2
10 files changed, 38 insertions, 32 deletions
diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
index 32f45a377..2d3e49170 100644
--- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
+++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java
@@ -31,7 +31,7 @@ public class OfflinePlayer implements Player
private final String name;
final transient IEssentials ess;
private Location location = new Location(null, 0, 0, 0, 0, 0);
- private World world = null;
+ private World world = ess.getServer().getWorlds().get(0);
private UUID uniqueId = UUID.randomUUID();
public OfflinePlayer(String name, IEssentials ess)
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandban.java b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
index dd52ebd02..1499b10ac 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandban.java
@@ -20,28 +20,26 @@ public class Commandban extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
- if (server.matchPlayer(args[0]).isEmpty())
+ final User player = getPlayer(server, args, 0, true);
+ if (player.isAuthorized("essentials.ban.exempt"))
+ {
+ sender.sendMessage(Util.i18n("banExempt"));
+ return;
+ }
+
+ String banReason;
+ if (args.length > 1)
{
- ess.getBans().banByName(args[0]);
- server.broadcastMessage(Util.format("playerBanned", args[0], Util.i18n("defaultBanReason")));
+ banReason = getFinalArg(args, 1);
+ player.setBanReason(commandLabel);
}
else
{
- final User player = ess.getUser(server.matchPlayer(args[0]).get(0));
- String banReason;
- if (args.length > 1)
- {
- banReason = getFinalArg(args, 1);
- player.setBanReason(commandLabel);
- }
- else
- {
- banReason = Util.i18n("defaultBanReason");
- }
- player.kickPlayer(banReason);
- ess.getBans().banByName(args[0]);
- server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason));
+ banReason = Util.i18n("defaultBanReason");
}
+ player.kickPlayer(banReason);
+ ess.getBans().banByName(player.getName());
+ server.broadcastMessage(Util.format("playerBanned", player.getName(), banReason));
}
}
+
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
index 5d3ad4c49..ac3bcd5f6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandkick.java
@@ -12,7 +12,7 @@ public class Commandkick extends EssentialsCommand
{
super("kick");
}
-
+
@Override
public void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
{
@@ -20,18 +20,12 @@ public class Commandkick extends EssentialsCommand
{
throw new NotEnoughArgumentsException();
}
-
- User u;
- try
+
+ User u = getPlayer(server, args, 0);
+ if (u.isAuthorized("essentials.kick.exempt"))
{
- u = ess.getUser(server.matchPlayer(args[0]).get(0));
+ sender.sendMessage(Util.i18n("kickExempt"));
}
- catch (Throwable ex)
- {
- sender.sendMessage(Util.i18n("playerNotFound"));
- return;
- }
-
charge(sender);
final String kickReason = args.length > 1 ? getFinalArg(args, 1) : Util.i18n("kickDefault");
u.kickPlayer(kickReason);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
index 794988867..88e7f10ba 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@@ -20,7 +21,8 @@ public class Commandunban extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
- ess.getBans().unbanByName(args[0]);
+ User u = getPlayer(server, args, 0, true);
+ ess.getBans().unbanByName(u.getName());
sender.sendMessage(Util.i18n("unbannedPlayer"));
}
}
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index b619cf2ab..a968d4153 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -12,7 +12,8 @@ backUsageMsg = \u00a77Returning to previous location.
backupFinished = Backup finished
backupStarted = Backup started
balance = \u00a77Balance: {0}
-balanceTop = \u00a77 Top {0} balances
+balanceTop = \u00a77Top {0} balances
+banExempt = \u00a7cYou can not ban that player.
banIpAddress = \u00a77Banned IP address
bannedIpsFileError = Error reading banned-ips.txt
bannedIpsFileNotFound = banned-ips.txt not found
@@ -131,6 +132,7 @@ jailNotExist = That jail does not exist.
jailSet = \u00a77Jail {0} has been set
jumpError = That would hurt your computer''s brain.
kickDefault = Kicked from server
+kickExempt = \u00a7cYou can not kick that person.
kill = \u00a77Killed {0}.
kitError = \u00a7cThere are no valid kits.
kitError2 = \u00a7cThat kit does not exist or is improperly defined.
diff --git a/Essentials/src/messages_da.properties b/Essentials/src/messages_da.properties
index 4a1703d38..e471b7dd0 100644
--- a/Essentials/src/messages_da.properties
+++ b/Essentials/src/messages_da.properties
@@ -16,6 +16,7 @@ backupStarted = Backup startede
balance = \u00a77Balance: {0}
balanceTop = \u00a77 Top {0} saldi
banIpAddress = \u00a77Bannede IP addresse
+banExempt = \u00a7cDu kan ikke forbyde den p\u00e5g\u00e6ldende spiller.
bannedIpsFileError = Fejl i l\u00e6sning af banned-ips.txt
bannedIpsFileNotFound = banned-ips.txt ikke fundet
bannedPlayersFileError = Fejl i l\u00e6sning af banned-players.txt
@@ -133,6 +134,7 @@ jailNotExist = Det f\u00e6ngsel eksisterer ikke.
jailSet = \u00a77F\u00e6ngsel {0} er blevet sat
jumpError = Det ville skade din computer''s hjerne.
kickDefault = Kicket fra serveren
+kickExempt = \u00a77Du kan ikke sparke denne spiller.
kill = \u00a77Dr\u00e6bte {0}.
kitError = \u00a7cDer er ikke nogen gyldige pakker.
kitError2 = \u00a7cDen pakke eksisterer ikke eller er forkert defineret.
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index e3f5b181f..a01c0e211 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -14,6 +14,7 @@ backupStarted = Backup gestartet
balance = \u00a77Geldb\u00f6rse: {0}
balanceTop = \u00a77 Top {0} Guthaben
banIpAddress = \u00a77IP-Adresse gesperrt.
+banExempt = \u00a7cDu kan ikke forbyde den p\u00e5g\u00e6ldende spiller.
bannedIpsFileError = Fehler beim Lesen von banned-ips.txt
bannedIpsFileNotFound = banned-ips.txt nicht gefunden
bannedPlayersFileError = Fehler beim Lesen von banned-players.txt
@@ -131,6 +132,7 @@ jailNotExist = Dieses Gef\u00e4ngnis existiert nicht.
jailSet = \u00a77Gef\u00e4ngnis {0} wurde erstellt.
jumpError = Das w\u00fcrde deinen Computer \u00fcberlasten.
kickDefault = Vom Server geworfen
+kickExempt = \u00a7cSie k\u00f6nnen nicht kicken, dass Spieler.
kill = \u00a77{0} get\u00f6tet.
kitError = \u00a7cEs gibt keine g\u00fcltigen Ausr\u00fcstungen.
kitError2 = \u00a7cDiese Ausr\u00fcstung existiert nicht oder ist ung\u00fcltig.
diff --git a/Essentials/src/messages_en.properties b/Essentials/src/messages_en.properties
index b619cf2ab..7d838ed09 100644
--- a/Essentials/src/messages_en.properties
+++ b/Essentials/src/messages_en.properties
@@ -14,6 +14,7 @@ backupStarted = Backup started
balance = \u00a77Balance: {0}
balanceTop = \u00a77 Top {0} balances
banIpAddress = \u00a77Banned IP address
+banExempt = \u00a7cYou can not ban that player.
bannedIpsFileError = Error reading banned-ips.txt
bannedIpsFileNotFound = banned-ips.txt not found
bannedPlayersFileError = Error reading banned-players.txt
@@ -131,6 +132,7 @@ jailNotExist = That jail does not exist.
jailSet = \u00a77Jail {0} has been set
jumpError = That would hurt your computer''s brain.
kickDefault = Kicked from server
+kickExempt = \u00a7cYou can not kick that person.
kill = \u00a77Killed {0}.
kitError = \u00a7cThere are no valid kits.
kitError2 = \u00a7cThat kit does not exist or is improperly defined.
diff --git a/Essentials/src/messages_fr.properties b/Essentials/src/messages_fr.properties
index 0c00178a3..bbdd5888a 100644
--- a/Essentials/src/messages_fr.properties
+++ b/Essentials/src/messages_fr.properties
@@ -14,6 +14,7 @@ backupStarted = D\u00e9but du backup
balance = \u00a77Solde: {0}
balanceTop = \u00a77 Top {0} soldes
banIpAddress = \u00a77Adresse IP banni
+banExempt = \u00a77Vous ne pouvez pas interdire ce joueur.
bannedIpsFileError = Erreur de lecture de banned-ips.txt
bannedIpsFileNotFound = Fichier banned-ips.txt introuvable
bannedPlayersFileError = Erreur lors de la lecture de banned-players.txt
@@ -131,6 +132,7 @@ jailNotExist = Cette prison n''existe pas.
jailSet = \u00a77La prison {0} a \u00e9t\u00e9 cr\u00e9\u00e9.
jumpError = \u00c7a aurait pu faire mal au cerveau de votre ordinateur.
kickDefault = Kick\u00e9 du serveur
+kickExempt = \u00a77Vous ne pouvez pas lancer ce joueur.
kill = \u00a77Tu\u00e9 {0}.
kitError = \u00a7cIl n''y a pas de kits valides.
kitError2 = \u00a7cCe kit n''existe pas ou a \u00e9t\u00e9 mal d\u00e9fini.
diff --git a/Essentials/src/messages_nl.properties b/Essentials/src/messages_nl.properties
index 00a0ed1ef..5ce098bdf 100644
--- a/Essentials/src/messages_nl.properties
+++ b/Essentials/src/messages_nl.properties
@@ -15,6 +15,7 @@ backupStarted = Backup wordt nu gemaakt
balance = \u00a77Saldo: {0}
balanceTop = \u00a77 Top {0} saldi
banIpAddress = \u00a77Verboden IP-adres
+banExempt = \u00a77Je kunt niet verbieden die speler.
bannedIpsFileError = Fout bij het lezen van banned-ips.txt
bannedIpsFileNotFound = banned-ips.txt werd niet gevonden
bannedPlayersFileError = Fout bij het lezen van banned-players.txt
@@ -132,6 +133,7 @@ jailNotExist = Die gevangenis bestaat niet.
jailSet = \u00a77Gevangenis {0} is ingesteld
jumpError = Dat zou je computers hersenen beschadigen.
kickDefault = Gekicked van de server
+kickExempt = \u00a77Je kunt niet schoppen die speler.
kill = \u00a77Jij doodde {0}.
kitError = \u00a7cEr zijn geen geldige kits.
kitError2 = \u00a7cDie kit bestaat niet of is verkeerde beschreven.