Pipeworks compatiblity: Wind Mill
This commit is contained in:
parent
29f6bd2852
commit
d337e2a0f5
@ -80,6 +80,7 @@ override={
|
||||
local inv=meta:get_inventory()
|
||||
return inv:room_for_item(listname,stack)
|
||||
end,
|
||||
input_inventory="charged",
|
||||
connect_sides={
|
||||
left=1,
|
||||
right=1,
|
||||
@ -158,3 +159,45 @@ minetest.override_item("industrialtest:geothermal_generator_active",override)
|
||||
|
||||
-- Water Mill
|
||||
minetest.override_item("industrialtest:water_mill",override)
|
||||
|
||||
-- Wind Mill
|
||||
def=table.copy(minetest.registered_nodes["industrialtest:wind_mill"])
|
||||
|
||||
def.groups.tubedevice=1
|
||||
def.groups.tubedevice_receiver=1
|
||||
|
||||
override={
|
||||
groups=def.groups,
|
||||
tube={
|
||||
insert_object=function(pos,node,stack,direction)
|
||||
if not industrialtest.api.hasPowerStorage(stack:get_meta()) then
|
||||
return nil
|
||||
end
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv=meta:get_inventory()
|
||||
local result=inv:add_item("charged",stack)
|
||||
return result
|
||||
end,
|
||||
can_insert=function(pos,node,stack,direction)
|
||||
if not industrialtest.api.hasPowerStorage(stack:get_meta()) then
|
||||
return false
|
||||
end
|
||||
local meta=minetest.get_meta(pos)
|
||||
local inv=meta:get_inventory()
|
||||
return inv:room_for_item("charged",stack)
|
||||
end,
|
||||
input_inventory="charged",
|
||||
connect_sides={
|
||||
left=1,
|
||||
right=1,
|
||||
back=1,
|
||||
bottom=1,
|
||||
top=1
|
||||
}
|
||||
},
|
||||
after_place_node=pipeworks.after_place,
|
||||
after_dig_node=pipeworks.after_dig,
|
||||
on_rotate=pipeworks.on_rotate
|
||||
}
|
||||
|
||||
minetest.override_item("industrialtest:wind_mill",override)
|
||||
|
Loading…
Reference in New Issue
Block a user