mirror of
https://github.com/plexusorg/Plex.git
synced 2025-06-28 22:46:40 +00:00
Cache whether the server is on a proxy or not
Fix kick where ban message was displayed instead of kick message
This commit is contained in:
@ -39,14 +39,14 @@ public class BanCMD extends PlexCommand
|
||||
return usage();
|
||||
}
|
||||
|
||||
UUID targetUUID = WebUtils.getFromName(args[0]);
|
||||
final PlexPlayer plexPlayer = DataUtils.getPlayer(args[0]);
|
||||
|
||||
if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID))
|
||||
if (plexPlayer == null)
|
||||
{
|
||||
throw new PlayerNotFoundException();
|
||||
}
|
||||
PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID);
|
||||
Player player = Bukkit.getPlayer(targetUUID);
|
||||
|
||||
Player player = Bukkit.getPlayer(plexPlayer.getUuid());
|
||||
|
||||
if (plugin.getSystem().equalsIgnoreCase("ranks"))
|
||||
{
|
||||
@ -64,7 +64,7 @@ public class BanCMD extends PlexCommand
|
||||
}
|
||||
}
|
||||
|
||||
plugin.getPunishmentManager().isAsyncBanned(targetUUID).whenComplete((aBoolean, throwable) ->
|
||||
plugin.getPunishmentManager().isAsyncBanned(plexPlayer.getUuid()).whenComplete((aBoolean, throwable) ->
|
||||
{
|
||||
if (aBoolean)
|
||||
{
|
||||
@ -72,7 +72,7 @@ public class BanCMD extends PlexCommand
|
||||
return;
|
||||
}
|
||||
String reason;
|
||||
Punishment punishment = new Punishment(targetUUID, getUUID(sender));
|
||||
Punishment punishment = new Punishment(plexPlayer.getUuid(), getUUID(sender));
|
||||
punishment.setType(PunishmentType.BAN);
|
||||
if (args.length > 1)
|
||||
{
|
||||
|
@ -38,21 +38,20 @@ public class KickCMD extends PlexCommand
|
||||
return usage();
|
||||
}
|
||||
|
||||
UUID targetUUID = WebUtils.getFromName(args[0]);
|
||||
PlexPlayer plexPlayer = DataUtils.getPlayer(args[0]);
|
||||
String reason = "No reason provided";
|
||||
|
||||
if (targetUUID == null || !DataUtils.hasPlayedBefore(targetUUID))
|
||||
if (plexPlayer == null)
|
||||
{
|
||||
throw new PlayerNotFoundException();
|
||||
}
|
||||
PlexPlayer plexPlayer = DataUtils.getPlayer(targetUUID);
|
||||
Player player = Bukkit.getPlayer(targetUUID);
|
||||
Player player = Bukkit.getPlayer(plexPlayer.getUuid());
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
throw new PlayerNotFoundException();
|
||||
}
|
||||
Punishment punishment = new Punishment(targetUUID, getUUID(sender));
|
||||
Punishment punishment = new Punishment(plexPlayer.getUuid(), getUUID(sender));
|
||||
punishment.setType(PunishmentType.KICK);
|
||||
if (args.length > 1)
|
||||
{
|
||||
@ -67,7 +66,7 @@ public class KickCMD extends PlexCommand
|
||||
punishment.setIp(player.getAddress().getAddress().getHostAddress().trim());
|
||||
plugin.getPunishmentManager().punish(plexPlayer, punishment);
|
||||
PlexUtils.broadcast(messageComponent("kickedPlayer", sender.getName(), plexPlayer.getName()));
|
||||
BungeeUtil.kickPlayer(player, Punishment.generateBanMessage(punishment));
|
||||
BungeeUtil.kickPlayer(player, Punishment.generateKickMessage(punishment));
|
||||
return null;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user