Examples of Sign


Examples of org.bukkit.block.Sign

    public void onPlayerInteract(PlayerInteractEvent e){
        BlockState bs = e.getClickedBlock().getState();
        Player player = e.getPlayer();

        if (bs instanceof Sign){
            Sign sign = (Sign) bs;
            String[] lines = sign.getLines();
            String function = lines[0].toLowerCase();

            if (function.equals("[balance]")){
                if (Permissions.checkPerms(player, "cex.sign.use.balance")){
                    if (Vault.ecoEnabled()){
View Full Code Here

Examples of org.bukkit.block.Sign

                      } else {
                        worldBlock.setType(Material.getMaterial(diskBlockType));
                        BlockState state = worldBlock.getState();
                        state.setData(new org.bukkit.material.Sign(diskBlockType, diskBlockData));
                        if (state instanceof Sign) {
                          Sign sign = (Sign) state;
                          if (lines != null && sign.getLines() != null) {
                            if (lines.length > 0) {
                              sign.setLine(0, lines[0]);
                            }
                            if (lines.length > 1) {
                              sign.setLine(1, lines[1]);
                            }
                            if (lines.length > 2) {
                              sign.setLine(2, lines[2]);
                            }
                            if (lines.length > 3) {
                              sign.setLine(3, lines[3]);
                            }
                            sign.update(true);
                          }
                        }
                      }
                    } else if (diskBlockType == Material.CHEST.getId()) {
                      // Chests read
View Full Code Here

Examples of org.bukkit.block.Sign

                blocksOutput.write(data);

                if (state instanceof Sign) {
                  // Signs
                  String extra = "";
                  Sign sign = (Sign) state;
                  if (sign.getLines() != null) {
                    for (String line : sign.getLines()) {
                      extra += line + ";;";
                    }
                    signsWriter.write(extra);
                    signsWriter.newLine();
                  }
View Full Code Here

Examples of org.bukkit.block.Sign

                            } else {
                              worldBlock.setType(Material.getMaterial(diskBlockType));
                              BlockState state = worldBlock.getState();
                              state.setData(new org.bukkit.material.Sign(diskBlockType, diskBlockData));
                              if (state instanceof Sign) {
                                Sign sign = (Sign) state;
                                if (lines != null && sign.getLines() != null) {
                                  if (lines.length > 0) {
                                    sign.setLine(0, lines[0]);
                                  }
                                  if (lines.length > 1) {
                                    sign.setLine(1, lines[1]);
                                  }
                                  if (lines.length > 2) {
                                    sign.setLine(2, lines[2]);
                                  }
                                  if (lines.length > 3) {
                                    sign.setLine(3, lines[3]);
                                  }
                                  sign.update(true);
                                }
                              }
                            }
                          }
                        } else if (diskBlockType == Material.CHEST.getId()) {
View Full Code Here

Examples of org.bukkit.block.Sign

        if (event.getClickedBlock().getTypeId() == 42) {
            handleReadyBlock(p);
        }
        // Sign
        else if (event.getClickedBlock().getState() instanceof Sign) {
            Sign sign = (Sign) event.getClickedBlock().getState();
            handleSign(sign, p);
        }
    }
View Full Code Here

Examples of org.bukkit.block.Sign

            return false;
        }
       
        // Grab the top left sign and set up a copy for parsing.
        this.topLeftSign = (Sign) state;
        Sign current = this.topLeftSign;
       
        // Calculate matrix dimensions.
        this.direction = getRightDirection(current);
        this.rows = getSignCount(current, BlockFace.DOWN);
        this.cols = getSignCount(current, direction);
       
        // Require at least 2x2 to be valid
        if (rows <= 1 || cols <= 1) {
            return false;
        }
       
        // Get the left-most sign in the current row.
        Sign first = getAdjacentSign(current, BlockFace.DOWN);
       
        for (int i = 1; i < rows; i++)
        {
            // Back to the first sign of the row.
            current = first;
View Full Code Here

Examples of org.bukkit.block.Sign

     * Requires: The grid MUST be valid!
     */
    private void initializeBoards()
    {
        boards.clear();
        Sign header = this.topLeftSign;
        Sign current;
       
        do
        {
            // Strip the sign of any colors.
            String name = ChatColor.stripColor(header.getLine(2));
View Full Code Here

Examples of org.bukkit.block.Sign

        // Make sure the stats will fit on the signs.
        int range = Math.min(stats.size(), signs.size()*4);
       
        for (int i = 0; i < range; i++) {
            // Grab the right sign.
            Sign s = signs.get(i/4);
           
            // Call the template method.
            String value = getLine(stats.get(i));
           
            // And set the line
            s.setLine(i % 4, value);
            s.update();
        }
    }
View Full Code Here

Examples of org.bukkit.block.Sign

        //Iterator<String> iterator = am.getClasses().iterator();
        Iterator<String> iterator = am.getClasses().keySet().iterator();
        for (int i = lx1+2; i <= lx2-2; i++) // Signs
        {
            world.getBlockAt(i,ly1+1,lz2-1).setTypeIdAndData(63, (byte)0x8, false);
            Sign sign = (Sign) world.getBlockAt(i,ly1+1,lz2-1).getState();
            sign.setLine(0, TextUtils.camelCase((String)iterator.next()));
            sign.update();
        }
        world.getBlockAt(lx2-2,ly1+1,lz1+2).setType(Material.IRON_BLOCK);
       
        // Set up the monster points.
        ArenaRegion region = arena.getRegion();
View Full Code Here

Examples of org.bukkit.block.Sign

   
    public RepairableSign(BlockState state)
    {
        super(state);
       
        Sign s = (Sign) state;
        lines  = s.getLines();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.