Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. package com.dbzjp.wewf;
  2.  
  3. import org.bukkit.Material;
  4. import org.bukkit.entity.Player;
  5. import org.bukkit.event.EventHandler;
  6. import org.bukkit.event.Listener;
  7. import org.bukkit.event.block.Action;
  8. import org.bukkit.event.player.PlayerInteractEvent;
  9. import org.bukkit.inventory.ItemStack;
  10.  
  11. public class Interact implements Listener {
  12.  
  13. @EventHandler
  14. public void onInteract(PlayerInteractEvent e) {
  15. Action a = e.getAction();
  16. Player p = e.getPlayer();
  17. ItemStack i = e.getItem();
  18. if(p.hasPermission("server.architecte.all") && !p.isOp()) {
  19. if(Main.plot.getPlot(p) == null) {
  20. if(a == Action.RIGHT_CLICK_BLOCK && i.getType() == Material.WOOD_AXE) {
  21. e.setCancelled(true);
  22. p.sendMessage("§4WorldEdit §8§l>> §eVous devez être sur un plot pour utiliser WorldEdit !");
  23. }
  24. else if(a == Action.LEFT_CLICK_BLOCK && i.getType() == Material.WOOD_AXE) {
  25. e.setCancelled(true);
  26. p.sendMessage("§4WorldEdit §8§l>> §eVous devez être sur un plot pour utiliser WorldEdit !");
  27. }
  28. }
  29. else if(Main.plot.getPlot(p).getTrusted().contains(p.getUniqueId()) || Main.plot.getPlot(p).getOwners().contains(p.getUniqueId())) {
  30. e.setCancelled(false);
  31. }
  32. else {
  33. if(a == Action.RIGHT_CLICK_BLOCK && i.getType() == Material.WOOD_AXE) {
  34. e.setCancelled(true);
  35. p.sendMessage("§4WorldEdit §8§l>> §eVous devez être trust ou propriétaire du plot pour utiliser WorldEdit !");
  36. }
  37. else if(a == Action.LEFT_CLICK_BLOCK && i.getType() == Material.WOOD_AXE) {
  38. e.setCancelled(true);
  39. p.sendMessage("§4WorldEdit §8§l>> §eVous devez être trust ou propriétaire du plot pour utiliser WorldEdit !");
  40. }
  41.  
  42. }
  43. }
  44. else {
  45.  
  46. }
  47.  
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement