Advertisement
Diamondista

Untitled

Jun 29th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. public void onPlayerMove(final PlayerMoveEvent event) {
  2. final Player player = event.getPlayer();
  3. final Location playerLoc = player.getLocation();
  4. final int ID = playerLoc.getWorld().getBlockAt(playerLoc).getRelative(0, -1, 0).getTypeId();
  5. final int plate = playerLoc.getWorld().getBlockAt(playerLoc).getTypeId();
  6. if (player instanceof Player && player.hasPermission("launcher.launch") && ID == this.getConfig().getInt("bottom-block-id") && plate == 70) {
  7. player.setVelocity(player.getLocation().getDirection().multiply(3));
  8. player.setVelocity(new Vector(player.getVelocity().getX(), 1.0, player.getVelocity().getZ()));
  9. player.playSound(player.getLocation(), Sound.valueOf(this.getConfig().getString("sound").toUpperCase()), 1.0f, 1.0f);
  10. Player[] onlinePlayers;
  11. for (int length = (onlinePlayers = Bukkit.getOnlinePlayers()).length, i = 0; i < length; ++i) {
  12. final Player all = onlinePlayers[i];
  13. all.playEffect(player.getLocation(), Effect.valueOf(this.getConfig().getString("effect").toUpperCase()), 4);
  14. }
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement