From a97409b64ad13ba4683f3a0553349cb96d60f096 Mon Sep 17 00:00:00 2001 From: William Burns Date: Thu, 25 Feb 2016 15:04:19 +0000 Subject: [PATCH] Adjust max distance for targeting. --- .../src/mineplex/core/common/util/UtilBlock.java | 1 + .../nautilus/game/arcade/game/games/draw/Draw.java | 11 ++++------- .../game/arcade/game/games/draw/tools/Tool.java | 5 +++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java index c632a1f99..8298bd7f1 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilBlock.java @@ -171,6 +171,7 @@ public class UtilBlock blockPassSet.add((byte) Material.STAINED_GLASS_PANE.getId()); blockPassSet.add((byte) Material.IRON_TRAPDOOR.getId()); blockPassSet.add((byte) Material.DAYLIGHT_DETECTOR_INVERTED.getId()); + blockPassSet.add((byte) Material.BARRIER.getId()); blockPassSet.add((byte) Material.BIRCH_FENCE_GATE.getId()); blockPassSet.add((byte) Material.JUNGLE_FENCE_GATE.getId()); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java index efc75824e..c30b0ba1c 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/Draw.java @@ -91,9 +91,6 @@ public class Draw extends SoloGame private boolean _useHolidayWords = false; private HashSet _usedWords = new HashSet(); - // Blocks to be ignored when targeting. (Air, Barrier) - public static final HashSet IGNORED_BLOCKS = new HashSet<>(Arrays.asList((byte)0, (byte)166)); - public Draw(ArcadeManager manager) { super(manager, GameType.Draw, @@ -590,7 +587,7 @@ public class Draw extends SoloGame continue; } - Block block = p.getTargetBlock(IGNORED_BLOCKS, 200); + Block block = p.getTargetBlock(UtilBlock.blockPassSet, 400); if (block == null || !_canvas.contains(block)) continue; @@ -649,7 +646,7 @@ public class Draw extends SoloGame continue; } - Block block = player.getTargetBlock(IGNORED_BLOCKS, 200); + Block block = player.getTargetBlock(UtilBlock.blockPassSet, 400); if (block == null || !_canvas.contains(block)) continue; @@ -763,7 +760,7 @@ public class Draw extends SoloGame } // Get the target block that the player clicks on. - Block target = p.getTargetBlock(IGNORED_BLOCKS, 200); + Block target = p.getTargetBlock(UtilBlock.blockPassSet, 400); if (target == null || !_canvas.contains(target)) { @@ -846,7 +843,7 @@ public class Draw extends SoloGame if (!_drawers.HasPlayer(player)) return; - Block block = player.getTargetBlock(IGNORED_BLOCKS, 200); + Block block = player.getTargetBlock(UtilBlock.blockPassSet, 400); List possibleBlocks = UtilBlock.getInBoundingBox(WorldData.GetDataLocs("GREEN").get(0), WorldData.GetDataLocs("GREEN").get(1)); diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/tools/Tool.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/tools/Tool.java index 8fc5ad1f2..acc0ecceb 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/tools/Tool.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/draw/tools/Tool.java @@ -4,6 +4,7 @@ package nautilus.game.arcade.game.games.draw.tools; import java.util.HashMap; import java.util.HashSet; +import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilGear; import mineplex.core.common.util.UtilServer; @@ -39,7 +40,7 @@ public abstract class Tool { if (!UtilEvent.isAction(event, ActionType.R)) return; - Block block = event.getPlayer().getTargetBlock(Draw.IGNORED_BLOCKS, 60); + Block block = event.getPlayer().getTargetBlock(UtilBlock.blockPassSet, 400); if (block == null) return; @@ -72,7 +73,7 @@ public abstract class Tool _new = new HashMap(); //Calculate New - Block end = _drawer.getTargetBlock(Draw.IGNORED_BLOCKS, 64); + Block end = _drawer.getTargetBlock(UtilBlock.blockPassSet, 400); if (end != null && Host.getCanvas().contains(end)) { customDraw(end);