mirror of
https://github.com/PEXPlugins/Modifyworld.git
synced 2024-11-16 10:35:32 +01:00
Added configurable whitelist kick message option.
This commit is contained in:
parent
7902f42beb
commit
6a461c1f5c
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user