From 9cc28d1ad89bd897c06f5f422116fab5eca6d604 Mon Sep 17 00:00:00 2001 From: Chiss Date: Sun, 12 Oct 2014 14:19:35 +1100 Subject: [PATCH] MAC Update --- .../src/mineplex/core/antihack/AntiHack.java | 253 ++++++++++-------- .../src/mineplex/core/antihack/types/Fly.java | 23 +- .../mineplex/core/antihack/types/Speed.java | 2 +- .../game/core/damage/DamageManager.java | 4 +- .../src/nautilus/game/arcade/Arcade.java | 1 + .../src/nautilus/game/arcade/game/Game.java | 2 + .../game/arcade/game/games/bridge/Bridge.java | 8 +- .../game/games/castlesiege/CastleSiege.java | 2 + .../games/champions/ChampionsDominate.java | 2 + .../game/games/champions/ChampionsTDM.java | 2 + .../arcade/game/games/deathtag/DeathTag.java | 2 + .../games/dragonescape/DragonEscapeData.java | 2 + .../dragonescape/DragonEscapeTeamsData.java | 2 + .../arcade/game/games/dragons/DragonData.java | 1 + .../arcade/game/games/dragons/Dragons.java | 30 +++ .../game/arcade/game/games/draw/Draw.java | 1 + .../game/arcade/game/games/micro/Micro.java | 2 + .../game/games/minestrike/MineStrike.java | 2 + .../game/arcade/game/games/quiver/Quiver.java | 1 + .../game/games/quiver/kits/KitLeaper.java | 6 +- .../arcade/game/games/sheep/SheepGame.java | 2 + .../sneakyassassins/SneakyAssassins.java | 2 + .../games/survivalgames/SurvivalGames.java | 2 + .../game/games/turfforts/TurfForts.java | 1 + .../game/arcade/game/games/uhc/UHC.java | 8 +- .../game/arcade/managers/GameFlagManager.java | 14 + .../arcade/managers/GamePlayerManager.java | 1 - 27 files changed, 241 insertions(+), 137 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index c3f0efc59..9be0c8991 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -7,14 +7,15 @@ import java.util.Iterator; import java.util.Map.Entry; import org.bukkit.Bukkit; +import org.bukkit.ChatColor; import org.bukkit.GameMode; import org.bukkit.Material; +import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerTeleportEvent; -import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.event.server.ServerListPingEvent; import org.bukkit.plugin.java.JavaPlugin; @@ -44,6 +45,8 @@ public class AntiHack extends MiniPlugin public static AntiHack Instance; private boolean _enabled = true; + private boolean _strict = true; + private boolean _kick = true; public Punish Punish; public Portal Portal; @@ -51,9 +54,6 @@ public class AntiHack extends MiniPlugin private CoreClientManager _clientManager; //Record Offenses - private HashMap>> _suspicion = new HashMap>>(); - - //Some suspicions will not become offenses, for example, using double jump will remove suspicion 2 seconds prior private HashMap>> _offense = new HashMap>>(); //Ignore Player @@ -64,12 +64,14 @@ public class AntiHack extends MiniPlugin private HashMap _lastMoveEvent = new HashMap(); //Hack Requirements - public int FloatHackTicks = 6; - public int HoverHackTicks = 3; + public int FloatHackTicks = 10; + public int HoverHackTicks = 4; public int RiseHackTicks = 6; public int SpeedHackTicks = 6; public int IdleTime = 20000; + public int KeepOffensesFor = 30000; + //Other Times public int FlightTriggerCancel = 2000; @@ -121,7 +123,7 @@ public class AntiHack extends MiniPlugin synchronized (_antiHackLock) { - _ignore.put(event.getPlayer(), System.currentTimeMillis() + 2000); + setIgnore(event.getPlayer(), 2000); } } @@ -137,35 +139,6 @@ public class AntiHack extends MiniPlugin } } - @EventHandler - public void playerToggleFly(PlayerToggleFlightEvent event) - { - if (!_enabled) - return; - - Player player = event.getPlayer(); - - synchronized (_antiHackLock) - { - if (!_suspicion.containsKey(player)) - return; - - //Remove all infractions within last 2 seconds. - for (ArrayList offenseList : _suspicion.get(player).values()) - { - Iterator offenseIterator = offenseList.iterator(); - - while (offenseIterator.hasNext()) - { - long time = offenseIterator.next(); - - if (!UtilTime.elapsed(time, FlightTriggerCancel)) - offenseIterator.remove(); - } - } - } - } - @EventHandler public void playerQuit(PlayerQuitEvent event) { @@ -197,7 +170,7 @@ public class AntiHack extends MiniPlugin if (timeBetweenPackets > 500) { - setIgnore(player, 5000); + setIgnore(player, Math.min(4000, timeBetweenPackets)); } } } @@ -235,70 +208,58 @@ public class AntiHack extends MiniPlugin } } - return (_ignore.containsKey(player) && System.currentTimeMillis() < _ignore.get(player)); + if ((_ignore.containsKey(player) && System.currentTimeMillis() < _ignore.get(player))) + { + return true; + } + + return false; } public void addSuspicion(Player player, String type) { if (!_enabled) return; - + + System.out.println(C.cRed + C.Bold + player.getName() + " suspected for " + type + "."); + synchronized (_antiHackLock) { //Add Offense - if (!_suspicion.containsKey(player)) - _suspicion.put(player, new HashMap>()); + if (!_offense.containsKey(player)) + _offense.put(player, new HashMap>()); - if (!_suspicion.get(player).containsKey(type)) - _suspicion.get(player).put(type, new ArrayList()); + if (!_offense.get(player).containsKey(type)) + _offense.get(player).put(type, new ArrayList()); - _suspicion.get(player).get(type).add(System.currentTimeMillis()); - } + _offense.get(player).get(type).add(System.currentTimeMillis()); - for (Player admin : UtilServer.getPlayers()) - if (_clientManager.Get(admin).GetRank().Has(Rank.MODERATOR) && _preferences.Get(admin).ShowMacReports) - UtilPlayer.message(admin, C.cRed + C.Bold + player.getName() + " suspected for " + type + "."); - - // Print (Debug) - System.out.println("[Offense] " + player.getName() + " received suspicion for " + type + "."); - } - - @EventHandler - public void processOffenses(UpdateEvent event) - { - if (!_enabled) - return; - - if (event.getType() != UpdateType.SEC) - return; - - synchronized (_antiHackLock) - { - for (Player player : _suspicion.keySet()) + //Cull & Count + int total = 0; + for (String curType : _offense.get(player).keySet()) { - if (!_offense.containsKey(player)) - _offense.put(player, new HashMap>()); - - for (String type : _suspicion.get(player).keySet()) + //Remove Old Offenses + Iterator offenseIterator = _offense.get(player).get(curType).iterator(); + while (offenseIterator.hasNext()) { - if (!_offense.get(player).containsKey(type)) - _offense.get(player).put(type, new ArrayList()); - - Iterator offenseIterator = _suspicion.get(player).get(type).iterator(); - - while (offenseIterator.hasNext()) - { - long time = offenseIterator.next(); - - //Suspicion turns into Offense - if (UtilTime.elapsed(time, FlightTriggerCancel)) - { - offenseIterator.remove(); - _offense.get(player).get(type).add(time); - } - } + if (UtilTime.elapsed(offenseIterator.next(), KeepOffensesFor)) + offenseIterator.remove(); } + + //Count + total += _offense.get(player).get(curType).size(); } + + + //Inform + for (Player admin : UtilServer.getPlayers()) + if (_clientManager.Get(admin).GetRank().Has(Rank.MODERATOR) && _preferences.Get(admin).ShowMacReports) + { + UtilPlayer.message(admin, "#" + total + ": " + C.cRed + C.Bold + player.getName() + " suspected for " + type + "."); + } + + // Print (Debug) + System.out.println("[Offense] #" + total + ": "+ player.getName() + " received suspicion for " + type + "."); } } @@ -308,7 +269,7 @@ public class AntiHack extends MiniPlugin if (!_enabled) return; - if (event.getType() != UpdateType.SLOW) + if (event.getType() != UpdateType.SEC) return; synchronized (_antiHackLock) @@ -321,12 +282,12 @@ public class AntiHack extends MiniPlugin for (String type : _offense.get(player).keySet()) { //Remove Old Offenses - Iterator offenseIterator = _suspicion.get(player).get(type).iterator(); + Iterator offenseIterator = _offense.get(player).get(type).iterator(); while (offenseIterator.hasNext()) { long time = offenseIterator.next(); - if (UtilTime.elapsed(time, 300000)) + if (UtilTime.elapsed(time, KeepOffensesFor)) offenseIterator.remove(); } @@ -340,11 +301,11 @@ public class AntiHack extends MiniPlugin if (out.length() > 0) out = out.substring(0, out.length() - 2); - String severity = ""; - if (total > 24) severity = "Extreme"; - else if (total > 16) severity = "High"; - else if (total > 8) severity = "Medium"; - else severity = "Low"; + String severity; + if (total > (_strict ? 6 : 15)) severity = "Extreme"; + else if (total > (_strict ? 4 : 10)) severity = "High"; + else if (total > (_strict ? 2 : 5)) severity = "Medium"; + else severity = "Low"; //Send Report sendReport(player, out, severity); @@ -356,15 +317,53 @@ public class AntiHack extends MiniPlugin { if (severity.equals("Extreme")) { - player.kickPlayer( - C.cGold + "Mineplex Anti-Cheat" + "\n" + - C.cWhite + "You were kicked for suspicious movement." + "\n" + - C.cWhite + "Cheating may result in a " + C.cRed + "Permanent Ban" + C.cWhite + "." + "\n" + - C.cWhite + "If you were not cheating, you will not be banned." - ); + ResetAll(player); - UtilServer.broadcast(F.main("MAC", player.getName() + " was kicked for suspicious movement.")); + //Staff + boolean handled = false; + for (Player staff : UtilServer.getPlayers()) + { + if (_clientManager.Get(staff).GetRank().Has(Rank.MODERATOR)) + { + UtilPlayer.message(staff, C.cAqua + C.Scramble + "A" + ChatColor.RESET + C.cRed + C.Bold + " MAC > " + ChatColor.RESET + C.cYellow + report); + UtilPlayer.message(staff, C.cAqua + C.Scramble + "A" + ChatColor.RESET + C.cRed + C.Bold + " MAC > " + ChatColor.RESET + C.cGold + player.getName() + C.cYellow + " has extreme violation. Please investigate."); + handled = true; + } + } + + //Auto-Kick + if (!handled) + { + player.playSound(player.getLocation(), Sound.ENDERDRAGON_GROWL, 2f, 0.5f); + + if (_kick) + { + player.kickPlayer( + C.cGold + "Mineplex Anti-Cheat" + "\n" + + C.cWhite + "You were kicked for suspicious movement." + "\n" + + C.cWhite + "Cheating may result in a " + C.cRed + "Permanent Ban" + C.cWhite + "." + "\n" + + C.cWhite + "If you were not cheating, you will not be banned." + ); + } + else + { + UtilPlayer.message(player, C.cGold + C.Bold + "----------------------------------------------------"); + UtilPlayer.message(player, ""); + UtilPlayer.message(player, C.cGold + "Mineplex Anti-Cheat"); + UtilPlayer.message(player, ""); + UtilPlayer.message(player, "You were kicked from the game for suspicious movement."); + UtilPlayer.message(player, "Cheating may result in a " + C.cRed + "Permanent Ban" + C.cWhite + "."); + UtilPlayer.message(player, "If you were not cheating, you will not be banned."); + UtilPlayer.message(player, ""); + UtilPlayer.message(player, C.cGold + C.Bold + "----------------------------------------------------"); + Portal.SendPlayerToServer(player, "Lobby"); + } + + UtilServer.broadcast(F.main("MAC", player.getName() + " was kicked for suspicious movement.")); + } + + //Record ServerListPingEvent event = new ServerListPingEvent(null, Bukkit.getServer().getMotd(), Bukkit.getServer().getOnlinePlayers().size(), Bukkit.getServer().getMaxPlayers()); GetPluginManager().callEvent(event); @@ -387,6 +386,12 @@ public class AntiHack extends MiniPlugin } } + private void Reset() + { + for (Player player : UtilServer.getPlayers()) + ResetAll(player); + } + private void ResetAll(Player player) { synchronized (_antiHackLock) @@ -397,7 +402,6 @@ public class AntiHack extends MiniPlugin _offense.remove(player); - _suspicion.remove(player); for (Detector detector : _detectors) detector.Reset(player); @@ -413,39 +417,52 @@ public class AntiHack extends MiniPlugin if (event.getType() != UpdateType.SLOW) return; - for (Iterator> playerIterator = _ignore.entrySet().iterator(); playerIterator.hasNext();) + synchronized (_antiHackLock) { - Player player = playerIterator.next().getKey(); + for (Iterator> playerIterator = _ignore.entrySet().iterator(); playerIterator.hasNext();) + { + Player player = playerIterator.next().getKey(); - if (!player.isOnline() || player.isDead() || !player.isValid()) - { - playerIterator.remove(); + if (!player.isOnline() || player.isDead() || !player.isValid()) + { + playerIterator.remove(); - _velocityEvent.remove(player); - _lastMoveEvent.remove(player); + _velocityEvent.remove(player); + _lastMoveEvent.remove(player); - _offense.remove(player); - _suspicion.remove(player); + _offense.remove(player); - for (Detector detector : _detectors) - detector.Reset(player); + for (Detector detector : _detectors) + detector.Reset(player); + } } } } - public HashMap>> getOffenses() - { - return _offense; - } - public void SetEnabled(boolean b) { _enabled = b; System.out.println("MAC Enabled: " + b); } - + public boolean IsEnabled() { return _enabled; } + + public void setStrict(boolean strict) + { + _strict = strict; + + Reset(); + + System.out.println("MAC Strict: " + strict); + } + + public void setKick(boolean kick) + { + _kick = kick; + + System.out.println("MAC Kick: " + kick); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Fly.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Fly.java index ff9270570..ccc1c68d1 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Fly.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Fly.java @@ -44,7 +44,7 @@ public class Fly extends MiniPlugin implements Detector //100% Valid if (Host.isValid(player, true)) - return; + Reset(player); //Hasn't moved, just looking around if (UtilMath.offset(event.getFrom(), event.getTo()) <= 0) @@ -52,6 +52,10 @@ public class Fly extends MiniPlugin implements Detector updateFloat(player); return; } + else + { + _floatTicks.remove(player); + } updateHover(player); updateRise(player); @@ -76,7 +80,7 @@ public class Fly extends MiniPlugin implements Detector if (count > Host.FloatHackTicks) { Host.addSuspicion(player, "Fly (Float)"); - count = 0; + count -= 2; } _floatTicks.put(player, new AbstractMap.SimpleEntry(count, player.getLocation().getY())); @@ -96,14 +100,16 @@ public class Fly extends MiniPlugin implements Detector { count = 0; } + + //player.sendMessage(count + " - " + player.getLocation().getY() + " vs " + _hoverTicks.get(player).getValue()); } if (count > Host.HoverHackTicks) { Host.addSuspicion(player, "Fly (Hover)"); - count = 0; + count -= 2; } - + _hoverTicks.put(player, new AbstractMap.SimpleEntry(count, player.getLocation().getY())); } @@ -113,7 +119,7 @@ public class Fly extends MiniPlugin implements Detector if (_riseTicks.containsKey(player)) { - if (player.getLocation().getY() > _riseTicks.get(player).getValue()) + if (player.getLocation().getY() >= _riseTicks.get(player).getValue()) { boolean nearBlocks = false; for (Block block : UtilBlock.getSurrounding(player.getLocation().getBlock(), true)) @@ -143,8 +149,11 @@ public class Fly extends MiniPlugin implements Detector if (count > Host.RiseHackTicks) { - Host.addSuspicion(player, "Fly (Rise)"); - count = 0; + //Only give Offense if actually rising - initial ticks can be trigged via Hover. + if (player.getLocation().getY() > _riseTicks.get(player).getValue()) + Host.addSuspicion(player, "Fly (Rise)"); + + count -= 2; } _riseTicks.put(player, new AbstractMap.SimpleEntry(count, player.getLocation().getY())); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Speed.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Speed.java index 2b14d2146..fbe092da9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Speed.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/types/Speed.java @@ -91,7 +91,7 @@ public class Speed extends MiniPlugin implements Detector if (count > Host.SpeedHackTicks) { Host.addSuspicion(player, "Speed (Fly/Move)"); - count = 0; + count -= 2; } _speedTicks.put(player, new AbstractMap.SimpleEntry(count, System.currentTimeMillis())); diff --git a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java index 873083a51..d3b8929a1 100644 --- a/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java +++ b/Plugins/Mineplex.Minecraft.Game.Core/src/mineplex/minecraft/game/core/damage/DamageManager.java @@ -216,7 +216,7 @@ public class DamageManager extends MiniPlugin @EventHandler(priority = EventPriority.MONITOR) public void EndDamageEvent(CustomDamageEvent event) { - if (!event.IsCancelled()) + if (!event.IsCancelled() && event.GetDamage() > 0) { Damage(event); @@ -241,7 +241,7 @@ public class DamageManager extends MiniPlugin if (event.GetDamageeEntity().getHealth() <= 0) return; - + //Player Conditions if (event.GetDamageePlayer() != null) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java index ff3ba653a..e95af4ba2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/Arcade.java @@ -106,6 +106,7 @@ public class Arcade extends JavaPlugin Punish punish = new Punish(this, webServerAddress, _clientManager); AntiHack.Initialize(this, punish, portal, preferenceManager, _clientManager); + AntiHack.Instance.setKick(false); BlockRestore blockRestore = new BlockRestore(this); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java index 4b146817a..cc785accd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/Game.java @@ -199,6 +199,8 @@ public abstract class Game implements Listener public GameState KitRegisterState = GameState.Live; public boolean JoinInProgress = false; + + public boolean StrictAntiHack = false; //Addons public boolean CompassEnabled = false; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index 4cb129dbd..470a7d032 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -148,6 +148,8 @@ public class Bridge extends TeamGame implements OreObsfucation // Flags GameTimeout = Manager.IsTournamentServer() ? 5400000 : 3600000; + this.StrictAntiHack = true; + DamageSelf = true; ItemDrop = true; @@ -984,6 +986,9 @@ public class Bridge extends TeamGame implements OreObsfucation { UtilPlayer.message(event.getPlayer(), F.main("Game", "Cannot place blocks in liquids until Bridge is down.")); + + event.getPlayer().setVelocity(new Vector(0,-0.5,0)); + event.setCancelled(true); return; } @@ -1091,8 +1096,7 @@ public class Bridge extends TeamGame implements OreObsfucation blockIterator.remove(); } } - - + @EventHandler(priority = EventPriority.LOW) public void BucketEmpty(PlayerBucketEmptyEvent event) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java index 1c1207d49..da2865ebb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiege/CastleSiege.java @@ -185,6 +185,8 @@ public class CastleSiege extends TeamGame }; + this.StrictAntiHack = true; + this.HungerSet = 20; this.DeathOut = false; this.WorldTimeSet = 14000; //14000 diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java index 269118570..02c88d89f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsDominate.java @@ -53,6 +53,8 @@ public class ChampionsDominate extends Domination Manager.GetDamage().UseSimpleWeaponDamage = false; + this.StrictAntiHack = true; + InventoryOpenChest = true; EloRanking = false; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java index 0ed74d64a..93bad19c4 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/champions/ChampionsTDM.java @@ -54,6 +54,8 @@ public class ChampionsTDM extends TeamDeathmatch this.Manager.GetDamage().UseSimpleWeaponDamage = false; + this.StrictAntiHack = true; + InventoryOpenChest = true; registerStatTrackers( diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java index 429a69ef9..3aab5f651 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java @@ -65,6 +65,8 @@ public class DeathTag extends SoloGame "The last Runner alive wins!" }); + this.StrictAntiHack = true; + this.DeathOut = false; this.HungerSet = 20; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeData.java index 47ec44048..f3547a6dd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeData.java @@ -1,6 +1,7 @@ package nautilus.game.arcade.game.games.dragonescape; import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilWorld; import org.bukkit.Location; @@ -24,6 +25,7 @@ public class DragonEscapeData Host = host; Dragon = dragon; + UtilEnt.ghost(Dragon, true, false); Location temp = dragon.getLocation(); temp.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(dragon.getLocation(), target))); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeamsData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeamsData.java index 97b70b516..30f64ea16 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeamsData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeamsData.java @@ -1,6 +1,7 @@ package nautilus.game.arcade.game.games.dragonescape; import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; import org.bukkit.Location; import org.bukkit.entity.EnderDragon; @@ -23,6 +24,7 @@ public class DragonEscapeTeamsData Host = host; Dragon = dragon; + UtilEnt.ghost(Dragon, true, false); Location temp = dragon.getLocation(); temp.setPitch(UtilAlg.GetPitch(UtilAlg.getTrajectory(dragon.getLocation(), target))); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/DragonData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/DragonData.java index 6f32e9ccd..6b523ca78 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/DragonData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/DragonData.java @@ -1,6 +1,7 @@ package nautilus.game.arcade.game.games.dragons; import mineplex.core.common.util.UtilAlg; +import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilTime; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/Dragons.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/Dragons.java index a13aeb2c3..05ce9e450 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/Dragons.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragons/Dragons.java @@ -18,8 +18,11 @@ import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilMath; +import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; @@ -221,4 +224,31 @@ public class Dragons extends SoloGame if (event.GetCause() == DamageCause.FALL) event.AddMod("Fall Reduction", "Fall Reduction", -1, false); } + + /* + @EventHandler + public void DragonKnockback(UpdateEvent event) + { + if (event.getType() != UpdateType.TICK) + return; + + for (DragonData data : _dragons.values()) + { + UtilParticle.PlayParticle(ParticleType.FIREWORKS_SPARK, data.Dragon.getLocation(), 0f, 0f, 0f, 0, 1); + + for (Player player : GetPlayers(true)) + { + if (!Recharge.Instance.use(player, "Dragon Hit", 500, false, false)) + continue; + + if (UtilMath.offset(player, data.Dragon) < 6) + { + UtilAction.velocity(player, UtilAlg.getTrajectory(data.Dragon, player), 1, false, 0, 0.6, 2, true); + + player.damage(1); + } + } + } + } + */ } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java index ffb647176..1c0eb7977 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java @@ -94,6 +94,7 @@ public class Draw extends SoloGame "Hints are given at top of screen", }); + this.StrictAntiHack = true; this.Damage = false; this.HungerSet = 20; this.WorldTimeSet = 8000; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java index 780517b8a..7446ccd66 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java @@ -46,6 +46,8 @@ public class Micro extends TeamGame "Small game, big strategy!", }); + this.StrictAntiHack = true; + this.TeamArmor = true; this.TeamArmorHotbar = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java index 25d92ff7e..4f8d6d298 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/MineStrike.java @@ -184,6 +184,8 @@ public class MineStrike extends TeamGame _shopManager = new ShopManager(this); + this.StrictAntiHack = true; + this.HungerSet = 20; this.ItemDrop = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java index c478b3296..ac1888718 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java @@ -63,6 +63,7 @@ public class Quiver extends SoloGame "First player to 20 kills wins." }); + this.StrictAntiHack = true; this.HungerSet = 20; this.DeathOut = false; this.DamageSelf = false; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/kits/KitLeaper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/kits/KitLeaper.java index 50d3c5a24..3e2d5e1d9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/kits/KitLeaper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/kits/KitLeaper.java @@ -20,16 +20,16 @@ public class KitLeaper extends Kit { public KitLeaper(ArcadeManager manager) { - super(manager, "Jumper", KitAvailability.Free, + super(manager, "Leaper", KitAvailability.Free, new String[] { - "Evade and kill using your double jump!" + "Evade and kill using your leap!" }, new Perk[] { - new PerkDoubleJump("Double Jump", 0.9, 0.9, true) + new PerkLeap("Leap", 1.2, 1, 3000) }, EntityType.ZOMBIE, new ItemStack(Material.IRON_AXE)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 9b8361bab..6bb919f66 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -139,6 +139,8 @@ public class SheepGame extends TeamGame "Most sheep at 5 minutes wins!" }); + this.StrictAntiHack = true; + this.DeathOut = false; this.DeathSpectateSecs = 8; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java index 96fadfe96..9d186f4ad 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sneakyassassins/SneakyAssassins.java @@ -63,6 +63,8 @@ public class SneakyAssassins extends SoloGame this._npcManager = new NpcManager(this, UtilMath.random); + this.StrictAntiHack = true; + this.DamageTeamSelf = true; this.PrepareFreeze = false; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java index 6f8344f14..e8c0b3e89 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/SurvivalGames.java @@ -158,6 +158,8 @@ public class SurvivalGames extends SoloGame Manager.GetAntiStack().SetEnabled(false); + this.StrictAntiHack = true; + this.GameTimeout = 9600000; this.WorldTimeSet = 0; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java index 0fb2aa12e..6898499c8 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/turfforts/TurfForts.java @@ -126,6 +126,7 @@ public class TurfForts extends TeamGame }); + this.StrictAntiHack = true; this.HungerSet = 20; this.DeathOut = false; this.BlockPlaceAllow.add(35); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java index 501fec48b..b3aed7e57 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/uhc/UHC.java @@ -119,6 +119,8 @@ public class UHC extends TeamGame "Last player/team alive wins!" }); + this.StrictAntiHack = true; + this.GameTimeout = 10800000; this.DamagePvP = false; @@ -546,7 +548,7 @@ public class UHC extends TeamGame //Get Radius Location else { - block = UtilBlock.getHighest(WorldData.World, around.getBlockX() - 8 + UtilMath.r(16), around.getBlockZ() - 8 + UtilMath.r(16), ignore); + block = UtilBlock.getHighest(WorldData.World, around.getBlockX() - 4 + UtilMath.r(8), around.getBlockZ() - 4 + UtilMath.r(8), ignore); } //Check Validity @@ -1319,9 +1321,9 @@ public class UHC extends TeamGame return 0; if (assist) - return 50; + return 40; - return 400; + return 200; } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index ecab40ff3..b94ab7f2f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.managers; +import mineplex.core.antihack.AntiHack; import mineplex.core.common.Rank; import mineplex.core.common.util.C; import mineplex.core.common.util.F; @@ -16,6 +17,7 @@ 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.GameStateChangeEvent; import nautilus.game.arcade.events.PlayerDeathOutEvent; import nautilus.game.arcade.game.Game; import nautilus.game.arcade.game.GameTeam; @@ -982,4 +984,16 @@ public class GameFlagManager implements Listener UtilPlayer.message(player, C.cWhite + C.Bold + "The next game will be starting soon..."); } } + + @EventHandler + public void AntiHackStrict(GameStateChangeEvent event) + { + if (event.GetState() == GameState.Prepare || event.GetState() == GameState.Live) + AntiHack.Instance.setStrict(event.GetGame().StrictAntiHack); + + else + AntiHack.Instance.setStrict(true); + + + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java index af22fd8d5..6a1ef1424 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GamePlayerManager.java @@ -398,5 +398,4 @@ public class GamePlayerManager implements Listener event.setCancelled(true); } } - }