TheRecovery

Untitled

Feb 26th, 2014
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. @EventHandler
  2. public void Join(PlayerJoinEvent e) {
  3. Player p = e.getPlayer();
  4. p.removePotionEffect(PotionEffectType.INVISIBILITY);
  5. if (settings.getConfig().getBoolean("Items.Speed.Enabled")) {
  6. p.getInventory().setItem(settings.getConfig().getInt("Items.Speed.Location"), speeduit());
  7. p.setWalkSpeed(0.3F);
  8. if (!(p.hasPlayedBefore())) {
  9. p.getInventory().setBoots(boots());
  10. }
  11. }
  12. }
  13. }
  14. @EventHandler
  15. public void onRightClick(PlayerInteractEvent e) {
  16. Player p = e.getPlayer();
  17. if (((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)))
  18. else if ((settings.getConfig().getBoolean("Items.Speed")) && (p.getItemInHand().getType() == Material.DIAMOND_BOOTS)) {
  19. p.getInventory().setItem(settings.getConfig().getInt("Inv.Speed.Loc"), speeduit());
  20. p.setWalkSpeed(0.3F);
  21. }
  22. else if ((settings.getConfig().getBoolean("Items.Speed")) && (p.getItemInHand().getType() == Material.IRON_BOOTS)) {
  23. p.getInventory().setItem(settings.getConfig().getInt("Inv.Speed.Loc"), speed());
  24. p.setWalkSpeed(0.6F);
  25. }
  26. }
  27. public ItemStack speed() { ItemStack is = new ItemStack(Material.DIAMOND_BOOTS);
  28. is.addEnchantment(Enchantment.DURABILITY, 1);
  29. ItemMeta im = is.getItemMeta();
  30. im.setDisplayName(ChatColor.AQUA + "" + ChatColor.BOLD + "Runner");
  31. im.setLore(Arrays.asList(new String[] { ChatColor.translateAlternateColorCodes('&', settings.getConfig().getString("Items.Speed.Lore")) }));
  32. is.setItemMeta(im);
  33.  
  34. return is;
  35. }
  36. public ItemStack speeduit() { ItemStack is = new ItemStack(Material.IRON_BOOTS);
  37. ItemMeta im = is.getItemMeta();
  38. im.setDisplayName(ChatColor.GRAY + "" + ChatColor.BOLD + "Walker");
  39. im.setLore(Arrays.asList(new String[] { ChatColor.translateAlternateColorCodes('&', settings.getConfig().getString("Items.Speed.Lore")) }));
  40. is.setItemMeta(im);
  41.  
  42. return is;
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment