From 739fcdc649a0f90618a4026de7f651d57a6f1f7b Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 10 Jun 2016 16:29:27 +0100 Subject: [PATCH] Fixes the problem where players could not fire a bow in OITQ Users with high latency were not able to fire bows. --- .../game/arcade/game/games/quiver/Quiver.java | 31 ------------------- .../game/games/quiver/kits/KitLeaper.java | 4 +-- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java index 84600d0c7..804e43b59 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/quiver/Quiver.java @@ -4,8 +4,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; -import java.util.UUID; - import mineplex.core.common.util.C; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; @@ -49,7 +47,6 @@ public class Quiver extends SoloGame private HashMap _combo = new HashMap(); private HashMap _bestCombo = new HashMap(); private HashMap _deathTime = new HashMap(); - private HashMap _bowTime = new HashMap<>(); private Objective _scoreObj; @@ -116,26 +113,6 @@ public class Quiver extends SoloGame { player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(262, (byte)0, 1, F.item("Super Arrow"))); player.playSound(player.getLocation(), Sound.PISTON_EXTEND, 3f, 2f); - _bowTime.put(player.getUniqueId(), 0); - } - } - - - @EventHandler - public void onUpdate(UpdateEvent event) - { - if(event.getType() != UpdateType.TICK) - return; - for(Player player : GetPlayers(true)) - { - if(UtilPlayer.isChargingBow(player)) - { - _bowTime.put(player.getUniqueId(), _bowTime.get(player.getUniqueId()) + 1); - } - else - { - _bowTime.put(player.getUniqueId(), 0); - } } } @@ -153,14 +130,6 @@ public class Quiver extends SoloGame if (!(arrow.getShooter() instanceof Player)) return; - Player shooter = (Player) arrow.getShooter(); - //If the player has a full charge but they haven't been holding the bow for more than 20 ticks - if(_bowTime.get(shooter.getUniqueId()) < 20 && event.getForce() == 1) - { - event.setCancelled(true); - return; - } - if (!_deathTime.containsKey(arrow.getShooter())) return; 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 5642d9653..c963e3f13 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 @@ -32,14 +32,14 @@ public class KitLeaper extends Kit new PerkDoubleJump("Double Jump", 0.9, 0.9, true) }, EntityType.ZOMBIE, - new ItemStack(Material.IRON_AXE)); + new ItemStack(Material.STONE_SWORD)); } @Override public void GiveItems(Player player) { - player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.IRON_AXE)); + player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.STONE_SWORD)); player.getInventory().addItem(ItemStackFactory.Instance.CreateStack(Material.BOW)); if (Manager.GetGame().GetState() == GameState.Live)