Advertisement
Guest User

Untitled

a guest
Mar 16th, 2011
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. package com.bukkit.techguard.ishop;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import org.bukkit.Location;
  6. import org.bukkit.World;
  7. import org.bukkit.block.Sign;
  8. /**
  9. * @author 'TechGuard
  10. */
  11. public class SignUpdate {
  12. private String world;
  13. private Location location;
  14. private String[] lines;
  15.  
  16. public SignUpdate(World w, Location l, String[] li){
  17. this.world = w.getName();
  18. this.location = l;
  19. this.lines = li;
  20. }
  21.  
  22. public static void update(final iShop plugin, final ArrayList<SignUpdate> listToUpdate){
  23. if(listToUpdate.size() < 1)return;
  24. plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
  25. @Override
  26. public void run() {
  27. for(SignUpdate su : listToUpdate){
  28. Sign sign = (Sign)plugin.getServer().getWorld(su.world).getBlockAt(su.location).getState();
  29. sign.setLine(0, su.lines[0]);
  30. sign.setLine(1, su.lines[1]);
  31. sign.setLine(2, su.lines[2]);
  32. sign.setLine(3, su.lines[3]);
  33. sign.update();
  34. }
  35. }
  36. });
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement