/** * @return if we are on a slab. */ public static boolean isOnSlab(Location location) { LocationBit bit = new LocationBit(0.5); // check if were already under that block. Location subtracted = location.clone().subtract(0, 0.1, 0); Block subtractedBlock = subtracted.getBlock(); if (subtractedBlock.getType().getData().equals(Step.class)) { return true; } for (int i = 1; i <= 4; i++) { Location newLocation = location.clone().add(bit.getX(), -0.1, bit.getZ()); Block block = newLocation.getBlock(); if (block.getType().getData().equals(Step.class)) { return true; } bit.shift(i); } return false; }
@Override public boolean isBlockSolid(PlotBlock block) { try { Material material = Material.getMaterial(block.id); if (material.isBlock() && material.isSolid() && !material.hasGravity()) { Class<? extends MaterialData> data = material.getData(); if (data.equals(MaterialData.class) || data.equals(Tree.class) || data.equals(Sandstone.class) || data.equals(Wool.class) || data.equals(Step.class)) { return true; } } return false; } catch (Exception e) { return false; } }
@Override public boolean isBlockSolid(PlotBlock block) { try { Material material = Material.getMaterial(block.id); if (material.isBlock() && material.isSolid() && !material.hasGravity()) { Class<? extends MaterialData> data = material.getData(); if (data.equals(MaterialData.class) && !material.isTransparent() && material.isOccluding() || data.equals(Tree.class) || data.equals(Sandstone.class) || data.equals(Wool.class) || data.equals(Step.class) || data.equals(WoodenStep.class)) { switch (material) { case NOTE_BLOCK: case MOB_SPAWNER: return false; default: return true; } } } return false; } catch (Exception ignored) { return false; } }
public Step() { }
@Deprecated public Step(int type) { }
public Step(Material type) { }
@Deprecated public Step(int type, byte data) { }
@Deprecated public Step(Material type, byte data) { }
public Step clone() { return null; }