Advertisement
mrmag518

NoLavaBlockListener

Oct 5th, 2011
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. package me.mrmag518.plugins.nolava;
  2.  
  3. //author mrmag518
  4.  
  5. import org.bukkit.Material;
  6. import org.bukkit.Server;
  7. import org.bukkit.block.Block;
  8. import org.bukkit.entity.Player;
  9. import org.bukkit.event.block.BlockListener;
  10. import org.bukkit.event.block.BlockPlaceEvent;
  11.  
  12. public class NoLavaBlockListener extends BlockListener {
  13. @Override
  14. public void onBlockPlace(BlockPlaceEvent event) {
  15. Player player = event.getPlayer();
  16. Block block = event.getBlock();
  17. Server server = player.getServer();
  18.  
  19. if (!player.hasPermission("NoLava.useLava")){
  20. return;
  21. }
  22.  
  23. if ( event.getItemInHand().getType() == Material.LAVA ||
  24. event.getItemInHand().getType() == Material.STATIONARY_LAVA ||
  25. event.getItemInHand().getType() == Material.LAVA_BUCKET) {
  26. event.setCancelled(true);
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement