From f500afd713d3f7c377600cdd177c1fbd72156beb Mon Sep 17 00:00:00 2001 From: asofold Date: Sun, 11 Nov 2012 13:16:38 +0100 Subject: [PATCH] Fix isInWeb. --- .../nocheatplus/utilities/PlayerLocation.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java b/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java index f828fb45..14d30b38 100644 --- a/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java +++ b/src/fr/neatmonster/nocheatplus/utilities/PlayerLocation.java @@ -310,19 +310,9 @@ public class PlayerLocation { * @return true, if the player is in web */ public boolean isInWeb() { - final int webId = Material.WEB.getId(); if (inWeb == null) { - for (int blockX = Location.locToBlock(minX + 0.001D); blockX <= Location.locToBlock(maxX - 0.001D); blockX++) { - for (int blockY = Location.locToBlock(minY + 0.001D); blockY <= Location.locToBlock(maxY - 0.001D); blockY++) { - for (int blockZ = Location.locToBlock(minZ + 0.001D); blockZ <= Location.locToBlock(maxZ - 0.001D); blockZ++) { - if (getTypeId(blockX, blockY, blockZ) == webId) { - inWeb = true; - return true; - } - } - } - } - inWeb = false; + final double inset = 0.001d; + inWeb = BlockProperties.collidesId(getBlockAccess(), minX + inset, minY + inset, minZ + inset, maxX - inset, maxY - inset, maxZ - inset, Material.WEB.getId()); } return inWeb; }