From 9e75cc6224076c40e4dfbee139dcc70d4c1eec6f Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Jun 2016 11:12:16 +0100 Subject: [PATCH 01/26] Fixes incorrect item in OITQ Players should now get the stone sword that is intended with the leaper kit, assuming it was some merge or pushing error. --- .../nautilus/game/arcade/game/games/quiver/kits/KitLeaper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c67f789fa..f12ed6a8d 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 @@ -31,7 +31,7 @@ public class KitLeaper extends ProgressingKit private static final ItemStack IN_HAND = new ItemStack(Material.STONE_SWORD); private static final ItemStack[] PLAYER_ITEMS = { - ItemStackFactory.Instance.CreateStack(Material.IRON_AXE), + ItemStackFactory.Instance.CreateStack(Material.STONE_SWORD), ItemStackFactory.Instance.CreateStack(Material.BOW) }; From c3a18813ee7f48935f295232bb8a991bd77feba6 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Jun 2016 11:39:51 +0100 Subject: [PATCH 02/26] PC-555 Fixes an issue where vanished players would show up in the "Give Co-Host" and "Remove player" menus in MPS. --- .../game/arcade/gui/privateServer/page/PlayerPage.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/PlayerPage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/PlayerPage.java index c2f6f2817..c6cf102d5 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/PlayerPage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/gui/privateServer/page/PlayerPage.java @@ -44,7 +44,12 @@ public abstract class PlayerPage extends BasePage players = new ArrayList<>(); for (String s : _players) { - players.add(Bukkit.getPlayer(s)); + Player player = Bukkit.getPlayer(s); + + if (!_plugin.isVanished(player)) + { + players.add(player); + } } } else @@ -56,7 +61,7 @@ public abstract class PlayerPage extends BasePage int slot = 9; for (Player player : players) { - if (showPlayer(player)) + if (showPlayer(player) && !_plugin.isVanished(player)) { ItemStack head = getPlayerHead(player.getName(), C.cGreen + C.Bold + player.getName(), new String[]{ ChatColor.RESET + C.cGray + getDisplayString(player) }); addButton(slot, head, new Button(slot, player)); From 1d3e12dfb643e694e62c420681c755d12a0f596a Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Jun 2016 12:10:39 +0100 Subject: [PATCH 03/26] PC-574 Fixes an issue where staff in vanish would be placed in the game after each round. --- .../game/arcade/game/games/minestrike/MineStrike.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 a7468cf90..f6b99efc2 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 @@ -2138,7 +2138,13 @@ public class MineStrike extends TeamGame team.SpawnTeleport(false); //Revive Dead Players - for (Player player : GetPlayers(false)) + for (Player player : GetPlayers(false)) + { + if (Manager.isVanished(player)) + { + continue; + } + if (!IsAlive(player)) { SetPlayerState(player, PlayerState.IN); @@ -2156,6 +2162,7 @@ public class MineStrike extends TeamGame if (GetKit(player) != null) GetKit(player).ApplyKit(player); } + } //Remove Scope for (Player player : GetPlayers(false)) From ce23a94f3f32f5b76f3d5435f6e8cdf41b4cb99f Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 16 Jun 2016 12:25:21 +0100 Subject: [PATCH 04/26] PC-550 Fixes an issue where players would be able to interact with blocks on other people's islands in Speed Builders --- .../games/speedbuilders/SpeedBuilders.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java index da4406b2c..1ff25e748 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java @@ -1694,6 +1694,33 @@ public class SpeedBuilders extends SoloGame UtilAction.velocity(event.getPlayer(), new Vector(0, 1, 0)); } + + @EventHandler + public void fixDoorToggling(PlayerInteractEvent event) + { + if (!IsLive()) + return; + + if (_state != SpeedBuildersState.BUILDING) + return; + + if (!_buildRecreations.containsKey(event.getPlayer())) + return; + + if (_perfectBuild.containsKey(event.getPlayer())) + { + event.setCancelled(true); + return; + } + + Block block = event.getClickedBlock(); + + if (!_buildRecreations.get(event.getPlayer()).inBuildArea(block)) + { + event.setCancelled(true); + UtilPlayer.message(event.getPlayer(), F.main("Build", "You cannot modify other player\'s builds")); + } + } @Override public void EndCheck() From 79085c1ecff09373d5fa9be0c172e748bd1485ba Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jun 2016 00:26:24 +0100 Subject: [PATCH 05/26] PC-541 Fixes an issue where glowing redstone ore would not be counted if the expected block was redstone ore. --- .../arcade/game/games/speedbuilders/data/RecreationData.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java index 268434338..4fd17f57c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java @@ -324,6 +324,11 @@ public class RecreationData score++; } + if (expectedState.getType() == Material.REDSTONE_ORE && currentBlock.getType() == Material.GLOWING_REDSTONE_ORE) + { + score++; + } + //Fix for corner stair shape if (currentBlock.getState().getData() instanceof Stairs && expectedState.getData() instanceof Stairs) { From a20ae6b58d1db779718614d20b64ca3bb2f99a9b Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jun 2016 00:31:32 +0100 Subject: [PATCH 06/26] PC-540 Fixes an issue where players could lose water blocks in Speed builders. --- .../arcade/game/games/speedbuilders/SpeedBuilders.java | 10 +++++++++- .../game/games/speedbuilders/data/RecreationData.java | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java index 1ff25e748..9aff3a136 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java @@ -17,6 +17,7 @@ import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilItem; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; @@ -1541,6 +1542,13 @@ public class SpeedBuilders extends SoloGame UtilPlayer.message(event.getPlayer(), F.main("Build", "Cannot build outside your area!")); } + else + { + if (liquid.getType() == Material.STATIONARY_WATER) + { + event.setCancelled(true); + } + } } @EventHandler @@ -1713,7 +1721,7 @@ public class SpeedBuilders extends SoloGame return; } - Block block = event.getClickedBlock(); + Block block = event.getClickedBlock().getRelative(event.getBlockFace()); if (!_buildRecreations.get(event.getPlayer()).inBuildArea(block)) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java index 4fd17f57c..f8d04201e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java @@ -324,6 +324,7 @@ public class RecreationData score++; } + //Fix for glowing redstone ore if (expectedState.getType() == Material.REDSTONE_ORE && currentBlock.getType() == Material.GLOWING_REDSTONE_ORE) { score++; From cbca7e9f7e1567458d7e1bb3da82767c8a802c4a Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jun 2016 12:06:56 +0100 Subject: [PATCH 07/26] PC-540 Fixed unneeded messages --- .../game/games/speedbuilders/SpeedBuilders.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java index 9aff3a136..0c02a2c71 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/SpeedBuilders.java @@ -17,7 +17,6 @@ import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilInv; -import mineplex.core.common.util.UtilItem; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; @@ -56,7 +55,6 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.v1_8_R3.entity.CraftEntity; import org.bukkit.entity.ArmorStand; @@ -1544,7 +1542,7 @@ public class SpeedBuilders extends SoloGame } else { - if (liquid.getType() == Material.STATIONARY_WATER) + if (liquid.getType() == Material.STATIONARY_WATER || liquid.getType() == Material.WATER) { event.setCancelled(true); } @@ -1721,12 +1719,18 @@ public class SpeedBuilders extends SoloGame return; } + if (event.getPlayer().getItemInHand() == null) + { + event.setCancelled(true); + return; + } + Block block = event.getClickedBlock().getRelative(event.getBlockFace()); if (!_buildRecreations.get(event.getPlayer()).inBuildArea(block)) { event.setCancelled(true); - UtilPlayer.message(event.getPlayer(), F.main("Build", "You cannot modify other player\'s builds")); + UtilPlayer.message(event.getPlayer(), F.main("Build", "Cannot build outside your area!")); } } From 35b00679e09ea851b7486b2ca8dc06183696d038 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jun 2016 18:08:37 +0100 Subject: [PATCH 08/26] PC-516 When out of leaps in dragon escape there is no longer the "You can now use Leap" message. --- .../src/nautilus/game/arcade/kit/perks/PerkLeap.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkLeap.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkLeap.java index f971ae57a..0c2b37ecf 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkLeap.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkLeap.java @@ -13,6 +13,7 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.NautHashMap; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilItem; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.recharge.Recharge; @@ -72,7 +73,7 @@ public class PerkLeap extends Perk if (event.getPlayer().getItemInHand() == null) return; - if (!event.getPlayer().getItemInHand().getType().toString().contains("_AXE")) + if (!UtilItem.isAxe(event.getPlayer().getItemInHand())) return; Player player = event.getPlayer(); @@ -94,7 +95,7 @@ public class PerkLeap extends Perk } //Energy - if (!Recharge.Instance.use(player, _name, _recharge, true, true)) + if (!Recharge.Instance.use(player, _name, _recharge, false, true)) return; //Use Use From 09957c203b8951a9abc3b73c34b953289df3a8a9 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 17 Jun 2016 22:24:46 +0100 Subject: [PATCH 09/26] PC-506 Fixes an issue where the creeper's passive in SSM would activate when they took starvation damage. --- .../game/arcade/kit/perks/PerkCreeperElectricity.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperElectricity.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperElectricity.java index c9054de14..0b6ae7d62 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperElectricity.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperElectricity.java @@ -39,10 +39,7 @@ public class PerkCreeperElectricity extends Perk if (event.IsCancelled()) return; - if (event.GetCause() == DamageCause.ENTITY_ATTACK) - return; - - if (event.GetCause() == DamageCause.FIRE_TICK) + if (event.GetCause() == DamageCause.ENTITY_ATTACK || event.GetCause() == DamageCause.FIRE_TICK || event.GetCause() == DamageCause.STARVATION) return; Player damagee = event.GetDamageePlayer(); From c19af4e1c53f1551f1229bb8fa0e6db8f7b3ca28 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 18 Jun 2016 00:04:03 +0100 Subject: [PATCH 10/26] PC-505 Fixed an issue where players could hit team members with Bouncy Bacon and get the health bonus from it. --- .../game/arcade/kit/perks/PerkPigBaconBounce.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java index cff63ed81..8b5d15ddc 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java @@ -33,6 +33,7 @@ import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.projectile.IThrown; import mineplex.core.projectile.ProjectileUser; import mineplex.core.recharge.Recharge; +import nautilus.game.arcade.game.games.smash.TeamSuperSmash; import nautilus.game.arcade.kit.SmashPerk; public class PerkPigBaconBounce extends SmashPerk implements IThrown @@ -108,6 +109,18 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown if (target == null) return; + + if (Manager.GetGame() instanceof TeamSuperSmash && target instanceof Player && data.GetThrower() instanceof Player) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + Player targetPlayer = (Player) target; + Player throwerPlayer = (Player) data.GetThrower(); + + if(smash.GetTeam(targetPlayer).equals(smash.GetTeam(throwerPlayer))) + { + return; + } + } //Damage Event Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, From d167f934860ea51425b66c922a093929b6fe5cf5 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 18 Jun 2016 15:33:39 +0100 Subject: [PATCH 11/26] PC-507 Fixes an issue where Blaze's "Firefly" and "Phoenix" abilities did no damage or knockback. --- .../nautilus/game/arcade/kit/perks/PerkFirefly.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) 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 5b8a4d23a..dfa1aac38 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 @@ -3,11 +3,8 @@ package nautilus.game.arcade.kit.perks; import java.util.HashSet; import java.util.Iterator; -import org.bukkit.Color; import org.bukkit.EntityEffect; -import org.bukkit.FireworkEffect; import org.bukkit.Sound; -import org.bukkit.FireworkEffect.Type; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; @@ -19,7 +16,6 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilFirework; import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle.ViewDist; import mineplex.core.common.util.UtilServer; @@ -30,7 +26,6 @@ import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import mineplex.minecraft.game.core.damage.CustomDamageEvent; -import nautilus.game.arcade.kit.Perk; import nautilus.game.arcade.kit.SmashPerk; import nautilus.game.arcade.kit.perks.data.FireflyData; @@ -93,7 +88,7 @@ public class PerkFirefly extends SmashPerk if (event.getType() != UpdateType.TICK) return; - _tick = (_tick + 1)%1000; + _tick++; Iterator dataIterator = _data.iterator(); @@ -147,11 +142,10 @@ public class PerkFirefly extends SmashPerk continue; other.playEffect(EntityEffect.HURT); - - if (_tick == 0) + + if (_tick % 12 == 0) { if (Recharge.Instance.use(other, GetName() + " hit by " + data.Player.getName(), 2000, false, false)) - { //Damage Event Manager.GetDamage().NewDamageEvent(other, data.Player, null, DamageCause.CUSTOM, 10, true, true, false, From e8b8a3cd66f2c725fa5c1affa91b13136cb712fb Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 19 Jun 2016 17:10:22 +0100 Subject: [PATCH 12/26] PC-504 Fixes an issue where if players in SSM destroyed all of the spawn point locations, players would not be handled correctly --- .../game/arcade/kit/perks/PerkCreeperExplode.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java index 5a97d8a8f..2f30b18fa 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java @@ -21,8 +21,10 @@ 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.GameTeam; import nautilus.game.arcade.kit.SmashPerk; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; @@ -165,6 +167,16 @@ public class PerkCreeperExplode extends SmashPerk if (UtilMath.offset(player.getLocation(), spawn) < 14) spawnIterator.remove(); } + + //If all spawns have been destroyed revert to using the spectator spawn + for (GameTeam team : Manager.GetGame().GetTeamList()) + { + if (team.GetSpawns().isEmpty()) + { + Bukkit.broadcastMessage(F.main("Debug", "Ran out of spawns!")); + team.GetSpawns().add(Manager.GetGame().GetSpectatorLocation()); + } + } } //Damage From a830b5b388e90f5ff6084c14471f7c9f49fa4438 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 19 Jun 2016 17:12:58 +0100 Subject: [PATCH 13/26] Removal of debug message and compilation error --- .../src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java | 1 - .../src/nautilus/game/arcade/kit/perks/PerkFirefly.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java index 2f30b18fa..fee25dd52 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkCreeperExplode.java @@ -173,7 +173,6 @@ public class PerkCreeperExplode extends SmashPerk { if (team.GetSpawns().isEmpty()) { - Bukkit.broadcastMessage(F.main("Debug", "Ran out of spawns!")); team.GetSpawns().add(Manager.GetGame().GetSpectatorLocation()); } } 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 dfa1aac38..df7e17b2e 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 @@ -146,6 +146,7 @@ public class PerkFirefly extends SmashPerk if (_tick % 12 == 0) { if (Recharge.Instance.use(other, GetName() + " hit by " + data.Player.getName(), 2000, false, false)) + { //Damage Event Manager.GetDamage().NewDamageEvent(other, data.Player, null, DamageCause.CUSTOM, 10, true, true, false, @@ -160,7 +161,7 @@ public class PerkFirefly extends SmashPerk { dataIterator.remove(); } - } + } } @EventHandler From 0131850fc371a25d2683b12de051cc635fd7bb66 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 21 Jun 2016 20:41:53 +0100 Subject: [PATCH 14/26] SSM fixes --- .../items/grenades/HighExplosive.java | 6 +- .../arcade/kit/perks/PerkNightLivingDead.java | 12 ++++ .../arcade/kit/perks/PerkSlimeRocket.java | 13 ++++ .../arcade/kit/perks/PerkWitherImage.java | 65 ++++++++++++------- 4 files changed, 70 insertions(+), 26 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java index 02c7b7300..0587fef2b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java @@ -49,7 +49,11 @@ public class HighExplosive extends Grenade for (Player player : players.keySet()) { if (!game.IsAlive(player)) - continue; + { + Bukkit.broadcastMessage("They are dead"); + } + + Bukkit.broadcastMessage("Dealing damage"); // Damage Event game.Manager.GetDamage().NewDamageEvent(player, _thrower, null, ent.getLocation(), diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNightLivingDead.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNightLivingDead.java index 64dcdc9b7..c2373d488 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNightLivingDead.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNightLivingDead.java @@ -1,5 +1,6 @@ package nautilus.game.arcade.kit.perks; +import java.lang.annotation.Target; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; @@ -22,6 +23,7 @@ import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilTime; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; +import nautilus.game.arcade.game.games.smash.TeamSuperSmash; import nautilus.game.arcade.kit.SmashPerk; import nautilus.game.arcade.kit.perks.data.NightLivingDeadData; @@ -128,6 +130,16 @@ public class PerkNightLivingDead extends SmashPerk { if (data.Player.equals(event.getTarget())) { + if (Manager.GetGame() instanceof TeamSuperSmash && event.getTarget() instanceof Player) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + Player targetPlayer = (Player) event.getTarget(); + + if (!smash.GetTeam(data.Player).equals(smash.GetTeam(targetPlayer))) + { + return; + } + } event.setCancelled(true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java index 1b16508b9..1371ddc1d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java @@ -33,6 +33,7 @@ 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.games.smash.TeamSuperSmash; import nautilus.game.arcade.kit.SmashPerk; public class PerkSlimeRocket extends SmashPerk implements IThrown @@ -225,6 +226,18 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown Slime slime = (Slime)data.GetThrown(); + if (Manager.GetGame() instanceof TeamSuperSmash && target instanceof Player && data.GetThrower() instanceof Player) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + Player targetPlayer = (Player) target; + Player throwerPlayer = (Player) data.GetThrower(); + + if(smash.GetTeam(targetPlayer).equals(smash.GetTeam(throwerPlayer))) + { + return; + } + } + //Damage Event Manager.GetDamage().NewDamageEvent(target, data.GetThrower(), null, DamageCause.PROJECTILE, 3 + slime.getSize() * 3, true, true, false, diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherImage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherImage.java index 5a7fccc01..a4422bc8e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherImage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherImage.java @@ -2,6 +2,17 @@ package nautilus.game.arcade.kit.perks; import java.util.HashMap; import java.util.Iterator; +import mineplex.core.common.util.C; +import mineplex.core.common.util.F; +import mineplex.core.common.util.UtilAction; +import mineplex.core.common.util.UtilBlock; +import mineplex.core.common.util.UtilPlayer; +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.games.smash.TeamSuperSmash; +import nautilus.game.arcade.kit.SmashPerk; import org.bukkit.Location; import org.bukkit.Material; @@ -17,20 +28,10 @@ import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.player.PlayerInteractEvent; -import mineplex.core.common.util.C; -import mineplex.core.common.util.F; -import mineplex.core.common.util.UtilAction; -import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilPlayer; -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.kit.SmashPerk; - public class PerkWitherImage extends SmashPerk { - private HashMap _images = new HashMap(); + private HashMap _ownerToSkeleton = new HashMap(); + private HashMap _skeletonToOwner = new HashMap(); public PerkWitherImage() { @@ -67,7 +68,7 @@ public class PerkWitherImage extends SmashPerk if (!Kit.HasKit(player)) return; - if (!_images.containsKey(player)) + if (!_ownerToSkeleton.containsKey(player)) { if (!Recharge.Instance.use(player, GetName(), 12000, true, true)) return; @@ -94,7 +95,8 @@ public class PerkWitherImage extends SmashPerk UtilAction.velocity(skel, player.getLocation().getDirection(), 1.6, false, 0, 0.2, 10, true); - _images.put(player, skel); + _ownerToSkeleton.put(player, skel); + _skeletonToOwner.put(skel, player); Recharge.Instance.use(player, "Wither Swap", 500, false, false); @@ -109,7 +111,7 @@ public class PerkWitherImage extends SmashPerk if (!Recharge.Instance.use(player, "Wither Swap", 2000, true, false)) return; - Skeleton skel = _images.get(player); + Skeleton skel = _ownerToSkeleton.get(player); Location loc = skel.getLocation(); skel.teleport(player.getLocation()); @@ -126,9 +128,21 @@ public class PerkWitherImage extends SmashPerk @EventHandler public void entityTarget(EntityTargetEvent event) { - if (_images.containsKey(event.getTarget())) - if (_images.get(event.getTarget()).equals(event.getEntity())) + if (_ownerToSkeleton.containsKey(event.getTarget()) && _skeletonToOwner.containsKey(event.getEntity())) + if (_ownerToSkeleton.get(event.getTarget()).equals(event.getEntity())) + { + if (Manager.GetGame() instanceof TeamSuperSmash && event.getTarget() instanceof Player) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + Player targetPlayer = (Player) event.getTarget(); + + if(!smash.GetTeam(_skeletonToOwner.get(event.getEntity())).equals(smash.GetTeam(targetPlayer))) + { + return; + } + } event.setCancelled(true); + } } @EventHandler @@ -137,13 +151,13 @@ public class PerkWitherImage extends SmashPerk Player damagee = event.GetDamageePlayer(); if (damagee == null) return; - if (!_images.containsKey(damagee)) + if (!_ownerToSkeleton.containsKey(damagee.getUniqueId())) return; LivingEntity damager = event.GetDamagerEntity(false); if (damager == null) return; - if (_images.get(damagee).equals(damager)) + if (_ownerToSkeleton.get(damagee.getUniqueId()).equals(damager)) event.SetCancelled("Wither Image"); } @@ -153,12 +167,12 @@ public class PerkWitherImage extends SmashPerk LivingEntity damager = event.GetDamagerEntity(true); if (damager == null) return; - if (!_images.containsValue(damager)) + if (!_ownerToSkeleton.containsValue(damager)) return; - for (Player player : _images.keySet()) + for (Player player : _ownerToSkeleton.keySet()) { - if (_images.get(player).equals(damager)) + if (_ownerToSkeleton.get(player).equals(damager)) { event.SetDamager(player); event.setKnockbackOrigin(damager.getLocation()); @@ -173,12 +187,12 @@ public class PerkWitherImage extends SmashPerk if (event.getType() != UpdateType.FAST) return; - Iterator playerIterator = _images.keySet().iterator(); + Iterator playerIterator = _ownerToSkeleton.keySet().iterator(); while (playerIterator.hasNext()) { Player player = playerIterator.next(); - Skeleton skel = _images.get(player); + Skeleton skel = _ownerToSkeleton.get(player); if (!player.isValid() || !skel.isValid() || skel.getTicksLived() > 160) { @@ -195,7 +209,8 @@ public class PerkWitherImage extends SmashPerk @EventHandler(priority = EventPriority.LOWEST) public void clean(PlayerDeathEvent event) { - Skeleton skel = _images.remove(event.getEntity()); + Skeleton skel = _ownerToSkeleton.remove(event.getEntity()); + _skeletonToOwner.remove(skel); if (skel != null) { From f8080d2663e1e59484d176276ed6abfb8af13df8 Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 23 Jun 2016 22:40:15 +0100 Subject: [PATCH 15/26] PC-574 Another fix for the minestrike vanish problem, this one fixes staff being assigned teams on join. --- .../game/arcade/game/games/minestrike/MineStrike.java | 5 +++++ 1 file changed, 5 insertions(+) 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 f6b99efc2..19073efd4 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 @@ -2326,6 +2326,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; if (GetTeamList().get(0).GetPlayers(false).size() < GetTeamList().get(1).GetPlayers(false).size()) From 40124b2cdde7c0ccbdd4d5014346c8eb02ae367b Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 30 Jun 2016 17:19:53 +0100 Subject: [PATCH 16/26] Updated changed method name (getThrower) In the ProjectileData class GetThrower was changed to getThrower, this fixes that in any of my classes --- .../nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java | 4 ++-- .../src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java index 6e6685993..195717459 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkPigBaconBounce.java @@ -110,11 +110,11 @@ public class PerkPigBaconBounce extends SmashPerk implements IThrown if (target == null) return; - if (Manager.GetGame() instanceof TeamSuperSmash && target instanceof Player && data.GetThrower() instanceof Player) + if (Manager.GetGame() instanceof TeamSuperSmash && target instanceof Player && data.getThrower() instanceof Player) { TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); Player targetPlayer = (Player) target; - Player throwerPlayer = (Player) data.GetThrower(); + Player throwerPlayer = (Player) data.getThrower(); if(smash.GetTeam(targetPlayer).equals(smash.GetTeam(throwerPlayer))) { diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java index 345f425d9..b296469af 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java @@ -226,11 +226,11 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown Slime slime = (Slime)data.getThrown(); - if (Manager.GetGame() instanceof TeamSuperSmash && target instanceof Player && data.GetThrower() instanceof Player) + if (Manager.GetGame() instanceof TeamSuperSmash && target instanceof Player && data.getThrower() instanceof Player) { TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); Player targetPlayer = (Player) target; - Player throwerPlayer = (Player) data.GetThrower(); + Player throwerPlayer = (Player) data.getThrower(); if(smash.GetTeam(targetPlayer).equals(smash.GetTeam(throwerPlayer))) { From 5e994e37dab9a076b90562ce7ffd86b94fc839b2 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Fri, 1 Jul 2016 17:30:07 -0400 Subject: [PATCH 17/26] Fix Monster Maze jumping mechanics (Fixes PC-711 and PC-634) --- .../game/games/monstermaze/MonsterMaze.java | 37 ++++++++++++++++++- .../games/monstermaze/kits/KitJumper.java | 4 +- .../arcade/managers/GamePlayerManager.java | 2 +- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java index d52c5039b..dc3538511 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/MonsterMaze.java @@ -48,6 +48,8 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityRegainHealthEvent; import org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; import org.bukkit.scoreboard.Team; public class MonsterMaze extends SoloGame @@ -60,6 +62,9 @@ public class MonsterMaze extends SoloGame private Location _center; private HashMap _launched = new HashMap(); + + private static final int JUMP_POTION_AMPLIFIER = -10; + private int _potionMult = JUMP_POTION_AMPLIFIER; @SuppressWarnings("unchecked") public MonsterMaze(ArcadeManager manager) @@ -260,6 +265,36 @@ public class MonsterMaze extends SoloGame } } + @EventHandler + public void onDebug(PlayerCommandPreprocessEvent event) + { + if (!event.getPlayer().isOp()) + return; + + if (event.getMessage().toLowerCase().contains("/setmult ")) + { + event.setCancelled(true); + Integer mult = Integer.parseInt(event.getMessage().toLowerCase().replace("/setmult ", "")); + _potionMult = mult; + + for (Player pl : GetPlayers(true)) + { + Manager.GetCondition().Clean(pl); + } + } + } + + @EventHandler + public void onBreakJumper(InventoryClickEvent event) + { + if (!InProgress()) + return; + if (!IsAlive(event.getWhoClicked())) + return; + + event.setCancelled(true); + } + @EventHandler public void PotionEffects(UpdateEvent event) { @@ -276,7 +311,7 @@ public class MonsterMaze extends SoloGame else { if (!Manager.GetCondition().HasCondition(pl, ConditionType.JUMP, null)) - Manager.GetCondition().Factory().Jump("No jumping", pl, null, 9999999, 250, true, false, false); + Manager.GetCondition().Factory().Jump("No jumping", pl, null, 9999999, _potionMult, true, false, false); } // if (!Manager.GetCondition().HasCondition(pl, ConditionType.INVISIBILITY, null)) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitJumper.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitJumper.java index 22c4d31a7..32841361a 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitJumper.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/monstermaze/kits/KitJumper.java @@ -42,7 +42,7 @@ public class KitJumper extends ProgressingKit @Override public void GiveItems(Player player) { - player.getInventory().setItem(4, PLAYER_ITEMS[4]); - player.getInventory().setItem(8, PLAYER_ITEMS[8]); + player.getInventory().setItem(4, PLAYER_ITEMS[0]); + player.getInventory().setItem(8, PLAYER_ITEMS[1]); } } 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 1525077bd..cef0c62ab 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 @@ -69,7 +69,7 @@ public class GamePlayerManager implements Listener } for (Player player : Manager.GetGame().GetPlayers(true)) { - if (!Manager.GetCondition().HasCondition(player, ConditionType.INVISIBILITY)) + if (!Manager.GetCondition().HasCondition(player, ConditionType.INVISIBILITY) && Manager.GetGame().IsAlive(player) && !UtilPlayer.isSpectator(player)) { for (Player viewer : Bukkit.getOnlinePlayers()) { From e4c94f5421646924283fa2844de71ce9f326cd03 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sat, 2 Jul 2016 01:20:07 -0400 Subject: [PATCH 18/26] Fix whitelist for Customer Support servers --- .../src/mineplex/core/account/CoreClientManager.java | 10 +++++++++- .../src/mineplex/staffServer/StaffServer.java | 9 +++++---- .../staffServer/customerSupport/CustomerSupport.java | 4 ++-- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java index f2c320b74..e025133f9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/account/CoreClientManager.java @@ -57,7 +57,14 @@ public class CoreClientManager extends MiniPlugin private static AtomicInteger _clientsConnecting = new AtomicInteger(0); private static AtomicInteger _clientsProcessing = new AtomicInteger(0); + private final Rank WHITELIST_BYPASS; + public CoreClientManager(JavaPlugin plugin, String webServer) + { + this(plugin, webServer, Rank.MODERATOR); + } + + public CoreClientManager(JavaPlugin plugin, String webServer, Rank whitelistBypass) { super("Client Manager", plugin); @@ -65,6 +72,7 @@ public class CoreClientManager extends MiniPlugin _repository = new AccountRepository(plugin, webServer); _clientList = new NautHashMap(); _duplicateLoginGlitchPreventionList = new HashSet(); + WHITELIST_BYPASS = whitelistBypass; } public AccountRepository getRepository() @@ -195,7 +203,7 @@ public class CoreClientManager extends MiniPlugin _clientsProcessing.decrementAndGet(); } - if (Bukkit.hasWhitelist() && !Get(event.getName()).GetRank().has(Rank.MODERATOR)) + if (Bukkit.hasWhitelist() && !Get(event.getName()).GetRank().has(WHITELIST_BYPASS)) { for (OfflinePlayer player : Bukkit.getWhitelistedPlayers()) { diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java index 5a58758c7..282933d23 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/StaffServer.java @@ -7,6 +7,7 @@ import mineplex.core.achievement.AchievementManager; import mineplex.core.antihack.AntiHack; import mineplex.core.chat.Chat; import mineplex.core.command.CommandCenter; +import mineplex.core.common.Rank; import mineplex.core.creature.Creature; import mineplex.core.donation.DonationManager; import mineplex.core.elo.EloManager; @@ -48,7 +49,7 @@ public class StaffServer extends JavaPlugin //Static Modules CommandCenter.Initialize(this); - CoreClientManager clientManager = new CoreClientManager(this, webServerAddress); + CoreClientManager clientManager = new CoreClientManager(this, webServerAddress, Rank.DEVELOPER); CommandCenter.Instance.setClientManager(clientManager); Recharge.Initialize(this); @@ -83,15 +84,15 @@ public class StaffServer extends JavaPlugin ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("cf1b629c-cc55-4eb4-be9e-3ca86dfc7b9d"), "mannalou")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("04a484d0-93e0-4777-a70c-808046917e3a"), "EvilEsther")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("adaa7613-6683-400f-baf8-7272c04b2cb4"), "Timmy48081_")); - ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("57791647-93b1-4980-8835-7fddadd20eb8"), "xTheOnlyOreOx")); + ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("231fb752-9556-489b-8428-f47c7598e061"), "Nuclear_Poptart")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp")); ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("492ff708-fe76-4c5a-b9ed-a747b5fa20a0"), "Cherdy8s")); - ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("cf85f470-5248-4978-8208-435736fa136e"), "RustyRoo")); + ((CraftServer)getServer()).getHandle().addWhitelist(new GameProfile(UUID.fromString("6edf17d5-6bb2-4ed9-92e9-bed8e96fff68"), "BlueBeetleHD")); ((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("377bdea3-badc-448d-81c1-65db43b17ea4"), "Strutt20")); ((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("efaf9a17-2304-4f42-8433-421523c308dc"), "B2_mp")); - ((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("cf85f470-5248-4978-8208-435736fa136e"), "RustyRoo")); + ((CraftServer)getServer()).getHandle().addOp(new GameProfile(UUID.fromString("6edf17d5-6bb2-4ed9-92e9-bed8e96fff68"), "BlueBeetleHD")); new ProfileCacheManager(this); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index 1842ee5e4..c4069fb94 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -57,9 +57,9 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable @EventHandler public void Join(PlayerJoinEvent event) { - if (!_clientManager.Get(event.getPlayer()).GetRank().has(Rank.MODERATOR)) + if (!_clientManager.Get(event.getPlayer()).GetRank().has(Rank.SUPPORT)) { - event.getPlayer().kickPlayer("Only for staff."); + event.getPlayer().kickPlayer("Only for support staff."); return; } From 2b74ec00b4641949496cdd8db9a8765e9a3ebe92 Mon Sep 17 00:00:00 2001 From: AlexTheCoder Date: Sat, 2 Jul 2016 01:43:15 -0400 Subject: [PATCH 19/26] Change display menu for CUST-1 server to reflect recent updates --- .../staffServer/customerSupport/CustomerSupport.java | 4 ++-- .../staffServer/salespackage/SalesPackageManager.java | 4 ++-- .../staffServer/salespackage/command/CoinCommand.java | 6 +++--- .../staffServer/salespackage/salespackages/Coins.java | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java index c4069fb94..c91f53c0e 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/customerSupport/CustomerSupport.java @@ -119,7 +119,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable caller.sendMessage(C.cDGreen + C.Strike + "============================================="); caller.sendMessage(C.cBlue + "Name: " + C.cYellow + playerName); caller.sendMessage(C.cBlue + "Rank: " + C.cYellow + (client.GetRank() == null ? C.cRed + "Error rank null!" : (client.GetRank().Name.isEmpty() ? "Regular" : client.GetRank().Name))); - caller.sendMessage(C.cBlue + "Coins: " + C.cYellow + donor.getCoins()); + caller.sendMessage(C.cBlue + "Shards: " + C.cYellow + donor.getCoins()); caller.sendMessage(C.cBlue + "Gems: " + C.cYellow + donor.GetGems()); int enjinCoinsReceived = 0; @@ -234,7 +234,7 @@ public class CustomerSupport extends MiniPlugin implements ResultSetCallable } // Strutt20 asked me to remove some stuff from the menu - caller.sendMessage(C.cBlue + "Enjin Coin Total Received: " + C.cYellow + enjinCoinsReceived); + caller.sendMessage(C.cBlue + "Enjin Shard Total Received: " + C.cYellow + enjinCoinsReceived); caller.sendMessage(C.cBlue + "Old Chests Received: " + C.cYellow + oldChestsReceived); caller.sendMessage(C.cBlue + "Ancient Chests Received: " + C.cYellow + ancientChestsReceived); caller.sendMessage(C.cBlue + "Mythical Chests Received: " + C.cYellow + mythicalChestsReceived); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java index 65f25a186..67dea4d96 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/SalesPackageManager.java @@ -94,7 +94,7 @@ public class SalesPackageManager extends MiniPlugin public void displaySalesPackages(Player caller, String playerName) { - JsonMessage coinBuilder = new JsonMessage("Coins : ").color("blue"); + JsonMessage coinBuilder = new JsonMessage("Shards : ").color("blue"); JsonMessage packageBuilder = new JsonMessage("Rank Packages : ").color("blue"); JsonMessage chestBuilder = new JsonMessage("Chest Packages : ").color("blue"); @@ -104,7 +104,7 @@ public class SalesPackageManager extends MiniPlugin { coinBuilder = coinBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray"); } - else if (salesPackage instanceof MythicalChest || salesPackage instanceof AncientChest || salesPackage instanceof OldChest || salesPackage instanceof IlluminatedChest) + else if (salesPackage instanceof MythicalChest || salesPackage instanceof AncientChest || salesPackage instanceof OldChest || salesPackage instanceof IlluminatedChest || salesPackage instanceof FreedomChest) { chestBuilder = chestBuilder.extra("[").color("gray").extra(salesPackage.getName()).color("green").click("run_command", "/display " + playerName + " " + salesPackage.getName()).extra("] ").color("gray"); } diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java index 02dd85695..3ced1fbc3 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/command/CoinCommand.java @@ -17,7 +17,7 @@ public class CoinCommand extends CommandBase { public CoinCommand(SalesPackageManager plugin) { - super(plugin, Rank.MODERATOR, "coin"); + super(plugin, Rank.MODERATOR, "coin", "shard", "shards"); } @Override @@ -43,11 +43,11 @@ public class CoinCommand extends CommandBase { if (completed) { - caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " coins to " + playerName + "'s account!")); + caller.sendMessage(F.main(Plugin.getName(), "Added " + amount + " shards to " + playerName + "'s account!")); } else { - UtilPlayer.message(caller, F.main(Plugin.getName(), "There was an error giving " + F.elem(amount + "Coins") + " to " + F.name(playerName) + ".")); + UtilPlayer.message(caller, F.main(Plugin.getName(), "There was an error giving " + F.elem(amount + "Shards") + " to " + F.name(playerName) + ".")); } } }, caller.getName(), playerName, client.getAccountId(), amount); diff --git a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/Coins.java b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/Coins.java index 1091a16fd..51c79115d 100644 --- a/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/Coins.java +++ b/Plugins/Mineplex.StaffServer/src/mineplex/staffServer/salespackage/salespackages/Coins.java @@ -10,13 +10,13 @@ public class Coins extends SalesPackageBase public Coins(SalesPackageManager manager, int amount) { - super(manager, amount + " Coins"); + super(manager, amount + " Shards"); _amount = amount; } public void displayToAgent(Player agent, String playerName) { - addButton(agent, "/sales coin " + playerName + " " + _amount, _amount + " Coins."); + addButton(agent, "/sales coin " + playerName + " " + _amount, _amount + " Shards."); agent.sendMessage(" "); addBackButton(agent, playerName); } From 8d8824446ddf3a68e76b49f298e48409eeb89de4 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 2 Jul 2016 12:12:15 +0100 Subject: [PATCH 20/26] PC-519 Fixes an issue where grenades would not do damage after you die. --- .../minestrike/items/grenades/HighExplosive.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java index 0587fef2b..c46e246d7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/minestrike/items/grenades/HighExplosive.java @@ -49,14 +49,16 @@ public class HighExplosive extends Grenade for (Player player : players.keySet()) { if (!game.IsAlive(player)) - { - Bukkit.broadcastMessage("They are dead"); - } - - Bukkit.broadcastMessage("Dealing damage"); + continue; // Damage Event - game.Manager.GetDamage().NewDamageEvent(player, _thrower, null, ent.getLocation(), + Player damager = null; + if (game.IsAlive(_thrower)) + { + damager = _thrower; + } + + game.Manager.GetDamage().NewDamageEvent(player, damager, null, ent.getLocation(), DamageCause.CUSTOM, 1 + (players.get(player) * 18), true, true, false, _thrower.getName(), getName()); From 26361eaee00cce5d2589a3e4bc4668aa997e699e Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 2 Jul 2016 13:38:22 +0100 Subject: [PATCH 21/26] PC-508 Fixes certain abilities in Team SSM that could be used to damage/knockback other team members --- .../game/arcade/kit/perks/PerkBoneRush.java | 13 ++++++++++ .../game/arcade/kit/perks/PerkInferno.java | 17 +++++++++++- .../arcade/kit/perks/PerkNightLivingDead.java | 23 +++++++--------- .../arcade/kit/perks/PerkWitherImage.java | 26 ++++++++++--------- 4 files changed, 53 insertions(+), 26 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java index 4a5790f73..bdef9e25b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkBoneRush.java @@ -30,6 +30,7 @@ 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.games.smash.TeamSuperSmash; import nautilus.game.arcade.kit.SmashPerk; public class PerkBoneRush extends SmashPerk implements IThrown @@ -151,6 +152,18 @@ public class PerkBoneRush extends SmashPerk implements IThrown double damage = 0.7; String reason = GetName(); + if (Manager.GetGame() instanceof TeamSuperSmash && target instanceof Player && data.getThrower() instanceof Player) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + Player targetPlayer = (Player) target; + Player throwerPlayer = (Player) data.getThrower(); + + if(smash.GetTeam(targetPlayer).equals(smash.GetTeam(throwerPlayer))) + { + return; + } + } + if (isSuperActive(damager)) { damage = 3; diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInferno.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInferno.java index ecf9b4bff..682c86fcd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInferno.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInferno.java @@ -2,6 +2,7 @@ package nautilus.game.arcade.kit.perks; import java.util.HashMap; +import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Item; @@ -20,7 +21,8 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.itemstack.ItemStackFactory; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; -import nautilus.game.arcade.kit.Perk; +import mineplex.minecraft.game.core.damage.CustomDamageEvent; +import nautilus.game.arcade.game.games.smash.TeamSuperSmash; import nautilus.game.arcade.kit.SmashPerk; public class PerkInferno extends SmashPerk @@ -119,4 +121,17 @@ public class PerkInferno extends SmashPerk } } + @EventHandler + public void onCustomDamage(CustomDamageEvent event) + { + if (Manager.GetGame() instanceof TeamSuperSmash) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + if (smash.GetTeam(event.GetDamagerPlayer(false)).equals(smash.GetTeam(event.GetDamageePlayer()))) + { + event.GetDamageeEntity().setFireTicks(0); + event.SetCancelled("Team Damage"); + } + } + } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNightLivingDead.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNightLivingDead.java index c2373d488..9f0bcc8c7 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNightLivingDead.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkNightLivingDead.java @@ -1,6 +1,5 @@ package nautilus.game.arcade.kit.perks; -import java.lang.annotation.Target; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; @@ -14,8 +13,6 @@ import org.bukkit.entity.Player; import org.bukkit.entity.Zombie; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.EntityTargetEvent; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; import org.bukkit.util.Vector; import mineplex.core.common.util.UtilAlg; @@ -128,18 +125,18 @@ public class PerkNightLivingDead extends SmashPerk { if (data.Zombies.contains(event.getEntity())) { + if (Manager.GetGame() instanceof TeamSuperSmash && event.getTarget() instanceof Player) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + Player targetPlayer = (Player) event.getTarget(); + + if (smash.GetTeam(data.Player).equals(smash.GetTeam(targetPlayer))) + { + event.setCancelled(true); + } + } if (data.Player.equals(event.getTarget())) { - if (Manager.GetGame() instanceof TeamSuperSmash && event.getTarget() instanceof Player) - { - TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); - Player targetPlayer = (Player) event.getTarget(); - - if (!smash.GetTeam(data.Player).equals(smash.GetTeam(targetPlayer))) - { - return; - } - } event.setCancelled(true); } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherImage.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherImage.java index a4422bc8e..28011f7ff 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherImage.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkWitherImage.java @@ -128,21 +128,23 @@ public class PerkWitherImage extends SmashPerk @EventHandler public void entityTarget(EntityTargetEvent event) { - if (_ownerToSkeleton.containsKey(event.getTarget()) && _skeletonToOwner.containsKey(event.getEntity())) + if (_skeletonToOwner.containsKey(event.getEntity())) + { + if (Manager.GetGame() instanceof TeamSuperSmash && event.getTarget() instanceof Player) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + Player targetPlayer = (Player) event.getTarget(); + + if(smash.GetTeam(_skeletonToOwner.get(event.getEntity())).equals(smash.GetTeam(targetPlayer))) + { + event.setCancelled(true); + } + } if (_ownerToSkeleton.get(event.getTarget()).equals(event.getEntity())) { - if (Manager.GetGame() instanceof TeamSuperSmash && event.getTarget() instanceof Player) - { - TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); - Player targetPlayer = (Player) event.getTarget(); - - if(!smash.GetTeam(_skeletonToOwner.get(event.getEntity())).equals(smash.GetTeam(targetPlayer))) - { - return; - } - } - event.setCancelled(true); + event.setCancelled(true); } + } } @EventHandler From bdc049efe1f44ad33f4663512025d0899a6ddf2d Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 3 Jul 2016 15:58:19 +0100 Subject: [PATCH 22/26] PC-508 Fixed an NPE with Inferno --- .../src/nautilus/game/arcade/kit/perks/PerkInferno.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInferno.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInferno.java index 682c86fcd..afba15ebd 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInferno.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkInferno.java @@ -2,7 +2,6 @@ package nautilus.game.arcade.kit.perks; import java.util.HashMap; -import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.Item; @@ -127,7 +126,13 @@ public class PerkInferno extends SmashPerk if (Manager.GetGame() instanceof TeamSuperSmash) { TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); - if (smash.GetTeam(event.GetDamagerPlayer(false)).equals(smash.GetTeam(event.GetDamageePlayer()))) + + if (event.GetDamagerPlayer(true) == null) + { + return; + } + + if (smash.GetTeam(event.GetDamagerPlayer(true)).equals(smash.GetTeam(event.GetDamageePlayer()))) { event.GetDamageeEntity().setFireTicks(0); event.SetCancelled("Team Damage"); From e96f7f121763d9137c55f3addb287e466571fb42 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 3 Jul 2016 15:58:54 +0100 Subject: [PATCH 23/26] PC-508 Fixes a hit box issue with Rocket Slimes --- .../arcade/kit/perks/PerkSlimeRocket.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java index b296469af..0bf4780f1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/kit/perks/PerkSlimeRocket.java @@ -209,6 +209,17 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown if (!_owner.containsKey(event.getEntity())) return; + if (Manager.GetGame() instanceof TeamSuperSmash && event.getTarget() instanceof Player) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + Player targetPlayer = (Player) event.getTarget(); + + if (smash.GetTeam(_owner.get(event.getEntity())).equals(smash.GetTeam(targetPlayer))) + { + event.setCancelled(true); + } + } + if (_owner.get(event.getEntity()).equals(event.getTarget())) { event.setCancelled(true); @@ -288,6 +299,16 @@ public class PerkSlimeRocket extends SmashPerk implements IThrown //if (owner != null) // event.SetDamager(owner); This gives knockback from wrong direction :( + if (Manager.GetGame() instanceof TeamSuperSmash) + { + TeamSuperSmash smash = (TeamSuperSmash) Manager.GetGame(); + + if (smash.GetTeam(owner).equals(smash.GetTeam(event.GetDamageePlayer()))) + { + event.SetCancelled("Team Damage"); + return; + } + } if (owner != null && owner.equals(event.GetDamageeEntity())) { From 5644589b10e03a103db805b106a31d55667dfa6b Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 3 Jul 2016 20:57:58 +0100 Subject: [PATCH 24/26] PC-541 Covers all possible eventualities of redstone ore and glowing redstone ore --- .../arcade/game/games/speedbuilders/data/RecreationData.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java index f8d04201e..2bf2488c0 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/speedbuilders/data/RecreationData.java @@ -325,7 +325,7 @@ public class RecreationData } //Fix for glowing redstone ore - if (expectedState.getType() == Material.REDSTONE_ORE && currentBlock.getType() == Material.GLOWING_REDSTONE_ORE) + if ((expectedState.getType() == Material.REDSTONE_ORE && currentBlock.getType() == Material.GLOWING_REDSTONE_ORE) || (expectedState.getType() == Material.GLOWING_REDSTONE_ORE && currentBlock.getType() == Material.REDSTONE_ORE)) { score++; } From 295711d626c705ecb08b2ee1cb29c007d6fe4b50 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 4 Jul 2016 20:31:59 +0100 Subject: [PATCH 25/26] PC-632 Fixes an issue where going under the map in Wither Assault would cause you to have negative speed and not be able to move --- .../nautilus/game/arcade/game/games/wither/WitherGame.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 d85536b2a..20e743fc8 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 @@ -633,7 +633,12 @@ public class WitherGame extends TeamGame implements IBlockRestorer { speed = 0.09 - (_yLimit - player.getLocation().getY()) * 0.006; } - + + if (speed < 0.01) //This is to stop players having negative speed when they go under the map + { + speed = 0.01; + } + player.setFlySpeed((float) Math.min(1, speed)); // Bump From 0eab6db1166759ef824b5b58ed8f939d57f1baa1 Mon Sep 17 00:00:00 2001 From: Thanos Paravantis Date: Sat, 2 Jul 2016 00:06:00 +0300 Subject: [PATCH 26/26] Soccer bug fixes and minor improvements - Slimeball will no longer be able to get stacked. - Players in soccer mode will not able to stack others. - Guardian lazer can no longer be used in the soccer field. - Players in soccer won't get knockback, except if they double jump. --- .../event/GadgetSelectLocationEvent.java | 84 +++++++++++++++++ .../core/gadget/gadgets/morph/MorphTitan.java | 16 ++++ .../src/mineplex/hub/HubManager.java | 8 +- .../src/mineplex/hub/modules/JumpManager.java | 20 ++++- .../mineplex/hub/modules/SoccerManager.java | 90 +++++++++++++------ 5 files changed, 186 insertions(+), 32 deletions(-) create mode 100644 Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetSelectLocationEvent.java diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetSelectLocationEvent.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetSelectLocationEvent.java new file mode 100644 index 000000000..fefbff7eb --- /dev/null +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/event/GadgetSelectLocationEvent.java @@ -0,0 +1,84 @@ +package mineplex.core.gadget.event; + +import org.bukkit.Location; +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + +import mineplex.core.gadget.types.Gadget; + +/** + * This event is called when a gadget selects a location for a specific effect to be shown. + */ +public class GadgetSelectLocationEvent extends Event +{ + private static final HandlerList handlers = new HandlerList(); + + private Player _player; + private Gadget _gadget; + private Location _location; + private boolean _showMessage = true; + private boolean _cancelled = false; + + public GadgetSelectLocationEvent(Player player, Gadget gadget, Location location) + { + _player = player; + _gadget = gadget; + _location = location; + } + + public HandlerList getHandlers() + { + return handlers; + } + + public static HandlerList getHandlerList() + { + return handlers; + } + + public Gadget getGadget() + { + return _gadget; + } + + public Player getPlayer() + { + return _player; + } + + public Location getLocation() + { + return _location; + } + + public void setCancelled(boolean cancel) + { + _cancelled = cancel; + } + + public boolean isCancelled() + { + return _cancelled; + } + + /** + * Whether or not a cancellation message should be displayed. + * + * @param showMessage True for the message to be shown and false for the message to be hidden/ignored. + */ + public void setShowMessage(boolean showMessage) + { + _showMessage = showMessage; + } + + /** + * Returns whether or not a cancellation message can be shown. + * + * @return True if the message can be shown and false if the message should be hidden/ignored. + */ + public boolean canShowMessage() + { + return _showMessage; + } +} diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java index 558335c68..9881ffa93 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/morph/MorphTitan.java @@ -4,6 +4,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; @@ -17,6 +18,7 @@ import org.bukkit.util.Vector; import mineplex.core.common.Rank; import mineplex.core.common.util.C; +import mineplex.core.common.util.F; import mineplex.core.common.util.LineFormat; import mineplex.core.common.util.UtilAction; import mineplex.core.common.util.UtilAlg; @@ -32,6 +34,7 @@ import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.disguise.disguises.DisguiseBase; import mineplex.core.disguise.disguises.DisguiseGuardian; import mineplex.core.gadget.GadgetManager; +import mineplex.core.gadget.event.GadgetSelectLocationEvent; import mineplex.core.gadget.types.MorphGadget; import mineplex.core.recharge.Recharge; import mineplex.core.recharge.RechargedEvent; @@ -105,6 +108,19 @@ public class MorphTitan extends MorphGadget Location loc = player.getTargetBlock(ignore, 64).getLocation().add(0.5, 0.5, 0.5); + GadgetSelectLocationEvent gadgetSelectLocationEvent = new GadgetSelectLocationEvent(player, this, loc); + Bukkit.getServer().getPluginManager().callEvent(gadgetSelectLocationEvent); + + if (gadgetSelectLocationEvent.isCancelled()) + { + if (gadgetSelectLocationEvent.canShowMessage()) + { + UtilPlayer.message(player, F.main("Gadget", "You cannot use the laser on this area!")); + } + + return; + } + ArmorStand stand = loc.getWorld().spawn(loc, ArmorStand.class); stand.setVisible(false); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java index f53d023f4..30d650252 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/HubManager.java @@ -135,6 +135,7 @@ public class HubManager extends MiniClientPlugin private IncognitoManager _incognito; private ValentinesManager _valentinesManager; private BonusManager _bonusManager; + private JumpManager _jumpManager; // private HalloweenSpookinessManager _halloweenManager; // private TrickOrTreatManager _trickOrTreatManager; @@ -181,7 +182,7 @@ public class HubManager extends MiniClientPlugin _parkour = new ParkourManager(this, donationManager, taskManager); new WorldManager(this); - new JumpManager(this); + _jumpManager = new JumpManager(this); //new TournamentInviter(this); @@ -1072,4 +1073,9 @@ public class HubManager extends MiniClientPlugin { return _incognito; } + + public JumpManager getJumpManager() + { + return _jumpManager; + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/JumpManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/JumpManager.java index e0367bdba..afa61a5a1 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/JumpManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/JumpManager.java @@ -1,11 +1,13 @@ package mineplex.hub.modules; -import org.bukkit.Bukkit; +import java.util.HashSet; + import org.bukkit.Effect; import org.bukkit.GameMode; import org.bukkit.block.BlockFace; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; +import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerToggleFlightEvent; import org.bukkit.util.Vector; @@ -28,6 +30,7 @@ import mineplex.hub.HubManager; public class JumpManager extends MiniPlugin { public HubManager Manager; + private HashSet _preparedDoubleJump = new HashSet<>(); public JumpManager(HubManager manager) { @@ -66,8 +69,9 @@ public class JumpManager extends MiniPlugin vec.setY(Math.abs(vec.getY())); //Velocity + _preparedDoubleJump.add(player.getName()); UtilAction.velocity(player, vec, 1.4, false, 0, 0.2, 1, true); - + //Sound player.playEffect(player.getLocation(), Effect.BLAZE_SHOOT, 0); @@ -105,8 +109,20 @@ public class JumpManager extends MiniPlugin { player.setAllowFlight(true); player.setFlying(false); + _preparedDoubleJump.remove(player.getName()); } } } } + + @EventHandler + public void onPlayerQuit(PlayerQuitEvent event) + { + _preparedDoubleJump.remove(event.getPlayer().getName()); + } + + public boolean hasDoubleJumped(Player player) + { + return _preparedDoubleJump.contains(player.getName()); + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java index 04fb771b8..bf5260b1c 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/SoccerManager.java @@ -3,9 +3,9 @@ package mineplex.hub.modules; import java.util.ArrayList; import java.util.HashSet; +import org.bukkit.Color; import org.bukkit.EntityEffect; import org.bukkit.FireworkEffect.Type; -import org.bukkit.Color; import org.bukkit.Location; import org.bukkit.Sound; import org.bukkit.entity.Bat; @@ -20,9 +20,10 @@ import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerVelocityEvent; import org.bukkit.util.Vector; -import mineplex.core.MiniPlugin; +import mineplex.core.MiniPlugin; import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAction; @@ -37,8 +38,10 @@ import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.common.util.UtilTime; +import mineplex.core.event.StackerEvent; import mineplex.core.gadget.GadgetManager; import mineplex.core.gadget.event.GadgetEnableEvent; +import mineplex.core.gadget.event.GadgetSelectLocationEvent; import mineplex.core.gadget.gadgets.outfit.OutfitTeam; import mineplex.core.gadget.types.Gadget; import mineplex.core.gadget.types.GadgetType; @@ -50,8 +53,8 @@ import mineplex.hub.HubManager; public class SoccerManager extends MiniPlugin { - public HubManager Manager; - + private HubManager _hubManager; + private HashSet _active = new HashSet(); private ArrayList _teamArmor = new ArrayList(); @@ -71,10 +74,10 @@ public class SoccerManager extends MiniPlugin private Location _cornerBlueGoalA; private Location _cornerBlueGoalB; - int _blueGoals = 0; - int _redGoals = 0; + private int _blueGoals = 0; + private int _redGoals = 0; - int _insideGoalTicks = 0; + private int _insideGoalTicks = 0; private Slime _ball; private Vector _ballVel; @@ -89,29 +92,29 @@ public class SoccerManager extends MiniPlugin protected Location _lastLoc; protected ArrayList _velHistory = new ArrayList(); - public SoccerManager(HubManager manager, GadgetManager gadgets) + public SoccerManager(HubManager hubManager, GadgetManager gadgetManager) { - super("Football Manager", manager.getPlugin()); + super("Football Manager", hubManager.getPlugin()); - Manager = manager; + _hubManager = hubManager; + + _cornerFieldPlayerA = new Location(hubManager.GetSpawn().getWorld(), 28.5,70,-27.5); + _cornerFieldPlayerB = new Location(hubManager.GetSpawn().getWorld(), 50.5,100,-65.5); - _cornerFieldPlayerA = new Location(Manager.GetSpawn().getWorld(), 28.5,70,-27.5); - _cornerFieldPlayerB = new Location(Manager.GetSpawn().getWorld(), 50.5,100,-65.5); + _cornerGoalPlayerA = new Location(hubManager.GetSpawn().getWorld(), 35.5,70,-24.5); + _cornerGoalPlayerB = new Location(hubManager.GetSpawn().getWorld(), 43.5,100,-68.5); - _cornerGoalPlayerA = new Location(Manager.GetSpawn().getWorld(), 35.5,70,-24.5); - _cornerGoalPlayerB = new Location(Manager.GetSpawn().getWorld(), 43.5,100,-68.5); + _cornerFieldA = new Location(hubManager.GetSpawn().getWorld(), 29.75,70,-28.75); + _cornerFieldB = new Location(hubManager.GetSpawn().getWorld(), 49.25,100,-64.25); - _cornerFieldA = new Location(Manager.GetSpawn().getWorld(), 29.75,70,-28.75); - _cornerFieldB = new Location(Manager.GetSpawn().getWorld(), 49.25,100,-64.25); + _cornerRedGoalA = new Location(hubManager.GetSpawn().getWorld(), 36.75,70,-64.25); + _cornerRedGoalB = new Location(hubManager.GetSpawn().getWorld(), 42.25,73.5,-67.25); - _cornerRedGoalA = new Location(Manager.GetSpawn().getWorld(), 36.75,70,-64.25); - _cornerRedGoalB = new Location(Manager.GetSpawn().getWorld(), 42.25,73.5,-67.25); - - _cornerBlueGoalA = new Location(Manager.GetSpawn().getWorld(), 36.75,70,-25.75); - _cornerBlueGoalB = new Location(Manager.GetSpawn().getWorld(), 42.25,73.5,-28.75); + _cornerBlueGoalA = new Location(hubManager.GetSpawn().getWorld(), 36.75,70,-25.75); + _cornerBlueGoalB = new Location(hubManager.GetSpawn().getWorld(), 42.25,73.5,-28.75); //Store Gadgets - for (Gadget gadget : gadgets.getGadgets(GadgetType.COSTUME)) + for (Gadget gadget : gadgetManager.getGadgets(GadgetType.COSTUME)) { if (gadget instanceof OutfitTeam) { @@ -352,7 +355,7 @@ public class SoccerManager extends MiniPlugin return UtilAlg.inBoundingBox(entity.getLocation(), _cornerFieldPlayerA, _cornerFieldPlayerB) || UtilAlg.inBoundingBox(entity.getLocation(), _cornerGoalPlayerA, _cornerGoalPlayerB); } - + @EventHandler public void clean(UpdateEvent event) { @@ -470,9 +473,9 @@ public class SoccerManager extends MiniPlugin outfit.add("Team Pants"); outfit.add("Team Boots"); - Manager.GetGadget().disableAll(player, outfit); - Manager.GetMount().DisableAll(player); - Manager.getPetManager().DisableAll(player); + _hubManager.GetGadget().disableAll(player, outfit); + _hubManager.GetMount().DisableAll(player); + _hubManager.getPetManager().DisableAll(player); } else { @@ -481,11 +484,11 @@ public class SoccerManager extends MiniPlugin } } - public boolean isSoccerMode(Player player) + public boolean isSoccerMode(Entity entity) { - return _active.contains(player); + return _active.contains(entity); } - + @EventHandler public void disableGadgets(GadgetEnableEvent event) { @@ -510,6 +513,35 @@ public class SoccerManager extends MiniPlugin event.setCancelled(true); } + @EventHandler + public void disableStacker(StackerEvent event) + { + if (isSoccerMode(event.getEntity())) + { + event.setCancelled(true); + } + } + + @EventHandler + public void disableGuardianLazer(GadgetSelectLocationEvent event) + { + if (UtilAlg.inBoundingBox(event.getLocation(), _cornerFieldA, _cornerFieldB)) + { + event.setCancelled(true); + } + } + + @EventHandler + public void disableVelocity(PlayerVelocityEvent event) + { + // Disable velocity but allow double jumping. + + if (isSoccerMode(event.getPlayer()) && !_hubManager.getJumpManager().hasDoubleJumped(event.getPlayer())) + { + event.setCancelled(true); + } + } + @EventHandler public void playerQuit(PlayerQuitEvent event) {