Guest User

Untitled

a guest
Sep 20th, 2018
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. package me.fatal;
  2.  
  3.  
  4.  
  5. import java.io.File;
  6. import java.util.Vector;
  7.  
  8. import org.bukkit.Location;
  9. import org.bukkit.Material;
  10. import org.bukkit.Sound;
  11. import org.bukkit.block.Block;
  12. import org.bukkit.configuration.file.YamlConfiguration;
  13. import org.bukkit.entity.Player;
  14. import org.bukkit.event.EventHandler;
  15. import org.bukkit.event.EventPriority;
  16. import org.bukkit.event.Listener;
  17. import org.bukkit.event.player.PlayerMoveEvent;
  18. import org.bukkit.util.BlockVector;
  19.  
  20.  
  21. public class ListenerClass implements Listener {
  22. public static JumpPad plugin;
  23. public ListenerClass(JumpPad jumpPad) {
  24.  
  25. }
  26.  
  27. @EventHandler
  28. public void onBoost(PlayerMoveEvent event){
  29.  
  30.  
  31. }
  32.  
  33.  
  34. //@SuppressWarnings("unlikely-arg-type")
  35. @EventHandler(priority = EventPriority.HIGH)
  36. public void onTrampoline(PlayerMoveEvent event){
  37. Player p = event.getPlayer();
  38. Location loc;
  39. loc = p.getLocation().subtract(0, 1, 0).getBlock().getLocation();
  40. // p.sendMessage("test");
  41.  
  42. if (loc.getBlock().getType().equals(Material.EMERALD_BLOCK)) {
  43. // p.sendMessage("test");
  44.  
  45.  
  46. if (JumpPad.blockLocs.contains(loc)) {
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53. double x = p.getVelocity().getX();
  54. double y = p.getVelocity().getY();
  55. double z = p.getVelocity().getZ();
  56.  
  57.  
  58.  
  59.  
  60. p.setVelocity(new BlockVector((x * JumpPadManager.f), y*JumpPadManager.f, z*JumpPadManager.f));
  61.  
  62. event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.ENTITY_PLAYER_LEVELUP, 4, 4);
  63.  
  64.  
  65. }
  66.  
  67.  
  68.  
  69.  
  70.  
  71. }
  72.  
  73. }
  74.  
  75.  
  76. }
Add Comment
Please, Sign In to add comment