From 6886484d794c9970cd55b86cda04d1119ff7fa81 Mon Sep 17 00:00:00 2001 From: Cheese Date: Wed, 17 Jun 2015 13:02:12 +1000 Subject: [PATCH] Fixed Micro Battles lag (stupid lava) cmds for jnr devs smaller head hitbox in MS added MB to parser plugin --- .../src/mineplex/mapparser/GameType.java | 1 + .../game/arcade/command/GameCommand.java | 2 +- .../game/arcade/command/SetCommand.java | 2 +- .../game/arcade/command/StartCommand.java | 2 +- .../game/arcade/command/StopCommand.java | 2 +- .../game/arcade/game/games/micro/Micro.java | 17 ++++++++++++++--- .../game/games/minestrike/MineStrike.java | 4 ++-- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java index 1973bcbfc..4328944d3 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/GameType.java @@ -11,6 +11,7 @@ public enum GameType BaconBrawl("Bacon Brawl"), Barbarians("A Barbarians Life"), Bridge("The Bridges"), + Build("Master Builders"), CastleSiege("Castle Siege"), ChampionsTDM("Champions TDM", "Champions"), ChampionsDominate("Champions Domination", "Champions"), 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 08887dde8..50fbfe062 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, new Rank[] {Rank.YOUTUBE, Rank.MAPLEAD}, "game"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.MAPLEAD, Rank.JNR_DEV}, "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 1b7e0e24d..e49c88b6d 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 @@ -19,7 +19,7 @@ public class SetCommand extends CommandBase { public SetCommand(ArcadeManager plugin) { - super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.MAPLEAD}, "set"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.MAPLEAD, Rank.JNR_DEV}, "set"); } @Override 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 79a38a797..b78521dc9 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, new Rank[] {Rank.YOUTUBE, Rank.MAPLEAD}, "start"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.YOUTUBE, Rank.MAPLEAD, Rank.JNR_DEV}, "start"); } @Override diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StopCommand.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StopCommand.java index 2f09c66bf..d7a255c84 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StopCommand.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/command/StopCommand.java @@ -13,7 +13,7 @@ public class StopCommand extends CommandBase { public StopCommand(ArcadeManager plugin) { - super(plugin, Rank.ADMIN, new Rank[] {Rank.MAPLEAD}, "stop"); + super(plugin, Rank.ADMIN, new Rank[] {Rank.MAPLEAD, Rank.JNR_DEV}, "stop"); } @Override 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 d8a817f01..94786569d 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 @@ -76,7 +76,7 @@ public class Micro extends TeamGame { Block block = WorldData.World.getBlockAt(x, y, z); - if (block.getType() == Material.AIR) + if (block.getType() == Material.AIR || block.isLiquid()) continue; _blocks.add(block); @@ -104,9 +104,18 @@ public class Micro extends TeamGame if (_blocks.isEmpty()) return; + if (!UtilTime.elapsed(GetStateTime(), 12000)) + return; + + int d = 1; + if (UtilTime.elapsed(GetStateTime(), 16000)) + d = 2; + if (UtilTime.elapsed(GetStateTime(), 20000)) + d = 3; + //TimingManager.start("Block Fall"); - for (int i = 0 ; i < 3 ; i++) + for (int i = 0 ; i < d ; i++) { Block bestBlock = null; double bestDist = 0; @@ -133,7 +142,7 @@ public class Micro extends TeamGame if (Math.random() > 0.75) bestBlock.getWorld().spawnFallingBlock(bestBlock.getLocation().add(0.5, 0.5, 0.5), bestBlock.getType(), bestBlock.getData()); - bestBlock.setType(Material.AIR); + MapUtil.QuickChangeBlockAt(bestBlock.getLocation(), Material.AIR); } } @@ -178,6 +187,8 @@ public class Micro extends TeamGame if (!UtilTime.elapsed(GetStateTime(), 10000)) return; + Announce("Removing Glass: " + _glass.size()); + for (Block block : _glass) MapUtil.QuickChangeBlockAt(block.getLocation(), Material.AIR); 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 cb3d46357..dab3e58da 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 @@ -1369,9 +1369,9 @@ public class MineStrike extends TeamGame public boolean hitHead(Player player, Location loc) { - return UtilMath.offset2d(loc, player.getLocation()) < 0.3 && //0.3 is ideal + return UtilMath.offset2d(loc, player.getLocation()) < 0.2 && //0.3 was old value, too large loc.getY() >= player.getEyeLocation().getY() - 0.1 && - loc.getY() < player.getEyeLocation().getY() + 0.2; + loc.getY() < player.getEyeLocation().getY() + 0.1; //0.2 was old value, too large }