From 7d6572ff4d45f8adfbff810ab6aadd318a93bc46 Mon Sep 17 00:00:00 2001 From: CoderTim Date: Tue, 26 Aug 2014 20:27:39 -0400 Subject: [PATCH 1/7] Fixed SheepGame Selfish achievement --- .../arcade/game/games/sheep/SheepGame.java | 20 ++++++------------- .../arcade/stats/ParalympicsStatTracker.java | 2 +- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java index 780c9155b..9b8361bab 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/sheep/SheepGame.java @@ -518,15 +518,7 @@ public class SheepGame extends TeamGame //Write New for (GameTeam team : _sheepPens.keySet()) { - int score = 0; - - for (Sheep sheep : _sheep.keySet()) - { - if (_sheepPens.get(team).contains(sheep.getLocation().getBlock())) - { - score++; - } - } + int score = getSheepCount(team); Scoreboard.WriteOrdered("Sheep", team.GetColor() + team.GetName(), score, true); @@ -682,14 +674,14 @@ public class SheepGame extends TeamGame public int getSheepCount(GameTeam team) { - int count = 0; + int score = 0; - for (SheepData data : _sheep.values()) + for (Sheep sheep : _sheep.keySet()) { - if (data.HolderTeam == team) - count++; + if (_sheepPens.get(team).contains(sheep.getLocation().getBlock())) + score++; } - return count; + return score; } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ParalympicsStatTracker.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ParalympicsStatTracker.java index acbda896a..11ced4a3f 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ParalympicsStatTracker.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/stats/ParalympicsStatTracker.java @@ -23,7 +23,7 @@ public class ParalympicsStatTracker extends StatTracker } @EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR) - public void onePerkLeap(PerkLeapEvent event) + public void onPerkLeap(PerkLeapEvent event) { if (getGame().GetState() != Game.GameState.Live) return; From da5f953212229df022e9e49ffbd64d2b34b341ef Mon Sep 17 00:00:00 2001 From: Chiss Date: Wed, 27 Aug 2014 14:22:35 +1000 Subject: [PATCH 2/7] Fixed BlockMorph leaving blocks behind when player was teleported. --- .../core/gadget/gadgets/BlockForm.java | 4 +- .../core/gadget/gadgets/MorphBlock.java | 41 ++++++++++++++++++- .../Mineplex.Hub/src/mineplex/hub/Hub.java | 6 +-- .../nautilus/game/arcade/ArcadeManager.java | 3 +- .../src/nautilus/game/arcade/GameFactory.java | 3 +- 5 files changed, 48 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/BlockForm.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/BlockForm.java index 40c53b9e3..4941f2648 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/BlockForm.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/BlockForm.java @@ -4,7 +4,6 @@ import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.MapUtil; import mineplex.core.common.util.UtilBlock; -import mineplex.core.common.util.UtilInv; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.disguise.disguises.DisguiseCat; @@ -22,7 +21,6 @@ import org.bukkit.craftbukkit.v1_7_R4.entity.CraftEntity; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftFallingSand; import org.bukkit.entity.FallingBlock; import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; public class BlockForm { @@ -228,6 +226,8 @@ public class BlockForm ((CraftFallingSand)block).getHandle().spectating = true; Player.setPassenger(block); + + Host.fallingBlockRegister(block); } //Ensure Falling doesnt Despawn diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java index dee262e66..6d868cc4b 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java @@ -2,12 +2,17 @@ package mineplex.core.gadget.gadgets; import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; import org.bukkit.Material; +import org.bukkit.entity.FallingBlock; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.block.Action; +import org.bukkit.event.entity.EntityChangeBlockEvent; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.util.BlockIterator; import mineplex.core.common.util.C; import mineplex.core.common.util.UtilEvent; @@ -23,6 +28,7 @@ import mineplex.core.updater.event.UpdateEvent; public class MorphBlock extends MorphGadget { private HashMap _active = new HashMap(); + private HashSet _blocks = new HashSet(); public MorphBlock(GadgetManager manager) { @@ -69,11 +75,10 @@ public class MorphBlock extends MorphGadget form.SolidifyUpdate(); form.FallingBlockCheck(); } - } @EventHandler - public void stacker(PlayerInteractEvent event) + public void formChange(PlayerInteractEvent event) { if (event.getClickedBlock() == null) return; @@ -100,4 +105,36 @@ public class MorphBlock extends MorphGadget if (_active.containsKey(event.getEntity())) event.setCancelled(true); } + + public void fallingBlockRegister(FallingBlock block) + { + _blocks.add(block); + } + + @EventHandler + public void fallingBlockForm(EntityChangeBlockEvent event) + { + if (_blocks.remove(event.getEntity())) + event.setCancelled(true); + } + + @EventHandler + public void fallingBlockClean(UpdateEvent event) + { + if (event.getType() != UpdateType.SEC) + return; + + Iterator blockIterator = _blocks.iterator(); + + while (blockIterator.hasNext()) + { + FallingBlock block = blockIterator.next(); + + if (!block.isValid()) + { + block.remove(); + blockIterator.remove(); + } + } + } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java index 983bf9614..7251dc428 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/Hub.java @@ -57,8 +57,8 @@ import mineplex.minecraft.game.core.fire.Fire; public class Hub extends JavaPlugin implements IRelation { private String WEB_CONFIG = "webServer"; - - @Override + + @Override public void onEnable() { getConfig().addDefault(WEB_CONFIG, "http://accounts.mineplex.com/"); @@ -68,7 +68,7 @@ public class Hub extends JavaPlugin implements IRelation String webServerAddress = getConfig().getString(WEB_CONFIG); Logger.initialize(this); - + //Static Modules CommandCenter.Initialize(this); CoreClientManager clientManager = new CoreClientManager(this, webServerAddress); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java index 889b987aa..3c8f047d6 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/ArcadeManager.java @@ -623,7 +623,8 @@ public class ArcadeManager extends MiniPlugin implements IRelation ((CraftEntity) player).getHandle().getDataWatcher().watch(0, Byte.valueOf((byte) 0)); player.setSprinting(false); - + player.setSneaking(false); + player.setFoodLevel(20); player.setSaturation(3f); player.setExhaustion(0f); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java index 5ff22c544..6108fa4b3 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java @@ -26,6 +26,7 @@ import nautilus.game.arcade.game.games.halloween.Halloween; import nautilus.game.arcade.game.games.hideseek.HideSeek; import nautilus.game.arcade.game.games.micro.Micro; import nautilus.game.arcade.game.games.milkcow.MilkCow; +import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.mineware.MineWare; import nautilus.game.arcade.game.games.quiver.Quiver; import nautilus.game.arcade.game.games.quiver.QuiverTeams; @@ -78,7 +79,7 @@ public class GameFactory else if (gameType == GameType.Halloween) return new Halloween(_manager); else if (gameType == GameType.HideSeek) return new HideSeek(_manager); else if (gameType == GameType.Micro) return new Micro(_manager); - //else if (gameType == GameType.MineStrike) return new MineStrike(_manager); + else if (gameType == GameType.MineStrike) return new MineStrike(_manager); else if (gameType == GameType.MineWare) return new MineWare(_manager); else if (gameType == GameType.MilkCow) return new MilkCow(_manager); else if (gameType == GameType.Paintball) return new Paintball(_manager); From d9ef5f50be57c9d6d89bf69747b0fd7b8e63ba00 Mon Sep 17 00:00:00 2001 From: Chiss Date: Wed, 27 Aug 2014 14:23:31 +1000 Subject: [PATCH 3/7] disabled minestrike --- .../src/nautilus/game/arcade/GameFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java index 6108fa4b3..4181d7e65 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/GameFactory.java @@ -26,7 +26,7 @@ import nautilus.game.arcade.game.games.halloween.Halloween; import nautilus.game.arcade.game.games.hideseek.HideSeek; import nautilus.game.arcade.game.games.micro.Micro; import nautilus.game.arcade.game.games.milkcow.MilkCow; -import nautilus.game.arcade.game.games.minestrike.MineStrike; +//import nautilus.game.arcade.game.games.minestrike.MineStrike; import nautilus.game.arcade.game.games.mineware.MineWare; import nautilus.game.arcade.game.games.quiver.Quiver; import nautilus.game.arcade.game.games.quiver.QuiverTeams; @@ -79,7 +79,7 @@ public class GameFactory else if (gameType == GameType.Halloween) return new Halloween(_manager); else if (gameType == GameType.HideSeek) return new HideSeek(_manager); else if (gameType == GameType.Micro) return new Micro(_manager); - else if (gameType == GameType.MineStrike) return new MineStrike(_manager); + //else if (gameType == GameType.MineStrike) return new MineStrike(_manager); else if (gameType == GameType.MineWare) return new MineWare(_manager); else if (gameType == GameType.MilkCow) return new MilkCow(_manager); else if (gameType == GameType.Paintball) return new Paintball(_manager); From 9439daa852e8605d34da66616d55cb8333b73ebf Mon Sep 17 00:00:00 2001 From: Chiss Date: Wed, 27 Aug 2014 15:16:20 +1000 Subject: [PATCH 4/7] Fixed bug where spectators could trigger anti-cheat in bridges --- .../src/mineplex/core/gadget/gadgets/MorphBlock.java | 2 +- .../src/nautilus/game/arcade/game/games/bridge/Bridge.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java index 6d868cc4b..7e17c92b2 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/MorphBlock.java @@ -130,7 +130,7 @@ public class MorphBlock extends MorphGadget { FallingBlock block = blockIterator.next(); - if (!block.isValid()) + if (!block.isValid() || block.getVehicle() == null) { block.remove(); blockIterator.remove(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java index c379d88e6..566110eba 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/bridge/Bridge.java @@ -1361,6 +1361,9 @@ public class Bridge extends TeamGame implements OreObsfucation if (event.getBlock().getType() != Material.CHEST) return; + + if (!IsAlive(event.getPlayer())) + return; for (Location loc : WorldData.GetCustomLocs("54")) { @@ -1384,6 +1387,9 @@ public class Bridge extends TeamGame implements OreObsfucation if (event.getClickedBlock().getType() != Material.CHEST) return; + + if (!IsAlive(event.getPlayer())) + return; for (Location loc : WorldData.GetCustomLocs("54")) { From 4e43a2ca736cfa9c12eb4608db5a47ff928747aa Mon Sep 17 00:00:00 2001 From: Chiss Date: Wed, 27 Aug 2014 15:19:08 +1000 Subject: [PATCH 5/7] Extended range of snake parkour, ensuring people tp back to it when they fall. --- .../Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java index eab382322..321f0381f 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java @@ -95,7 +95,7 @@ public class ParkourManager extends MiniPlugin "and great agility! Some say it was created", "by the devil as a cruel joke!" }, 8000, new Location(Manager.GetSpawn().getWorld(), 22,70,-54), - new Location(Manager.GetSpawn().getWorld(), 28,-50,-88), new Location(Manager.GetSpawn().getWorld(), -24,90,-46))); + new Location(Manager.GetSpawn().getWorld(), 35,-200,-90), new Location(Manager.GetSpawn().getWorld(), -30,250,-46))); _lavaParkourReturn = new Location(Manager.GetSpawn().getWorld(), -89.5,68,36.5); _lavaParkourReturn.setYaw(90); From 9cde497a5c92f3ec8bef7195cc2579dc9048a3c9 Mon Sep 17 00:00:00 2001 From: Chiss Date: Wed, 27 Aug 2014 15:20:55 +1000 Subject: [PATCH 6/7] Fixed ethereal pearl text --- .../src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java index b166d9d85..32d8a3127 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java @@ -33,7 +33,7 @@ public class ItemEtherealPearl extends ItemGadget }, -1, Material.ENDER_PEARL, (byte)0, - 500, new Ammo("Ethereal Pearl", "50 Bats", Material.ENDER_PEARL, (byte)0, new String[] { C.cWhite + "50 Pearls to get around with!" }, 500, 50)); + 500, new Ammo("Ethereal Pearl", "50 Pearls", Material.ENDER_PEARL, (byte)0, new String[] { C.cWhite + "50 Pearls to get around with!" }, 500, 50)); } @Override From 311711f2f0a8bf7ff494e617ebbdc7034d1e510e Mon Sep 17 00:00:00 2001 From: Chiss Date: Wed, 27 Aug 2014 15:24:10 +1000 Subject: [PATCH 7/7] Disabled fireworks for non-gadget enderpearls. --- .../mineplex/core/gadget/gadgets/ItemEtherealPearl.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java index 32d8a3127..ca2a9aec8 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/ItemEtherealPearl.java @@ -1,11 +1,15 @@ package mineplex.core.gadget.gadgets; +import java.util.ArrayList; +import java.util.Iterator; + import org.bukkit.Color; import org.bukkit.FireworkEffect; import org.bukkit.Material; import org.bukkit.FireworkEffect.Type; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftPlayer; import org.bukkit.entity.EnderPearl; +import org.bukkit.entity.Item; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.player.PlayerTeleportEvent; @@ -50,7 +54,7 @@ public class ItemEtherealPearl extends ItemGadget EnderPearl pearl = player.launchProjectile(EnderPearl.class); pearl.setPassenger(player); - + //Inform UtilPlayer.message(player, F.main("Skill", "You threw " + F.skill(GetName()) + ".")); @@ -63,6 +67,9 @@ public class ItemEtherealPearl extends ItemGadget @EventHandler public void teleportCancel(PlayerTeleportEvent event) { + if (!IsActive(event.getPlayer())) + return; + if (event.getCause() == TeleportCause.ENDER_PEARL) { //Firework