Commit 530160f9 authored by Milan's avatar Milan
Browse files

use honey and bees from mobs_animal

parent a01fe4d5
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -28,11 +28,4 @@ minetest.register_tool("xdecor:hammer", {
	on_use = function() do return end end
})

minetest.register_craftitem("xdecor:honey", {
	description = "Honey",
	inventory_image = "xdecor_honey.png",
	wield_image = "xdecor_honey.png",
	groups = {not_in_creative_inventory=1},
	on_use = minetest.item_eat(2)
})
minetest.register_alias("xdecor:honey", "mobs:honey")
+8 −2
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ function hive.timer(pos)
	local flowers = minetest.find_nodes_in_area_under_air(minp, maxp, "group:flower")

	if #flowers > 2 and honey < honey_max then
		inv:add_item("honey", "xdecor:honey")
		inv:add_item("honey", "mobs:honey")
	elseif honey == honey_max then
		local timer = minetest.get_node_timer(pos)
		timer:stop() return true
@@ -56,7 +56,13 @@ xdecor.register("hive", {
		return inv:is_empty("honey")
	end,
	on_punch = function(_, _, puncher)
		puncher:set_hp(puncher:get_hp() - 2)
        if math.random(1, 4) == 1 then
            minetest.add_entity(pos, "mobs_animal:bee_angry")
        end
        if math.random(1, 4) == 2 then
            minetest.add_entity(pos, "mobs_animal:bee_angry")
            minetest.add_entity(pos, "mobs_animal:bee_angry")
        end
	end,
	allow_metadata_inventory_put = function() return 0 end,
	on_metadata_inventory_take = function(pos, _, _, stack)