1
0
Fork 0
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:
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

@ -25,12 +25,12 @@ local function place_nodes(param)
local pos = param.pos
local start_pos = param.start_pos
table.sort(nodes)
minetest.chat_send_player(name, "Placing nodes …")
core.chat_send_player(name, "Placing nodes …")
local nodes_placed = 0
local aborted = false
for n=1, #nodes do
local itemstring = nodes[n]
local def = minetest.registered_nodes[itemstring]
local def = core.registered_nodes[itemstring]
local p2_max = 0
if param.param ~= "no_param2" then
-- Also test the param2 values of the nodes
@ -64,7 +64,7 @@ local function place_nodes(param)
((def.paramtype2 == "colorfacedir" or def.paramtype2 == "colordegrotate")
and p2 % 32 > 23)) then
minetest.set_node(pos, { name = itemstring, param2 = p2 })
core.set_node(pos, { name = itemstring, param2 = p2 })
nodes_placed = nodes_placed + 1
pos = advance_pos(pos, start_pos)
if not pos then
@ -78,9 +78,9 @@ local function place_nodes(param)
end
end
if aborted then
minetest.chat_send_player(name, "Not all nodes could be placed, please move further away from the world boundary. Nodes placed: "..nodes_placed)
core.chat_send_player(name, "Not all nodes could be placed, please move further away from the world boundary. Nodes placed: "..nodes_placed)
end
minetest.chat_send_player(name, "Nodes placed: "..nodes_placed..".")
core.chat_send_player(name, "Nodes placed: "..nodes_placed..".")
end
local function after_emerge(blockpos, action, calls_remaining, param)
@ -89,11 +89,11 @@ local function after_emerge(blockpos, action, calls_remaining, param)
end
end
minetest.register_chatcommand("test_place_nodes", {
core.register_chatcommand("test_place_nodes", {
params = "[ no_param2 ]",
description = "Test: Place all nodes (except dummy and callback nodes) and optionally their permissible param2 variants",
func = function(name, param)
local player = minetest.get_player_by_name(name)
local player = core.get_player_by_name(name)
if not player then
return false, "No player."
end
@ -112,12 +112,12 @@ minetest.register_chatcommand("test_place_nodes", {
local aborted = false
local nodes = {}
local emerge_estimate = 0
for itemstring, def in pairs(minetest.registered_nodes) do
for itemstring, def in pairs(core.registered_nodes) do
if itemstring ~= "ignore" and
-- Skip callback test and dummy nodes
-- to avoid clutter and chat spam
minetest.get_item_group(itemstring, "callback_test") == 0 and
minetest.get_item_group(itemstring, "dummy") == 0 then
core.get_item_group(itemstring, "callback_test") == 0 and
core.get_item_group(itemstring, "dummy") == 0 then
table.insert(nodes, itemstring)
if def.paramtype2 == 0 then
emerge_estimate = emerge_estimate + 1
@ -130,7 +130,7 @@ minetest.register_chatcommand("test_place_nodes", {
-- Note we will emerge much more than we need to (overestimation),
-- the estimation code could be improved performance-wise …
local length = 16 + math.ceil(emerge_estimate / 24) * 2
minetest.emerge_area(start_pos,
core.emerge_area(start_pos,
{ x = start_pos.x + 46, y = start_pos.y, z = start_pos.z + length },
after_emerge, { nodes = nodes, name = name, pos = pos, start_pos = start_pos, param = param })
return true, "Emerging area …"

View file

@ -13,10 +13,10 @@ unrelated to the drawtype, stuff that is mostly there to make
testing this node easier and more convenient.
]]
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- A regular cube
minetest.register_node("testnodes:normal", {
core.register_node("testnodes:normal", {
description = S("\"normal\" Drawtype Test Node").."\n"..
S("Opaque texture"),
drawtype = "normal",
@ -26,7 +26,7 @@ minetest.register_node("testnodes:normal", {
})
-- Standard glasslike node
minetest.register_node("testnodes:glasslike", {
core.register_node("testnodes:glasslike", {
description = S("\"glasslike\" Drawtype Test Node").."\n"..
S("Transparent node with hidden backfaces"),
drawtype = "glasslike",
@ -37,7 +37,7 @@ minetest.register_node("testnodes:glasslike", {
})
-- Glasslike framed with the two textures (normal and "detail")
minetest.register_node("testnodes:glasslike_framed", {
core.register_node("testnodes:glasslike_framed", {
description = S("\"glasslike_framed\" Drawtype Test Node").."\n"..
S("Transparent node with hidden backfaces").."\n"..
S("Frame connects to neighbors"),
@ -56,7 +56,7 @@ minetest.register_node("testnodes:glasslike_framed", {
-- Like the one above, but without the "detail" texture (texture 2).
-- This node was added to see how the engine behaves when the "detail" texture
-- is missing.
minetest.register_node("testnodes:glasslike_framed_no_detail", {
core.register_node("testnodes:glasslike_framed_no_detail", {
description = S("\"glasslike_framed\" Drawtype without Detail Test Node").."\n"..
S("Transparent node with hidden backfaces").."\n"..
S("Frame connects to neighbors, but the 'detail' tile is not used"),
@ -70,7 +70,7 @@ minetest.register_node("testnodes:glasslike_framed_no_detail", {
})
minetest.register_node("testnodes:glasslike_framed_optional", {
core.register_node("testnodes:glasslike_framed_optional", {
description = S("\"glasslike_framed_optional\" Drawtype Test Node").."\n"..
S("Transparent node with hidden backfaces").."\n"..
S("Frame connects if 'connected_glass' setting is true"),
@ -88,7 +88,7 @@ minetest.register_node("testnodes:glasslike_framed_optional", {
minetest.register_node("testnodes:allfaces", {
core.register_node("testnodes:allfaces", {
description = S("\"allfaces\" Drawtype Test Node").."\n"..
S("Transparent node with visible internal backfaces"),
drawtype = "allfaces",
@ -98,7 +98,7 @@ minetest.register_node("testnodes:allfaces", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:allfaces_6", {
core.register_node("testnodes:allfaces_6", {
description = S("\"allfaces 6 Textures\" Drawtype Test Node").."\n"..
S("Transparent node with visible internal backfaces"),
drawtype = "allfaces",
@ -121,7 +121,7 @@ local allfaces_optional_tooltip = ""..
S("* 'simple': transparent with hidden backfaces").."\n"..
S("* 'opaque': opaque")
minetest.register_node("testnodes:allfaces_optional", {
core.register_node("testnodes:allfaces_optional", {
description = S("\"allfaces_optional\" Drawtype Test Node").."\n"..
allfaces_optional_tooltip,
drawtype = "allfaces_optional",
@ -131,7 +131,7 @@ minetest.register_node("testnodes:allfaces_optional", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:allfaces_optional_waving", {
core.register_node("testnodes:allfaces_optional_waving", {
description = S("Waving \"allfaces_optional\" Drawtype Test Node").."\n"..
allfaces_optional_tooltip.."\n"..
S("Waves if waving leaves are enabled by client"),
@ -143,7 +143,7 @@ minetest.register_node("testnodes:allfaces_optional_waving", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:firelike", {
core.register_node("testnodes:firelike", {
description = S("\"firelike\" Drawtype Test Node").."\n"..
S("Changes shape based on neighbors"),
drawtype = "firelike",
@ -155,7 +155,7 @@ minetest.register_node("testnodes:firelike", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:fencelike", {
core.register_node("testnodes:fencelike", {
description = S("\"fencelike\" Drawtype Test Node").."\n"..
S("Connects to neighbors"),
drawtype = "fencelike",
@ -165,7 +165,7 @@ minetest.register_node("testnodes:fencelike", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:torchlike", {
core.register_node("testnodes:torchlike", {
description = S("Floor \"torchlike\" Drawtype Test Node").."\n"..
S("Always on floor"),
drawtype = "torchlike",
@ -178,7 +178,7 @@ minetest.register_node("testnodes:torchlike", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:torchlike_wallmounted", {
core.register_node("testnodes:torchlike_wallmounted", {
description = S("Wallmounted \"torchlike\" Drawtype Test Node").."\n"..
S("param2 = wallmounted rotation (0..7)"),
drawtype = "torchlike",
@ -196,7 +196,7 @@ minetest.register_node("testnodes:torchlike_wallmounted", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:torchlike_wallmounted_rot", {
core.register_node("testnodes:torchlike_wallmounted_rot", {
description = S("Wallmounted Rotatable Torchlike Drawtype Test Node"),
drawtype = "torchlike",
paramtype = "light",
@ -214,7 +214,7 @@ minetest.register_node("testnodes:torchlike_wallmounted_rot", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:signlike", {
core.register_node("testnodes:signlike", {
description = S("Floor \"signlike\" Drawtype Test Node").."\n"..
S("Always on floor"),
drawtype = "signlike",
@ -226,7 +226,7 @@ minetest.register_node("testnodes:signlike", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:signlike_wallmounted", {
core.register_node("testnodes:signlike_wallmounted", {
description = S("Wallmounted \"signlike\" Drawtype Test Node").."\n"..
S("param2 = wallmounted rotation (0..7)"),
drawtype = "signlike",
@ -240,7 +240,7 @@ minetest.register_node("testnodes:signlike_wallmounted", {
sunlight_propagates = true,
})
minetest.register_node("testnodes:signlike_rot", {
core.register_node("testnodes:signlike_rot", {
description = S("Wallmounted Rotatable Signlike Drawtype Test Node"),
drawtype = "signlike",
paramtype = "light",
@ -256,7 +256,7 @@ minetest.register_node("testnodes:signlike_rot", {
minetest.register_node("testnodes:plantlike", {
core.register_node("testnodes:plantlike", {
description = S("\"plantlike\" Drawtype Test Node"),
drawtype = "plantlike",
paramtype = "light",
@ -268,7 +268,7 @@ minetest.register_node("testnodes:plantlike", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:plantlike_waving", {
core.register_node("testnodes:plantlike_waving", {
description = S("Waving \"plantlike\" Drawtype Test Node").."\n"..
S("Waves if waving plants are enabled by client"),
drawtype = "plantlike",
@ -282,7 +282,7 @@ minetest.register_node("testnodes:plantlike_waving", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:plantlike_wallmounted", {
core.register_node("testnodes:plantlike_wallmounted", {
description = S("Wallmounted \"plantlike\" Drawtype Test Node").."\n"..
S("param2 = wallmounted rotation (0..7)"),
drawtype = "plantlike",
@ -300,7 +300,7 @@ minetest.register_node("testnodes:plantlike_wallmounted", {
-- param2 will rotate
local function rotate_on_rightclick(pos, node, clicker)
local def = minetest.registered_nodes[node.name]
local def = core.registered_nodes[node.name]
local aux1 = clicker:get_player_control().aux1
local deg, deg_max
@ -318,12 +318,12 @@ local function rotate_on_rightclick(pos, node, clicker)
deg = (deg + (aux1 and 10 or 1)) % deg_max
node.param2 = color * color_mult + deg
minetest.swap_node(pos, node)
minetest.chat_send_player(clicker:get_player_name(),
core.swap_node(pos, node)
core.chat_send_player(clicker:get_player_name(),
"Rotation is now " .. deg .. " / " .. deg_max)
end
minetest.register_node("testnodes:plantlike_degrotate", {
core.register_node("testnodes:plantlike_degrotate", {
description = S("Degrotate \"plantlike\" Drawtype Test Node").."\n"..
S("param2 = horizontal rotation (0..239)"),
drawtype = "plantlike",
@ -338,7 +338,7 @@ minetest.register_node("testnodes:plantlike_degrotate", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:mesh_degrotate", {
core.register_node("testnodes:mesh_degrotate", {
description = S("Degrotate \"mesh\" Drawtype Test Node").."\n"..
S("param2 = horizontal rotation (0..239)"),
drawtype = "mesh",
@ -353,7 +353,7 @@ minetest.register_node("testnodes:mesh_degrotate", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:mesh_colordegrotate", {
core.register_node("testnodes:mesh_colordegrotate", {
description = S("Colordegrotate \"mesh\" Drawtype Test Node").."\n"..
S("param2 = color + horizontal rotation (0..23, 32..55, ...)"),
drawtype = "mesh",
@ -371,7 +371,7 @@ minetest.register_node("testnodes:mesh_colordegrotate", {
})
-- param2 will change height
minetest.register_node("testnodes:plantlike_leveled", {
core.register_node("testnodes:plantlike_leveled", {
description = S("Leveled \"plantlike\" Drawtype Test Node").."\n"..
S("param2 = height (0..255)"),
drawtype = "plantlike",
@ -390,7 +390,7 @@ minetest.register_node("testnodes:plantlike_leveled", {
})
-- param2 changes shape
minetest.register_node("testnodes:plantlike_meshoptions", {
core.register_node("testnodes:plantlike_meshoptions", {
description = S("Meshoptions \"plantlike\" Drawtype Test Node").."\n"..
S("param2 = plant shape"),
drawtype = "plantlike",
@ -403,7 +403,7 @@ minetest.register_node("testnodes:plantlike_meshoptions", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:plantlike_rooted", {
core.register_node("testnodes:plantlike_rooted", {
description = S("\"rooted_plantlike\" Drawtype Test Node"),
drawtype = "plantlike_rooted",
paramtype = "light",
@ -413,7 +413,7 @@ minetest.register_node("testnodes:plantlike_rooted", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:plantlike_rooted_wallmounted", {
core.register_node("testnodes:plantlike_rooted_wallmounted", {
description = S("Wallmounted \"rooted_plantlike\" Drawtype Test Node").."\n"..
S("param2 = wallmounted rotation (0..7)"),
drawtype = "plantlike_rooted",
@ -428,7 +428,7 @@ minetest.register_node("testnodes:plantlike_rooted_wallmounted", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:plantlike_rooted_waving", {
core.register_node("testnodes:plantlike_rooted_waving", {
description = S("Waving \"rooted_plantlike\" Drawtype Test Node").."\n"..
S("Waves if waving plants are enabled by client"),
drawtype = "plantlike_rooted",
@ -445,7 +445,7 @@ minetest.register_node("testnodes:plantlike_rooted_waving", {
})
-- param2 changes height
minetest.register_node("testnodes:plantlike_rooted_leveled", {
core.register_node("testnodes:plantlike_rooted_leveled", {
description = S("Leveled \"rooted_plantlike\" Drawtype Test Node").."\n"..
S("param2 = height (0..255)"),
drawtype = "plantlike_rooted",
@ -467,7 +467,7 @@ minetest.register_node("testnodes:plantlike_rooted_leveled", {
})
-- param2 changes shape
minetest.register_node("testnodes:plantlike_rooted_meshoptions", {
core.register_node("testnodes:plantlike_rooted_meshoptions", {
description = S("Meshoptions \"rooted_plantlike\" Drawtype Test Node").."\n"..
S("param2 = plant shape"),
drawtype = "plantlike_rooted",
@ -486,7 +486,7 @@ minetest.register_node("testnodes:plantlike_rooted_meshoptions", {
})
-- param2 changes rotation
minetest.register_node("testnodes:plantlike_rooted_degrotate", {
core.register_node("testnodes:plantlike_rooted_degrotate", {
description = S("Degrotate \"rooted_plantlike\" Drawtype Test Node").."\n"..
S("param2 = horizontal rotation (0..239)"),
drawtype = "plantlike_rooted",
@ -508,7 +508,7 @@ minetest.register_node("testnodes:plantlike_rooted_degrotate", {
-- DRAWTYPE ONLY, NO LIQUID PHYSICS!
-- Liquid ranges 0 to 8
for r = 0, 8 do
minetest.register_node("testnodes:liquid_"..r, {
core.register_node("testnodes:liquid_"..r, {
description = S("\"liquid\" Drawtype Test Node, Range @1", r).."\n"..
S("Drawtype only; all liquid physics are disabled"),
drawtype = "liquid",
@ -530,7 +530,7 @@ for r = 0, 8 do
liquid_alternative_source = "testnodes:liquid_"..r,
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:liquid_flowing_"..r, {
core.register_node("testnodes:liquid_flowing_"..r, {
description = S("\"flowingliquid\" Drawtype Test Node, Range @1", r).."\n"..
S("Drawtype only; all liquid physics are disabled").."\n"..
S("param2 = flowing liquid level"),
@ -558,7 +558,7 @@ for r = 0, 8 do
end
-- Waving liquid test (drawtype only)
minetest.register_node("testnodes:liquid_waving", {
core.register_node("testnodes:liquid_waving", {
description = S("Waving \"liquid\" Drawtype Test Node").."\n"..
S("Drawtype only; all liquid physics are disabled").."\n"..
S("Waves if waving liquids are enabled by client"),
@ -582,7 +582,7 @@ minetest.register_node("testnodes:liquid_waving", {
liquid_alternative_source = "testnodes:liquid_waving",
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:liquid_flowing_waving", {
core.register_node("testnodes:liquid_flowing_waving", {
description = S("Waving \"flowingliquid\" Drawtype Test Node").."\n"..
S("Drawtype only; all liquid physics are disabled").."\n"..
S("param2 = flowing liquid level").."\n"..
@ -610,7 +610,7 @@ minetest.register_node("testnodes:liquid_flowing_waving", {
})
-- Invisible node
minetest.register_node("testnodes:airlike", {
core.register_node("testnodes:airlike", {
description = S("\"airlike\" Drawtype Test Node").."\n"..
S("Invisible node").."\n"..
S("Inventory/wield image = no_texture_airlike.png"),
@ -626,7 +626,7 @@ minetest.register_node("testnodes:airlike", {
})
-- param2 changes liquid height
minetest.register_node("testnodes:glassliquid", {
core.register_node("testnodes:glassliquid", {
description = S("\"glasslike_framed\" Drawtype with Liquid Test Node").."\n"..
S("param2 = liquid level (0..63)"),
drawtype = "glasslike_framed",
@ -661,14 +661,14 @@ for r=1, #rails do
local tt = rails[r][3]
local raillike_group
if id ~= "groupless" then
raillike_group = minetest.raillike_group(id)
raillike_group = core.raillike_group(id)
end
for c=1, #colors do
local color
if colors[c] ~= "" then
color = colors[c]
end
minetest.register_node("testnodes:raillike_"..id..c, {
core.register_node("testnodes:raillike_"..id..c, {
description = S("\"raillike\" Drawtype Test Node: @1 @2", id, c).."\n"..
tt,
drawtype = "raillike",
@ -693,7 +693,7 @@ end
-- Add visual_scale variants of previous nodes for half and double size
local scale = function(subname, append)
local original = "testnodes:"..subname
local def = table.copy(minetest.registered_items[original])
local def = table.copy(core.registered_items[original])
local orig_desc
if append and type(append) == "string" then
orig_desc = ItemStack(original):get_short_description()
@ -705,11 +705,11 @@ local scale = function(subname, append)
end
def.visual_scale = 2.0
def.description = S("Double-sized @1", orig_desc)
minetest.register_node("testnodes:"..subname.."_double", def)
def = table.copy(minetest.registered_items[original])
core.register_node("testnodes:"..subname.."_double", def)
def = table.copy(core.registered_items[original])
def.visual_scale = 0.5
def.description = S("Half-sized @1", orig_desc)
minetest.register_node("testnodes:"..subname.."_half", def)
core.register_node("testnodes:"..subname.."_half", def)
end
local allfaces_newsize_tt = ""..

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.."/drawtypes.lua")
dofile(path.."/meshes.lua")

View file

@ -1,10 +1,10 @@
-- Test Nodes: Light test
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- All possible light levels
for i=1, minetest.LIGHT_MAX do
minetest.register_node("testnodes:light"..string.format("%02d", i), {
for i=1, core.LIGHT_MAX do
core.register_node("testnodes:light"..string.format("%02d", i), {
description = S("Light Source (@1)", i),
paramtype = "light",
light_source = i,
@ -21,7 +21,7 @@ end
-- Lets light through, but not sunlight, leading to a
-- reduction in light level when light passes through
minetest.register_node("testnodes:sunlight_filter", {
core.register_node("testnodes:sunlight_filter", {
description = S("Sunlight Filter") .."\n"..
S("Lets light through, but weakens sunlight"),
paramtype = "light",
@ -35,7 +35,7 @@ minetest.register_node("testnodes:sunlight_filter", {
})
-- Lets light and sunlight through without obstruction
minetest.register_node("testnodes:sunlight_propagator", {
core.register_node("testnodes:sunlight_propagator", {
description = S("Sunlight Propagator") .."\n"..
S("Lets all light through"),
paramtype = "light",

View file

@ -7,7 +7,7 @@ for d=0, 8 do
else
tt_normal = "\n".."Swimmable, spreading, renewable liquid"
end
minetest.register_node("testnodes:rliquid_"..d, {
core.register_node("testnodes:rliquid_"..d, {
description = "Test Liquid Source, Range "..d..
tt_normal .. "\n" .. "(falling & floating node)",
drawtype = "liquid",
@ -29,7 +29,7 @@ for d=0, 8 do
groups = {float = 1, falling_node = 1},
})
minetest.register_node("testnodes:rliquid_flowing_"..d, {
core.register_node("testnodes:rliquid_flowing_"..d, {
description = "Flowing Test Liquid, Range "..d..
tt_normal,
drawtype = "flowingliquid",
@ -58,7 +58,7 @@ for d=0, 8 do
end
local mod = "^[colorize:#000000:127"
minetest.register_node("testnodes:vliquid_"..d, {
core.register_node("testnodes:vliquid_"..d, {
description = "Test Liquid Source, Viscosity/Resistance "..d.."\n"..
"Swimmable, spreading, renewable liquid"..
tt_reduced,
@ -79,7 +79,7 @@ for d=0, 8 do
liquid_viscosity = d,
})
minetest.register_node("testnodes:vliquid_flowing_"..d, {
core.register_node("testnodes:vliquid_flowing_"..d, {
description = "Flowing Test Liquid, Viscosity/Resistance "..d.."\n"..
"Swimmable, spreading, renewable liquid"..
tt_reduced,
@ -103,7 +103,7 @@ for d=0, 8 do
mod = "^[colorize:#000000:192"
local v = 4
minetest.register_node("testnodes:vrliquid_"..d, {
core.register_node("testnodes:vrliquid_"..d, {
description = "Test Liquid Source, Viscosity "..v..", Resistance "..d.."\n"..
"Swimmable, spreading, renewable liquid"..
tt_reduced,
@ -127,7 +127,7 @@ for d=0, 8 do
move_resistance = d,
})
minetest.register_node("testnodes:vrliquid_flowing_"..d, {
core.register_node("testnodes:vrliquid_flowing_"..d, {
description = "Flowing Test Liquid, Viscosity "..v..", Resistance "..d.."\n"..
"Swimmable, spreading, renewable liquid"..
tt_reduced,

View file

@ -1,6 +1,6 @@
-- Meshes
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
local ocorner_cbox = {
type = "fixed",
@ -23,7 +23,7 @@ local tall_pyr_cbox = {
}
-- Normal mesh
minetest.register_node("testnodes:mesh", {
core.register_node("testnodes:mesh", {
description = S("Mesh Test Node"),
drawtype = "mesh",
mesh = "testnodes_pyramid.obj",
@ -35,7 +35,7 @@ minetest.register_node("testnodes:mesh", {
})
-- Facedir mesh: outer corner slope
minetest.register_node("testnodes:mesh_facedir", {
core.register_node("testnodes:mesh_facedir", {
description = S("Facedir Mesh Test Node").."\n"..
S("param2 = facedir rotation (0..23)"),
drawtype = "mesh",
@ -48,7 +48,7 @@ minetest.register_node("testnodes:mesh_facedir", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:mesh_colorfacedir", {
core.register_node("testnodes:mesh_colorfacedir", {
description = S("Color Facedir Mesh Test Node").."\n"..
S("param2 = color + facedir rotation (0..23, 32..55, ...)"),
drawtype = "mesh",
@ -62,7 +62,7 @@ minetest.register_node("testnodes:mesh_colorfacedir", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:mesh_4dir", {
core.register_node("testnodes:mesh_4dir", {
description = S("4dir Mesh Test Node").."\n"..
S("param2 = 4dir rotation (0..3)"),
drawtype = "mesh",
@ -75,7 +75,7 @@ minetest.register_node("testnodes:mesh_4dir", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:mesh_color4dir", {
core.register_node("testnodes:mesh_color4dir", {
description = S("Color 4dir Mesh Test Node").."\n"..
S("param2 = color + 4dir rotation (0..255)"),
drawtype = "mesh",
@ -90,7 +90,7 @@ minetest.register_node("testnodes:mesh_color4dir", {
})
-- Wallmounted mesh: pyramid
minetest.register_node("testnodes:mesh_wallmounted", {
core.register_node("testnodes:mesh_wallmounted", {
description = S("Wallmounted Mesh Test Node").."\n"..
S("param2 = wallmounted rotation (0..7)"),
drawtype = "mesh",
@ -103,7 +103,7 @@ minetest.register_node("testnodes:mesh_wallmounted", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:mesh_colorwallmounted", {
core.register_node("testnodes:mesh_colorwallmounted", {
description = S("Color Wallmounted Mesh Test Node").."\n"..
S("param2 = color + wallmounted rotation (0..7, 8..15, ...)"),
drawtype = "mesh",
@ -118,7 +118,7 @@ minetest.register_node("testnodes:mesh_colorwallmounted", {
})
minetest.register_node("testnodes:mesh_double", {
core.register_node("testnodes:mesh_double", {
description = S("Double-sized Mesh Test Node"),
drawtype = "mesh",
mesh = "testnodes_pyramid.obj",
@ -129,7 +129,7 @@ minetest.register_node("testnodes:mesh_double", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:mesh_half", {
core.register_node("testnodes:mesh_half", {
description = S("Half-sized Mesh Test Node"),
drawtype = "mesh",
mesh = "testnodes_pyramid.obj",
@ -141,7 +141,7 @@ minetest.register_node("testnodes:mesh_half", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:mesh_waving1", {
core.register_node("testnodes:mesh_waving1", {
description = S("Plantlike-waving Mesh Test Node").."\n"..
S("Waves if waving plants are enabled by client"),
drawtype = "mesh",
@ -153,7 +153,7 @@ minetest.register_node("testnodes:mesh_waving1", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:mesh_waving2", {
core.register_node("testnodes:mesh_waving2", {
description = S("Leaflike-waving Mesh Test Node").."\n"..
S("Waves if waving leaves are enabled by client"),
drawtype = "mesh",
@ -165,7 +165,7 @@ minetest.register_node("testnodes:mesh_waving2", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:mesh_waving3", {
core.register_node("testnodes:mesh_waving3", {
description = S("Liquidlike-waving Mesh Test Node").."\n"..
S("Waves if waving liquids are enabled by client"),
drawtype = "mesh",

View file

@ -1,9 +1,9 @@
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- Nodebox examples and tests.
-- An simple example nodebox with one centered box
minetest.register_node("testnodes:nodebox_fixed", {
core.register_node("testnodes:nodebox_fixed", {
description = S("Fixed Nodebox Test Node").."\n"..
S("Nodebox is always the same"),
tiles = {"testnodes_nodebox.png"},
@ -18,7 +18,7 @@ minetest.register_node("testnodes:nodebox_fixed", {
})
-- 50% higher than a regular node
minetest.register_node("testnodes:nodebox_overhigh", {
core.register_node("testnodes:nodebox_overhigh", {
description = S("+50% high Nodebox Test Node"),
tiles = {"testnodes_nodebox.png"},
drawtype = "nodebox",
@ -32,7 +32,7 @@ minetest.register_node("testnodes:nodebox_overhigh", {
})
-- 95% higher than a regular node
minetest.register_node("testnodes:nodebox_overhigh2", {
core.register_node("testnodes:nodebox_overhigh2", {
description = S("+95% high Nodebox Test Node"),
tiles = {"testnodes_nodebox.png"},
drawtype = "nodebox",
@ -47,7 +47,7 @@ minetest.register_node("testnodes:nodebox_overhigh2", {
})
-- Height of nodebox changes with its param2 value
minetest.register_node("testnodes:nodebox_leveled", {
core.register_node("testnodes:nodebox_leveled", {
description = S("Leveled Nodebox Test Node").."\n"..
S("param2 = height (0..127)"),
tiles = {"testnodes_nodebox.png^[colorize:#0F0:32"},
@ -93,7 +93,7 @@ local nodebox_wall_thick = {
}
-- Wall-like nodebox that connects to 4 neighbors
minetest.register_node("testnodes:nodebox_connected", {
core.register_node("testnodes:nodebox_connected", {
description = S("Connected Nodebox Test Node (4 Side Wall)").."\n"..
S("Connects to 4 neighbors sideways"),
tiles = {"testnodes_nodebox.png^[colorize:#F00:32"},
@ -106,7 +106,7 @@ minetest.register_node("testnodes:nodebox_connected", {
})
-- Cable-like nodebox that connects to 6 neighbors
minetest.register_node("testnodes:nodebox_connected_6side", {
core.register_node("testnodes:nodebox_connected_6side", {
description = S("Connected Nodebox Test Node (6 Side Cable)").."\n"..
S("Connects to 6 neighbors"),
tiles = {"testnodes_nodebox.png^[colorize:#F00:32"},
@ -119,7 +119,7 @@ minetest.register_node("testnodes:nodebox_connected_6side", {
})
-- More walls
minetest.register_node("testnodes:nodebox_connected_facedir", {
core.register_node("testnodes:nodebox_connected_facedir", {
description = S("Facedir Connected Nodebox Test Node (4 Side Wall)").."\n"..
S("Connects to neighbors").."\n"..
S("param2 = facedir rotation of textures (not of the nodebox!)"),
@ -140,7 +140,7 @@ minetest.register_node("testnodes:nodebox_connected_facedir", {
node_box = nodebox_wall_thick,
})
minetest.register_node("testnodes:nodebox_connected_4dir", {
core.register_node("testnodes:nodebox_connected_4dir", {
description = S("4Dir Connected Nodebox Test Node").."\n"..
S("Connects to neighbors").."\n"..
S("param2 = 4dir rotation of textures (not of the nodebox!)"),
@ -162,7 +162,7 @@ minetest.register_node("testnodes:nodebox_connected_4dir", {
})
-- Doesn't connect, but lets other nodes connect
minetest.register_node("testnodes:facedir_to_connect_to", {
core.register_node("testnodes:facedir_to_connect_to", {
description = S("Facedir Node that connected Nodeboxes connect to").."\n"..
S("Neighbors connect only to left (blue 4) and top (yellow 1) face").."\n"..
S("(Currently broken for param2 >= 4, see FIXME in nodedef.cpp)").."\n"..
@ -184,7 +184,7 @@ minetest.register_node("testnodes:facedir_to_connect_to", {
-- 3D sign and button:
-- These are example nodes for more realistic example uses
-- of wallmounted_rotate_vertical
minetest.register_node("testnodes:sign3d", {
core.register_node("testnodes:sign3d", {
description = S("Nodebox Sign, Nodebox Type \"fixed\""),
drawtype = "nodebox",
paramtype = "light",
@ -202,7 +202,7 @@ minetest.register_node("testnodes:sign3d", {
},
})
minetest.register_node("testnodes:sign3d_wallmounted", {
core.register_node("testnodes:sign3d_wallmounted", {
description = S("Nodebox Sign, Nodebox Type \"wallmounted\""),
drawtype = "nodebox",
paramtype = "light",
@ -222,7 +222,7 @@ minetest.register_node("testnodes:sign3d_wallmounted", {
},
})
minetest.register_node("testnodes:button", {
core.register_node("testnodes:button", {
description = S("Button Nodebox Test Node"),
drawtype = "nodebox",
paramtype = "light",

View file

@ -1,13 +1,13 @@
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
minetest.register_node("testnodes:overlay", {
core.register_node("testnodes:overlay", {
description = S("Texture Overlay Test Node") .. "\n" ..
S("Uncolorized"),
tiles = {{name = "testnodes_overlayable.png"}},
overlay_tiles = {{name = "testnodes_overlay.png"}},
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:overlay_color_all", {
core.register_node("testnodes:overlay_color_all", {
description = S("Texture Overlay Test Node, Colorized") .. "\n" ..
S("param2 changes color"),
tiles = {{name = "testnodes_overlayable.png"}},
@ -18,7 +18,7 @@ minetest.register_node("testnodes:overlay_color_all", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:overlay_color_overlay", {
core.register_node("testnodes:overlay_color_overlay", {
description = S("Texture Overlay Test Node, Colorized Overlay") .. "\n" ..
S("param2 changes color of overlay"),
tiles = {{name = "testnodes_overlayable.png", color="white"}},
@ -29,7 +29,7 @@ minetest.register_node("testnodes:overlay_color_overlay", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:overlay_color_overlayed", {
core.register_node("testnodes:overlay_color_overlayed", {
description = S("Texture Overlay Test Node, Colorized Base") .. "\n" ..
S("param2 changes color of base texture"),
tiles = {{name = "testnodes_overlayable.png"}},
@ -42,7 +42,7 @@ minetest.register_node("testnodes:overlay_color_overlayed", {
})
local global_overlay_color = "#FF2000"
minetest.register_node("testnodes:overlay_global", {
core.register_node("testnodes:overlay_global", {
description = S("Texture Overlay Test Node, Global Color") .. "\n" ..
S("Global color = @1", global_overlay_color),
tiles = {{name = "testnodes_overlayable.png"}},
@ -52,7 +52,7 @@ minetest.register_node("testnodes:overlay_global", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:overlay_global_color_all", {
core.register_node("testnodes:overlay_global_color_all", {
description = S("Texture Overlay Test Node, Global Color + Colorized") .. "\n" ..
S("Global color = @1", global_overlay_color) .. "\n" ..
S("param2 changes color"),
@ -65,7 +65,7 @@ minetest.register_node("testnodes:overlay_global_color_all", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:overlay_global_color_overlay", {
core.register_node("testnodes:overlay_global_color_overlay", {
description = S("Texture Overlay Test Node, Global Color + Colorized Overlay") .. "\n" ..
S("Global color = @1", global_overlay_color) .. "\n" ..
S("param2 changes color of overlay"),
@ -78,7 +78,7 @@ minetest.register_node("testnodes:overlay_global_color_overlay", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:overlay_global_color_overlayed", {
core.register_node("testnodes:overlay_global_color_overlayed", {
description = S("Texture Overlay Test Node, Global Color + Colorized Base") .. "\n" ..
S("Global color = @1", global_overlay_color) .. "\n" ..
S("param2 changes color of base texture"),

View file

@ -1,8 +1,8 @@
-- This file is for misc. param2 tests that aren't covered in drawtypes.lua already.
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
minetest.register_node("testnodes:facedir", {
core.register_node("testnodes:facedir", {
description = S("Facedir Test Node").."\n"..
S("param2 = facedir rotation (0..23)"),
paramtype2 = "facedir",
@ -18,7 +18,7 @@ minetest.register_node("testnodes:facedir", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:4dir", {
core.register_node("testnodes:4dir", {
description = S("4dir Test Node").."\n"..
S("param2 = 4dir rotation (0..3)"),
paramtype2 = "4dir",
@ -34,7 +34,7 @@ minetest.register_node("testnodes:4dir", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:facedir_nodebox", {
core.register_node("testnodes:facedir_nodebox", {
description = S("Facedir Nodebox Test Node").."\n"..
S("param2 = facedir rotation (0..23)"),
tiles = {
@ -56,7 +56,7 @@ minetest.register_node("testnodes:facedir_nodebox", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:4dir_nodebox", {
core.register_node("testnodes:4dir_nodebox", {
description = S("4dir Nodebox Test Node").."\n"..
S("param2 = 4dir rotation (0..3)"),
tiles = {
@ -78,7 +78,7 @@ minetest.register_node("testnodes:4dir_nodebox", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:4dir_nodebox_stair", {
core.register_node("testnodes:4dir_nodebox_stair", {
description = S("4dir Nodebox Stair Test Node").."\n"..
S("param2 = 4dir rotation (0..3)"),
tiles = {
@ -104,7 +104,7 @@ minetest.register_node("testnodes:4dir_nodebox_stair", {
})
minetest.register_node("testnodes:wallmounted", {
core.register_node("testnodes:wallmounted", {
description = S("Wallmounted Test Node").."\n"..
S("param2 = wallmounted rotation (0..7)"),
paramtype2 = "wallmounted",
@ -120,7 +120,7 @@ minetest.register_node("testnodes:wallmounted", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:wallmounted_rot", {
core.register_node("testnodes:wallmounted_rot", {
description = S("Wallmounted Rotatable Test Node"),
paramtype2 = "wallmounted",
wallmounted_rotate_vertical = true,
@ -136,7 +136,7 @@ minetest.register_node("testnodes:wallmounted_rot", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:wallmounted_nodebox", {
core.register_node("testnodes:wallmounted_nodebox", {
description = S("Wallmounted Nodebox Test Node").."\n"..
S("param2 = wallmounted rotation (0..7)"),
paramtype2 = "wallmounted",
@ -160,7 +160,7 @@ minetest.register_node("testnodes:wallmounted_nodebox", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:wallmounted_nodebox_rot", {
core.register_node("testnodes:wallmounted_nodebox_rot", {
description = S("Wallmounted Rotatable Nodebox Test Node"),
paramtype2 = "wallmounted",
wallmounted_rotate_vertical = true,
@ -184,7 +184,7 @@ minetest.register_node("testnodes:wallmounted_nodebox_rot", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:color", {
core.register_node("testnodes:color", {
description = S("Color Test Node").."\n"..
S("param2 = color (0..255)"),
paramtype2 = "color",
@ -196,7 +196,7 @@ minetest.register_node("testnodes:color", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:colorfacedir", {
core.register_node("testnodes:colorfacedir", {
description = S("Color Facedir Test Node").."\n"..
S("param2 = color + facedir rotation (0..23, 32..55, ...)"),
paramtype2 = "colorfacedir",
@ -213,7 +213,7 @@ minetest.register_node("testnodes:colorfacedir", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:colorfacedir_nodebox", {
core.register_node("testnodes:colorfacedir_nodebox", {
description = S("Color Facedir Nodebox Test Node").."\n"..
S("param2 = color + facedir rotation (0..23, 32..55, ...)"),
tiles = {
@ -236,7 +236,7 @@ minetest.register_node("testnodes:colorfacedir_nodebox", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:color4dir", {
core.register_node("testnodes:color4dir", {
description = S("Color 4dir Test Node").."\n"..
S("param2 = color + 4dir rotation (0..255)"),
paramtype2 = "color4dir",
@ -253,7 +253,7 @@ minetest.register_node("testnodes:color4dir", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:color4dir_nodebox", {
core.register_node("testnodes:color4dir_nodebox", {
description = S("Color 4dir Nodebox Test Node").."\n"..
S("param2 = color + 4dir rotation (0..255)"),
tiles = {
@ -276,7 +276,7 @@ minetest.register_node("testnodes:color4dir_nodebox", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:colorwallmounted", {
core.register_node("testnodes:colorwallmounted", {
description = S("Color Wallmounted Test Node").."\n"..
S("param2 = color + wallmounted rotation (0..7, 8..15, ...)"),
paramtype2 = "colorwallmounted",
@ -294,7 +294,7 @@ minetest.register_node("testnodes:colorwallmounted", {
groups = { dig_immediate = 3 },
})
minetest.register_node("testnodes:colorwallmounted_nodebox", {
core.register_node("testnodes:colorwallmounted_nodebox", {
description = S("Color Wallmounted Nodebox Test Node").."\n"..
S("param2 = color + wallmounted rotation (0..7, 8..15, ...)"),
paramtype2 = "colorwallmounted",

View file

@ -1,9 +1,9 @@
-- Performance test mesh nodes
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- Complex mesh
minetest.register_node("testnodes:performance_mesh_clip", {
core.register_node("testnodes:performance_mesh_clip", {
description = S("Performance Test Node") .. "\n" .. S("Marble with 'clip' transparency"),
drawtype = "mesh",
mesh = "testnodes_marble_glass.obj",
@ -15,7 +15,7 @@ minetest.register_node("testnodes:performance_mesh_clip", {
})
-- Complex mesh, alpha blending
minetest.register_node("testnodes:performance_mesh_blend", {
core.register_node("testnodes:performance_mesh_blend", {
description = S("Performance Test Node") .. "\n" .. S("Marble with 'blend' transparency"),
drawtype = "mesh",
mesh = "testnodes_marble_glass.obj",
@ -27,7 +27,7 @@ minetest.register_node("testnodes:performance_mesh_blend", {
})
-- Overlay
minetest.register_node("testnodes:performance_overlay_clip", {
core.register_node("testnodes:performance_overlay_clip", {
description = S("Performance Test Node") .. "\n" .. S("Marble with overlay with 'clip' transparency") .. "\n" .. S("Palette for demonstration"),
drawtype = "mesh",
mesh = "testnodes_marble_metal.obj",
@ -43,7 +43,7 @@ minetest.register_node("testnodes:performance_overlay_clip", {
})
-- Overlay
minetest.register_node("testnodes:performance_overlay_blend", {
core.register_node("testnodes:performance_overlay_blend", {
description = S("Performance Test Node") .. "\n" .. S("Marble with overlay with 'blend' transparency") .. "\n" .. S("Palette for demonstration"),
drawtype = "mesh",
mesh = "testnodes_marble_metal.obj",

View file

@ -1,9 +1,9 @@
-- Test Nodes: Node property tests
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
-- Is supposed to fall when it doesn't rest on solid ground
minetest.register_node("testnodes:falling", {
core.register_node("testnodes:falling", {
description = S("Falling Node").."\n"..
S("Falls down if no node below"),
tiles = {
@ -14,7 +14,7 @@ minetest.register_node("testnodes:falling", {
groups = { falling_node = 1, dig_immediate = 3 },
})
minetest.register_node("testnodes:falling_facedir", {
core.register_node("testnodes:falling_facedir", {
description = S("Falling Facedir Node").."\n"..
S("Falls down if no node below").."\n"..
S("param2 = facedir rotation"),
@ -31,7 +31,7 @@ minetest.register_node("testnodes:falling_facedir", {
})
-- Same as falling node, but will stop falling on top of liquids
minetest.register_node("testnodes:falling_float", {
core.register_node("testnodes:falling_float", {
description = S("Falling+Floating Node").."\n"..
S("Falls down if no node below, floats on liquids (liquidtype ~= \"none\")"),
groups = { falling_node = 1, float = 1, dig_immediate = 3 },
@ -47,7 +47,7 @@ minetest.register_node("testnodes:falling_float", {
-- This node attaches to the floor and drops as item
-- when the floor is gone.
minetest.register_node("testnodes:attached", {
core.register_node("testnodes:attached", {
description = S("Floor-Attached Node").."\n"..
S("Drops as item if no solid node below"),
tiles = {
@ -59,7 +59,7 @@ minetest.register_node("testnodes:attached", {
})
-- This node attaches to the side of a node and drops as item
-- when the node it attaches to is gone.
minetest.register_node("testnodes:attached_wallmounted", {
core.register_node("testnodes:attached_wallmounted", {
description = S("Wallmounted Attached Node").."\n"..
S("Attaches to solid node it was placed on; drops as item if neighbor node is gone").."\n"..
S("param2 = wallmounted rotation (0..7)"),
@ -75,7 +75,7 @@ minetest.register_node("testnodes:attached_wallmounted", {
-- This node attaches to the side of a node and drops as item
-- when the node it attaches to is gone.
-- Also adds vertical 90° rotation variants.
minetest.register_node("testnodes:attached_wallmounted_rot", {
core.register_node("testnodes:attached_wallmounted_rot", {
description = S("Rotatable Wallmounted Attached Node").."\n"..
S("Attaches to solid node it was placed on; drops as item if neighbor node is gone").."\n"..
S("param2 = wallmounted rotation (0..7)").."\n"..
@ -91,7 +91,7 @@ minetest.register_node("testnodes:attached_wallmounted_rot", {
})
-- Wallmounted node that always attaches to the floor
minetest.register_node("testnodes:attached_wallmounted_floor", {
core.register_node("testnodes:attached_wallmounted_floor", {
description = S("Floor-Attached Wallmounted Node").."\n"..
S("Drops as item if no solid node below (regardless of rotation)").."\n"..
S("param2 = wallmounted rotation (visual only) (0..7)"),
@ -107,7 +107,7 @@ minetest.register_node("testnodes:attached_wallmounted_floor", {
-- Wallmounted node that always attaches to the floor.
-- Also adds 90° rotation variants.
minetest.register_node("testnodes:attached_wallmounted_floor_rot", {
core.register_node("testnodes:attached_wallmounted_floor_rot", {
description = S("Rotatable Floor-Attached Wallmounted Node").."\n"..
S("Drops as item if no solid node below (regardless of rotation)").."\n"..
S("param2 = wallmounted rotation (visual only) (0..7)").."\n"..
@ -124,7 +124,7 @@ minetest.register_node("testnodes:attached_wallmounted_floor_rot", {
-- This node attaches to the ceiling and drops as item
-- when the ceiling is gone.
minetest.register_node("testnodes:attached_top", {
core.register_node("testnodes:attached_top", {
description = S("Ceiling-Attached Node").."\n"..
S("Drops as item if no solid node above"),
tiles = {
@ -136,7 +136,7 @@ minetest.register_node("testnodes:attached_top", {
})
-- Same as wallmounted attached, but for facedir
minetest.register_node("testnodes:attached_facedir", {
core.register_node("testnodes:attached_facedir", {
description = S("Facedir Attached Node").."\n"..
S("Attaches to a neighboring solid node; drops as item if that node is gone").."\n"..
S("param2 = facedir rotation (0..23)"),
@ -153,7 +153,7 @@ minetest.register_node("testnodes:attached_facedir", {
})
-- Same as facedir attached, but for 4dir
minetest.register_node("testnodes:attached_4dir", {
core.register_node("testnodes:attached_4dir", {
description = S("4dir Attached Node").."\n"..
S("Attaches to the side of a solid node; drops as item if that node is gone").."\n"..
S("param2 = 4dir rotation (0..3)"),
@ -170,7 +170,7 @@ minetest.register_node("testnodes:attached_4dir", {
})
-- Jump disabled
minetest.register_node("testnodes:nojump", {
core.register_node("testnodes:nojump", {
description = S("Non-jumping Node").."\n"..
S("You can't jump on it"),
groups = {disable_jump=1, dig_immediate=3},
@ -178,7 +178,7 @@ minetest.register_node("testnodes:nojump", {
})
-- Jump disabled plant
minetest.register_node("testnodes:nojump_walkable", {
core.register_node("testnodes:nojump_walkable", {
description = S("Non-jumping Plant Node").."\n"..
S("You can't jump while your feet are in it"),
drawtype = "plantlike",
@ -192,7 +192,7 @@ local climbable_nodebox = {
}
-- Climbable up and down with jump and sneak keys
minetest.register_node("testnodes:climbable", {
core.register_node("testnodes:climbable", {
description = S("Climbable Node").."\n"..
S("You can climb up and down"),
climbable = true,
@ -210,7 +210,7 @@ minetest.register_node("testnodes:climbable", {
})
-- Climbable only downwards with sneak key
minetest.register_node("testnodes:climbable_nojump", {
core.register_node("testnodes:climbable_nojump", {
description = S("Downwards-climbable Node").."\n"..
S("You can climb only downwards"),
climbable = true,
@ -226,7 +226,7 @@ minetest.register_node("testnodes:climbable_nojump", {
})
minetest.register_node("testnodes:climbable_nodescend", {
core.register_node("testnodes:climbable_nodescend", {
description = S("Upwards-climbable Node"),
climbable = true,
walkable = false,
@ -240,7 +240,7 @@ minetest.register_node("testnodes:climbable_nodescend", {
sunlight_propagates = true,
})
minetest.register_node("testnodes:climbable_nodescend_nojump", {
core.register_node("testnodes:climbable_nodescend_nojump", {
description = S("Horizontal-only Climbable Node"),
climbable = true,
walkable = false,
@ -255,7 +255,7 @@ minetest.register_node("testnodes:climbable_nodescend_nojump", {
})
-- A liquid in which you can't rise
minetest.register_node("testnodes:liquid_nojump", {
core.register_node("testnodes:liquid_nojump", {
description = S("Non-jumping Liquid Source Node").."\n"..
S("Swimmable liquid, but you can't swim upwards"),
liquidtype = "source",
@ -282,7 +282,7 @@ minetest.register_node("testnodes:liquid_nojump", {
})
-- A liquid in which you can't rise (flowing variant)
minetest.register_node("testnodes:liquidflowing_nojump", {
core.register_node("testnodes:liquidflowing_nojump", {
description = S("Non-jumping Flowing Liquid Node").."\n"..
S("Swimmable liquid, but you can't swim upwards"),
liquidtype = "flowing",
@ -311,7 +311,7 @@ minetest.register_node("testnodes:liquidflowing_nojump", {
})
-- A liquid which doesn't have liquid movement physics (source variant)
minetest.register_node("testnodes:liquid_noswim", {
core.register_node("testnodes:liquid_noswim", {
description = S("No-swim Liquid Source Node").."\n"..
S("Liquid node, but swimming is disabled"),
liquidtype = "source",
@ -340,7 +340,7 @@ minetest.register_node("testnodes:liquid_noswim", {
})
-- A liquid which doen't have liquid movement physics (flowing variant)
minetest.register_node("testnodes:liquidflowing_noswim", {
core.register_node("testnodes:liquidflowing_noswim", {
description = S("No-swim Flowing Liquid Node").."\n"..
S("Liquid node, but swimming is disabled"),
liquidtype = "flowing",
@ -372,7 +372,7 @@ minetest.register_node("testnodes:liquidflowing_noswim", {
-- A liquid in which you can't actively descend.
-- Note: You'll still descend slowly by doing nothing.
minetest.register_node("testnodes:liquid_nodescend", {
core.register_node("testnodes:liquid_nodescend", {
description = S("No-descending Liquid Source Node"),
liquidtype = "source",
liquid_range = 0,
@ -398,7 +398,7 @@ minetest.register_node("testnodes:liquid_nodescend", {
})
-- A liquid in which you can't actively descend (flowing variant)
minetest.register_node("testnodes:liquidflowing_nodescend", {
core.register_node("testnodes:liquidflowing_nodescend", {
description = S("No-descending Flowing Liquid Node"),
liquidtype = "flowing",
liquid_range = 1,
@ -452,7 +452,7 @@ for i=-100, 100, 25 do
end
desc = S("Fall Damage Node (-@1%)", math.abs(i))
end
minetest.register_node("testnodes:damage"..subname, {
core.register_node("testnodes:damage"..subname, {
description = desc,
groups = {fall_damage_add_percent=i, dig_immediate=3},
@ -483,7 +483,7 @@ for i=-MAX_BOUNCE_NONJUMPY, MAX_BOUNCE_JUMPY, 20 do
color = { r=val2, g=255, b=val2, a=255 }
num = "NEG"..num
end
minetest.register_node("testnodes:bouncy"..num, {
core.register_node("testnodes:bouncy"..num, {
description = desc,
groups = {bouncy=i, dig_immediate=3},
@ -497,7 +497,7 @@ end
-- Slippery nodes (various slippery levels)
for i=1, 5 do
minetest.register_node("testnodes:slippery"..i, {
core.register_node("testnodes:slippery"..i, {
description = S("Slippery Node (@1)", i),
tiles ={"testnodes_slippery.png"},
is_ground_content = false,
@ -509,7 +509,7 @@ end
-- Move resistance nodes (various resistance levels)
for r=0, 7 do
if r > 0 then
minetest.register_node("testnodes:move_resistance"..r, {
core.register_node("testnodes:move_resistance"..r, {
description = S("Move-resistant Node (@1)", r).."\n"..
S("Reduces movement speed"),
walkable = false,
@ -537,7 +537,7 @@ for r=0, 7 do
end
minetest.register_node("testnodes:move_resistance_liquidlike"..r, {
core.register_node("testnodes:move_resistance_liquidlike"..r, {
description = mdesc,
walkable = false,
move_resistance = r,
@ -553,7 +553,7 @@ for r=0, 7 do
})
end
minetest.register_node("testnodes:climbable_move_resistance_4", {
core.register_node("testnodes:climbable_move_resistance_4", {
description = S("Climbable Move-resistant Node (4)").."\n"..
S("You can climb up and down; reduced movement speed"),
walkable = false,
@ -570,7 +570,7 @@ minetest.register_node("testnodes:climbable_move_resistance_4", {
})
-- By placing something on the node, the node itself will be replaced
minetest.register_node("testnodes:buildable_to", {
core.register_node("testnodes:buildable_to", {
description = S("\"buildable_to\" Node").."\n"..
S("Placing a node on it will replace it"),
buildable_to = true,
@ -598,7 +598,7 @@ for d=-3,3 do
elseif math.abs(d) == 3 then
tile = tile .. "^[colorize:#000000:140"
end
minetest.register_node("testnodes:damage_"..sub, {
core.register_node("testnodes:damage_"..sub, {
description = desc,
damage_per_second = d,
@ -615,7 +615,7 @@ for d=-3,3 do
end
-- Causes drowning damage
minetest.register_node("testnodes:drowning_1", {
core.register_node("testnodes:drowning_1", {
description = S("Drowning Node (@1 damage)", 1).."\n"..
S("You'll drown inside it"),
drowning = 1,
@ -632,7 +632,7 @@ minetest.register_node("testnodes:drowning_1", {
-- post_effect_color_shaded
minetest.register_node("testnodes:post_effect_color_shaded_false", {
core.register_node("testnodes:post_effect_color_shaded_false", {
description = S("\"post_effect_color_shaded = false\" Node"),
drawtype = "allfaces",
@ -648,7 +648,7 @@ minetest.register_node("testnodes:post_effect_color_shaded_false", {
groups = {dig_immediate=3},
})
minetest.register_node("testnodes:post_effect_color_shaded_true", {
core.register_node("testnodes:post_effect_color_shaded_true", {
description = S("\"post_effect_color_shaded = true\" Node"),
drawtype = "allfaces",
@ -669,7 +669,7 @@ minetest.register_node("testnodes:post_effect_color_shaded_true", {
-- Register wrapper for compactness
local function register_pointable_test_node(name, description, pointable)
local texture = "testnodes_"..name..".png"
minetest.register_node("testnodes:"..name, {
core.register_node("testnodes:"..name, {
description = S(description),
tiles = {texture},
drawtype = "glasslike_framed",

View file

@ -1,8 +1,8 @@
-- Node texture tests
local S = minetest.get_translator("testnodes")
local S = core.get_translator("testnodes")
minetest.register_node("testnodes:6sides", {
core.register_node("testnodes:6sides", {
description = S("Six Textures Test Node").."\n"..
S("Has 1 texture per face"),
tiles = {
@ -17,7 +17,7 @@ minetest.register_node("testnodes:6sides", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:anim", {
core.register_node("testnodes:anim", {
description = S("Animated Test Node").."\n"..
S("Tiles animate from A to D in 4s cycle"),
tiles = {
@ -33,7 +33,7 @@ minetest.register_node("testnodes:anim", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:fill_positioning", {
core.register_node("testnodes:fill_positioning", {
description = S("Fill Modifier Test Node") .. "\n" ..
S("The node should have the same look as " ..
"testnodes:fill_positioning_reference."),
@ -44,7 +44,7 @@ minetest.register_node("testnodes:fill_positioning", {
groups = {dig_immediate = 3},
})
minetest.register_node("testnodes:fill_positioning_reference", {
core.register_node("testnodes:fill_positioning_reference", {
description = S("Fill Modifier Test Node Reference"),
drawtype = "glasslike",
paramtype = "light",
@ -52,7 +52,7 @@ minetest.register_node("testnodes:fill_positioning_reference", {
groups = {dig_immediate = 3},
})
minetest.register_node("testnodes:modifier_mask", {
core.register_node("testnodes:modifier_mask", {
description = S("[mask Modifier Test Node"),
tiles = {"testnodes_128x128_rgb.png^[mask:testnodes_mask_WRGBKW.png"},
groups = {dig_immediate = 3},
@ -66,7 +66,7 @@ for a=1,#alphas do
local alpha = alphas[a]
-- Transparency taken from texture
minetest.register_node("testnodes:alpha_texture_"..alpha, {
core.register_node("testnodes:alpha_texture_"..alpha, {
description = S("Texture Alpha Test Node (@1)", alpha).."\n"..
S("Semi-transparent"),
drawtype = "glasslike",
@ -80,7 +80,7 @@ for a=1,#alphas do
})
-- Transparency set via texture modifier
minetest.register_node("testnodes:alpha_"..alpha, {
core.register_node("testnodes:alpha_"..alpha, {
description = S("Alpha Test Node (@1)", alpha).."\n"..
S("Semi-transparent"),
drawtype = "glasslike",
@ -94,7 +94,7 @@ for a=1,#alphas do
})
end
minetest.register_node("testnodes:alpha_compositing", {
core.register_node("testnodes:alpha_compositing", {
description = S("Texture Overlay Test Node") .. "\n" ..
S("A regular grid should be visible where each cell contains two " ..
"texels with the same color.") .. "\n" ..
@ -204,23 +204,23 @@ core.dynamic_add_media({
filedata = png_ck,
})
minetest.register_node("testnodes:generated_png_mb", {
core.register_node("testnodes:generated_png_mb", {
description = S("Generated Mandelbrot PNG Test Node"),
tiles = { "testnodes_generated_mb.png" },
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:generated_png_ck", {
core.register_node("testnodes:generated_png_ck", {
description = S("Generated Checker PNG Test Node"),
tiles = { "testnodes_generated_ck.png" },
groups = { dig_immediate = 2 },
})
local png_emb = "[png:" .. minetest.encode_base64(
local png_emb = "[png:" .. core.encode_base64(
encode_and_check(64, 64, "rgba", data_emb))
minetest.register_node("testnodes:generated_png_emb", {
core.register_node("testnodes:generated_png_emb", {
description = S("Generated In-Band Mandelbrot PNG Test Node"),
tiles = { png_emb },
@ -229,7 +229,7 @@ minetest.register_node("testnodes:generated_png_emb", {
paramtype = "light",
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:generated_png_src_emb", {
core.register_node("testnodes:generated_png_src_emb", {
description = S("Generated In-Band Source Blit Mandelbrot PNG Test Node"),
tiles = { png_emb .. "^testnodes_damage_neg.png" },
@ -238,7 +238,7 @@ minetest.register_node("testnodes:generated_png_src_emb", {
paramtype = "light",
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:generated_png_dst_emb", {
core.register_node("testnodes:generated_png_dst_emb", {
description = S("Generated In-Band Dest Blit Mandelbrot PNG Test Node"),
tiles = { "testnodes_generated_ck.png^" .. png_emb },
@ -270,7 +270,7 @@ then the string “TRUEVISION-XFILE.”, then another null byte.
]]--
minetest.register_node("testnodes:tga_type1_24bpp_bt", {
core.register_node("testnodes:tga_type1_24bpp_bt", {
description = S("TGA Type 1 (color-mapped RGB) 24bpp bottom-top Test Node"),
drawtype = "glasslike",
paramtype = "light",
@ -279,7 +279,7 @@ minetest.register_node("testnodes:tga_type1_24bpp_bt", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type1_24bpp_tb", {
core.register_node("testnodes:tga_type1_24bpp_tb", {
description = S("TGA Type 1 (color-mapped RGB) 24bpp top-bottom Test Node"),
drawtype = "glasslike",
paramtype = "light",
@ -288,7 +288,7 @@ minetest.register_node("testnodes:tga_type1_24bpp_tb", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type2_16bpp_bt", {
core.register_node("testnodes:tga_type2_16bpp_bt", {
description = S("TGA Type 2 (uncompressed RGB) 16bpp bottom-top Test Node"),
drawtype = "glasslike",
paramtype = "light",
@ -298,7 +298,7 @@ minetest.register_node("testnodes:tga_type2_16bpp_bt", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type2_16bpp_tb", {
core.register_node("testnodes:tga_type2_16bpp_tb", {
description = S("TGA Type 2 (uncompressed RGB) 16bpp top-bottom Test Node"),
drawtype = "glasslike",
paramtype = "light",
@ -308,7 +308,7 @@ minetest.register_node("testnodes:tga_type2_16bpp_tb", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type2_32bpp_bt", {
core.register_node("testnodes:tga_type2_32bpp_bt", {
description = S("TGA Type 2 (uncompressed RGB) 32bpp bottom-top Test Node"),
drawtype = "glasslike",
paramtype = "light",
@ -318,7 +318,7 @@ minetest.register_node("testnodes:tga_type2_32bpp_bt", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type2_32bpp_tb", {
core.register_node("testnodes:tga_type2_32bpp_tb", {
description = S("TGA Type 2 (uncompressed RGB) 32bpp top-bottom Test Node"),
drawtype = "glasslike",
paramtype = "light",
@ -328,7 +328,7 @@ minetest.register_node("testnodes:tga_type2_32bpp_tb", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type3_16bpp_bt", {
core.register_node("testnodes:tga_type3_16bpp_bt", {
description = S("TGA Type 3 (uncompressed grayscale) 16bpp bottom-top Test Node"),
drawtype = "glasslike",
paramtype = "light",
@ -338,7 +338,7 @@ minetest.register_node("testnodes:tga_type3_16bpp_bt", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type3_16bpp_tb", {
core.register_node("testnodes:tga_type3_16bpp_tb", {
description = S("TGA Type 3 (uncompressed grayscale) 16bpp top-bottom Test Node"),
drawtype = "glasslike",
paramtype = "light",
@ -348,7 +348,7 @@ minetest.register_node("testnodes:tga_type3_16bpp_tb", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type10_32bpp_bt", {
core.register_node("testnodes:tga_type10_32bpp_bt", {
description = S("TGA Type 10 (RLE-compressed RGB) 32bpp bottom-top Test Node"),
tiles = { "testnodes_tga_type10_32bpp_bt.tga" },
drawtype = "glasslike",
@ -358,7 +358,7 @@ minetest.register_node("testnodes:tga_type10_32bpp_bt", {
groups = { dig_immediate = 2 },
})
minetest.register_node("testnodes:tga_type10_32bpp_tb", {
core.register_node("testnodes:tga_type10_32bpp_tb", {
description = S("TGA Type 10 (RLE-compressed RGB) 32bpp top-bottom Test Node"),
drawtype = "glasslike",
paramtype = "light",