forked from VoxeLibre/VoxeLibre
Compare commits
3 Commits
master
...
beehive_dr
Author | SHA1 | Date |
---|---|---|
PrairieWind | c50b72a526 | |
PrairieWind | f4d0c985af | |
PrairieWind | d97a09181f |
|
@ -226,7 +226,7 @@ if mcl_weather.allow_abm then
|
||||||
}
|
}
|
||||||
for a=1, #around do
|
for a=1, #around do
|
||||||
local apos = vector.add(pos, around[a])
|
local apos = vector.add(pos, around[a])
|
||||||
if mcl_weather.is_outdoor(apos) and mcl_weather.has_rain(apos) then
|
if mcl_weather.is_outdoor(apos) then
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}, true)
|
minetest.sound_play("fire_extinguish_flame", {pos = pos, max_hear_distance = 8, gain = 0.1}, true)
|
||||||
return
|
return
|
||||||
|
@ -244,7 +244,7 @@ if mcl_weather.allow_abm then
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
-- Rain is equivalent to a water bottle
|
-- Rain is equivalent to a water bottle
|
||||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) and mcl_weather.has_rain(pos) then
|
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
||||||
if node.name == "mcl_cauldrons:cauldron" then
|
if node.name == "mcl_cauldrons:cauldron" then
|
||||||
minetest.set_node(pos, {name="mcl_cauldrons:cauldron_1"})
|
minetest.set_node(pos, {name="mcl_cauldrons:cauldron_1"})
|
||||||
elseif node.name == "mcl_cauldrons:cauldron_1" then
|
elseif node.name == "mcl_cauldrons:cauldron_1" then
|
||||||
|
@ -267,7 +267,7 @@ if mcl_weather.allow_abm then
|
||||||
interval = 22.0,
|
interval = 22.0,
|
||||||
chance = 3,
|
chance = 3,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) and mcl_weather.has_rain(pos) then
|
if mcl_weather.rain.raining and mcl_weather.is_outdoor(pos) then
|
||||||
if node.name == "mcl_farming:soil" then
|
if node.name == "mcl_farming:soil" then
|
||||||
minetest.set_node(pos, {name="mcl_farming:soil_wet"})
|
minetest.set_node(pos, {name="mcl_farming:soil_wet"})
|
||||||
end
|
end
|
||||||
|
|
|
@ -48,17 +48,26 @@ local dig_hive = function(pos, node, oldmetadata, digger)
|
||||||
local beenest = string.find(node.name, "mcl_beehives:bee_nest")
|
local beenest = string.find(node.name, "mcl_beehives:bee_nest")
|
||||||
local silk_touch = mcl_enchanting.has_enchantment(wield_item, "silk_touch")
|
local silk_touch = mcl_enchanting.has_enchantment(wield_item, "silk_touch")
|
||||||
local is_creative = minetest.is_creative_enabled(digger:get_player_name())
|
local is_creative = minetest.is_creative_enabled(digger:get_player_name())
|
||||||
|
local inv = digger:get_inventory()
|
||||||
|
|
||||||
if beehive then
|
if beehive then
|
||||||
|
if not is_creative then
|
||||||
minetest.add_item(pos, "mcl_beehives:beehive")
|
minetest.add_item(pos, "mcl_beehives:beehive")
|
||||||
if not silk_touch and not is_creative then mcl_util.deal_damage(digger, 10) end
|
if not silk_touch then mcl_util.deal_damage(digger, 10) end
|
||||||
|
elseif is_creative and inv:room_for_item("main", "mcl_beehives:beehive") and not inv:contains_item("main", "mcl_beehives:beehive") then
|
||||||
|
inv:add_item("main", "mcl_beehives:beehive")
|
||||||
|
end
|
||||||
elseif beenest then
|
elseif beenest then
|
||||||
if silk_touch or is_creative then
|
if not is_creative then
|
||||||
|
if silk_touch then
|
||||||
minetest.add_item(pos, "mcl_beehives:bee_nest")
|
minetest.add_item(pos, "mcl_beehives:bee_nest")
|
||||||
awards.unlock(digger:get_player_name(), "mcl:total_beelocation")
|
awards.unlock(digger:get_player_name(), "mcl:total_beelocation")
|
||||||
else
|
else
|
||||||
mcl_util.deal_damage(digger, 10)
|
mcl_util.deal_damage(digger, 10)
|
||||||
end
|
end
|
||||||
|
elseif is_creative and inv:room_for_item("main", "mcl_beehives:bee_nest") and not inv:contains_item("main", "mcl_beehives:bee_nest") then
|
||||||
|
inv:add_item("main", "mcl_beehives:bee_nest")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue