diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 1f75df4e8..44430ffdb 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -2,14 +2,15 @@ package mineplex.core.antihack; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; +import com.google.common.collect.ImmutableMap; import com.google.common.util.concurrent.AtomicDouble; import com.mineplex.anticheat.api.GameEndEvent; import com.mineplex.anticheat.api.GameStartEvent; import com.mineplex.anticheat.api.MineplexLink; import com.mineplex.anticheat.api.PlayerViolationEvent; -import mineplex.core.PlayerSelector; import mineplex.core.Managers; import mineplex.core.MiniPlugin; +import mineplex.core.PlayerSelector; import mineplex.core.ReflectivelyCreateMiniPlugin; import mineplex.core.account.CoreClient; import mineplex.core.account.CoreClientManager; @@ -21,15 +22,7 @@ import mineplex.core.antihack.types.Reach; import mineplex.core.antihack.types.Speed; import mineplex.core.command.CommandBase; import mineplex.core.common.Rank; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilEnt; -import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilMath; -import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilPlayer; -import mineplex.core.common.util.UtilServer; -import mineplex.core.common.util.UtilTime; +import mineplex.core.common.util.*; import mineplex.core.disguise.DisguiseManager; import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.portal.Portal; @@ -41,44 +34,23 @@ import mineplex.core.punish.Punishment; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.serverdata.commands.ServerCommandManager; -import net.minecraft.server.v1_8_R3.ChatClickable; -import net.minecraft.server.v1_8_R3.ChatComponentText; -import net.minecraft.server.v1_8_R3.ChatHoverable; -import net.minecraft.server.v1_8_R3.ChatModifier; -import net.minecraft.server.v1_8_R3.EnumChatFormat; -import net.minecraft.server.v1_8_R3.IChatBaseComponent; -import net.minecraft.server.v1_8_R3.MathHelper; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.GameMode; -import org.bukkit.Location; +import net.minecraft.server.v1_8_R3.*; +import org.bukkit.*; import org.bukkit.Material; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.player.PlayerCommandPreprocessEvent; -import org.bukkit.event.player.PlayerInteractEvent; -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.player.*; import org.bukkit.event.server.ServerListPingEvent; import org.bukkit.plugin.ServicePriority; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; import org.bukkit.scheduler.BukkitTask; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; +import java.util.*; import java.util.Map.Entry; -import java.util.Set; -import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; @@ -89,7 +61,14 @@ import java.util.function.Predicate; @ReflectivelyCreateMiniPlugin public class AntiHack extends MiniPlugin { - public static final boolean IS_PHASE_TWO = false; + public static final Map CHECKS = ImmutableMap.of( + "Killaura (Type A)", new CheckThresholds("Kill Aura", 25, 50), + "Killaura (Type B)", new CheckThresholds("High CPS", 0, Integer.MAX_VALUE), + "Killaura (Type C)", new CheckThresholds("Reach", Integer.MAX_VALUE, Integer.MAX_VALUE), + "Killaura (Type D)", new CheckThresholds("Kill Aura", 1000, 1500), + "BadPackets", new CheckThresholds("Regen", 1000, 2000) + ); + public static final String NAME = "Chiss"; public static final String USER_HAS_BEEN_BANNED = F.main("GWEN", "%s has been banned. I am always watching"); public static final String USER_HAS_BEEN_BANNED_BANWAVE = USER_HAS_BEEN_BANNED; @@ -200,74 +179,17 @@ public class AntiHack extends MiniPlugin ServerCommandManager.getInstance().registerCommandType(MajorViolationCommand.class, violation -> { - if (!violation.getOriginatingServer().equals(this._thisServer)) - { - IChatBaseComponent component = new ChatComponentText("") - .addSibling( - new ChatComponentText("A") - .setChatModifier( - new ChatModifier() - .setColor(EnumChatFormat.AQUA) - .setRandom(true) - ) - ) - .addSibling( - new ChatComponentText(" GWEN > ") - .setChatModifier( - new ChatModifier() - .setColor(EnumChatFormat.RED) - .setBold(true) - ) - ) - .addSibling( - new ChatComponentText(violation.getPlayerName()) - .setChatModifier( - new ChatModifier() - .setColor(EnumChatFormat.GOLD) - ) - ) - .addSibling( - new ChatComponentText(" failed " + violation.getHackType() + " VL" + violation.getViolations() + " in server ") - .setChatModifier( - new ChatModifier() - .setColor(EnumChatFormat.YELLOW) - ) - ) - .addSibling( - new ChatComponentText( - violation.getOriginatingServer() - ) - .setChatModifier( - new ChatModifier() - .setColor(EnumChatFormat.YELLOW) - .setChatClickable( - new ChatClickable( - ChatClickable.EnumClickAction.RUN_COMMAND, - "/server " + violation.getOriginatingServer() - ) - ) - .setChatHoverable( - new ChatHoverable( - ChatHoverable.EnumHoverAction.SHOW_TEXT, - new ChatComponentText("Teleport to " + violation.getOriginatingServer()) - ) - ) - ) - ) - .addSibling( - new ChatComponentText(": " + violation.getMessage() + ". Please investigate") - .setChatModifier( - new ChatModifier() - .setColor(EnumChatFormat.YELLOW) - ) - ); + IChatBaseComponent component = getMinimalMessage(violation); - for (Player player : Bukkit.getOnlinePlayers()) + for (Player player : Bukkit.getOnlinePlayers()) + { + if (player.getName().equals("Spoobncoobr")) { - if (Managers.get(PreferencesManager.class).Get(player).ShowMacReports && _clientManager.Get(player).GetRank().has(Rank.HELPER)) - { - ((CraftPlayer) player).getHandle().sendMessage(component); - } + ((CraftPlayer) player).getHandle().sendMessage(getDetailedMessage(violation)); + + } else if (_clientManager.Get(player).GetRank().has(Rank.HELPER) && (violation.getOriginatingServer().equals(_thisServer) || Managers.get(PreferencesManager.class).Get(player).ShowMacReports)) + { + ((CraftPlayer) player).getHandle().sendMessage(component); } } }); @@ -355,6 +277,144 @@ public class AntiHack extends MiniPlugin require(BanWaveManager.class); } + private IChatBaseComponent getDetailedMessage(MajorViolationCommand violation) + { + return new ChatComponentText("") + .addSibling( + new ChatComponentText("A") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.AQUA) + .setRandom(true) + ) + ) + .addSibling( + new ChatComponentText(" GWEN > ") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.RED) + .setBold(true) + ) + ) + .addSibling( + new ChatComponentText(violation.getPlayerName()) + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.GOLD) + ) + ) + .addSibling( + new ChatComponentText(" failed " + violation.getHackType() + " VL" + violation.getViolations() + " in server ") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.YELLOW) + ) + ) + .addSibling( + new ChatComponentText( + violation.getOriginatingServer() + ) + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.YELLOW) + .setChatClickable( + new ChatClickable( + ChatClickable.EnumClickAction.RUN_COMMAND, + "/server " + violation.getOriginatingServer() + ) + ) + .setChatHoverable( + new ChatHoverable( + ChatHoverable.EnumHoverAction.SHOW_TEXT, + new ChatComponentText("Teleport to " + violation.getOriginatingServer()) + ) + ) + ) + ) + .addSibling( + new ChatComponentText(": " + violation.getMessage() + ". Please investigate!") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.YELLOW) + ) + ); + } + + private IChatBaseComponent getMinimalMessage(MajorViolationCommand violation) + { + IChatBaseComponent component = new ChatComponentText("") + .addSibling( + new ChatComponentText("A") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.AQUA) + .setRandom(true) + ) + ) + .addSibling( + new ChatComponentText(" GWEN > ") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.RED) + .setBold(true) + ) + ) + .addSibling( + new ChatComponentText(violation.getPlayerName()) + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.GOLD) + ) + ) + .addSibling( + new ChatComponentText(" suspected of ") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.YELLOW) + ) + ) + .addSibling(CHECKS.get(violation.getHackType()).format(violation.getViolations())); + + if (!violation.getOriginatingServer().equals(this._thisServer)) + { + component + .addSibling( + new ChatComponentText(" in ") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.YELLOW) + ) + ) + .addSibling( + new ChatComponentText(violation.getOriginatingServer()) + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.AQUA) + .setChatClickable( + new ChatClickable( + ChatClickable.EnumClickAction.RUN_COMMAND, + "/server " + violation.getOriginatingServer() + ) + ) + .setChatHoverable( + new ChatHoverable( + ChatHoverable.EnumHoverAction.SHOW_TEXT, + new ChatComponentText("Teleport to " + violation.getOriginatingServer()) + ) + ) + ) + ); + } + + return component.addSibling( + new ChatComponentText(". Please investigate!") + .setChatModifier( + new ChatModifier() + .setColor(EnumChatFormat.YELLOW) + ) + ); + } + public void registerFilter(Predicate filter) { if (filter == null) @@ -382,9 +442,6 @@ public class AntiHack extends MiniPlugin public void runBanAnimation(Player player, Runnable after) { - if (!IS_PHASE_TWO) - return; - if (_pendingBan.add(player)) { float oldWalkSpeed = player.getWalkSpeed(); @@ -495,19 +552,17 @@ public class AntiHack extends MiniPlugin { runSync(() -> { - int totalPunishments = getPunishments(player); - int daysBanned = getDaysBanned(player); CoreClient coreClient = _clientManager.Get(player); if (coreClient.GetRank().has(Rank.TWITCH)) { - require(Punish.class).AddPunishment(coreClient.getName(), Category.Hacking, message, AntiHack.NAME, totalPunishments + 1, true, daysBanned == -1 ? -1 : TimeUnit.DAYS.toHours(daysBanned), true); + require(Punish.class).AddPunishment(coreClient.getName(), Category.Hacking, message, AntiHack.NAME, 3, true, -1, true); } else { runBanAnimation(player, () -> { - require(Punish.class).AddPunishment(coreClient.getName(), Category.Hacking, message, AntiHack.NAME, totalPunishments + 1, true, daysBanned == -1 ? -1 : TimeUnit.DAYS.toHours(daysBanned), true); + require(Punish.class).AddPunishment(coreClient.getName(), Category.Hacking, message, AntiHack.NAME, 3, true, -1, true); announceBan(player); }); } @@ -576,10 +631,7 @@ public class AntiHack extends MiniPlugin @EventHandler public void on(PlayerViolationEvent event) { - if (IS_PHASE_TWO) - { - AntiHackAction.getAction(event.getCheckClass()).handle(event); - } + AntiHackAction.getAction(event.getCheckClass()).handle(event); } public void announceBan(Player player) @@ -918,21 +970,9 @@ public class AntiHack extends MiniPlugin @EventHandler public void onHack(PlayerViolationEvent event) { - for (Player player : Bukkit.getOnlinePlayers()) - { - CoreClient client = _clientManager.Get(player); - if (event.shouldTellStaff()) - { - if (client.GetRank().has(Rank.HELPER)) - { - UtilPlayer.message(player, C.cAqua + C.Scramble + "A" + ChatColor.RESET + C.cRed + C.Bold + " GWEN > " + ChatColor.RESET + C.cGold + event.getPlayer().getName() + C.cYellow + " failed " + event.getHackType() + " VL" + event.getViolations() + ": " + event.getMessage() + ". Please investigate"); - } - } - } - if (event.shouldTellStaff()) { - String key = event.getPlayer().getName() + "." + event.getHackType(); + String key = event.getPlayer().getName() + "." + event.getHackType() + "." + CHECKS.get(event.getHackType()).getSeverity(event.getViolations()).toString(); Integer pastVl = this._cooldown.getIfPresent(key); if (pastVl != null) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/CheckThresholds.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/CheckThresholds.java new file mode 100644 index 000000000..b00207db6 --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/CheckThresholds.java @@ -0,0 +1,61 @@ +package mineplex.core.antihack; + +import net.minecraft.server.v1_8_R3.ChatComponentText; +import net.minecraft.server.v1_8_R3.ChatModifier; +import net.minecraft.server.v1_8_R3.EnumChatFormat; +import net.minecraft.server.v1_8_R3.IChatBaseComponent; + +public class CheckThresholds +{ + private final String _friendlyName; + private final int _med; + private final int _high; + + public CheckThresholds(String friendlyName, int med, int high) + { + _friendlyName = friendlyName; + _med = med; + _high = high; + } + + public String getFriendlyName() + { + return _friendlyName; + } + + public IChatBaseComponent format(int violationLevel) + { + EnumChatFormat color = getSeverity(violationLevel)._color; + return new ChatComponentText(_friendlyName).setChatModifier(new ChatModifier().setColor(color)); + } + + public Severity getSeverity(int violationLevel) + { + if (violationLevel >= _high) + { + return Severity.HIGH; + + } else if (violationLevel >= _med) + { + return Severity.MEDIUM; + + } else + { + return Severity.LOW; + } + } + + public enum Severity + { + LOW(EnumChatFormat.GREEN), + MEDIUM(EnumChatFormat.GOLD), + HIGH(EnumChatFormat.RED), + ; + private final EnumChatFormat _color; + + Severity(EnumChatFormat color) + { + _color = color; + } + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/AntiHackAction.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/AntiHackAction.java index 0d09b4e80..689f57f7b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/AntiHackAction.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/AntiHackAction.java @@ -2,9 +2,6 @@ package mineplex.core.antihack.actions; import com.mineplex.anticheat.api.PlayerViolationEvent; import com.mineplex.anticheat.checks.combat.KillauraTypeA; -import com.mineplex.anticheat.checks.combat.KillauraTypeB; -import com.mineplex.anticheat.checks.combat.KillauraTypeD; -import com.mineplex.anticheat.checks.player.BadPackets; import mineplex.core.common.util.UtilServer; import org.bukkit.event.Listener; @@ -22,10 +19,7 @@ public abstract class AntiHackAction implements Listener static { - ACTIONS.put(KillauraTypeA.class, new ImmediateBanAction(60)); - ACTIONS.put(KillauraTypeB.class, new BanwaveAction(NEXT_BAN_WAVE, 50)); - ACTIONS.put(KillauraTypeD.class, new BanwaveAction(NEXT_BAN_WAVE, 550)); - ACTIONS.put(BadPackets.class, new MixedAction(new BanwaveAction(NEXT_BAN_WAVE, 80), new ImmediateBanAction(120))); + ACTIONS.put(KillauraTypeA.class, new ImmediateBanAction(200)); } private int _vl; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/ImmediateBanAction.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/ImmediateBanAction.java index 70f3a7609..668d82389 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/ImmediateBanAction.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/actions/ImmediateBanAction.java @@ -3,10 +3,7 @@ package mineplex.core.antihack.actions; import com.mineplex.anticheat.api.PlayerViolationEvent; import mineplex.core.Managers; import mineplex.core.antihack.AntiHack; -import mineplex.core.punish.Category; -import mineplex.core.punish.Punish; - -import java.util.concurrent.TimeUnit; +import mineplex.core.common.util.UtilServer; class ImmediateBanAction extends AntiHackAction { @@ -20,7 +17,12 @@ class ImmediateBanAction extends AntiHackAction { if (event.getViolations() >= this.getMinVl()) { - Managers.get(AntiHack.class).doBan(event.getPlayer(), event.getMessage()); + String server = UtilServer.getServerName(); + if (server.contains("-")) + { + server = server.substring(0, server.indexOf('-')); + } + Managers.get(AntiHack.class).doBan(event.getPlayer(), "[GWEN] Hacking - " + AntiHack.CHECKS.get(event.getHackType()).getFriendlyName() + " [" + server + "]"); } } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/banwave/BanWaveManager.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/banwave/BanWaveManager.java index c39c476a7..8b39d9ac0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/banwave/BanWaveManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/banwave/BanWaveManager.java @@ -24,11 +24,6 @@ public class BanWaveManager extends MiniPlugin @EventHandler public void onJoin(PlayerJoinEvent event) { - if (!AntiHack.IS_PHASE_TWO) - { - return; - } - runAsync(() -> { CoreClient client = require(CoreClientManager.class).Get(event.getPlayer()); diff --git a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java index b4846dfc8..802b3d643 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/monitor/LagMeter.java @@ -37,8 +37,6 @@ public class LagMeter extends MiniPlugin private boolean _timingsPasted; private long _timingsStarted; - private boolean _fakeTps = false; - private HashSet _monitoring = new HashSet(); public LagMeter(JavaPlugin plugin, CoreClientManager clientManager) @@ -122,10 +120,6 @@ public class LagMeter extends MiniPlugin public double getTicksPerSecond() { - if (_fakeTps) - { - return 20.0; - } return _ticksPerSecond; } @@ -170,10 +164,4 @@ public class LagMeter extends MiniPlugin player.sendMessage(F.main(getName(), ChatColor.GRAY + "Free-------" + ChatColor.YELLOW + (Runtime.getRuntime().freeMemory() / 1048576) + "MB")); player.sendMessage(F.main(getName(), ChatColor.GRAY + "Max--------" + ChatColor.YELLOW + (Runtime.getRuntime().maxMemory() / 1048576)) + "MB"); } - - // I'm so sorry. Blame ServerMonitor for being so strict - public void setFakeTps(boolean fakeTps) - { - this._fakeTps = fakeTps; - } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/ExclusivePreferencesPage.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/ExclusivePreferencesPage.java index b0b052ffa..c376b2461 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/ExclusivePreferencesPage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/ui/ExclusivePreferencesPage.java @@ -126,7 +126,7 @@ public class ExclusivePreferencesPage extends ShopPageBase 24100) + if (this.WorldTimeSet > 24100 || GetTeam(ChatColor.RED).GetSize() == 0) { SetCustomWinLine(_kingName + ChatColor.RESET + " has survived the siege!"); @@ -607,7 +613,7 @@ public class CastleSiege extends TeamGame SetState(GameState.End); } - if (!_king.isValid()) + if (!_king.isValid() || GetTeam(ChatColor.AQUA).GetSize() == 0) { if (_kingDamager != null) { 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 8ec8474f7..b6bad607f 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 @@ -111,7 +111,7 @@ public class Draw extends SoloGame { "Take turns to draw something", "Right-Click with items to draw", - "Hints are given at top of screen", + "Hints are given at the bottom of screen", }); StrictAntiHack = true; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java index ac294cd0b..05527b4cd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/hideseek/HideSeek.java @@ -1339,6 +1339,11 @@ public class HideSeek extends TeamGame if (UtilBlock.usable(event.getClickedBlock())) event.setCancelled(true); + + if (event.getClickedBlock().getType() == Material.WOODEN_DOOR) + { + event.setCancelled(false); + } } public GameTeam getHiders() 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 6c7fa3b4e..e6d8f5e0a 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 @@ -1042,6 +1042,11 @@ public class Minestrike extends TeamGame { if (GetState() == GameState.Recruit || GetState() == GameState.Loading) return; + + if (Manager.isVanished(event.getPlayer())) + { + return; + } //Target Team GameTeam targetTeam = null; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitPig.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitPig.java index 23efec302..228622660 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitPig.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitPig.java @@ -76,8 +76,8 @@ public class KitPig extends SmashKit private static final ItemStack[] PLAYER_ARMOR = { ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS), - ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE), ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS), + ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE), null, }; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitWitherSkeleton.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitWitherSkeleton.java index b59a1bd66..75739762e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitWitherSkeleton.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/smash/kits/KitWitherSkeleton.java @@ -67,10 +67,10 @@ public class KitWitherSkeleton extends SmashKit private static final ItemStack[] PLAYER_ARMOR = { - ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET), - ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE), + ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS), ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_LEGGINGS), - ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_BOOTS) + ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_CHESTPLATE), + ItemStackFactory.Instance.CreateStack(Material.CHAINMAIL_HELMET) }; 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 021f988ea..5b6f4d4b3 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 @@ -36,6 +36,7 @@ import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.EntityShootBowEvent; import org.bukkit.event.entity.ExplosionPrimeEvent; import org.bukkit.event.entity.ItemSpawnEvent; +import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.hanging.HangingBreakEvent; @@ -1244,7 +1245,7 @@ public abstract class SurvivalGames extends Game if (!(event.getEntity() instanceof Fireball)) return; - + Collection blocks = UtilBlock.getInRadius( event.getEntity().getLocation(), 2.4).keySet(); @@ -1266,6 +1267,15 @@ public abstract class SurvivalGames extends Game return sides >= 3; } + + @EventHandler + public void borderSpecInteraction(EntityDamageByEntityEvent event) + { + if (event.getEntity() instanceof Fireball && UtilPlayer.isSpectator(event.getDamager())) + { + event.setCancelled(true); + } + } @EventHandler public void borderDamage(CustomDamageEvent event) 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 3ddb02053..18d67e8ca 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 @@ -715,19 +715,6 @@ public class UHC extends TeamGame implements NCPHook } } - @EventHandler - public void toggleFakeTps(GameStateChangeEvent event) - { - if (event.GetState() != GameState.Dead) - { - Managers.get(LagMeter.class).setFakeTps(true); - } - else - { - Managers.get(LagMeter.class).setFakeTps(false); - } - } - @EventHandler public void generateWorld(GameStateChangeEvent event) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java index 516caaf7f..17683ac99 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/wither/WitherGame.java @@ -271,13 +271,6 @@ public class WitherGame extends TeamGame implements IBlockRestorer return; } - if(event.getBlock().getLocation().getBlockY() < _maxY - 4) - { - event.getPlayer().sendMessage(F.main("BlockChecker", "You may not build under this height!")); - event.setCancelled(true); - return; - } - _locationsOfBlocks.add(event.getBlock().getLocation()); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFirefly.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFirefly.java index df7e17b2e..f16ef797c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFirefly.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkFirefly.java @@ -17,15 +17,17 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilParticle; -import mineplex.core.common.util.UtilParticle.ViewDist; -import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilParticle.ParticleType; +import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; 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.game.Game; +import nautilus.game.arcade.game.games.smash.TeamSuperSmash; import nautilus.game.arcade.kit.SmashPerk; import nautilus.game.arcade.kit.perks.data.FireflyData; @@ -170,6 +172,11 @@ public class PerkFirefly extends SmashPerk if (event.GetDamage() <= 4) return; + if (!(event.GetDamagerEntity(true) instanceof Player)) + { + return; + } + Iterator dataIterator = _data.iterator(); while (dataIterator.hasNext()) @@ -181,6 +188,17 @@ public class PerkFirefly extends SmashPerk if (!UtilTime.elapsed(data.Time, 1250) && !isSuperActive(data.Player))// && event.GetCause() == DamageCause.PROJECTILE) { + Game game = Manager.GetGame(); + + if (game instanceof TeamSuperSmash) + { + if (game.GetTeam(data.Player).equals(game.GetTeam(event.GetDamagerPlayer(true)))) + { + event.SetCancelled("Team Damage"); + return; + } + } + dataIterator.remove(); } else diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java index 7e877fba7..2d8ce0e93 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameHostManager.java @@ -426,7 +426,14 @@ public class GameHostManager implements Listener msg += event.getMessage().split(" ")[i] + " "; } msg = msg.trim(); - + + msg = Manager.GetChat().getFilteredMessage(event.getPlayer(), msg); + + if (msg == null) + { + return; + } + Bukkit.broadcastMessage(C.cDGreen + C.Bold + event.getPlayer().getName() + " " + C.cGreen + msg); } @@ -677,11 +684,12 @@ public class GameHostManager implements Listener player.closeInventory(); } UtilPlayer.message(player, F.main("Server", "Your Co-Host privileges were removed.")); - - player.setGameMode(GameMode.SURVIVAL); - + if (isEventServer()) + { + player.setGameMode(GameMode.SURVIVAL); worldeditPermissionSet(player, false); + } } }