public boolean canPlaceObject(World w, int x, int y, int z) {
byte missingWallBlocks = 0;
for (byte yy = -1; yy < height + 2; yy++) {
for (byte xx = (byte) (-radiusX - 1); xx < radiusX + 2; xx++) {
for (byte zz = (byte) (-radiusZ - 1); zz < radiusZ + 2; zz++) {
BlockMaterial material = w.getBlockMaterial(x + xx, y + yy, z + zz);
if ((yy == -1 || yy == height + 1)
&& material.isMaterial(VanillaMaterials.AIR)) {
return false;
}
if ((xx == -radiusX - 1 || xx == radiusX + 1
|| zz == -radiusZ - 1 || zz == radiusZ + 1)
&& yy == 0 && material.isMaterial(VanillaMaterials.AIR)
&& w.getBlockMaterial(x + xx, y + yy + 1, z + zz).isMaterial(VanillaMaterials.AIR)) {
missingWallBlocks++;
}
}
}