Package org.bukkit.block

Examples of org.bukkit.block.Sign


                if (!isSign(relative)) {
                    continue;
                }

                Sign sign = (Sign) relative.getState();

                if (getAttachedBlock(sign).equals(block)) {
                    attachedSigns.add(sign);
                }
            }
View Full Code Here


            if (block.equals(signBlock) || !BlockUtil.isSign(block)) {
                continue;
            }

            Sign sign = (Sign) block.getState();

            if (!ChestShopSign.isValid(sign) || !BlockUtil.getAttachedBlock(sign).equals(baseBlock)) {
                continue;
            }

            if (!sign.getLine(ChestShopSign.NAME_LINE).equals(shortName)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

    public static final BlockFace[] CHEST_EXTENSION_FACES = {BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH};
    public static final BlockFace[] SHOP_FACES = {BlockFace.SELF, BlockFace.DOWN, BlockFace.UP, BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH};
    public static final BlockFace[] NEIGHBOR_FACES = {BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH};

    public static Sign getConnectedSign(Chest chest) {
        Sign sign = uBlock.findAnyNearbyShopSign(chest.getBlock());

        if (sign == null && getNeighbor(chest) != null) {
            sign = uBlock.findAnyNearbyShopSign(getNeighbor(chest).getBlock());
        }
View Full Code Here

        }
        return null;
    }

    public static Sign findValidShopSign(Block block, String originalName) {
        Sign ownerShopSign = null;

        for (BlockFace bf : SHOP_FACES) {
            Block faceBlock = block.getRelative(bf);

            if (!BlockUtil.isSign(faceBlock)) {
                continue;
            }

            Sign sign = (Sign) faceBlock.getState();

            if (ChestShopSign.isValid(sign) && signIsAttachedToBlock(sign, block)) {
                if (!sign.getLine(0).equals(originalName)) {
                    return sign;
                } else if (ownerShopSign == null) {
                    ownerShopSign = sign;
                }
            }
View Full Code Here

            if (!BlockUtil.isSign(faceBlock)) {
                continue;
            }

            Sign sign = (Sign) faceBlock.getState();

            if (ChestShopSign.isValid(sign)) {
                return sign;
            }
        }
View Full Code Here

        if (event.getTransactionType() != TransactionEvent.TransactionType.BUY) {
            return;
        }

        Inventory ownerInventory = event.getOwnerInventory();
        Sign sign = event.getSign();
        Chest connectedChest = uBlock.findConnectedChest(sign);

        if (!shopShouldBeRemoved(ownerInventory, event.getStock())) {
            return;
        }

        ShopDestroyedEvent destroyedEvent = new ShopDestroyedEvent(null, event.getSign(), connectedChest);
        ChestShop.callEvent(destroyedEvent);

        sign.getBlock().setType(Material.AIR);

        if (Properties.REMOVE_EMPTY_CHESTS && !ChestShopSign.isAdminShop(ownerInventory) && InventoryUtil.isEmpty(ownerInventory)) {
            connectedChest.getBlock().setType(Material.AIR);
        } else {
            ownerInventory.addItem(new ItemStack(Material.SIGN, 1));
View Full Code Here

      Block block = event.getBlock();
      Player player = event.getPlayer();
     
      if(block.getType() == Material.SIGN_POST || block.getType() == Material.WALL_SIGN) {
       
        Sign sign = (Sign) block.getState();
          List<String> MSets = config.getStringList("MarkerSets");
          PermissionUser user = PermissionsEx.getUser(player);
     
          for (String M : MSets) {
           
            if(sign.getLine(0).equalsIgnoreCase("[" + M + "]")) {
         if(user.has("nuxflags.remove")){
                   String idpos = "NF_" + event.getBlock().getX() + "-" + event.getBlock().getY() + "-" + event.getBlock().getZ();
                Markerer.removeMarker(player, M, idpos);
         }
         else {
View Full Code Here

          break;
      }
    } else {
      if (b.getType() != Material.SIGN_POST && b.getType() != Material.WALL_SIGN)
        return;
      final Sign s = (Sign) b.getState();
      switch (mode) {
        case DELETE:
          s.setLine(line, "");
          break;
        case SET:
          assert delta != null;
          s.setLine(line, (String) delta[0]);
          break;
      }
      if (hasUpdateBooleanBoolean) {
        try {
          s.update(false, false);
        } catch (final NoSuchMethodError err) {
          hasUpdateBooleanBoolean = false;
          s.update();
        }
      } else {
        s.update();
      }
    }
  }
View Full Code Here

            topHalf.setTypeIdAndData(state.getTypeId(), state.getData().getData(), false);
            door.setTopHalf(false);
            bottomHalf.setTypeIdAndData(state.getTypeId(), state.getData().getData(), false);
        } else if(state instanceof Sign) {
            block.setTypeIdAndData(state.getTypeId(), state.getData().getData(), false);
            Sign sign = (Sign)block.getState();
            int i = 0;
            for(String line : ((Sign)state).getLines())
                sign.setLine(i++, line);
        } else if(state.getData() instanceof PistonExtensionMaterial) {
            PistonExtensionMaterial extension = (PistonExtensionMaterial)state.getData();
            Block piston = block.getRelative(extension.getAttachedFace());
            block.setTypeIdAndData(state.getTypeId(), state.getData().getData(), false);
            if(altState != null) {
View Full Code Here

TOP

Related Classes of org.bukkit.block.Sign

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.