starlit  Diff

Differences From Artifact [cc61bb3736]:

To Artifact [33f1e7300a]:


     7      7   --[[ {
     8      8   	part = {
     9      9   		['starlit_building:pipe'] = 'myMod:stage3';
    10     10   	};
    11     11   	tool = {
    12     12   		['starlit:screwdriver'] = 'myMod:otherThing_stage1';
    13     13   		['starlit:saw'] = function(node, tool)
    14         -			minetest.replace_node(node, {name='myMod:stage1'})
    15         -			minetest.drop_item(node, 'starlit_building:pipe')
           14  +			core.replace_node(node, {name='myMod:stage1'})
           15  +			core.drop_item(node, 'starlit_building:pipe')
    16     16   		end;
    17     17   		['myMod:laserWrench'] = {
    18     18   			allow = function(node, tool) ... end;
    19     19   			handle = function(node, tool) ... end;
    20     20   		};
    21     21   	};
    22     22   } ]]
................................................................................
    81     81   	if e.fab then
    82     82   		scmID = string.format('%s_schematic', id)
    83     83   		rev = {
    84     84   			sw = scmID;
    85     85   			complexity = e.complexity or 1;
    86     86   		}
    87     87   	end
    88         -	minetest.register_craftitem(id, {
           88  +	core.register_craftitem(id, {
    89     89   		short_description = e.name;
    90     90   		description = starlit.ui.tooltip {
    91     91   			title = e.name;
    92     92   			desc = e.desc;
    93     93   			props = props;
    94     94   		};
    95     95   		stack_max = e.max or (e.mass and math.min(math.max(math.floor(500 / e.mass), 1), 500)) or 10;
    96     96   		inventory_image = e.img;
    97     97   		on_place = function(stack, luser, point)
    98         -			local node = minetest.get_node(point.under)
           98  +			local node = core.get_node(point.under)
    99     99   			local function tryBuild()
   100    100   				local p = B.path[node.name]
   101    101   				if not p then return nil end
   102    102   				if (not p.part) or (not p.part[id]) then return nil end
   103    103   				local n = p.part[id]
   104    104   				local obj
   105    105   				if type(n) == 'function' then
................................................................................
   108    108   				else
   109    109   					obj = ItemStack(n)
   110    110   					stack:take_item(1)
   111    111   				end
   112    112   				local pname = obj:get_name()
   113    113   				local stg = B.stage.db[pname]
   114    114   				node.name = pname
   115         -				minetest.swap_node(point.under, node)
          115  +				core.swap_node(point.under, node)
   116    116   				-- TODO make a noise
   117    117   				if stg.onBuild then
   118    118   					stg.onBuild(point.under, luser, stack)
   119    119   				end
   120    120   				return stack
   121    121   			end
   122    122   
................................................................................
   125    125   				if not p then return nil end
   126    126   				if type(p) == 'function' then
   127    127   					p = p(stack, node, point)
   128    128   					if p == nil then return nil end
   129    129   				else
   130    130   					stack:take_item(1)
   131    131   				end
   132         -				minetest.rotate_and_place(ItemStack(p), luser, point, true)
          132  +				core.rotate_and_place(ItemStack(p), luser, point, true)
   133    133   				-- TODO make a noise
   134    134   				return stack
   135    135   			end
   136    136   
   137    137   			return tryBuild() or tryBegin() or stack
   138    138   		end;
   139    139   		_starlit = {
................................................................................
   177    177   	local grp = e.groups and table.copy(e.groups) or {}
   178    178   	grp.stage = 1
   179    179   	local meta = {
   180    180   		stage = id;
   181    181   		recover = e.recover;
   182    182   	}
   183    183   	for k,v in pairs(e.meta or {}) do meta[k] = v end
   184         -	minetest.register_node(id, {
          184  +	core.register_node(id, {
   185    185   		description = 'Construction';
   186    186   		drawtype = (e.box  and 'nodebox')
   187    187   		        or (e.mesh and 'mesh')
   188    188   		        or 'regular';
   189    189   		paramtype  = e.paramtype or (e.box or e.mesh or e.light) and 'light' or nil;
   190    190   		paramtype2 = e.paramtype2 or 'none';
   191    191   		tiles = e.tex;