mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Rename minetest.*
to core.*
in devtest
This commit is contained in:
parent
d849d51c2d
commit
88c7a54e08
78 changed files with 914 additions and 914 deletions
|
@ -1,29 +1,29 @@
|
|||
local function print_to_everything(msg)
|
||||
minetest.log("action", "[callbacks] " .. msg)
|
||||
minetest.chat_send_all(msg)
|
||||
core.log("action", "[callbacks] " .. msg)
|
||||
core.chat_send_all(msg)
|
||||
end
|
||||
|
||||
minetest.register_node("callbacks:callback_node", {
|
||||
core.register_node("callbacks:callback_node", {
|
||||
description = "Callback Test Node (construct/destruct/timer)".."\n"..
|
||||
"Tests callbacks: on_construct, after_place_node, on_destruct, after_destruct, after_dig_node, on_timer",
|
||||
tiles = {"callbacks_callback_node.png"},
|
||||
groups = {callback_test=1, dig_immediate=3},
|
||||
-- This was known to cause a bug in minetest.item_place_node() when used
|
||||
-- via minetest.place_node(), causing a placer with no position
|
||||
-- This was known to cause a bug in core.item_place_node() when used
|
||||
-- via core.place_node(), causing a placer with no position
|
||||
paramtype2 = "facedir",
|
||||
drop = "",
|
||||
|
||||
on_construct = function(pos)
|
||||
print_to_everything("callbacks:callback_node:on_construct("..minetest.pos_to_string(pos)..")")
|
||||
local meta = minetest.get_meta(pos)
|
||||
print_to_everything("callbacks:callback_node:on_construct("..core.pos_to_string(pos)..")")
|
||||
local meta = core.get_meta(pos)
|
||||
meta:set_string("mine", "test")
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
local timer = core.get_node_timer(pos)
|
||||
timer:start(4, 3)
|
||||
end,
|
||||
|
||||
after_place_node = function(pos, placer)
|
||||
print_to_everything("callbacks:callback_node:after_place_node("..minetest.pos_to_string(pos)..")")
|
||||
local meta = minetest.get_meta(pos)
|
||||
print_to_everything("callbacks:callback_node:after_place_node("..core.pos_to_string(pos)..")")
|
||||
local meta = core.get_meta(pos)
|
||||
if meta:get_string("mine") == "test" then
|
||||
print_to_everything("correct metadata found")
|
||||
else
|
||||
|
@ -32,15 +32,15 @@ minetest.register_node("callbacks:callback_node", {
|
|||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
print_to_everything("callbacks:callback_node:on_destruct("..minetest.pos_to_string(pos)..")")
|
||||
print_to_everything("callbacks:callback_node:on_destruct("..core.pos_to_string(pos)..")")
|
||||
end,
|
||||
|
||||
after_destruct = function(pos)
|
||||
print_to_everything("callbacks:callback_node:after_destruct("..minetest.pos_to_string(pos)..")")
|
||||
print_to_everything("callbacks:callback_node:after_destruct("..core.pos_to_string(pos)..")")
|
||||
end,
|
||||
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
print_to_everything("callbacks:callback_node:after_dig_node("..minetest.pos_to_string(pos)..")")
|
||||
print_to_everything("callbacks:callback_node:after_dig_node("..core.pos_to_string(pos)..")")
|
||||
end,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue