mrkirby153

Untitled

Mar 15th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. package me.mrkirby153.plugins.simplegames.signs;
  2.  
  3. import me.mrkirby153.plugins.simplegames.game.Game;
  4. import org.bukkit.ChatColor;
  5. import org.bukkit.Location;
  6. import org.bukkit.block.Block;
  7. import org.bukkit.block.Sign;
  8.  
  9. import java.util.ArrayList;
  10.  
  11. public class SignWall {
  12.  
  13.     private Location pt1;
  14.     private Location pt2;
  15.     private Game game;
  16.     private ArrayList<Location> signs;
  17.     private int count;
  18.  
  19.     public SignWall(Location pt1, Location pt2, Game game, ArrayList<Location> signs) {
  20.         this.pt1 = pt1;
  21.         this.pt2 = pt2;
  22.         this.game = game;
  23.         this.signs = signs;
  24.     }
  25.  
  26.     public void update() {
  27.         if (count > 3) count = 0;
  28.         for (Location l : signs) {
  29.             Block b = l.getBlock();
  30.             if (!b.getType().toString().contains("SIGN")) {
  31.                 System.out.println("returned");
  32.                 return;
  33.             }
  34.             System.out.println("passed");
  35.             Sign sign = (Sign) b.getState();
  36.             sign.setLine(0, ChatColor.DARK_RED + "################");
  37.             sign.setLine(1, ChatColor.RED + "Offline" + count);
  38.             sign.setLine(3, ChatColor.DARK_RED + "################");
  39.         }
  40.         count++;
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment