Merge pull request #18 from bell07/master

Use API for on_punch on all nodes
This commit is contained in:
Gerold55 2017-12-04 01:51:42 -05:00 committed by GitHub
commit 15ef7d58b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -343,8 +343,8 @@ minetest.register_node("laptop:monitor3_off", {
drop = "laptop:monitor3_off",
groups = {choppy=2, oddly_breakably_by_hand=2},
on_punch = function (pos, node, puncher)
node.name = "laptop:monitor3_on"
minetest.set_node(pos, node)
local os = laptop.os_get(pos)
os:power_on( "laptop:monitor3_on")
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
@ -385,8 +385,8 @@ minetest.register_node("laptop:laptop_closed", {
drop = "laptop:laptop_closed",
groups = {choppy=2, oddly_breakably_by_hand=2},
on_punch = function (pos, node, puncher)
node.name = "laptop:laptop_open"
minetest.set_node(pos, node)
local os = laptop.os_get(pos)
os:power_off("laptop:laptop_open")
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)
@ -416,8 +416,8 @@ minetest.register_node("laptop:laptop_open", {
drop = "laptop:laptop_closed",
groups = {choppy=2, oddly_breakably_by_hand=2, not_in_creative_inventory=1},
on_punch = function (pos, node, puncher)
node.name = "laptop:laptop_open_on"
minetest.set_node(pos, node)
local os = laptop.os_get(pos)
os:resume("laptop:laptop_open_on")
end,
on_construct = function(pos)
local meta = minetest.env:get_meta(pos)