Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
- Player p = (Player) sender;
- if(cmd.getName().equalsIgnoreCase("note")) {
- if(args.length == 0) {
- sender.sendMessage(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_RED + "Team" + ChatColor.GOLD + "Elite" + ChatColor.DARK_GRAY + "]" + ChatColor.RED + " Not enough arguments! Correct usage for this command is /note <note>");
- } else {
- StringBuilder sb = new StringBuilder();
- for(int i=0; i<args.length; i++) {
- sb.append(args[i]).append(" ");
- }
- //String note = sb.toString();
- Location location = p.getLocation();
- signUpdate(location);
- }
- }
- return true;
- }
- @SuppressWarnings("deprecation")
- public void signUpdate(Location loc) {
- World world = loc.getWorld();
- Block block = world.getBlockAt(loc);
- if(block.getTypeId() == Material.SIGN_POST.getId() || block.getTypeId() == Material.WALL_SIGN.getId()) {
- Sign s = (Sign) block.getState();
- s.setLine(0, ChatColor.RED + "" + ChatColor.BOLD + "[NOTE]");
- s.update(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement