Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPlayerInteract(PlayerInteractEvent e){
- if(e.getAction() == Action.RIGHT_CLICK_BLOCK && ( e.getMaterial() == Material.LAVA_BUCKET || e.getMaterial() == Material.WATER_BUCKET)){
- Block b = e.getClickedBlock().getRelative(e.getBlockFace());
- for (BlockFace face : faces) {
- if ((e.getMaterial() == Material.WATER_BUCKET && (b.getRelative(face).getType() == Material.STATIONARY_LAVA || b.getRelative(face).getType() == Material.LAVA))
- || (e.getMaterial() == Material.LAVA_BUCKET
- && (b.getRelative(face).getType() == Material.STATIONARY_WATER || b.getRelative(face).getType() == Material.WATER))) {
- b.getRelative(face).setType(Material.AIR);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement