From 987cc5a6a425b1f9bcd9000608dc389a45c675a1 Mon Sep 17 00:00:00 2001
From: you <ovvv@web.de>
Date: Mon, 05 Jun 2017 16:51:59 +0200
Subject: [PATCH] Add api documentation (#361)

---
 technic/machines/HV/nuclear_reactor.lua |   53 ++++++++++++++++++-----------------------------------
 1 files changed, 18 insertions(+), 35 deletions(-)

diff --git a/technic/machines/HV/nuclear_reactor.lua b/technic/machines/HV/nuclear_reactor.lua
index 235d03c..7338d28 100644
--- a/technic/machines/HV/nuclear_reactor.lua
+++ b/technic/machines/HV/nuclear_reactor.lua
@@ -15,8 +15,8 @@
 
 local S = technic.getter
 
-local reactor_desc = S("@1 Nuclear Reactor Core", S("HV")),
-
+local reactor_desc = S("@1 Nuclear Reactor Core", S("HV"))
+local cable_entry = "^technic_cable_connection_overlay.png"
 
 -- FIXME: Recipe should make more sense like a rod recepticle, steam chamber, HV generator?
 minetest.register_craft({
@@ -34,26 +34,6 @@
 	"list[current_name;src;2,1;3,2;]"..
 	"list[current_player;main;0,5;8,4;]"..
 	"listring[]"
-
--- "Boxy sphere"
-local node_box = {
-	{-0.353, -0.353, -0.353, 0.353, 0.353, 0.353}, -- Box
-	{-0.495, -0.064, -0.064, 0.495, 0.064, 0.064}, -- Circle +-x
-	{-0.483, -0.128, -0.128, 0.483, 0.128, 0.128},
-	{-0.462, -0.191, -0.191, 0.462, 0.191, 0.191},
-	{-0.433, -0.249, -0.249, 0.433, 0.249, 0.249},
-	{-0.397, -0.303, -0.303, 0.397, 0.303, 0.303},
-	{-0.305, -0.396, -0.305, 0.305, 0.396, 0.305}, -- Circle +-y
-	{-0.250, -0.432, -0.250, 0.250, 0.432, 0.250},
-	{-0.191, -0.461, -0.191, 0.191, 0.461, 0.191},
-	{-0.130, -0.482, -0.130, 0.130, 0.482, 0.130},
-	{-0.066, -0.495, -0.066, 0.066, 0.495, 0.066},
-	{-0.064, -0.064, -0.495, 0.064, 0.064, 0.495}, -- Circle +-z
-	{-0.128, -0.128, -0.483, 0.128, 0.128, 0.483},
-	{-0.191, -0.191, -0.462, 0.191, 0.191, 0.462},
-	{-0.249, -0.249, -0.433, 0.249, 0.249, 0.433},
-	{-0.303, -0.303, -0.397, 0.303, 0.303, 0.397},
-}
 
 local SS_OFF = 0
 local SS_DANGER = 1
@@ -221,6 +201,7 @@
 
 
 minetest.register_abm({
+	label = "Machines: reactor melt-down check",
 	nodenames = {"technic:hv_nuclear_reactor_core_active"},
 	interval = 4,
 	chance = 1,
@@ -289,17 +270,18 @@
 
 minetest.register_node("technic:hv_nuclear_reactor_core", {
 	description = reactor_desc,
-	tiles = {"technic_hv_nuclear_reactor_core.png"},
+	tiles = {
+		"technic_hv_nuclear_reactor_core.png",
+		"technic_hv_nuclear_reactor_core.png"..cable_entry
+	},
+	drawtype = "mesh",
+	mesh = "technic_reactor.obj",
 	groups = {cracky=1, technic_machine=1, technic_hv=1},
 	legacy_facedir_simple = true,
 	sounds = default.node_sound_wood_defaults(),
-	drawtype = "nodebox",
 	paramtype = "light",
+	paramtype2 = "facedir",
 	stack_max = 1,
-	node_box = {
-		type = "fixed",
-		fixed = node_box
-	},
 	on_construct = function(pos)
 		local meta = minetest.get_meta(pos)
 		meta:set_string("infotext", reactor_desc)
@@ -316,19 +298,20 @@
 })
 
 minetest.register_node("technic:hv_nuclear_reactor_core_active", {
-	tiles = {"technic_hv_nuclear_reactor_core.png"},
+	tiles = {
+		"technic_hv_nuclear_reactor_core.png",
+		"technic_hv_nuclear_reactor_core.png"..cable_entry
+	},
+	drawtype = "mesh",
+	mesh = "technic_reactor.obj",
 	groups = {cracky=1, technic_machine=1, technic_hv=1,
-		radioactive=6, not_in_creative_inventory=1},
+		radioactive=4, not_in_creative_inventory=1},
 	legacy_facedir_simple = true,
 	sounds = default.node_sound_wood_defaults(),
 	drop = "technic:hv_nuclear_reactor_core",
-	drawtype = "nodebox",
 	light_source = 14,
 	paramtype = "light",
-	node_box = {
-		type = "fixed",
-		fixed = node_box
-	},
+	paramtype2 = "facedir",
 	can_dig = technic.machine_can_dig,
 	after_dig_node = melt_down_reactor,
 	on_destruct = function(pos) siren_set_state(pos, SS_OFF) end,

--
Gitblit v1.8.0