Posted July 16, 201411 yr Hi guys. I ban player using next code: entityPlayerMP.playerNetServerHandler.kickPlayerFromServer("YOU ARE BANNED!"); I want to unban the player with his/her name and I found method: MinecraftServer.getServer().getConfigurationManager().allowUserToConnect(SocketAdress addr, GameProfile prf); but I think this method unban player with IP. Not the one I want.... Is there any method unban player with his/her name? or how can I use "allowUserToConnect" to unban player?
July 17, 201411 yr Author I found CommandPardonPlayer that contains next code: MinecraftServer minecraftserver = MinecraftServer.getServer(); GameProfile gameprofile = minecraftserver.getConfigurationManager().func_152608_h().func_152703_a(p_71515_2_[0]); if (gameprofile == null) { throw new CommandException("commands.unban.failed", new Object[] {p_71515_2_[0]}); } else { minecraftserver.getConfigurationManager().func_152608_h().func_152684_c(gameprofile); func_152373_a(p_71515_1_, this, "commands.unban.success", new Object[] {p_71515_2_[0]}); } and I think I can rewrite for my purpose : MinecraftServer minecraftserver = MinecraftServer.getServer(); GameProfile gameprofile = minecraftserver.getConfigurationManager().func_152608_h().func_152703_a(String playername); minecraftserver.getConfigurationManager().func_152608_h().func_152684_c(gameprofile); I think this will work, but I can't debug it because I have another problem with running server... Anyway, Thank you!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.