Advertisement
riking

Untitled

Jul 28th, 2013
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public static void createBlackHole(Location loc) {
  2. Block b = loc.getBlock();
  3. b.setType(Material.CAKE_BLOCK);
  4.  
  5. final Location holeLoc = loc;
  6. final int pullRadius = plugin.getConfig().getInt("Pull Radius");
  7.  
  8. Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
  9. public void run() {
  10. ArrayList<Player> players = new ArrayList<Player>();
  11. for (Player pl : holeLoc.getWorld().getPlayers()) {
  12. if (pl.getLocation().distance(holeLoc) <= pullRadius) {
  13. Vector vector = holeLoc.toVector().subtract(p.getLocation().toVector());
  14. p.setVelocity(vector.multiply(0.5));
  15. }
  16. }
  17. }
  18. }, 0, 1);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement