package de.maniacraft.admincontrol; import org.bukkit.entity.Player; import org.bukkit.event.player.PlayerJoinEvent; import org.bukkit.event.player.PlayerListener; import com.nijiko.permissions.User; public class PlayerJoin extends PlayerListener { private ManiaCraftAdminControl plugin; public PlayerJoin(ManiaCraftAdminControl instance) { plugin = instance; } /*public PlayerJoin(ManiaCraftAdminControl ref) { plugin = ref; }*/ @Override public void onPlayerJoin(PlayerJoinEvent event) { Player player = event.getPlayer(); User user = plugin.perm.getUserObject(player.getWorld().getName(), player.getName()); String playerIP = event.getPlayer().getAddress().toString(); if (user == null) { try { user = plugin.perm.safeGetUser(player.getWorld().getName(), player.getName()); } catch (Exception e) { e.printStackTrace(); return; } } if (user.inGroup(player.getWorld().getName(), Config.getString(\"GuestGroup\"))) { if(plugin.DB.getList().contains(player.getName())) { plugin.sendOpMessage(\"&a\" + player.getName() + \"&2\" + Config.getString(\"Lang_CanAccept\")); } else { player.sendMessage(Config.getString(\"Lang_Welcome\")); } } //System.out.println(\"Playerjoin test \" + playerIP); if(playerIP.contains(\"127.0.0.1\")) { //System.out.println(\"ip passt!\"); player.sendMessage(Config.getString(\"Lang_Welcome_IPWarn\")); } } }