1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-15 18:57:08 +00:00

Rename minetest.* to core.* in devtest

This commit is contained in:
Lars Müller 2024-10-28 15:57:54 +01:00 committed by GitHub
parent d849d51c2d
commit 88c7a54e08
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 914 additions and 914 deletions

View file

@ -1,8 +1,8 @@
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- After ABM node
minetest.register_node("testabms:after_abm", {
core.register_node("testabms:after_abm", {
description = S("After ABM processed node."),
drawtype = "normal",
tiles = { "testabms_after_node.png" },

View file

@ -1,9 +1,9 @@
-- test ABMs with different chances
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- ABM chance 5 node
minetest.register_node("testabms:chance_5", {
core.register_node("testabms:chance_5", {
description = S("Node for test ABM chance_5"),
drawtype = "normal",
tiles = { "testabms_wait_node.png" },
@ -11,25 +11,25 @@ minetest.register_node("testabms:chance_5", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext", "Waiting for ABM testabms:chance_5")
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:chance_5",
nodenames = "testabms:chance_5",
interval = 10,
chance = 5,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext", "ABM testabsm:chance_5 changed this node.")
end
})
-- ABM chance 20 node
minetest.register_node("testabms:chance_20", {
core.register_node("testabms:chance_20", {
description = S("Node for test ABM chance_20"),
drawtype = "normal",
tiles = { "testabms_wait_node.png" },
@ -37,19 +37,19 @@ minetest.register_node("testabms:chance_20", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext", "Waiting for ABM testabms:chance_20")
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:chance_20",
nodenames = "testabms:chance_20",
interval = 10,
chance = 20,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext", "ABM testabsm:chance_20 changed this node.")
end
})

View file

@ -1,4 +1,4 @@
local path = minetest.get_modpath(minetest.get_current_modname())
local path = core.get_modpath(core.get_current_modname())
dofile(path.."/after_node.lua")
dofile(path.."/chances.lua")

View file

@ -1,9 +1,9 @@
-- test ABMs with different interval
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- ABM inteval 1 node
minetest.register_node("testabms:interval_1", {
core.register_node("testabms:interval_1", {
description = S("Node for test ABM interval_1"),
drawtype = "normal",
tiles = { "testabms_wait_node.png" },
@ -11,25 +11,25 @@ minetest.register_node("testabms:interval_1", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext", "Waiting for ABM testabms:interval_1")
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:interval_1",
nodenames = "testabms:interval_1",
interval = 1,
chance = 1,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext", "ABM testabsm:interval_1 changed this node.")
end
})
-- ABM interval 60 node
minetest.register_node("testabms:interval_60", {
core.register_node("testabms:interval_60", {
description = S("Node for test ABM interval_60"),
drawtype = "normal",
tiles = { "testabms_wait_node.png" },
@ -37,19 +37,19 @@ minetest.register_node("testabms:interval_60", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext", "Waiting for ABM testabms:interval_60")
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:interval_60",
nodenames = "testabms:interval_60",
interval = 60,
chance = 1,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext", "ABM testabsm:interval_60 changed this node.")
end
})

View file

@ -1,9 +1,9 @@
-- test ABMs with min_y and max_y
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- ABM min_y node
minetest.register_node("testabms:min_y", {
core.register_node("testabms:min_y", {
description = S("Node for test ABM min_y."),
drawtype = "normal",
tiles = { "testabms_wait_node.png" },
@ -11,26 +11,26 @@ minetest.register_node("testabms:min_y", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext", "Waiting for ABM testabms:min_y at y "..pos.y.." with min_y = 0")
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:min_y",
nodenames = "testabms:min_y",
interval = 10,
chance = 1,
min_y = 0,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext", "ABM testabsm:min_y changed this node.")
end
})
-- ABM max_y node
minetest.register_node("testabms:max_y", {
core.register_node("testabms:max_y", {
description = S("Node for test ABM max_y."),
drawtype = "normal",
tiles = { "testabms_wait_node.png" },
@ -38,20 +38,20 @@ minetest.register_node("testabms:max_y", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext", "Waiting for ABM testabms:max_y at y "..pos.y.." with max_y = 0")
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:max_y",
nodenames = "testabms:max_y",
interval = 10,
chance = 1,
max_y = 0,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext", "ABM testabsm:max_y changed this node.")
end
})

View file

@ -1,9 +1,9 @@
-- test ABMs with neighbor and without_neighbor
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- ABM required neighbor
minetest.register_node("testabms:required_neighbor", {
core.register_node("testabms:required_neighbor", {
description = S("Node for test ABM required_neighbor.") .. "\n"
.. S("Sensitive neighbor node is testnodes:normal."),
drawtype = "normal",
@ -12,29 +12,29 @@ minetest.register_node("testabms:required_neighbor", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext",
"Waiting for ABM testabms:required_neighbor "
.. "(normal drawtype testnode sensitive)")
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:required_neighbor",
nodenames = "testabms:required_neighbor",
neighbors = {"testnodes:normal"},
interval = 1,
chance = 1,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext",
"ABM testabsm:required_neighbor changed this node.")
end
})
-- ABM missing neighbor node
minetest.register_node("testabms:missing_neighbor", {
core.register_node("testabms:missing_neighbor", {
description = S("Node for test ABM missing_neighbor.") .. "\n"
.. S("Sensitive neighbor node is testnodes:normal."),
drawtype = "normal",
@ -43,29 +43,29 @@ minetest.register_node("testabms:missing_neighbor", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext",
"Waiting for ABM testabms:missing_neighbor"
.. " (normal drawtype testnode sensitive)")
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:missing_neighbor",
nodenames = "testabms:missing_neighbor",
without_neighbors = {"testnodes:normal"},
interval = 1,
chance = 1,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext",
"ABM testabsm:missing_neighbor changed this node.")
end
})
-- ABM required and missing neighbor node
minetest.register_node("testabms:required_missing_neighbor", {
core.register_node("testabms:required_missing_neighbor", {
description = S("Node for test ABM required_missing_neighbor.") .. "\n"
.. S("Sensitive neighbor nodes are testnodes:normal and testnodes:glasslike."),
drawtype = "normal",
@ -74,7 +74,7 @@ minetest.register_node("testabms:required_missing_neighbor", {
groups = { dig_immediate = 3 },
on_construct = function (pos)
local meta = minetest.get_meta(pos)
local meta = core.get_meta(pos)
meta:set_string("infotext",
"Waiting for ABM testabms:required_missing_neighbor"
.. " (wint normal drawtype testnode and no glasslike"
@ -82,7 +82,7 @@ minetest.register_node("testabms:required_missing_neighbor", {
end,
})
minetest.register_abm({
core.register_abm({
label = "testabms:required_missing_neighbor",
nodenames = "testabms:required_missing_neighbor",
neighbors = {"testnodes:normal"},
@ -90,8 +90,8 @@ minetest.register_abm({
interval = 1,
chance = 1,
action = function (pos)
minetest.swap_node(pos, {name="testabms:after_abm"})
local meta = minetest.get_meta(pos)
core.swap_node(pos, {name="testabms:after_abm"})
local meta = core.get_meta(pos)
meta:set_string("infotext",
"ABM testabsm:required_missing_neighbor changed this node.")
end