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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
|
-- internationalization boilerplate
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
minetest.register_node("castle_gates:portcullis_bars", {
drawtype = "nodebox",
description = S("Portcullis Bars"),
_doc_items_longdesc = castle_gates.doc.portcullis_bars_longdesc,
_doc_items_usagehelp = castle_gates.doc.portcullis_bars_usagehelp,
groups = {castle_gate = 1, choppy = 1, flow_through = 1},
tiles = {
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
},
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.125, -0.5, -0.5, 0.125, 0.5, -0.25}, -- middle bar
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.25}, -- side bar
{0.375, -0.5, -0.5, 0.5, 0.5, -0.25}, -- side bar
{-0.375, 0.1875, -0.4375, 0.375, 0.3125, -0.3125}, -- crosspiece
{-0.375, -0.3125, -0.4375, 0.375, -0.1875, -0.3125}, -- crosspiece
}
},
on_rightclick = castle_gates.trigger_gate,
})
minetest.register_node("castle_gates:portcullis_bars_bottom", {
drawtype = "nodebox",
description = S("Portcullis Bottom"),
_doc_items_longdesc = castle_gates.doc.portcullis_bars_bottom_longdesc,
_doc_items_usagehelp = castle_gates.doc.portcullis_bars_bottom_usagehelp,
groups = {castle_gate = 1, choppy = 1, flow_through = 1},
tiles = {
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_portcullis_mask.png)",
},
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.125, -0.5, -0.5, 0.125, 0.5, -0.25}, -- middle bar
{-0.5, -0.5, -0.5, -0.375, 0.5, -0.25}, -- side bar
{0.375, -0.5, -0.5, 0.5, 0.5, -0.25}, -- side bar
{-0.375, 0.1875, -0.4375, 0.375, 0.3125, -0.3125}, -- crosspiece
{-0.375, -0.3125, -0.4375, 0.375, -0.1875, -0.3125}, -- crosspiece
{-0.0625, -0.5, -0.4375, 0.0625, -0.625, -0.3125}, -- peg
{0.4375, -0.5, -0.4375, 0.5, -0.625, -0.3125}, -- peg
{-0.5, -0.5, -0.4375, -0.4375, -0.625, -0.3125}, -- peg
}
},
_gate_edges = {bottom=true},
on_rightclick = castle_gates.trigger_gate,
})
minetest.register_craft({
output = "castle_gates:portcullis_bars 3",
recipe = {
{"group:wood","default:steel_ingot","group:wood" },
{"group:wood","default:steel_ingot","group:wood" },
{"group:wood","default:steel_ingot","group:wood" },
},
})
minetest.register_craft({
output = "castle_gates:portcullis_bars",
recipe = {
{"castle_gates:portcullis_bars_bottom"}
},
})
minetest.register_craft({
output = "castle_gates:portcullis_bars_bottom",
recipe = {
{"castle_gates:portcullis_bars"}
},
})
--------------------------------------------------------------------------------------------------------------
minetest.register_craft({
output = "castle_gates:gate_panel 8",
recipe = {
{"stairs:slab_wood","stairs:slab_wood", ""},
{"stairs:slab_wood","stairs:slab_wood", ""},
},
})
minetest.register_node("castle_gates:gate_panel", {
drawtype = "nodebox",
description = S("Gate Door"),
_doc_items_longdesc = castle_gates.doc.gate_panel_longdesc,
_doc_items_usagehelp = castle_gates.doc.gate_panel_usagehelp,
groups = {choppy = 1, castle_gate = 1},
tiles = {
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
},
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
}
},
on_rightclick = castle_gates.trigger_gate,
})
minetest.register_craft({
output = "castle_gates:gate_edge",
type = "shapeless",
recipe = {"castle_gates:gate_panel"},
})
minetest.register_node("castle_gates:gate_edge", {
drawtype = "nodebox",
description = S("Gate Door Edge"),
_doc_items_longdesc = castle_gates.doc.gate_edge_longdesc,
_doc_items_usagehelp = castle_gates.doc.gate_edge_usagehelp,
groups = {choppy = 1, castle_gate = 1},
tiles = {
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90",
"default_wood.png^[transformR90^(default_coal_block.png^[mask:castle_door_edge_mask.png^[transformFX)",
"default_wood.png^[transformR90^(default_coal_block.png^[mask:castle_door_edge_mask.png)",
},
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
}
},
_gate_edges = {right=true},
on_rightclick = castle_gates.trigger_gate,
})
minetest.register_craft({
output = "castle_gates:gate_edge_handle",
type = "shapeless",
recipe = {"castle_gates:gate_edge"},
})
minetest.register_craft({
output = "castle_gates:gate_panel",
type = "shapeless",
recipe = {"castle_gates:gate_edge_handle"},
})
minetest.register_node("castle_gates:gate_edge_handle", {
drawtype = "nodebox",
description = S("Gate Door With Handle"),
_doc_items_longdesc = castle_gates.doc.gate_edge_handle_longdesc,
_doc_items_usagehelp = castle_gates.doc.gate_edge_handle_usagehelp,
groups = {choppy = 1, castle_gate = 1},
tiles = {
"castle_steel.png^(default_wood.png^[mask:castle_door_side_mask.png^[transformR90)",
"castle_steel.png^(default_wood.png^[mask:castle_door_side_mask.png^[transformR270)",
"castle_steel.png^(default_wood.png^[transformR90^[mask:castle_door_side_mask.png)",
"castle_steel.png^(default_wood.png^[transformR90^[mask:(castle_door_side_mask.png^[transformFX))",
"default_wood.png^[transformR90^(default_coal_block.png^[mask:castle_door_edge_mask.png^[transformFX)^(castle_steel.png^[mask:castle_door_handle_mask.png^[transformFX)",
"default_wood.png^[transformR90^(default_coal_block.png^[mask:castle_door_edge_mask.png)^(castle_steel.png^[mask:castle_door_handle_mask.png)",
},
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
{4/16, -4/16, -2/16, 6/16, 4/16, -3/16},
{4/16, -4/16, -9/16, 6/16, 4/16, -10/16},
{4/16, -4/16, -9/16, 6/16, -3/16, -3/16},
{4/16, 4/16, -9/16, 6/16, 3/16, -3/16},
}
},
_gate_edges = {right=true},
on_rightclick = castle_gates.trigger_gate,
})
------------------------------------------------------------------------------
minetest.register_craft({
output = "castle_gates:gate_hinge 3",
recipe = {
{"", "castle_gates:gate_panel", ""},
{"default:steel_ingot", "castle_gates:gate_panel", ""},
{"", "castle_gates:gate_panel", ""}
},
})
minetest.register_node("castle_gates:gate_hinge", {
drawtype = "nodebox",
description = S("Gate Door With Hinge"),
_doc_items_longdesc = castle_gates.doc.gate_hinge_longdesc,
_doc_items_usagehelp = castle_gates.doc.gate_hinge_usagehelp,
groups = {choppy = 1, castle_gate = 1},
tiles = {
"default_wood.png^[transformR90",
},
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
{-10/16, -4/16, -10/16, -6/16, 4/16, -6/16},
}
},
collision_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, -0.25},
},
_gate_hinge = {axis="top", offset={"front","left"}},
on_rightclick = castle_gates.trigger_gate,
})
|