starlit  Diff

Differences From Artifact [c40c4aaae1]:

To Artifact [e52f2bba90]:


    46     46   	liveUI = {
    47     47   		-- cached subset of activeUI containing those UIs needing live updates
    48     48   	};
    49     49   
    50     50   	interface = lib.registry.mk 'starlit:interface';
    51     51   	item = {
    52     52   		food = lib.registry.mk 'starlit:food';
           53  +		seed = lib.registry.mk 'starlit:seed';
    53     54   	};
    54     55   
    55     56   	region = {
    56     57   		radiator = {
    57     58   			store = AreaStore();
    58         -			emitters = {}
           59  +			emitters = {};
    59     60   		};
    60     61   	};
    61     62   
    62     63   	-- standardized effects
    63     64   	fx = {};
    64     65   
    65     66   	type = {};
................................................................................
   386    387   })
   387    388   minetest.register_item("starlit:_hand_dig", {
   388    389   	type = "none",
   389    390   	wield_image = "wieldhand.png",
   390    391   	wield_scale = {x=1,y=1,z=2.5},
   391    392   	tool_capabilities = {
   392    393   		groupcaps = {
   393         -			plant = {maxlevel=1, times = {.50,.5,.5}};
   394         -			dirt = {maxlevel=1, times = {2.5,1,1}};
          394  +			plant = {maxlevel=1, times = {.50}};
          395  +			dirt = {maxlevel=1, times = {2.5}};
          396  +
          397  +			log = {maxlevel=1, times = {1}};
   395    398   		};
   396    399   	}
   397    400   })
   398    401   
   399    402   minetest.register_on_player_inventory_action(function(luser, act, inv, p)
   400    403   	local name = luser:get_player_name()
   401    404   	local user = starlit.activeUsers[name]
................................................................................
   418    421   		-- cranked by similarly
   419    422   	end
   420    423   	return delta
   421    424   end, true)
   422    425   
   423    426   function minetest.handle_node_drops(pos, drops, digger)
   424    427   	local function jitter(pos)
   425         -		local function r(x) return x+math.random(-0.2, 0.2) end
          428  +		local function r(x) return x+math.random(-0.01, 0.01) end
   426    429   		return vector.new(
   427    430   			r(pos.x),
   428    431   			r(pos.y),
   429    432   			r(pos.z)
   430    433   		)
   431    434   	end
   432    435   	for i, it in ipairs(drops) do
   433         -		minetest.add_item(jitter(pos), it)
          436  +		local it = minetest.add_item(jitter(pos), it)
          437  +		local dp = vector.new(0,0,0)
          438  +		if digger then dp = digger:get_pos() end
          439  +		local delta = dp - it:get_pos()
          440  +		it:add_velocity(vector.new(delta.x,0,delta.z));
   434    441   	end
   435    442   end
   436    443   
   437    444   
   438    445   -- TODO timer iterates live UI
   439    446