summaryrefslogtreecommitdiffstats
path: root/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
diff options
context:
space:
mode:
authorFearFree <fearfree@cubetown.net>2014-07-12 17:37:25 +0100
committerKHobbits <rob@khobbits.co.uk>2014-07-12 17:40:14 +0100
commit6d8d3a486f76921433067c77589ca09b598979fa (patch)
tree95b66e861679acebef74afe6afd1b5768c91c0af /Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
parent394ea6f172e211853a5cbf6fdb732fc84b1d4c04 (diff)
downloadEssentials-6d8d3a486f76921433067c77589ca09b598979fa.tar
Essentials-6d8d3a486f76921433067c77589ca09b598979fa.tar.gz
Essentials-6d8d3a486f76921433067c77589ca09b598979fa.tar.lz
Essentials-6d8d3a486f76921433067c77589ca09b598979fa.tar.xz
Essentials-6d8d3a486f76921433067c77589ca09b598979fa.zip
Update to new ban method.
Diffstat (limited to 'Essentials/src/com/earth2me/essentials/commands/Commandtempban.java')
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtempban.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
index 478c2c257..aeaf4dbd8 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtempban.java
@@ -5,8 +5,11 @@ import com.earth2me.essentials.Console;
import static com.earth2me.essentials.I18n.tl;
import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.DateUtil;
+import java.util.Date;
import java.util.GregorianCalendar;
import java.util.logging.Level;
+import org.bukkit.BanList;
+import org.bukkit.Bukkit;
import org.bukkit.Server;
@@ -61,9 +64,8 @@ public class Commandtempban extends EssentialsCommand
final String senderName = sender.isPlayer() ? sender.getPlayer().getDisplayName() : Console.NAME;
final String banReason = tl("tempBanned", DateUtil.formatDateDiff(banTimestamp), senderName, stringDregs);
- user.setBanReason(banReason);
- user.setBanTimeout(banTimestamp);
- user.getBase().setBanned(true);
+
+ Bukkit.getBanList(BanList.Type.NAME).addBan(user.getName(), banReason, new Date(banTimestamp), senderName);
user.getBase().kickPlayer(banReason);
final String message = tl("playerBanned", senderName, user.getName(), banReason, DateUtil.formatDateDiff(banTimestamp));