- Added system to ensure banned players are removed from the network
This commit is contained in:
parent
f5b4f28848
commit
7770fa0284
@ -16,6 +16,8 @@ import mineplex.core.common.util.UtilTime.TimeUnit;
|
|||||||
import mineplex.core.punish.Command.PunishCommand;
|
import mineplex.core.punish.Command.PunishCommand;
|
||||||
import mineplex.core.punish.Tokens.PunishClientToken;
|
import mineplex.core.punish.Tokens.PunishClientToken;
|
||||||
import mineplex.core.punish.Tokens.PunishmentToken;
|
import mineplex.core.punish.Tokens.PunishmentToken;
|
||||||
|
import mineplex.core.updater.UpdateType;
|
||||||
|
import mineplex.core.updater.event.UpdateEvent;
|
||||||
import mineplex.serverdata.commands.ServerCommandManager;
|
import mineplex.serverdata.commands.ServerCommandManager;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -108,6 +110,33 @@ public class Punish extends MiniPlugin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void banRefresh(UpdateEvent event)
|
||||||
|
{
|
||||||
|
if (event.getType() != UpdateType.SEC)
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (Player check : UtilServer.getPlayers())
|
||||||
|
{
|
||||||
|
PunishClient client = GetClient(check.getName());
|
||||||
|
if (client != null && client.IsBanned())
|
||||||
|
{
|
||||||
|
Punishment punishment = client.GetPunishment(PunishmentSentence.Ban);
|
||||||
|
String time = UtilTime.convertString(punishment.GetRemaining(), 0, TimeUnit.FIT);
|
||||||
|
|
||||||
|
if (punishment.GetHours() == -1)
|
||||||
|
time = "Permanent";
|
||||||
|
|
||||||
|
String reason = C.cRed + C.Bold + "You are banned for " + time +
|
||||||
|
"\n" + C.cWhite + punishment.GetReason() +
|
||||||
|
"\n" + C.cDGreen + "Unfairly banned? Appeal at " + C.cGreen + "www.mineplex.com/appeals"
|
||||||
|
;
|
||||||
|
|
||||||
|
check.kickPlayer(reason);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Help(Player caller)
|
public void Help(Player caller)
|
||||||
{
|
{
|
||||||
UtilPlayer.message(caller, F.main(_moduleName, "Commands List:"));
|
UtilPlayer.message(caller, F.main(_moduleName, "Commands List:"));
|
||||||
|
Loading…
Reference in New Issue
Block a user