Implement a message when GWEN kicks a player and bump to latest anticheat version

This commit is contained in:
AlexTheCoder 2018-03-30 06:37:51 -04:00
parent e9c2346814
commit 5872aec38c
2 changed files with 8 additions and 1 deletions

View File

@ -48,7 +48,7 @@
<dependency>
<groupId>com.mineplex</groupId>
<artifactId>anticheat</artifactId>
<version>1.11.1</version>
<version>1.11.2</version>
</dependency>
<dependency>
<groupId>org.tukaani</groupId>

View File

@ -1,11 +1,16 @@
package mineplex.core.antihack.actions;
import org.bukkit.Bukkit;
import com.mineplex.anticheat.api.PlayerViolationEvent;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
public class ImmediateKickAction extends AntiHackAction
{
private static final String USER_HAS_BEEN_KICKED = F.main("GWEN", "%s was removed from the game due to suspicious activity. I am always watching.");
public ImmediateKickAction(int vl)
{
super(vl);
@ -19,11 +24,13 @@ public class ImmediateKickAction extends AntiHackAction
if (event.getViolations() >= (Math.floor(getMinVl() * .9)) && event.getPlayer().getMetadata("GWENEXTREMEPREJUDICE").get(0).asBoolean())
{
event.getPlayer().kickPlayer(message);
Bukkit.getServer().broadcastMessage(String.format(USER_HAS_BEEN_KICKED, event.getPlayer().getName()));
return;
}
if (event.getViolations() >= this.getMinVl())
{
event.getPlayer().kickPlayer(message);
Bukkit.getServer().broadcastMessage(String.format(USER_HAS_BEEN_KICKED, event.getPlayer().getName()));
}
}
}