Advertisement
Guest User

Updated AntiLava

a guest
Aug 5th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1.     @EventHandler
  2.     public void onPlayerInteract(PlayerInteractEvent e){
  3.         if(e.getAction() == Action.RIGHT_CLICK_BLOCK && ( e.getMaterial() == Material.LAVA_BUCKET || e.getMaterial() == Material.WATER_BUCKET)){
  4.             Block b = e.getClickedBlock().getRelative(e.getBlockFace());
  5.             for (BlockFace face : faces) {
  6.                 if ((e.getMaterial() == Material.WATER_BUCKET && (b.getRelative(face).getType() == Material.STATIONARY_LAVA || b.getRelative(face).getType() == Material.LAVA))
  7.                         || (e.getMaterial() == Material.LAVA_BUCKET
  8.                                 && (b.getRelative(face).getType() == Material.STATIONARY_WATER || b.getRelative(face).getType() == Material.WATER))) {
  9.                     b.getRelative(face).setType(Material.AIR);
  10.                 }
  11.             }
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement