diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java index 684ac1b42..0a36b9ddb 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/Rank.java @@ -35,11 +35,29 @@ public enum Rank } public boolean Has(Player player, Rank rank, boolean inform) + { + return Has(player, rank, null, inform); + } + + public boolean Has(Player player, Rank rank, Rank[] specific, boolean inform) { if (player != null) if (player.getName().equals("Chiss")) return true; + //Specific Rank + if (specific != null) + { + for (Rank curRank : specific) + { + if (compareTo(curRank) == 0) + { + return true; + } + } + } + + // if (compareTo(rank) <= 0) return true; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/blockrestore/BlockRestore.java b/Plugins/Mineplex.Core/src/mineplex/core/blockrestore/BlockRestore.java index 68db3569f..476dc8ae9 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/blockrestore/BlockRestore.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/blockrestore/BlockRestore.java @@ -118,7 +118,7 @@ public class BlockRestore extends MiniPlugin return; //No Snow on Ice - if (block.getRelative(BlockFace.DOWN).getTypeId() == 79) + if (block.getRelative(BlockFace.DOWN).getTypeId() == 79 || block.getRelative(BlockFace.DOWN).getTypeId() == 174) return; //No Snow on Slabs @@ -130,8 +130,8 @@ public class BlockRestore extends MiniPlugin return; //No Snow on Fence or Walls - if (block.getRelative(BlockFace.DOWN).getTypeId() == 85 || - block.getRelative(BlockFace.DOWN).getTypeId() == 139) + if (block.getRelative(BlockFace.DOWN).getType().name().toLowerCase().contains("fence") || + block.getRelative(BlockFace.DOWN).getType().name().toLowerCase().contains("wall")) return; //Not Buildable diff --git a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandBase.java b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandBase.java index 26014d350..7361db14c 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandBase.java @@ -13,6 +13,8 @@ import mineplex.core.recharge.Recharge; public abstract class CommandBase implements ICommand { private Rank _requiredRank; + private Rank[] _specificRank; + private List _aliases; protected PluginType Plugin; @@ -26,6 +28,15 @@ public abstract class CommandBase implements ICom _aliases = Arrays.asList(aliases); } + public CommandBase(PluginType plugin, Rank requiredRank, Rank[] specificRank, String...aliases) + { + Plugin = plugin; + _requiredRank = requiredRank; + _specificRank = specificRank; + + _aliases = Arrays.asList(aliases); + } + public Collection Aliases() { return _aliases; @@ -41,6 +52,11 @@ public abstract class CommandBase implements ICom return _requiredRank; } + public Rank[] GetSpecificRanks() + { + return _specificRank; + } + public void SetCommandCenter(CommandCenter commandCenter) { CommandCenter = commandCenter; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java index dd3d19ed6..3713ca453 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/command/CommandCenter.java @@ -55,7 +55,7 @@ public class CommandCenter implements Listener ICommand command = Commands.get(commandName.toLowerCase()); - if (command != null && ClientManager.Get(event.getPlayer()).GetRank().Has(event.getPlayer(), command.GetRequiredRank(), true)) + if (command != null && ClientManager.Get(event.getPlayer()).GetRank().Has(event.getPlayer(), command.GetRequiredRank(), command.GetSpecificRanks(), true)) { if (!Recharge.Instance.use(event.getPlayer(), "Command", 500, false, false)) { diff --git a/Plugins/Mineplex.Core/src/mineplex/core/command/ICommand.java b/Plugins/Mineplex.Core/src/mineplex/core/command/ICommand.java index 48ebe363e..22c109459 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/command/ICommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/command/ICommand.java @@ -16,4 +16,5 @@ public interface ICommand void SetAliasUsed(String name); Rank GetRequiredRank(); + Rank[] GetSpecificRanks(); } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/command/MultiCommandBase.java b/Plugins/Mineplex.Core/src/mineplex/core/command/MultiCommandBase.java index 48736d577..e035964f6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/command/MultiCommandBase.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/command/MultiCommandBase.java @@ -17,6 +17,13 @@ public abstract class MultiCommandBase extends Co Commands = new NautHashMap(); } + public MultiCommandBase(PluginType plugin, Rank rank, Rank[] specificRanks, String...aliases) + { + super(plugin, rank, specificRanks, aliases); + + Commands = new NautHashMap(); + } + public void AddCommand(ICommand command) { for (String commandRoot : command.Aliases()) @@ -48,7 +55,7 @@ public abstract class MultiCommandBase extends Co ICommand command = Commands.get(commandName); - if (command != null && CommandCenter.ClientManager.Get(caller).GetRank().Has(caller, command.GetRequiredRank(), true)) + if (command != null && CommandCenter.ClientManager.Get(caller).GetRank().Has(caller, command.GetRequiredRank(), command.GetSpecificRanks(), true)) { command.SetAliasUsed(commandName); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java index 5b7ef1b65..0cac2bf42 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/AdminMountManager.java @@ -40,7 +40,7 @@ public class AdminMountManager extends MiniPlugin public void AddCommands() { AddCommand(new HorseSpawn(this)); - } + } @EventHandler public void HorseInteract(PlayerInteractEntityEvent event) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java index 0fe0c7daf..12e8b0d39 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java @@ -89,6 +89,7 @@ public class ParkourManager extends MiniPlugin }, 4000, new Location(Manager.GetSpawn().getWorld(), -93,67,38), new Location(Manager.GetSpawn().getWorld(), -86,100,42), new Location(Manager.GetSpawn().getWorld(), -120,50,-17))); + /* _parkour.add(new ParkourSnake("Snake Parkour", new String[] { "This parkour requires incredible timing", @@ -96,7 +97,7 @@ public class ParkourManager extends MiniPlugin "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))); - +*/ _lavaParkourReturn = new Location(Manager.GetSpawn().getWorld(), -89.5,68,36.5); _lavaParkourReturn.setYaw(90); diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java index ab65b9e03..8f7999986 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/WorldManager.java @@ -69,7 +69,7 @@ public class WorldManager extends MiniPlugin Manager = manager; } - @EventHandler + //@EventHandler public void SpawnAnimals(UpdateEvent event) { if (event.getType() != UpdateType.SLOW) diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/parkour/ParkourSnake.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/parkour/ParkourSnake.java index ad95bebd5..a2622f71e 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/parkour/ParkourSnake.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/parkour/ParkourSnake.java @@ -56,8 +56,6 @@ public class ParkourSnake extends ParkourData { e.printStackTrace(); } - - System.out.println("Done"); } public SnakePart loadSnake(String locString) @@ -207,6 +205,9 @@ public class ParkourSnake extends ParkourData public void Update() { + if (_snakes == null) + return; + for (SnakePart snake : _snakes) snake.Update(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/GameCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/GameCommand.java index 362ed2400..e1cc12a87 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/GameCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/GameCommand.java @@ -10,7 +10,7 @@ public class GameCommand extends MultiCommandBase { public GameCommand(ArcadeManager plugin) { - super(plugin, Rank.ADMIN, "game"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.MAPDEV}, "game"); AddCommand(new StartCommand(Plugin)); AddCommand(new StopCommand(Plugin)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/SetCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/SetCommand.java index 7b3d19b5a..5ad5c815e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/SetCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/SetCommand.java @@ -12,22 +12,22 @@ import mineplex.core.common.Rank; import mineplex.core.common.util.C; public class SetCommand extends CommandBase -{ +{ public SetCommand(ArcadeManager plugin) { - super(plugin, Rank.ADMIN, "set"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.MAPDEV}, "set"); } - - @Override + + @Override public void Execute(Player caller, String[] args) - { + { if (Plugin.GetGame() == null) return; - + if (args.length == 0) { caller.sendMessage("/game set (Map)"); - return; + return; } String game = args[0].toLowerCase(); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StartCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StartCommand.java index d8b996565..a57fd55d2 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StartCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StartCommand.java @@ -12,7 +12,7 @@ public class StartCommand extends CommandBase { public StartCommand(ArcadeManager plugin) { - super(plugin, Rank.ADMIN, "start"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.MAPDEV}, "start"); } @Override @@ -30,7 +30,7 @@ public class StartCommand extends CommandBase int seconds; if(args != null && args.length > 0) seconds = Integer.parseInt(args[0]); - else + else seconds = 10; Plugin.GetGameManager().StateCountdown(Plugin.GetGame(), seconds, true); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java index c13a9b904..9538ceb9e 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/deathtag/DeathTag.java @@ -1,10 +1,13 @@ package nautilus.game.arcade.game.games.deathtag; import java.util.ArrayList; +import java.util.Collections; import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.entity.PlayerDeathEvent; @@ -25,6 +28,7 @@ import nautilus.game.arcade.game.GameTeam; import nautilus.game.arcade.game.SoloGame; import nautilus.game.arcade.game.GameTeam.PlayerState; import nautilus.game.arcade.game.games.deathtag.kits.*; +import nautilus.game.arcade.game.games.sneakyassassins.powerups.PowerUpManager; import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.NullKit; @@ -36,6 +40,8 @@ public class DeathTag extends SoloGame private NautHashMap _deathLocation = new NautHashMap(); private int _currentSpeed = -1; + + private ArrayList _lights = new ArrayList(); public DeathTag(ArcadeManager manager) { @@ -65,6 +71,20 @@ public class DeathTag extends SoloGame this.PrepareFreeze = false; } + + @Override + public void ParseData() + { + _lights = this.WorldData.GetCustomLocs("89"); + + for (Location loc : _lights) + { + if (Math.random() > 0.5) + loc.getBlock().setType(Material.GOLD_BLOCK); + else + loc.getBlock().setTypeIdAndData(35, (byte)15, false); + } + } @Override public void RestrictKits() @@ -110,6 +130,25 @@ public class DeathTag extends SoloGame { return _runners; } + + @EventHandler + public void UpdateLights(UpdateEvent event) + { + if (!IsLive()) + return; + + if (event.getType() != UpdateType.SEC) + return; + + for (Location loc : _lights) + { + if (loc.getBlock().getType() == Material.GOLD_BLOCK) + loc.getBlock().setTypeIdAndData(35, (byte)15, false); + else + loc.getBlock().setType(Material.GOLD_BLOCK); + } + } + @EventHandler public void UpdateSpeed(UpdateEvent event) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java index 3528d43fa..d7f43170d 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/dragonescape/DragonEscapeTeams.java @@ -2,6 +2,8 @@ package nautilus.game.arcade.game.games.dragonescape; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; +import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.ChatColor; @@ -11,6 +13,8 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.FireworkEffect.Type; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; import org.bukkit.entity.EnderDragon; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -171,18 +175,38 @@ public class DragonEscapeTeams extends TeamGame @EventHandler public void MoveDragon(UpdateEvent event) - { + { if (event.getType() != UpdateType.TICK) return; if (_dragonData == null) return; - + _dragonData.Target = _waypoints.get(Math.min(_waypoints.size()-1, (GetWaypointIndex(_dragonData.Location) + 1))); _dragonData.Move(); + + Set blocks = UtilBlock.getInRadius(_dragonData.Location, 10d).keySet(); + + Iterator blockIterator = blocks.iterator(); + while (blockIterator.hasNext()) + { + Block block = blockIterator.next(); + + if (block.isLiquid()) + blockIterator.remove(); + + else if (block.getRelative(BlockFace.UP).isLiquid()) + blockIterator.remove(); - Manager.GetExplosion().BlockExplosion(UtilBlock.getInRadius(_dragonData.Location, 10d).keySet(), _dragonData.Location, false); + else if (WorldData.MapName.contains("Hell") && block.getY() < 30) + blockIterator.remove(); + + else if (WorldData.MapName.contains("Pirate") && (block.getY() < 6)) + blockIterator.remove(); + } + + Manager.GetExplosion().BlockExplosion(blocks, _dragonData.Location, false); } @EventHandler diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java index 9a28f8a4f..9d816df01 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/micro/Micro.java @@ -62,8 +62,11 @@ public class Micro extends TeamGame public void ParseData() { for (Location loc : WorldData.GetCustomLocs("20")) + { _glass.add(loc.getBlock()); - + loc.getBlock().setType(Material.STAINED_GLASS); + } + for (int y= WorldData.MinY ; y < WorldData.MaxY ; y++) for (int x= WorldData.MinX ; x < WorldData.MaxX ; x++) for (int z= WorldData.MinZ ; z < WorldData.MaxZ ; z++) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverTeams.java index ecc6c48be..7d2470059 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverTeams.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/QuiverTeams.java @@ -32,10 +32,9 @@ import nautilus.game.arcade.kit.Kit; public class QuiverTeams extends TeamGame { private HashMap _teamKills = new HashMap(); - private ArrayList _lastScoreboard = new ArrayList(); private HashMap _deathTime = new HashMap(); - private int _reqKills = 100; + private int _reqKills = 6; public QuiverTeams(ArcadeManager manager) { @@ -52,7 +51,7 @@ public class QuiverTeams extends TeamGame "Bow and Arrow insta-kills.", "You receive 1 Arrow per kill.", "Glass blocks are breakable", - "First team to 100 kills wins." + "First team to 60 kills wins." }); this.HungerSet = 20; @@ -195,6 +194,10 @@ public class QuiverTeams extends TeamGame Scoreboard.Write(kills + "" + team.GetColor() + " Kills"); } + Scoreboard.WriteBlank(); + Scoreboard.Write(C.Bold + "First To"); + Scoreboard.Write(C.cGold + C.Bold + _reqKills + " Kills"); + Scoreboard.Draw(); } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java index d375e9104..cbe626a4c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/Spleef.java @@ -258,7 +258,7 @@ public class Spleef extends SoloGame @EventHandler public void Hunger(UpdateEvent event) { - if (event.getType() != UpdateType.SEC) + if (event.getType() != UpdateType.SLOW) return; if (!IsLive()) @@ -275,7 +275,7 @@ public class Spleef extends SoloGame UtilPlayer.message(player, F.main("Game", "Break blocks to restore hunger!")); } - UtilPlayer.hunger(player, -1); + UtilPlayer.hunger(player, -2); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/SpleefTeams.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/SpleefTeams.java index fe3d10c85..d408691ba 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/SpleefTeams.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/spleef/SpleefTeams.java @@ -3,10 +3,13 @@ package nautilus.game.arcade.game.games.spleef; import java.lang.reflect.Field; import org.bukkit.Effect; +import org.bukkit.Location; +import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftArrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; +import org.bukkit.entity.Snowball; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.BlockDamageEvent; @@ -16,7 +19,11 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; +import mineplex.core.common.util.UtilInv; +import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; +import mineplex.core.itemstack.ItemStackFactory; +import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; import nautilus.game.arcade.ArcadeManager; @@ -56,14 +63,59 @@ public class SpleefTeams extends TeamGame } @EventHandler - public void ArrowDamage(ProjectileHitEvent event) + public void SnowballDamage(ProjectileHitEvent event) { - final Arrow arrow = (Arrow)event.getEntity(); - final double velocity = arrow.getVelocity().length(); + if (!(event.getEntity() instanceof Snowball)) + return; + + Snowball ball = (Snowball)event.getEntity(); - if (!(arrow.getShooter() instanceof Player)) + if (ball.getShooter() == null || !(ball.getShooter() instanceof Player)) return; + Location loc = ball.getLocation().add(ball.getVelocity().multiply(0.8)); + + Block block = loc.getBlock(); + + //Find Nearest if hit nothing :O + if (block.getType() == Material.AIR) + { + Block closest = null; + double closestDist = 0; + + for (Block other : UtilBlock.getSurrounding(block, true)) + { + if (other.getType() == Material.AIR) + continue; + + double dist = UtilMath.offset(loc, other.getLocation().add(0.5, 0.5, 0.5)); + + if (closest == null || dist < closestDist) + { + closest = other; + closestDist = dist; + } + } + + if (closest != null) + block = closest; + } + + BlockFade(block, (Player)ball.getShooter(), false); + } + + @EventHandler + public void ArrowDamage(ProjectileHitEvent event) + { + if (!(event.getEntity() instanceof Arrow)) + return; + + final Arrow arrow = (Arrow)event.getEntity(); + final double velocity = arrow.getVelocity().length(); + + if (!(arrow.getShooter() instanceof Player)) + return; + final Player player = (Player)arrow.getShooter(); Manager.GetPlugin().getServer().getScheduler().scheduleSyncDelayedTask(Manager.GetPlugin(), new Runnable() @@ -89,14 +141,14 @@ public class SpleefTeams extends TeamGame Block block = arrow.getWorld().getBlockAt(x, y, z); double radius = 0.5 + velocity/1.6d; - - BlockFade(block, player); - + + BlockFade(block, player, false); + for (Block other : UtilBlock.getInRadius(block.getLocation().add(0.5, 0.5, 0.5), radius).keySet()) { - BlockFade(other, player); + BlockFade(other, player, true); } - + arrow.remove(); } catch (Exception e) @@ -106,25 +158,41 @@ public class SpleefTeams extends TeamGame } }, 0); } - + @EventHandler(priority = EventPriority.LOW) public void BlockDamage(BlockDamageEvent event) { if (!this.IsLive()) return; - + if (!this.IsAlive(event.getPlayer())) return; event.setCancelled(true); - - BlockFade(event.getBlock(), event.getPlayer()); + + BlockFade(event.getBlock(), event.getPlayer(), false); + + //Snowball + if (GetKit(event.getPlayer()) instanceof KitSnowballer) + if (!UtilInv.contains(event.getPlayer(), Material.SNOW_BALL, (byte)0, 16)) + event.getPlayer().getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.SNOW_BALL)); } - - public void BlockFade(Block block, Player player) + + public void BlockFade(Block block, Player player, boolean slowDamage) { - UtilPlayer.hunger(player, 1); - + AddStat(player, "BlocksBroken", 1, false, false); + + //Prevent Super Hunger from Bow + if (Recharge.Instance.use(player, GetName() + " Hunger", 50, false, false)) + if (block.getTypeId() != 7) + UtilPlayer.hunger(player, 1); + + if (!slowDamage) + { + Break(block); + return; + } + //Wool and Stained Clay if (block.getTypeId() == 35 || block.getTypeId() == 159) { @@ -155,7 +223,7 @@ public class SpleefTeams extends TeamGame else Break(block); } - + //Grass else if (block.getTypeId() == 2) { @@ -170,7 +238,7 @@ public class SpleefTeams extends TeamGame else if (block.getData() == 0) block.setData((byte)2); - + else Break(block); } @@ -181,25 +249,22 @@ public class SpleefTeams extends TeamGame Break(block); } } - + public void Break(Block block) { block.getWorld().playEffect(block.getLocation(), Effect.STEP_SOUND, block.getTypeId()); block.setTypeId(0); } - + @EventHandler public void Hunger(UpdateEvent event) { - if (Manager.IsTournamentServer()) + if (event.getType() != UpdateType.SLOW) return; - - if (event.getType() != UpdateType.SEC) - return; - + if (!IsLive()) return; - + for (Player player : GetPlayers(true)) { if (player.getFoodLevel() <= 0) @@ -207,11 +272,11 @@ public class SpleefTeams extends TeamGame Manager.GetDamage().NewDamageEvent(player, null, null, DamageCause.STARVATION, 1, false, true, false, "Starvation", GetName()); - + UtilPlayer.message(player, F.main("Game", "Break blocks to restore hunger!")); } - - UtilPlayer.hunger(player, -1); + + UtilPlayer.hunger(player, -2); } } } diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java index 24364eeaa..4e1499814 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/managers/GameFlagManager.java @@ -39,6 +39,7 @@ import org.bukkit.event.block.BlockFromToEvent; import org.bukkit.event.block.BlockIgniteEvent; import org.bukkit.event.block.BlockIgniteEvent.IgniteCause; import org.bukkit.event.block.BlockPlaceEvent; +import org.bukkit.event.block.LeavesDecayEvent; import org.bukkit.event.entity.CreatureSpawnEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; @@ -921,7 +922,7 @@ public class GameFlagManager implements Listener } @EventHandler - public void WorldLeavesDecay(BlockFromToEvent event) + public void WorldLeavesDecay(LeavesDecayEvent event) { Game game = Manager.GetGame(); if (game == null) return;