mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-05 10:00:26 +01:00
[mesecons/hydroturbine] Make turbines sensitive to river water
- Solves #295
This commit is contained in:
parent
04d28d7a6b
commit
f34d5a6d2c
|
@ -59,7 +59,7 @@ nodenames = {"mesecons_hydroturbine:hydro_turbine_off"},
|
||||||
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)
|
||||||
local waterpos={x=pos.x, y=pos.y+1, z=pos.z}
|
local waterpos={x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
if minetest.get_node(waterpos).name=="default:water_flowing" then
|
if minetest.get_node(waterpos).name=="default:water_flowing" or minetest.get_node(waterpos).name == "default:river_water_flowing" then
|
||||||
minetest.add_node(pos, {name="mesecons_hydroturbine:hydro_turbine_on"})
|
minetest.add_node(pos, {name="mesecons_hydroturbine:hydro_turbine_on"})
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
mesecon.receptor_on(pos)
|
mesecon.receptor_on(pos)
|
||||||
|
@ -73,7 +73,7 @@ nodenames = {"mesecons_hydroturbine:hydro_turbine_on"},
|
||||||
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)
|
||||||
local waterpos={x=pos.x, y=pos.y+1, z=pos.z}
|
local waterpos={x=pos.x, y=pos.y+1, z=pos.z}
|
||||||
if minetest.get_node(waterpos).name~="default:water_flowing" then
|
if minetest.get_node(waterpos).name~="default:water_flowing" or minetest.get_node(waterpos).name ~= "default:river_water_flowing" then
|
||||||
minetest.add_node(pos, {name="mesecons_hydroturbine:hydro_turbine_off"})
|
minetest.add_node(pos, {name="mesecons_hydroturbine:hydro_turbine_off"})
|
||||||
nodeupdate(pos)
|
nodeupdate(pos)
|
||||||
mesecon.receptor_off(pos)
|
mesecon.receptor_off(pos)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user