Differences From
Artifact [1db75c4003]:
11 11 local liq = sorcery.register.liquid.db[liqid]
12 12 if not liq then log.err('missing entry for liquid',liqid) return end
13 13 local measure = liq.measure or function(u)
14 14 return string.format('%s drams', u*63.9)
15 15 end
16 16
17 17 return {
18 - title = string.format('Keg of %s', liq.name);
18 + title = string.format('%s Keg', sorcery.lib.str.capitalize(liq.name));
19 19 color = sorcery.lib.color(liq.color);
20 - props = {
21 - {title = 'Contains', desc = measure(m:get_int('charge'))};
22 - }
20 + desc = string.format('%s of %s', measure(m:get_int('charge')), liq.name);
23 21 };
24 22 else return { title = 'Empty Keg', props = {} } end
25 23 end
26 24 local log = sorcery.logger('keg')
27 25 minetest.register_node('sorcery:keg', {
28 26 description = 'Keg';
29 27 drawtype = 'mesh';
................................................................................
65 63 m:set_string('infotext', 'Empty Keg')
66 64 end;
67 65 on_rightclick = function(pos, node, user, stack)
68 66 local m = minetest.get_meta(pos)
69 67 local update = function()
70 68 local c = kegcaption(m)
71 69 local str = c.title
72 - for _,p in pairs(c.props) do
70 + if c.desc then str = str .. '\n(' .. c.desc .. ')' end
71 + if c.props then for _,p in pairs(c.props) do -- future-proofing
73 72 str = str .. string.format('\n(%s: %s)', p.title, p.desc)
74 - end
73 + end end
75 74 m:set_string('infotext', str)
76 75 end
77 76 local noise = function(amt)
78 77 minetest.sound_play('default_water_footstep', {
79 78 gain = 0.5 + amt / 9.0;
80 79 pitch = 1.3 - amt / 12.0;
81 80 pos = pos;
................................................................................
189 188 }
190 189 end
191 190 end
192 191
193 192 end
194 193 end;
195 194 })
195 +
196 +minetest.register_craft {
197 + output = "sorcery:keg";
198 + recipe = {
199 + {'', 'basic_materials:steel_bar', 'screwdriver:screwdriver'};
200 + {'sorcery:screw_bronze', 'default:bronze_ingot', 'sorcery:screw_bronze'};
201 + {'', 'xdecor:barrel', ''};
202 + };
203 + replacements = {
204 + {'screwdriver:screwdriver', 'screwdriver:screwdriver'};
205 + };
206 +}