Differences From
Artifact [6f8dfbcd79]:
347 347
348 348 local function pointChanged(a,b)
349 349 return a.type ~= b.type
350 350 or a.type == 'node' and vector.new(a.under) ~= vector.new(b.under)
351 351 or a.type == 'object' and a.ref ~= b.ref
352 352 end
353 353 local function triggerPower(_, luser, point)
354 + for k,v in pairs(starlit.activeUsers) do
355 + print (k,v) end
356 + print("trigger", luser, luser:get_player_name())
354 357 local user = starlit.activeUsers[luser:get_player_name()]
355 358 local oldTgt = user.action.tgt
356 359 user.action.tgt = point
357 360 if bit.band(user.action.bits, 0x100)==0 then
358 361 user.action.bits = bit.bor(user.action.bits, 0x100)
359 362 --return user:trigger('secondary', {state = 'prog', delta = 0})
360 363 elseif pointChanged(oldTgt, point) then
................................................................................
367 370 if not triggerPower(...) then
368 371 minetest.item_place(...)
369 372 end
370 373 end
371 374 core.noneitemdef_default.on_use = function(...) triggerPower(...) end
372 375 core.noneitemdef_default.on_secondary_use = function(...) triggerPower(...) end
373 376 ]]
374 -print(dump(core.noneitemdef_default))
375 377 minetest.register_item(":", {
376 378 type = "none",
377 379 wield_image = "wieldhand.png",
378 380 wield_scale = {x=1,y=1,z=2.5},
379 381 on_secondary_use = function(...) triggerPower(...) end;
380 382 -- on_use = function(...) print'base' end;
381 - after_use = function(...) triggerPower(...) end;
383 + after_use = function(i,u,n,p)
384 + if (u:is_player()) then triggerPower(i,u,p) end
385 + end;
382 386 })
383 387 minetest.register_item("starlit:_hand_dig", {
384 388 type = "none",
385 389 wield_image = "wieldhand.png",
386 390 wield_scale = {x=1,y=1,z=2.5},
387 391 tool_capabilities = {
388 392 groupcaps = {