/** * Check if the plate is deadly * * @param block The block to check * @return The plate if it is deadly, otherwise null * @see Plate */ public static Plate getPlateIfDeadly(Block block) { Material m = block.getType(); if (m != Material.WOOD_PLATE && m != Material.STONE_PLATE) { return null; } String w = block.getWorld().getName(); String x = block.getX() + ""; String y = block.getY() + ""; String z = block.getZ() + ""; return DeadlyPlates.getInstance() .getDatabase() .find(Plate.class) .where() .ieq("world", w) .ieq("x", x) .ieq("y", y) .ieq("z", z) .findUnique(); }
/** * Get the location * * @return */ public Location getLocation() { World w = DeadlyPlates.getInstance().getServer().getWorld(world); return new Location(w, x, y, z); }