Added configurable whitelist kick message option.

This commit is contained in:
t3hk0d3 2012-04-06 19:56:55 +04:00
parent 7902f42beb
commit 6a461c1f5c
3 changed files with 6 additions and 5 deletions

View File

@ -27,7 +27,6 @@ import org.bukkit.event.Listener;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.PluginManager;
import org.bukkit.util.config.ConfigurationNode;
import ru.tehkode.permissions.PermissionManager;
import ru.tehkode.permissions.bukkit.PermissionsEx;

View File

@ -18,8 +18,6 @@
*/
package ru.tehkode.modifyworld.bukkit;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.util.ArrayList;
import java.util.List;

View File

@ -80,9 +80,13 @@ public class PlayerListener extends ModifyworldListener {
}
PermissionUser user = this.permissionsManager.getUser(event.getName());
String worldName = Bukkit.getServer().getWorlds().get(0).getName();
if (user != null && !user.has("modifyworld.login", Bukkit.getServer().getWorlds().get(0).getName())) {
event.disallow(PlayerPreLoginEvent.Result.KICK_WHITELIST, whitelistKickMessage);
if (user != null && !user.has("modifyworld.login", worldName)) {
String whiteListMessage = user.getOption("kick-message", worldName, this.whitelistKickMessage);
event.disallow(PlayerPreLoginEvent.Result.KICK_WHITELIST, whiteListMessage);
Logger.getLogger("Minecraft").info("Player \"" + user.getName() + "\" were kicked by Modifyworld - lack of modifyworld.login permission");
}
}