mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-09 12:10:37 +01:00
Fix isInWeb.
This commit is contained in:
parent
a1655371ff
commit
f500afd713
@ -310,19 +310,9 @@ public class PlayerLocation {
|
|||||||
* @return true, if the player is in web
|
* @return true, if the player is in web
|
||||||
*/
|
*/
|
||||||
public boolean isInWeb() {
|
public boolean isInWeb() {
|
||||||
final int webId = Material.WEB.getId();
|
|
||||||
if (inWeb == null) {
|
if (inWeb == null) {
|
||||||
for (int blockX = Location.locToBlock(minX + 0.001D); blockX <= Location.locToBlock(maxX - 0.001D); blockX++) {
|
final double inset = 0.001d;
|
||||||
for (int blockY = Location.locToBlock(minY + 0.001D); blockY <= Location.locToBlock(maxY - 0.001D); blockY++) {
|
inWeb = BlockProperties.collidesId(getBlockAccess(), minX + inset, minY + inset, minZ + inset, maxX - inset, maxY - inset, maxZ - inset, Material.WEB.getId());
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
return inWeb;
|
return inWeb;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user