Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void createBlackHole(Location loc) {
- Block b = loc.getBlock();
- b.setType(Material.CAKE_BLOCK);
- final Location holeLoc = loc;
- final int pullRadius = plugin.getConfig().getInt("Pull Radius");
- Bukkit.getScheduler().runTaskTimer(plugin, new Runnable() {
- public void run() {
- ArrayList<Player> players = new ArrayList<Player>();
- for (Player pl : holeLoc.getWorld().getPlayers()) {
- if (pl.getLocation().distance(holeLoc) <= pullRadius) {
- Vector vector = holeLoc.toVector().subtract(p.getLocation().toVector());
- p.setVelocity(vector.multiply(0.5));
- }
- }
- }
- }, 0, 1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement