aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBuckarooBanzay <BuckarooBanzay@users.noreply.github.com>2021-05-14 14:04:14 +0200
committerBuckarooBanzay <BuckarooBanzay@users.noreply.github.com>2021-05-14 14:04:14 +0200
commitb72d16a63ade357b34f020fe2e2eca3fdddb29f3 (patch)
tree6c116b49579bc09e5a8e1f2d5212fe0a9a1149cf
parent8cd02607bb1f76032970e9d7cf0dadbd17b3cf76 (diff)
downloadmesecons_debug-b72d16a63ade357b34f020fe2e2eca3fdddb29f3.tar.gz
mesecons_debug-b72d16a63ade357b34f020fe2e2eca3fdddb29f3.zip
indent stuff
-rw-r--r--penalty_controller.lua105
1 files changed, 52 insertions, 53 deletions
diff --git a/penalty_controller.lua b/penalty_controller.lua
index 37d83a8..33093ca 100644
--- a/penalty_controller.lua
+++ b/penalty_controller.lua
@@ -1,63 +1,62 @@
minetest.register_node("mesecons_debug:penalty_controller", {
- description = "Mesecons penalty controller",
- groups = {
+ description = "Mesecons penalty controller",
+ groups = {
cracky=3
},
- on_construct = function(pos)
- local meta = minetest.get_meta(pos)
- meta:set_string("formspec","field[channel;Channel;${channel}")
- end,
+ on_construct = function(pos)
+ local meta = minetest.get_meta(pos)
+ meta:set_string("formspec","field[channel;Channel;${channel}")
+ end,
- tiles = {
- "penalty_controller_top.png",
- "jeija_microcontroller_bottom.png",
- "jeija_microcontroller_sides.png",
- "jeija_microcontroller_sides.png",
- "jeija_microcontroller_sides.png",
- "jeija_microcontroller_sides.png"
- },
-
- inventory_image = "penalty_controller_top.png",
- drawtype = "nodebox",
- selection_box = {
- --From luacontroller
- type = "fixed",
- fixed = { -8/16, -8/16, -8/16, 8/16, -5/16, 8/16 },
- },
- node_box = {
- --From Luacontroller
- type = "fixed",
- fixed = {
- {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16}, -- Bottom slab
- {-5/16, -7/16, -5/16, 5/16, -6/16, 5/16}, -- Circuit board
- {-3/16, -6/16, -3/16, 3/16, -5/16, 3/16}, -- IC
- }
- },
+ tiles = {
+ "penalty_controller_top.png",
+ "jeija_microcontroller_bottom.png",
+ "jeija_microcontroller_sides.png",
+ "jeija_microcontroller_sides.png",
+ "jeija_microcontroller_sides.png",
+ "jeija_microcontroller_sides.png"
+ },
- paramtype = "light",
- sunlight_propagates = true,
+ inventory_image = "penalty_controller_top.png",
+ drawtype = "nodebox",
+ selection_box = {
+ --From luacontroller
+ type = "fixed",
+ fixed = { -8/16, -8/16, -8/16, 8/16, -5/16, 8/16 },
+ },
+ node_box = {
+ --From Luacontroller
+ type = "fixed",
+ fixed = {
+ {-8/16, -8/16, -8/16, 8/16, -7/16, 8/16}, -- Bottom slab
+ {-5/16, -7/16, -5/16, 5/16, -6/16, 5/16}, -- Circuit board
+ {-3/16, -6/16, -3/16, 3/16, -5/16, 3/16}, -- IC
+ }
+ },
- on_receive_fields = function(pos, _, fields, sender)
- local name = sender:get_player_name()
- if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
- minetest.record_protection_violation(pos,name)
- return
- end
- local meta = minetest.get_meta(pos)
- if fields.channel then meta:set_string("channel",fields.channel) end
- end,
+ paramtype = "light",
+ sunlight_propagates = true,
- digiline = {
- receptor = {},
- effector = {
- action = function(pos, _, channel, msg)
- local meta = minetest.get_meta(pos)
- if meta:get_string("channel") ~= channel then
- return
- end
+ on_receive_fields = function(pos, _, fields, sender)
+ local name = sender:get_player_name()
+ if minetest.is_protected(pos,name) and not minetest.check_player_privs(name,{protection_bypass=true}) then
+ minetest.record_protection_violation(pos,name)
+ return
+ end
+ local meta = minetest.get_meta(pos)
+ if fields.channel then meta:set_string("channel",fields.channel) end
+ end,
+ digiline = {
+ receptor = {},
+ effector = {
+ action = function(pos, _, channel, msg)
+ local meta = minetest.get_meta(pos)
+ if meta:get_string("channel") ~= channel then
+ return
+ end
if msg == "GET" then
local ctx = mesecons_debug.get_context(pos)
-- copy and send values
@@ -68,7 +67,7 @@ minetest.register_node("mesecons_debug:penalty_controller", {
whitelisted = ctx.whitelisted
})
end
- end
- }
- }
+ end
+ }
+ }
})