forked from wintersknight94/NodeCore-Additions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reinforced.lua
81 lines (81 loc) · 2.57 KB
/
reinforced.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore, pairs, vector
= minetest, nodecore, pairs, vector
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
------------------------------------------------------------------------
local glare = "nc_optics_glass_glare.png"
local edges = "nc_optics_glass_edges.png"
local clear = glare.. "^" ..edges
local alode = "nc_lode_annealed.png"
local tlode = "nc_lode_tempered.png"
local lmesh = alode.. "^[mask:nc_concrete_pattern_hashy.png"
local frame = alode.. "^[mask:nc_api_storebox_frame.png"
------------------------------------------------------------------------
local rglass = glare.. "^" ..lmesh
local rgedge = frame.. "^" ..edges
------------------------------------------------------------------------
local src = "nc_optics:glass_hot_source"
local flow = "nc_optics:glass_hot_flowing"
------------------------------------------------------------------------
local function near(pos, crit)
return #nodecore.find_nodes_around(pos, crit, {1, 1, 1}, {1, 0, 1}) > 0
end
-- ================================================================== --
minetest.register_node(modname .. ":glass_hard", {
description = "Reinforced Glass",
drawtype = "glasslike_framed",
tiles = {
"(" ..rglass.. ")^(" ..rgedge.. ")",
rglass
},
groups = {
silica = 1,
silica_reinforced = 1,
cracky = 4,
lux_absorb = 20,
scaling_time = 300
},
sunlight_propagates = true,
paramtype = "light",
sounds = nodecore.sounds("nc_optics_glassy")
})
-- ================================================================== --
nodecore.register_craft({
label = "cool reinforced glass",
action = "cook",
duration = 120,
touchgroups = {flame = 0},
neargroups = {coolant = 0},
cookfx = {smoke = true, hiss = true},
check = function(pos)
return not near(pos, {flow})
end,
indexkeys = {src},
nodes = {
{
match = src,
replace = "air"
},
{
y = -1,
match = "nc_lode:frame_annealed",
replace = modname .. ":glass_hard"
}
}
})
-- ================================================================== --
nodecore.register_craft({
label = "hammer reinforced glass to crude",
action = "pummel",
priority = -1,
toolgroups = {thumpy = 5},
nodes = {
{
match = {groups = {silica_reinforced = true, visinv = false}},
replace = "nc_lode:form"
}
},
items = {"nc_optics:glass_crude"}
})
-- ================================================================== --