Package org.bukkit.block

Examples of org.bukkit.block.Sign


    checkBlock = block.getRelative(BlockFace.NORTH);
    type = checkBlock.getTypeId();
    if(type == Material.WALL_SIGN.getId()){
      face = checkBlock.getData();
      if(face == 4){
        Sign    sign = (Sign) checkBlock.getState();
        String    text = sign.getLine(0).replaceAll("(?i)\u00A7[0-F]", "").toLowerCase();
       
        if(text.equals("[more users]") || text.equalsIgnoreCase(altMoreUsers)) list.add(checkBlock);
      }
    }
    else if(iterate){
      if(type == block.getTypeId()){
        list.addAll(findBlockUsersBase(checkBlock, false, iterateUp, iterateDown, false, includeYPos));
      }
    }
    else if(traps) if(type == Material.TRAP_DOOR.getId()){
      face = checkBlock.getData();
      if((face & 3) == 2){
        list.addAll(findBlockUsersBase(checkBlock, false, false, false, false, includeYPos));
      }
    }
   
    checkBlock = block.getRelative(BlockFace.EAST);
    type = checkBlock.getTypeId();
    if(type == Material.WALL_SIGN.getId()){
      face = checkBlock.getData();
      if(face == 2){
        Sign    sign = (Sign) checkBlock.getState();
        String    text = sign.getLine(0).replaceAll("(?i)\u00A7[0-F]", "").toLowerCase();

        if(text.equals("[more users]") || text.equalsIgnoreCase(altMoreUsers)) list.add(checkBlock);
      }
    }
    else if(iterate){
      if(type == block.getTypeId()){
        list.addAll(findBlockUsersBase(checkBlock, false, iterateUp, iterateDown, false, includeYPos));
      }
    }
    else if(traps) if(type == Material.TRAP_DOOR.getId()){
      face = checkBlock.getData();
      if((face & 3) == 0){
        list.addAll(findBlockUsersBase(checkBlock, false, false, false, false, includeYPos));
      }
    }
   
    checkBlock = block.getRelative(BlockFace.SOUTH);
    type = checkBlock.getTypeId();
    if(type == Material.WALL_SIGN.getId()){
      face = checkBlock.getData();
      if(face == 5){
        Sign    sign = (Sign) checkBlock.getState();
        String    text = sign.getLine(0).replaceAll("(?i)\u00A7[0-F]", "").toLowerCase();

        if(text.equals("[more users]") || text.equalsIgnoreCase(altMoreUsers)) list.add(checkBlock);
      }
    }
    else if(iterate){
      if(type == block.getTypeId()){
        list.addAll(findBlockUsersBase(checkBlock, false, iterateUp, iterateDown, false, includeYPos));
      }
    }
    else if(traps) if(type == Material.TRAP_DOOR.getId()){
      face = checkBlock.getData();
      if((face & 3) == 3){
        list.addAll(findBlockUsersBase(checkBlock, false, false, false, false, includeYPos));
      }
    }
   
    checkBlock = block.getRelative(BlockFace.WEST);
    type = checkBlock.getTypeId();
    if(type == Material.WALL_SIGN.getId()){
      face = checkBlock.getData();
      if(face == 3){
        Sign    sign = (Sign) checkBlock.getState();
        String    text = sign.getLine(0).replaceAll("(?i)\u00A7[0-F]", "").toLowerCase();

        if(text.equals("[more users]") || text.equalsIgnoreCase(altMoreUsers)) list.add(checkBlock);
      }
    }
    else if(iterate){
View Full Code Here


  //********************************************************************************************************************
  // Start of utility section
 
 
  protected static int getSignOption(Block signBlock, String tag, String altTag, int defaultValue){
    Sign    sign = (Sign) signBlock.getState();
   
   
    // Check main two users.
   
    String    line;
    int      x, y, end, index;
   
    for(y = 2; y <= 3; ++y) if(!sign.getLine(y).isEmpty()){
      line = sign.getLine(y).replaceAll("(?i)\u00A7[0-F]", "");
      //if(line.isEmpty()) continue;
     
      end = line.length() - 1;
     
      if(end >= 2) if((line.charAt(0) == '[') && (line.charAt(end) == ']')){
View Full Code Here

    // Check to see if it is a sign change packet for an existing protected sign.
    // No longer needed in builds around 556+, but I am leaving this here for now.
    // Needed again as of build 1093...  :<
   
    if(typeWallSign){
      Sign    sign = (Sign) block.getState();
      String    text = sign.getLine(0).replaceAll("(?i)\u00A7[0-F]", "");
     
      if(text.equalsIgnoreCase("[Private]") || text.equalsIgnoreCase(Lockette.altPrivate) ||
          text.equalsIgnoreCase("[More Users]") || text.equalsIgnoreCase(Lockette.altMoreUsers)){
        // Okay, sign already exists and someone managed to send an event to replace.
        // Cancel it!  Also, set event text to sign text, just in case.
        // And check for this later in queue.
       
        event.setCancelled(true);
        event.setLine(0, sign.getLine(0));
        event.setLine(1, sign.getLine(1));
        event.setLine(2, sign.getLine(2));
        event.setLine(3, sign.getLine(3));
        Lockette.log.info("[" + plugin.getDescription().getName() + "] " + player.getName() + " just tried to change a non-editable sign. (Bukkit bug, or plugin conflict?)");
        return;
      }
    }
    else if(typeSignPost){
View Full Code Here

            }
        }

        if (event.getAction() == Action.RIGHT_CLICK_BLOCK && event.getClickedBlock().getState() instanceof Sign) {
            try {
                Sign sign = ((Sign) event.getClickedBlock().getState());
                if (OpenInv.hasPermission(player, Permissions.PERM_OPENINV) && sign.getLine(0).equalsIgnoreCase("[openinv]")) {
                    String text = sign.getLine(1).trim() + sign.getLine(2).trim() + sign.getLine(3).trim();
                    player.performCommand("openinv " + text);
                }
            }
            catch (Exception ex) {
                player.sendMessage("Internal Error.");
View Full Code Here

        }
    }

    private void signCheck(String player, Block block) {
        if (block.getState() instanceof Sign) {
            Sign sign = (Sign) block.getState();
            bystanders.add(new SignDestroyed(player, block.getTypeId(), block.getData(), sign, world));
        }
    }
View Full Code Here

        String[] lines = data.split("\u0060");


        Block block = currWorld.getBlockAt(x, y, z);
        if (block.getState() instanceof Sign) {
            Sign sign = (Sign) block.getState();
            for (int i = 0; i < lines.length; i++) {
                sign.setLine(i, lines[i]);
            }
        } else {
            BBLogging.warning("Error when restoring sign");
        }
    }
View Full Code Here

            currWorld.loadChunk(x >> 4, z >> 4);
        }

        Block block = currWorld.getBlockAt(x, y, z);
        if (block.getState() instanceof Sign) {
            Sign sign = (Sign) block.getState();
            for (int i = 0; i < sign.getLines().length; i++) {
                sign.setLine(i, "");
            }
        } else {
            BBLogging.warning("Error when restoring sign");
        }
    }
View Full Code Here

        }
    }

    private void signCheck(String player, Block block) {
        if (block.getState() instanceof Sign) {
            Sign sign = (Sign) block.getState();
            bystanders.add(new SignDestroyed(player, block.getTypeId(), block.getData(), sign, world));
        }
    }
View Full Code Here

        }
    }

    private void signCheck(Block block) {
        if (block.getState() instanceof Sign) {
            Sign sign = (Sign) block.getState();
            bystanders.add(new SignDestroyed(ENVIRONMENT, block.getTypeId(), block.getData(), sign, world));
        }
    }
View Full Code Here

        Block block = currWorld.getBlockAt(x, y, z);
        block.setTypeId(type);
        block.setData(Byte.valueOf(lines[0]));
        if (block.getState() instanceof Sign) {
            Sign sign = (Sign) block.getState();
            for (int i = 1; i < lines.length+1; i++) {
                sign.setLine(i, lines[i]);
            }
        } else {
            BBLogging.warning("Error when restoring sign");
        }
    }
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.