minetest.register_tool(':mobs:pick_lava', {
   description = ('Lava Pickaxe'),
   inventory_image = 'mobs_pick_lava.png',
   tool_capabilities = {
      full_punch_interval = 0.4,
      max_drop_level=4,
      groupcaps={
         cracky = {times={[1]=1.80, [2]=0.80, [3]=0.40}, uses=40, maxlevel=4},
      },
      damage_groups = {fleshy = 6, fire = 1},
   },
   groups = {pickaxe = 1}
})

minetest.clear_craft({ --TNT recipe
   recipe = {
      {'default:coal_lump', 'default:gravel', ''},
   }
})

minetest.clear_craft({output = 'default:sign_wall_steel'})
minetest.clear_craft({output = 'mobs:horseshoe_steel'})
minetest.clear_craft({output = 'mobs:horseshoe_bronze'})
minetest.clear_craft({output = 'mobs:horseshoe_mese'})
minetest.clear_craft({output = 'mobs:horseshoe_diamond'})

local on_burn = {
   {'acacia_tree', 'tree_ash'},
   {'aspen_tree', 'tree_ash'},
   {'jungletree', 'tree_ash'},
   {'tree', 'tree_ash'},
   {'pine_tree', 'tree_ash'},
   {'acacia_wood', 'wood_ash'},
   {'aspen_wood', 'wood_ash'},
   {'junglewood', 'wood_ash'},
   {'pine_wood', 'wood_ash'},
   {'wood', 'wood_ash'},
   {'dirt_with_grass', 'scorched_dirt'},
   {'dirt_with_coniferous_litter', 'scorched_dirt'},
   {'dirt_with_dry_grass', 'scorched_dirt'},
   {'dirt_with_rainforest_litter', 'scorched_dirt'},
   {'dry_dirt_with_dry_grass', 'scorched_dirt'}
}

for i in ipairs(on_burn) do
   local input = on_burn[i][1]
   local output = on_burn[i][2]

   minetest.override_item('default:'..input, {
      on_burn = function(pos)
         local node = minetest.get_node(pos)
         minetest.swap_node(pos, {name = 'epic:'..output, param2=node.param2})
      end,
   })
end

minetest.override_item('default:dirt_with_coniferous_litter', {
   groups = {crumbly=3, soil=1, not_in_creative_inventory=1, flammable=1, spreading_dirt_type=1, relic_general=-10},
})

minetest.override_item('default:dirt_with_dry_grass', {
   groups = {crumbly=3, soil=1, flammable=1, spreading_dirt_type=1, relic_general=-10},
})

minetest.override_item('default:dirt_with_rainforest_litter', {
   groups = {crumbly=3, soil=1, not_in_creative_inventory=1, flammable=1, spreading_dirt_type=1, relic_general=-10},
})

minetest.override_item('default:dry_dirt_with_dry_grass', {
   groups = {crumbly=3, soil=1, flammable=1, spreading_dirt_type=1, relic_general=-10},
})

minetest.override_item('carts:cart', {
   inventory_image = 'epic_cart.png'
})

minetest.override_item('default:marram_grass_1', {
   groups = {snappy = 3, flammable = 3, attached_node = 1, flora = 1},
})

local crop_groups = function(node, group_name)
   local ndef = minetest.registered_nodes[node]
   local groups = ndef.groups
   groups[group_name] = 1
   minetest.override_item(node,{
      groups = groups,
   })
end

crop_groups('farming:wheat_8', 'grain')
crop_groups('farming:wheat_7', 'grain')
crop_groups('farming:wheat_6', 'grain')
crop_groups('farming:oat_8', 'grain')
crop_groups('farming:oat_7', 'grain')
crop_groups('farming:oat_6', 'grain')
crop_groups('farming:rice_8', 'grain')
crop_groups('farming:rice_7', 'grain')
crop_groups('farming:rice_6', 'grain')
crop_groups('farming:rye_8', 'grain')
crop_groups('farming:rye_7', 'grain')
crop_groups('farming:rye_6', 'grain')
crop_groups('farming:barley_7', 'grain')
crop_groups('farming:barley_6', 'grain')
crop_groups('farming:barley_5', 'grain')
crop_groups('farming:beetroot_5', 'veggie')
crop_groups('farming:beetroot_4', 'veggie')
crop_groups('farming:beetroot_3', 'veggie')
crop_groups('farming:beetroot_3', 'veggie')
crop_groups('farming:carrot_8', 'veggie')
crop_groups('farming:carrot_7', 'veggie')
crop_groups('farming:carrot_6', 'veggie')
crop_groups('farming:cucumber_4', 'veggie')
crop_groups('farming:cucumber_3', 'veggie')
crop_groups('farming:pepper_5', 'veggie')
crop_groups('farming:pepper_4', 'veggie')
crop_groups('farming:potato_4', 'veggie')
crop_groups('farming:potato_3', 'veggie')
crop_groups('farming:tomato_8', 'veggie')
crop_groups('farming:tomato_7', 'veggie')
crop_groups('farming:tomato_6', 'veggie')
crop_groups('farming:blueberry_4', 'fruit')
crop_groups('farming:blueberry_3', 'fruit')
crop_groups('farming:raspberry_4', 'fruit')
crop_groups('farming:raspberry_3', 'fruit')
crop_groups('farming:blueberry_4', 'fruit')
crop_groups('farming:pineapple_8', 'fruit')
crop_groups('farming:pineapple_7', 'fruit')
crop_groups('farming:pineapple_6', 'fruit')
crop_groups('farming:rhubarb_3', 'fruit')
crop_groups('farming:rhubarb_2', 'fruit')

function default.grow_papyrus(pos, node)
   pos.y = pos.y - 1
   local name = minetest.get_node(pos).name
   if name ~= 'default:dirt_with_grass' and name ~= 'default:dirt' and name ~= 'trail:dirt_with_grass' and name ~= 'trail:dirt' then
      return
   end
   if not minetest.find_node_near(pos, 3, {'group:water'}) then
      return
   end
   pos.y = pos.y + 1
   local height = 0
   while node.name == 'default:papyrus' and height < 4 do
      height = height + 1
      pos.y = pos.y + 1
      node = minetest.get_node(pos)
   end
   if height == 4 or node.name ~= 'air' then
      return
   end
   if minetest.get_node_light(pos) < 13 then
      return
   end
   minetest.set_node(pos, {name = 'default:papyrus'})
   return true
end

bonemeal:set_deco({
   {'farming:soil_wet', {'', '', ''}, {'farming:blueberry_1', 'farming:raspberry_1', '', ''}}
})

bonemeal:set_deco({
   {'default:dirt_with_rainforest_litter', {'', '', ''}, {'default:junglegrass', '', '',}}
})

bonemeal:set_deco({
   { 'farming:soil', {''}, {''} }
})

minetest.override_item('default:water_source', {
   drowning = 10,
})
