public double getZ() { return 0.5 * (((Chest)getLeftSide()).getZ() + ((Chest)getRightSide()).getZ()); } }
public double getY() { return 0.5 * (((Chest)getLeftSide()).getY() + ((Chest)getRightSide()).getY()); }
private boolean isPistonExtended(Block block) { // TODO: check direction of piston_extension to make sure that the extension is attached to // piston Block pistonHead = block .getRelative(((PistonBaseMaterial) block.getState().getData()).getFacing()); return pistonHead.getType() == Material.PISTON_EXTENSION; }
private boolean isNearWater(Block block) { for (BlockFace face : SIDES) { switch (block.getRelative(face).getType()) { case WATER: case STATIONARY_WATER: return true; default: break; } } return false; }
/** * Returns true if the Piston in the event is sticky. * * @return stickiness of the piston */ public boolean isSticky() { return block.getType() == Material.PISTON_STICKY_BASE; }
/** * Convenience method for getting the faced Block. * * @return The faced Block */ public Block getToBlock() { if (to == null) { to = block.getRelative(face); } return to; }
/** * Checks whether this tree can grow on top of the given block. * @param soil the block we're growing on * @return true if this tree can grow on the type of block below it; false otherwise */ public boolean canPlaceOn(BlockState soil) { return soil.getType() == Material.GRASS || soil.getType() == Material.DIRT || soil.getType() == Material.SOIL; }
public double getX() { return 0.5 * (((Chest)getLeftSide()).getX() + ((Chest)getRightSide()).getX()); }
public World getWorld() { return ((Chest)getLeftSide()).getWorld(); }
private static void set(int id, Biome biome) { ids[biome.ordinal()] = id; biomes[id] = biome; }
private boolean hasDownSupport(Block block) { Block down = block.getRelative(BlockFace.DOWN); return down.getType() == Material.CHORUS_PLANT || down.getType() == Material.ENDER_STONE; } }