Tweak anticheat checks enabled in specific games

This commit is contained in:
AlexTheCoder 2018-07-01 04:15:25 -04:00
parent b2909c2434
commit ab5ddee92a
8 changed files with 19 additions and 24 deletions

View File

@ -14,9 +14,6 @@ import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import net.minecraft.server.v1_8_R3.EntityItem;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
import org.apache.commons.lang3.tuple.Triple;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -43,14 +40,11 @@ import org.bukkit.event.hanging.HangingPlaceEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.world.WorldLoadEvent;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scoreboard.NameTagVisibility;
import org.bukkit.scoreboard.Scoreboard;
import org.bukkit.scoreboard.Team;
import org.bukkit.util.Vector;
import com.mineplex.anticheat.MineplexAnticheat;
import com.mineplex.anticheat.checks.move.Glide;
import com.mojang.authlib.GameProfile;
import mineplex.core.Managers;
@ -90,7 +84,6 @@ import mineplex.core.utils.UtilGameProfile;
import mineplex.minecraft.game.classcombat.event.ClassCombatCreatureAllowSpawnEvent;
import mineplex.minecraft.game.core.combat.DeathMessageType;
import mineplex.minecraft.game.core.combat.event.CombatDeathEvent;
import nautilus.game.arcade.ArcadeFormat;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
@ -132,6 +125,8 @@ import nautilus.game.arcade.stats.StatTracker;
import nautilus.game.arcade.stats.WinStatTracker;
import nautilus.game.arcade.wineffect.WinEffectManager;
import nautilus.game.arcade.world.WorldData;
import net.minecraft.server.v1_8_R3.EntityItem;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
public abstract class Game extends ListenerComponent implements Lifetimed
{
@ -295,7 +290,6 @@ public abstract class Game extends ListenerComponent implements Lifetimed
public boolean StrictAntiHack = false;
public boolean AnticheatDisabled = false;
public boolean GlideCheckEnabled = true;
public boolean DisableKillCommand = true;
@ -819,10 +813,6 @@ public abstract class Game extends ListenerComponent implements Lifetimed
if (!AnticheatDisabled)
{
Managers.get(AntiHack.class).enableAnticheat();
if (!GlideCheckEnabled)
{
JavaPlugin.getPlugin(MineplexAnticheat.class).getCheckManager().disableCheck(Glide.class);
}
}
}
else if (_gameState == Game.GameState.End && !this.AnticheatDisabled)

View File

@ -94,7 +94,6 @@ public class Dragons extends SoloGame
.register(this);
// Disable specific GWEN checks for this game
this.GlideCheckEnabled = false;
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Speed.class);
antiHack.addIgnoredCheck(Glide.class);

View File

@ -78,7 +78,6 @@ import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.condition.Condition.ConditionType;
import mineplex.minecraft.game.core.condition.events.ConditionApplyEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GamePrepareCountdownCommence;
@ -260,7 +259,6 @@ public class BawkBawkBattles extends TeamGame implements IThrown
Manager.GetCreature().SetDisableCustomDrops(true);
GlideCheckEnabled = false;
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Speed.class);
antiHack.addIgnoredCheck(Glide.class);

View File

@ -179,7 +179,6 @@ public class Moba extends TeamGame
.register(this);
// Disable specific GWEN checks for this game
GlideCheckEnabled = false;
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Speed.class);
antiHack.addIgnoredCheck(Glide.class);

View File

@ -90,7 +90,6 @@ public class Runner extends SoloGame implements IThrown
new ChatStatData("kit", "Kit", true)
);
GlideCheckEnabled = false;
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Speed.class);
antiHack.addIgnoredCheck(Glide.class);

View File

@ -8,8 +8,6 @@ import java.util.Iterator;
import java.util.TreeMap;
import java.util.UUID;
import net.md_5.bungee.api.ChatColor;
import org.bukkit.Color;
import org.bukkit.Effect;
import org.bukkit.FireworkEffect;
@ -72,7 +70,6 @@ import mineplex.core.titles.tracks.standard.UnluckyTrack;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.ChestRefillEvent;
@ -92,6 +89,7 @@ import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.stats.KillsWithinTimeLimitStatTracker;
import nautilus.game.arcade.stats.WinWithoutWearingArmorStatTracker;
import net.md_5.bungee.api.ChatColor;
/**
* GameObject of the game Skyfall
@ -206,7 +204,6 @@ public abstract class Skyfall extends Game
registerModule(new VersionModule(MinecraftVersion.Version1_9));
// Disable specific GWEN checks for this game
GlideCheckEnabled = false;
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Speed.class);
antiHack.addIgnoredCheck(Glide.class);

View File

@ -32,9 +32,12 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.scheduler.BukkitRunnable;
import com.google.common.collect.Sets;
import com.mineplex.anticheat.checks.move.Glide;
import mineplex.core.Managers;
import mineplex.core.account.permissions.Permission;
import mineplex.core.account.permissions.PermissionGroup;
import mineplex.core.antihack.AntiHack;
import mineplex.core.blockrestore.BlockRestore;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
@ -55,7 +58,6 @@ import mineplex.core.recharge.Recharge;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.minecraft.game.core.damage.CustomDamageEvent;
import nautilus.game.arcade.ArcadeFormat;
import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType;
@ -144,7 +146,9 @@ public abstract class SuperSmash extends Game
ReplaceTeamsWithKits = true;
AllowParticles = false;
PlayerGameMode = GameMode.ADVENTURE;
GlideCheckEnabled = false;
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Glide.class);
manager.GetExplosion().SetRegenerate(true);
manager.GetExplosion().setRegenerateTime(TimeUnit.SECONDS.toMillis(30));

View File

@ -12,6 +12,12 @@ import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason;
import org.bukkit.event.player.PlayerInteractEvent;
import com.mineplex.anticheat.checks.move.Glide;
import com.mineplex.anticheat.checks.move.HeadRoll;
import com.mineplex.anticheat.checks.move.Speed;
import mineplex.core.Managers;
import mineplex.core.antihack.AntiHack;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilInv;
import mineplex.core.common.util.UtilPlayer;
@ -83,7 +89,10 @@ public class SuperSmashDominate extends Domination
new ChatStatData("kit", "Kit", true)
);
GlideCheckEnabled = false;
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Speed.class);
antiHack.addIgnoredCheck(Glide.class);
antiHack.addIgnoredCheck(HeadRoll.class);
}
@EventHandler(priority = EventPriority.LOWEST)