From b9640a763c656f1383d67fe5a9264f79a6a8c552 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Aug 2017 19:38:22 +0100 Subject: [PATCH 01/12] Fix a negative number of defenders shown on the scoreboard. --- .../arcade/game/games/castlesiegenew/CastleSiegeNew.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java index d65b021bd..40c6b117e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java @@ -22,6 +22,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; @@ -371,6 +372,12 @@ public class CastleSiegeNew extends TeamGame } } + @EventHandler + public void playerQuit(PlayerQuitEvent event) + { + _wolves.remove(event.getPlayer()); + } + @Override public void EndCheck() { From 8135ca022c52f9eec21972a5e0dc509a89e703d8 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Aug 2017 20:14:57 +0100 Subject: [PATCH 02/12] Actually check that the player is allowed to have the default kit --- .../src/nautilus/game/arcade/managers/GamePlayerManager.java | 2 +- .../nautilus/game/arcade/managers/ProgressingKitManager.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 98d0cfb35..1c0ae3e0d 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 @@ -114,7 +114,7 @@ public class GamePlayerManager implements Listener if (kit instanceof ProgressingKit) { ProgressingKit progressingKit = (ProgressingKit) kit; - if (progressingKit.isDefault(player.getUniqueId())) + if (progressingKit.canEquipKit(player) && progressingKit.isDefault(player.getUniqueId())) { progressingKit.onSelected(player.getUniqueId()); return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/ProgressingKitManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/ProgressingKitManager.java index 16cb7c383..6d3dc6f3c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/ProgressingKitManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/ProgressingKitManager.java @@ -302,13 +302,15 @@ public class ProgressingKitManager implements Listener { UtilServer.getPlayersCollection().forEach(player -> { + UUID id = player.getUniqueId(); + for (Kit kit : _manager.GetGame().GetKits()) { //Set default kit if (kit instanceof ProgressingKit) { ProgressingKit progressingKit = (ProgressingKit) kit; - if (progressingKit.isDefault(player.getUniqueId())) + if (progressingKit.canEquipKit(player) && progressingKit.isDefault(id)) { progressingKit.onSelected(player.getUniqueId()); break; From c23c34c346d0506a22bf48759fa843e285cc37f4 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Aug 2017 20:22:56 +0100 Subject: [PATCH 03/12] Only check if they can mount a horses if the games is live --- .../game/games/castlesiegenew/CastleSiegeHorseManager.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeHorseManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeHorseManager.java index 009ecabfd..9ba19cf8e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeHorseManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeHorseManager.java @@ -66,7 +66,6 @@ public class CastleSiegeHorseManager implements Listener @EventHandler public void horseInteract(PlayerInteractEntityEvent event) { - if (!(event.getRightClicked() instanceof Horse)) { return; } From bad25cabd9834df7e427b55887426b6f5bb072b6 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 10 Aug 2017 20:23:09 +0100 Subject: [PATCH 04/12] Thanks git... --- .../game/games/castlesiegenew/CastleSiegeHorseManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeHorseManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeHorseManager.java index 9ba19cf8e..a1ba93f08 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeHorseManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeHorseManager.java @@ -66,6 +66,7 @@ public class CastleSiegeHorseManager implements Listener @EventHandler public void horseInteract(PlayerInteractEntityEvent event) { + if (!(event.getRightClicked() instanceof Horse) || !_host.IsLive()) { return; } From bcf66dc5748c21d60201f911c2630469ab2d8dd9 Mon Sep 17 00:00:00 2001 From: cnr Date: Sat, 12 Aug 2017 23:14:12 -0400 Subject: [PATCH 05/12] Re-enable KillAura type D; disable type F --- .../Mineplex.Core/src/mineplex/core/antihack/AntiHack.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 5f37a1453..680ee9600 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -109,8 +109,8 @@ public class AntiHack extends MiniPlugin public static final Map, AntiHackAction> ACTIONS = ImmutableMap., AntiHackAction>builder() .put(KillauraTypeA.class, new ImmediateBanAction(200)) - //.put(KillauraTypeD.class, new BanwaveAction(1500)) - .put(KillauraTypeF.class, new BanwaveAction(600)) + .put(KillauraTypeD.class, new BanwaveAction(1500)) + //.put(KillauraTypeF.class, new BanwaveAction(600)) .put(Glide.class, new ImmediateBanAction(10000)) .put(Speed.class, new ImmediateBanAction(10000)) .put(HeadRoll.class, new ImmediateBanAction(2000)) From 36bd6af9023d1e4058f6690e24f5c4ed9c4b9abd Mon Sep 17 00:00:00 2001 From: cnr Date: Sat, 12 Aug 2017 23:31:09 -0400 Subject: [PATCH 06/12] Disable movement checks in MOBA and lower Timer threshold --- .../src/mineplex/core/antihack/AntiHack.java | 2 +- .../game/arcade/game/games/moba/Moba.java | 51 ++++++++++++------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 680ee9600..789d6e04c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -115,7 +115,7 @@ public class AntiHack extends MiniPlugin .put(Speed.class, new ImmediateBanAction(10000)) .put(HeadRoll.class, new ImmediateBanAction(2000)) .put(Toggle.class, new ImmediateBanAction(500)) - .put(Timer.class, new ImmediateBanAction(15000)) + .put(Timer.class, new ImmediateBanAction(10000)) .put(BadPackets.class, new GEPBanAction(300)) .put(KillauraTypeB.class, new GEPBanAction(100)) .build(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/Moba.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/Moba.java index e35238b84..1ec98ddda 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/Moba.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/Moba.java @@ -1,6 +1,31 @@ package nautilus.game.arcade.game.games.moba; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.bukkit.Bukkit; +import org.bukkit.GameMode; +import org.bukkit.Location; +import org.bukkit.block.BlockFace; +import org.bukkit.entity.Arrow; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.EventPriority; +import org.bukkit.event.Listener; +import org.bukkit.event.entity.ProjectileHitEvent; +import org.bukkit.event.player.PlayerQuitEvent; + +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.Pair; import mineplex.core.common.Rank; import mineplex.core.common.util.F; @@ -16,6 +41,7 @@ import mineplex.core.leaderboard.Leaderboard; import mineplex.core.leaderboard.LeaderboardManager; import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType; import mineplex.minecraft.game.core.combat.DeathMessageType; + import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.GameType; import nautilus.game.arcade.events.GameStateChangeEvent; @@ -56,25 +82,6 @@ import nautilus.game.arcade.game.modules.CustomScoreboardModule; import nautilus.game.arcade.game.modules.compass.CompassModule; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.managers.lobby.current.NewGameLobbyManager; -import org.bukkit.Bukkit; -import org.bukkit.GameMode; -import org.bukkit.Location; -import org.bukkit.block.BlockFace; -import org.bukkit.entity.Arrow; -import org.bukkit.entity.Player; -import org.bukkit.event.EventHandler; -import org.bukkit.event.EventPriority; -import org.bukkit.event.Listener; -import org.bukkit.event.entity.ProjectileHitEvent; -import org.bukkit.event.player.PlayerQuitEvent; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; public class Moba extends TeamGame { @@ -186,6 +193,12 @@ public class Moba extends TeamGame caller.sendMessage(F.main("Kit", "Sorry that is not a kit!")); } }); + + // Disable specific GWEN checks for this game + AntiHack antiHack = Managers.get(AntiHack.class); + antiHack.addIgnoredCheck(Speed.class); + antiHack.addIgnoredCheck(Glide.class); + antiHack.addIgnoredCheck(HeadRoll.class); } protected T registerManager(T listener) From ab5ee84cb8ab0585f07eaf5f9c587208c06a489d Mon Sep 17 00:00:00 2001 From: cnr Date: Sat, 12 Aug 2017 23:31:35 -0400 Subject: [PATCH 07/12] Disable KillAura type D --- Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 789d6e04c..34b7f3699 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -109,7 +109,7 @@ public class AntiHack extends MiniPlugin public static final Map, AntiHackAction> ACTIONS = ImmutableMap., AntiHackAction>builder() .put(KillauraTypeA.class, new ImmediateBanAction(200)) - .put(KillauraTypeD.class, new BanwaveAction(1500)) + //.put(KillauraTypeD.class, new BanwaveAction(1500)) //.put(KillauraTypeF.class, new BanwaveAction(600)) .put(Glide.class, new ImmediateBanAction(10000)) .put(Speed.class, new ImmediateBanAction(10000)) From 4a08c3f1d706c65aafe1405860ad6ca052c28816 Mon Sep 17 00:00:00 2001 From: cnr Date: Thu, 17 Aug 2017 00:58:39 -0400 Subject: [PATCH 08/12] Implement requested Anticheat changes - Reduce speed + glide ban VL to 7500 - Re-enable bans for Killaura type D and Killaura type F - Re-enable auto-sneak detection and bans - Disable Killaura type D in MOBA and CS --- .../src/mineplex/core/antihack/AntiHack.java | 25 ++++++++----------- .../games/castlesiegenew/CastleSiegeNew.java | 8 ++++++ .../game/arcade/game/games/moba/Moba.java | 2 ++ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java index 34b7f3699..36fc72e4f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/antihack/AntiHack.java @@ -1,5 +1,6 @@ package mineplex.core.antihack; +import javax.xml.bind.DatatypeConverter; import java.util.Collections; import java.util.HashSet; import java.util.Map; @@ -9,7 +10,11 @@ import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -import javax.xml.bind.DatatypeConverter; +import net.md_5.bungee.api.ChatColor; +import net.md_5.bungee.api.chat.BaseComponent; +import net.md_5.bungee.api.chat.ClickEvent; +import net.md_5.bungee.api.chat.ComponentBuilder; +import net.md_5.bungee.api.chat.HoverEvent; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -81,11 +86,6 @@ import mineplex.core.punish.PunishClient; import mineplex.core.punish.Punishment; import mineplex.core.punish.PunishmentResponse; import mineplex.serverdata.commands.ServerCommandManager; -import net.md_5.bungee.api.ChatColor; -import net.md_5.bungee.api.chat.BaseComponent; -import net.md_5.bungee.api.chat.ClickEvent; -import net.md_5.bungee.api.chat.ComponentBuilder; -import net.md_5.bungee.api.chat.HoverEvent; @ReflectivelyCreateMiniPlugin public class AntiHack extends MiniPlugin @@ -109,10 +109,10 @@ public class AntiHack extends MiniPlugin public static final Map, AntiHackAction> ACTIONS = ImmutableMap., AntiHackAction>builder() .put(KillauraTypeA.class, new ImmediateBanAction(200)) - //.put(KillauraTypeD.class, new BanwaveAction(1500)) - //.put(KillauraTypeF.class, new BanwaveAction(600)) - .put(Glide.class, new ImmediateBanAction(10000)) - .put(Speed.class, new ImmediateBanAction(10000)) + .put(KillauraTypeD.class, new BanwaveAction(1500)) + .put(KillauraTypeF.class, new BanwaveAction(600)) + .put(Glide.class, new ImmediateBanAction(7500)) + .put(Speed.class, new ImmediateBanAction(7500)) .put(HeadRoll.class, new ImmediateBanAction(2000)) .put(Toggle.class, new ImmediateBanAction(500)) .put(Timer.class, new ImmediateBanAction(10000)) @@ -435,11 +435,6 @@ public class AntiHack extends MiniPlugin @EventHandler public void onHack(PlayerViolationEvent event) { - if (event.getCheckClass() == Toggle.class) - { - return; - } - if (_ignoredChecks.contains(event.getCheckClass())) { return; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java index 40c6b117e..f3c30678c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/CastleSiegeNew.java @@ -26,8 +26,12 @@ import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; +import com.mineplex.anticheat.checks.combat.KillauraTypeD; + +import mineplex.core.Managers; import mineplex.core.achievement.Achievement; import mineplex.core.achievement.AchievementCategory; +import mineplex.core.antihack.AntiHack; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilEnt; @@ -171,6 +175,10 @@ public class CastleSiegeNew extends TeamGame new CompassModule() .register(this); + + // Disable specific GWEN checks for this game + AntiHack antiHack = Managers.get(AntiHack.class); + antiHack.addIgnoredCheck(KillauraTypeD.class); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/Moba.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/Moba.java index 1ec98ddda..e67ec6094 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/Moba.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/moba/Moba.java @@ -20,6 +20,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.player.PlayerQuitEvent; +import com.mineplex.anticheat.checks.combat.KillauraTypeD; import com.mineplex.anticheat.checks.move.Glide; import com.mineplex.anticheat.checks.move.HeadRoll; import com.mineplex.anticheat.checks.move.Speed; @@ -199,6 +200,7 @@ public class Moba extends TeamGame antiHack.addIgnoredCheck(Speed.class); antiHack.addIgnoredCheck(Glide.class); antiHack.addIgnoredCheck(HeadRoll.class); + antiHack.addIgnoredCheck(KillauraTypeD.class); } protected T registerManager(T listener) From 7f6796cff9a9e914555c994259722d508711f490 Mon Sep 17 00:00:00 2001 From: Sarah Date: Sat, 5 Aug 2017 00:20:29 +0200 Subject: [PATCH 09/12] Fix Dragon Escape mission --- .../dragonescape/quests/DragonEscapeWinQuestTracker.java | 5 +++++ .../src/nautilus/game/arcade/quest/CollectQuestTracker.java | 2 -- .../src/nautilus/game/arcade/quest/HitQuestTracker.java | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/quests/DragonEscapeWinQuestTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/quests/DragonEscapeWinQuestTracker.java index b47de5575..80efbbcc3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/quests/DragonEscapeWinQuestTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/quests/DragonEscapeWinQuestTracker.java @@ -24,6 +24,11 @@ public class DragonEscapeWinQuestTracker extends QuestTracker public void increment(Player player) { + if (!player.isOnline()) + { + return; + } + incrementQuests(player, 1, ((Arcade) UtilServer.getPlugin()).getServerConfig().getServerGroup().getPrefix(), getGame().GetKit(player).GetName() + "Kit", "Parkour"); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/CollectQuestTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/CollectQuestTracker.java index 9bcc6165e..a67d3b93e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/CollectQuestTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/CollectQuestTracker.java @@ -1,12 +1,10 @@ package nautilus.game.arcade.quest; -import java.awt.dnd.DragSourceDropEvent; import java.util.ArrayList; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.Material; -import org.bukkit.block.Block; import org.bukkit.block.Chest; import org.bukkit.block.DoubleChest; import org.bukkit.entity.Player; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/HitQuestTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/HitQuestTracker.java index 665657a3d..77ad5189a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/HitQuestTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/quest/HitQuestTracker.java @@ -51,8 +51,6 @@ public class HitQuestTracker extends QuestTracker if (!event.GetReason().contains("Axe Thrower")) return; - System.out.println("Test2"); - incrementQuests(event.GetDamagerPlayer(true), 1, "Player", "Axe", getGame().GetKit(event.GetDamagerPlayer(true)).GetName() + "Kit"); } } From 0d7e404da88508c2a2c24954b94598fd6d836baf Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sat, 12 Aug 2017 23:50:43 -0400 Subject: [PATCH 10/12] Add mute awareness message feature for t3 Tested by t3hero --- .../mineplex/core/message/ClientMessage.java | 2 +- .../mineplex/core/message/MessageManager.java | 51 +++++++++++-------- .../core/message/redis/RedisMessage.java | 2 +- .../message/redis/RedisMessageCallback.java | 12 +++-- .../mineplex/core/preferences/Preference.java | 8 +-- 5 files changed, 46 insertions(+), 29 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/ClientMessage.java b/Plugins/Mineplex.Core/src/mineplex/core/message/ClientMessage.java index c27e778fa..64956db8f 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/ClientMessage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/ClientMessage.java @@ -6,4 +6,4 @@ public class ClientMessage public String LastAdminTo; public long LastToTime; public int SpamCounter; -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java index cbb4950e9..0096f0486 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/MessageManager.java @@ -1,5 +1,17 @@ package mineplex.core.message; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.UUID; + +import org.bukkit.Bukkit; +import org.bukkit.ChatColor; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.scheduler.BukkitRunnable; + import mineplex.core.MiniClientPlugin; import mineplex.core.account.CoreClientManager; import mineplex.core.chat.Chat; @@ -33,18 +45,6 @@ import mineplex.core.punish.Punishment; import mineplex.core.punish.PunishmentSentence; import mineplex.serverdata.commands.AnnouncementCommand; import mineplex.serverdata.commands.ServerCommandManager; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.Sound; -import org.bukkit.entity.Player; -import org.bukkit.plugin.java.JavaPlugin; -import org.bukkit.scheduler.BukkitRunnable; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.UUID; public class MessageManager extends MiniClientPlugin { @@ -263,6 +263,10 @@ public class MessageManager extends MiniClientPlugin // Send UtilPlayer.message(to, C.cGold + "§l" + from.getName() + " > " + to.getName() + C.cYellow + " §l" + message); + if (_punish.GetClient(to.getName()).IsMuted() && _preferences.get(to).isActive(Preference.INFORM_MUTED)) + { + UtilPlayer.message(from, F.main(getName(), F.elem(to.getName()) + " is currently muted and cannot reply to you!")); + } } public void DoMessageAdmin(Player from, Player to, String message) @@ -345,7 +349,8 @@ public class MessageManager extends MiniClientPlugin "Mmm...Steak!", "Poop! Poop everywhere!", "I'm so forgetful. Like I was going to say somethin...wait what were we talking about?", - "Mmm...Steak!" + "Mmm...Steak!", + "#BlameAlex" ); } @@ -359,7 +364,7 @@ public class MessageManager extends MiniClientPlugin if (_randomMessage.isEmpty()) return "meow"; - return _randomMessage.get(UtilMath.r(_randomMessage.size())); + return UtilMath.randomElement(_randomMessage); } public void Help(Player caller) @@ -392,7 +397,7 @@ public class MessageManager extends MiniClientPlugin // Message the sender RedisMessageCallback message = new RedisMessageCallback(globalMessage, true, to.getName(), - C.cPurple + "-> " + toRank + " " + to.getName() + " " + C.cPurple + globalMessage.getMessage()); + C.cPurple + "-> " + toRank + " " + to.getName() + " " + C.cPurple + globalMessage.getMessage(), false); // Inform Admins for (Player staff : UtilServer.getPlayers()) @@ -416,8 +421,7 @@ public class MessageManager extends MiniClientPlugin if (canMessage != null) { - - RedisMessageCallback message = new RedisMessageCallback(globalMessage, false, null, canMessage); + RedisMessageCallback message = new RedisMessageCallback(globalMessage, false, null, canMessage, false); message.publish(); @@ -431,9 +435,11 @@ public class MessageManager extends MiniClientPlugin UtilPlayer.message(to, message); to.playSound(to.getLocation(), Sound.NOTE_PIANO, 2f, 2f); + + boolean informMuted = _punish.GetClient(to.getName()).IsMuted() && _preferences.get(to).isActive(Preference.INFORM_MUTED); // Message the sender - RedisMessageCallback redisMessage = new RedisMessageCallback(globalMessage, false, to.getName(), message); + RedisMessageCallback redisMessage = new RedisMessageCallback(globalMessage, false, to.getName(), message, informMuted); redisMessage.publish(); } @@ -453,6 +459,11 @@ public class MessageManager extends MiniClientPlugin if (target != null) { target.sendMessage(message.getMessage()); + + if (message.informMuted()) + { + UtilPlayer.message(target, F.main(getName(), F.elem(message.getLastReplied()) + " is currently muted and cannot reply to you!")); + } target.playSound(target.getLocation(), Sound.NOTE_PIANO, 2f, 2f); @@ -647,6 +658,6 @@ public class MessageManager extends MiniClientPlugin public PreferencesManager getPreferences() { - return this._preferences; + return _preferences; } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/redis/RedisMessage.java b/Plugins/Mineplex.Core/src/mineplex/core/message/redis/RedisMessage.java index 941ea76e5..2cd47cc02 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/redis/RedisMessage.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/redis/RedisMessage.java @@ -70,4 +70,4 @@ public class RedisMessage extends ServerCommand { // Utilitizes a callback functionality to seperate dependencies } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/message/redis/RedisMessageCallback.java b/Plugins/Mineplex.Core/src/mineplex/core/message/redis/RedisMessageCallback.java index 11a634d37..e5218ebe0 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/message/redis/RedisMessageCallback.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/message/redis/RedisMessageCallback.java @@ -12,16 +12,17 @@ public class RedisMessageCallback extends ServerCommand private String _message; private String _setLastMessage; private String _target; - private boolean _staffMessage; + private boolean _staffMessage, _informMuted; private UUID _uuid; - public RedisMessageCallback(RedisMessage globalMessage, boolean staffMessage, String receivedPlayer, String message) + public RedisMessageCallback(RedisMessage globalMessage, boolean staffMessage, String receivedPlayer, String message, boolean informMuted) { _target = globalMessage.getSender(); _message = message; _setLastMessage = receivedPlayer; _uuid = globalMessage.getUUID(); _staffMessage = staffMessage; + _informMuted = informMuted; if (globalMessage.getSendingServer() != null) { @@ -33,6 +34,11 @@ public class RedisMessageCallback extends ServerCommand { return _staffMessage; } + + public boolean informMuted() + { + return _informMuted; + } public String getLastReplied() { @@ -59,4 +65,4 @@ public class RedisMessageCallback extends ServerCommand { // Utilitizes a callback functionality to seperate dependencies } -} +} \ No newline at end of file diff --git a/Plugins/Mineplex.Core/src/mineplex/core/preferences/Preference.java b/Plugins/Mineplex.Core/src/mineplex/core/preferences/Preference.java index 66c0f116c..20fc14901 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/preferences/Preference.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/preferences/Preference.java @@ -48,7 +48,9 @@ public enum Preference PARTY_DISPLAY_INVENTORY_UI(true, PreferenceCategory.SOCIAL, Material.CHEST, "Display Parties GUI"), - RANDOM_MESSAGES(true, PreferenceCategory.USER, Material.COMMAND, "Send random messages", "Got nothing to say? We got you covered!") + RANDOM_MESSAGES(true, PreferenceCategory.USER, Material.COMMAND, "Send Random Messages", "Got nothing to say? We got you covered!"), + + INFORM_MUTED(false, PreferenceCategory.USER, Material.BARRIER, "Inform When Muted", "Inform people who message you if you are muted!") ; private static final Map PREFERENCE_MAP = Maps.newHashMap(); @@ -118,6 +120,4 @@ public enum Preference { return PREFERENCE_MAP.get(id); } - - -} +} \ No newline at end of file From 607d976f0ea04b146e9cd224ce18e2a56dd7b20d Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 11 Aug 2017 14:05:01 +0100 Subject: [PATCH 11/12] Change Castle Siege in the game menu --- .../Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java index 8227ede93..501bc687a 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/server/ui/ServerGameMenu.java @@ -178,7 +178,7 @@ public class ServerGameMenu extends ShopPageBase { (_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATES", C.Reset + "", - C.Reset + "Defenders must protect King Sparklez", + C.Reset + "Defenders must protect King Chiss", C.Reset + "from the endless waves of Undead", C.Reset + "until the sun rises!", }, "CS", "Castle_Siege", new SelectCSButton(this)); From d9a2306f9b70f9127de8070574de57202e06a845 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 11 Aug 2017 14:05:24 +0100 Subject: [PATCH 12/12] Always setMaxHealth from a base of 20 --- .../arcade/game/games/castlesiegenew/kits/KitUndeadZombie.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie.java index 363bd7c16..8b5ac6ada 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/castlesiegenew/kits/KitUndeadZombie.java @@ -76,6 +76,6 @@ public class KitUndeadZombie extends KitCastleSiege int level = getUpgradeLevel(player.getUniqueId()); - player.setMaxHealth(player.getMaxHealth() + level * 2); + player.setMaxHealth(20 + level * 2); } }