Advertisement
Guest User

Untitled

a guest
Apr 5th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. package com.finest.sponge;
  2.  
  3. import org.bukkit.Material;
  4. import org.bukkit.block.Block;
  5. import org.bukkit.event.EventHandler;
  6. import org.bukkit.event.Listener;
  7. import org.bukkit.event.block.Action;
  8. import org.bukkit.event.block.BlockBreakEvent;
  9. import org.bukkit.event.player.PlayerInteractEvent;
  10.  
  11. public class Sponge
  12. implements Listener
  13. {
  14. @EventHandler
  15. public void BlockBreak(BlockBreakEvent e)
  16. {
  17. if (e.isCancelled())
  18. {
  19. e.setCancelled(true);
  20. }
  21. }
  22. @EventHandler
  23. public void PLayerInteract(PlayerInteractEvent e)
  24. {
  25. Block b = e.getClickedBlock();
  26.  
  27. if (e.getAction() == Action.LEFT_CLICK_BLOCK)
  28. {
  29. if (b.getType() == Material.SPONGE)
  30. {
  31. b.breakNaturally();
  32. }
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement