From 7bf2caa3d64f680d6d68a3a621a825c6082e6bb2 Mon Sep 17 00:00:00 2001 From: IamPyu Date: Wed, 27 Nov 2024 15:27:59 -0600 Subject: [PATCH] minetest -> core --- game.conf | 2 +- mods/CORE/pyutest/damage.lua | 4 +- mods/CORE/pyutest/init.lua | 8 +-- mods/CORE/pyutest/util.lua | 48 ++++++------- mods/CORE/pyutest_basicsettings/init.lua | 6 +- mods/CORE/walkin/init.lua | 2 +- mods/CORE/walkover/init.lua | 10 +-- mods/ENTITIES/pyutest_entities/api.lua | 24 +++---- mods/ENTITIES/pyutest_entities/init.lua | 2 +- mods/ENTITIES/pyutest_fireworks/init.lua | 22 +++--- mods/ENTITIES/pyutest_mobs/api.lua | 4 +- mods/ENTITIES/pyutest_mobs/init.lua | 6 +- mods/ITEMS/pyutest_blocks/api.lua | 24 +++---- mods/ITEMS/pyutest_blocks/basic.lua | 4 +- mods/ITEMS/pyutest_blocks/crate.lua | 8 +-- mods/ITEMS/pyutest_blocks/fire.lua | 14 ++-- mods/ITEMS/pyutest_blocks/init.lua | 2 +- mods/ITEMS/pyutest_blocks/special.lua | 30 ++++---- mods/ITEMS/pyutest_buckets/init.lua | 12 ++-- mods/ITEMS/pyutest_crafts/init.lua | 80 ++++++++++----------- mods/ITEMS/pyutest_electricity/delayer.lua | 4 +- mods/ITEMS/pyutest_electricity/devices.lua | 38 +++++----- mods/ITEMS/pyutest_electricity/init.lua | 20 +++--- mods/ITEMS/pyutest_farming/api.lua | 14 ++-- mods/ITEMS/pyutest_farming/init.lua | 4 +- mods/ITEMS/pyutest_flowers/init.lua | 2 +- mods/ITEMS/pyutest_furnace/init.lua | 10 +-- mods/ITEMS/pyutest_furniture/init.lua | 12 ++-- mods/ITEMS/pyutest_grass/init.lua | 8 +-- mods/ITEMS/pyutest_leaves/init.lua | 2 +- mods/ITEMS/pyutest_lootboxes/init.lua | 8 +-- mods/ITEMS/pyutest_magic/init.lua | 20 +++--- mods/ITEMS/pyutest_overrides/init.lua | 8 +-- mods/ITEMS/pyutest_tools/api.lua | 10 +-- mods/ITEMS/pyutest_tools/init.lua | 2 +- mods/ITEMS/pyutest_tools/items.lua | 2 +- mods/ITEMS/pyutest_tools/tools.lua | 4 +- mods/ITEMS/pyutest_upgrades/init.lua | 4 +- mods/ITEMS/pyutest_wood/init.lua | 12 ++-- mods/ITEMS/pyutest_wool/init.lua | 16 ++--- mods/PLAYER/pyutest_cmds/fun.lua | 10 +-- mods/PLAYER/pyutest_cmds/gameplay.lua | 10 +-- mods/PLAYER/pyutest_cmds/init.lua | 2 +- mods/PLAYER/pyutest_cmds/worldedit.lua | 26 +++---- mods/PLAYER/pyutest_home/init.lua | 26 +++---- mods/PLAYER/pyutest_inventory/init.lua | 4 +- mods/PLAYER/pyutest_player/init.lua | 30 ++++---- mods/PLAYER/pyutest_player/stats.lua | 16 ++--- mods/PLAYER/pyutest_spawnpoints/init.lua | 14 ++-- mods/WORLD/pyutest_environment/init.lua | 24 +++---- mods/WORLD/pyutest_mapgen/api.lua | 34 ++++----- mods/WORLD/pyutest_mapgen/init.lua | 2 +- mods/WORLD/pyutest_mapgen/mapgen.lua | 20 +++--- mods/WORLD/pyutest_ores/api.lua | 20 +++--- mods/WORLD/pyutest_ores/init.lua | 14 ++-- mods/WORLD/pyutest_overworld/features.lua | 8 +-- mods/WORLD/pyutest_overworld/init.lua | 2 +- mods/WORLD/pyutest_overworld/structures.lua | 2 +- mods/WORLD/pyutest_overworld/trees.lua | 52 +++++++------- mods/WORLD/pyutest_worlds/api.lua | 20 +++--- mods/WORLD/pyutest_worlds/init.lua | 2 +- 61 files changed, 425 insertions(+), 425 deletions(-) diff --git a/game.conf b/game.conf index 0f1b384..9f386fe 100644 --- a/game.conf +++ b/game.conf @@ -1,5 +1,5 @@ title = Nodelands description = Pyu's Minetest Game disallowed_mapgens = v6 -min_minetest_version = 5.8 +min_minetest_version = 5.10 first_mod = pyutest diff --git a/mods/CORE/pyutest/damage.lua b/mods/CORE/pyutest/damage.lua index 1af9d84..8148121 100644 --- a/mods/CORE/pyutest/damage.lua +++ b/mods/CORE/pyutest/damage.lua @@ -30,7 +30,7 @@ PyuTest.mt_damage_to_pyutest_damage = function(reason) return reason._pyutest or reason end -minetest.register_on_dieplayer(function(player, reason) +core.register_on_dieplayer(function(player, reason) local playername = player:get_player_name() local message = string.format("%s died", playername) @@ -60,5 +60,5 @@ minetest.register_on_dieplayer(function(player, reason) end end - minetest.chat_send_all(message) + core.chat_send_all(message) end) diff --git a/mods/CORE/pyutest/init.lua b/mods/CORE/pyutest/init.lua index 8680dbe..0714436 100644 --- a/mods/CORE/pyutest/init.lua +++ b/mods/CORE/pyutest/init.lua @@ -1,6 +1,6 @@ PyuTest = {} Translate = function(s) - return minetest.get_translator(minetest.get_current_modname())(s) + return core.get_translator(core.get_current_modname())(s) end PyuTest.BLOCK_FAST = 3 @@ -34,12 +34,12 @@ PyuTest.DEFAULT_EFFECTS = { fog_color = "#00000000" } -PyuTest.WORLD_GRAVITY = minetest.settings:get("movement_gravity") +PyuTest.WORLD_GRAVITY = core.settings:get("movement_gravity") PyuTest.get_schematic_path = function(name) - return minetest.get_modpath("pyutest") .. "/schematics/" .. name .. ".mts" + return core.get_modpath("pyutest") .. "/schematics/" .. name .. ".mts" end -local modpath = minetest.get_modpath("pyutest") +local modpath = core.get_modpath("pyutest") dofile(modpath .. "/damage.lua") dofile(modpath .. "/util.lua") diff --git a/mods/CORE/pyutest/util.lua b/mods/CORE/pyutest/util.lua index 8a9957a..06e75b0 100644 --- a/mods/CORE/pyutest/util.lua +++ b/mods/CORE/pyutest/util.lua @@ -65,7 +65,7 @@ PyuTest.node_beside_node = function(pos, name) } for _, v in pairs(n) do - local node = minetest.get_node(v) + local node = core.get_node(v) if node.name == name then return true end @@ -83,8 +83,8 @@ PyuTest.node_beside_group = function(pos, group) } for _, v in pairs(n) do - local node = minetest.get_node(v) - if minetest.get_item_group(node.name, group) ~= 0 then + local node = core.get_node(v) + if core.get_item_group(node.name, group) ~= 0 then return true end end @@ -96,29 +96,29 @@ PyuTest.create_explosion = function(pos, range, rm_pos, dmg, damage_whitelist, m local max_resist = max_blast_resistance or 3 if rm_pos then - minetest.remove_node(pos) + core.remove_node(pos) end PyuTest.dorange(pos, range, function(p) - local node = minetest.get_node(p) - local def = minetest.registered_nodes[node.name] + local node = core.get_node(p) + local def = core.registered_nodes[node.name] local resist = def._pyutest_blast_resistance or 1 if resist > max_resist then return end - if minetest.get_node(p).name == "pyutest_blocks:tnt" then - minetest.after(0.8, function() - minetest.remove_node(p) + if core.get_node(p).name == "pyutest_blocks:tnt" then + core.after(0.8, function() + core.remove_node(p) PyuTest.create_explosion(p, range, rm_pos, dmg, damage_whitelist, max_blast_resistance) end) else - minetest.dig_node(p) + core.dig_node(p) end end) - for _, v in pairs(minetest.get_objects_inside_radius(pos, range)) do + for _, v in pairs(core.get_objects_inside_radius(pos, range)) do local function damage() if v:is_valid() then PyuTest.deal_damage(v, dmg, PyuTest.DAMAGE_TYPES.explosion(range)) @@ -148,7 +148,7 @@ PyuTest.create_explosion = function(pos, range, rm_pos, dmg, damage_whitelist, m local minpos = { x = pos.x - r, y = pos.y - r, z = pos.z - r } local maxpos = { x = pos.x + r, y = pos.y + r, z = pos.z + r } - minetest.add_particlespawner({ + core.add_particlespawner({ amount = range * 8, time = 0.4, minexptime = 0.4, @@ -167,7 +167,7 @@ PyuTest.create_explosion = function(pos, range, rm_pos, dmg, damage_whitelist, m maxvel = vector.new(1, 1, 1), }) - minetest.add_particlespawner({ + core.add_particlespawner({ amount = range * 18, time = 0.4, minexptime = 0.4, @@ -186,7 +186,7 @@ PyuTest.create_explosion = function(pos, range, rm_pos, dmg, damage_whitelist, m maxvel = vector.new(6, 6, 6), }) - minetest.add_particlespawner({ + core.add_particlespawner({ amount = range * 18, time = 0.4, minexptime = 0.4, @@ -205,7 +205,7 @@ PyuTest.create_explosion = function(pos, range, rm_pos, dmg, damage_whitelist, m maxvel = vector.new(6, 6, 6), }) - minetest.sound_play("block_break", { + core.sound_play("block_break", { pos = pos, gain = 2.5 }) @@ -245,7 +245,7 @@ PyuTest.rotate_and_place = function(itemstack, placer, pointed_thing) local placer_pos = placer:get_pos() if placer_pos then local diff = vector.subtract(p1, placer_pos) - param2 = minetest.dir_to_facedir(diff) + param2 = core.dir_to_facedir(diff) -- The player places a node on the side face of the node he is standing on if p0.y == p1.y and math.abs(diff.x) <= 0.5 and math.abs(diff.z) <= 0.5 and diff.y < 0 then -- reverse node direction @@ -253,7 +253,7 @@ PyuTest.rotate_and_place = function(itemstack, placer, pointed_thing) end end - local finepos = minetest.pointed_thing_to_face_pos(placer, pointed_thing) + local finepos = core.pointed_thing_to_face_pos(placer, pointed_thing) local fpos = finepos.y % 1 if p0.y - 1 == p1.y or (fpos > 0 and fpos < 0.5) @@ -266,7 +266,7 @@ PyuTest.rotate_and_place = function(itemstack, placer, pointed_thing) end end end - return minetest.item_place(itemstack, placer, pointed_thing, param2) + return core.item_place(itemstack, placer, pointed_thing, param2) end PyuTest.register_interval = function(fn, time) @@ -279,7 +279,7 @@ PyuTest.register_interval = function(fn, time) fn() end - minetest.after(time, fn) + core.after(time, fn) end interval() @@ -289,20 +289,20 @@ PyuTest.give_item_or_drop = function(stack, inventory, listname, pos) local leftover = inventory:add_item(listname, stack) if leftover then - minetest.add_item(pos, leftover) + core.add_item(pos, leftover) end end PyuTest.get_biome_def = function(pos) - local data = minetest.get_biome_data(pos) + local data = core.get_biome_data(pos) if not data then return end - return minetest.registered_biomes[minetest.get_biome_name(data.biome)] + return core.registered_biomes[core.get_biome_name(data.biome)] end -- https://github.com/minetest/minetest_game/blob/master/mods/default/functions.lua#L184 function PyuTest.get_inventory_drops(pos, inventory, drops) - local inv = minetest.get_meta(pos):get_inventory() + local inv = core.get_meta(pos):get_inventory() local n = #drops for i = 1, inv:get_size(inventory) do local stack = inv:get_stack(inventory, i) @@ -314,7 +314,7 @@ function PyuTest.get_inventory_drops(pos, inventory, drops) end PyuTest.drop_item = function(pos, name) - local o = minetest.add_item(pos, name) + local o = core.add_item(pos, name) if o then o:add_velocity(vector.new(math.random(-2, 2), 5, math.random(-2, 2))) diff --git a/mods/CORE/pyutest_basicsettings/init.lua b/mods/CORE/pyutest_basicsettings/init.lua index a7c1328..e64fd61 100644 --- a/mods/CORE/pyutest_basicsettings/init.lua +++ b/mods/CORE/pyutest_basicsettings/init.lua @@ -1,5 +1,5 @@ -minetest.register_globalstep(function() - if minetest.settings:get_bool("always_day", false) then - minetest.set_timeofday(0.5) +core.register_globalstep(function() + if core.settings:get_bool("always_day", false) then + core.set_timeofday(0.5) end end) diff --git a/mods/CORE/walkin/init.lua b/mods/CORE/walkin/init.lua index ef7da0d..c22e702 100644 --- a/mods/CORE/walkin/init.lua +++ b/mods/CORE/walkin/init.lua @@ -1 +1 @@ -local get_connected_players = minetest.get_connected_players() +local get_connected_players = core.get_connected_players() diff --git a/mods/CORE/walkover/init.lua b/mods/CORE/walkover/init.lua index ec4fcbc..2a05a33 100644 --- a/mods/CORE/walkover/init.lua +++ b/mods/CORE/walkover/init.lua @@ -1,5 +1,5 @@ -local get_connected_players = minetest.get_connected_players -local get_node = minetest.get_node +local get_connected_players = core.get_connected_players +local get_node = core.get_node local vector = vector local ceil = math.ceil local pairs = pairs @@ -15,8 +15,8 @@ function walkover.register_global(func) table.insert(registered_globals, func) end -minetest.register_on_mods_loaded(function() - for name,def in pairs(minetest.registered_nodes) do +core.register_on_mods_loaded(function() + for name,def in pairs(core.registered_nodes) do if def.on_walk_over then on_walk[name] = def.on_walk_over end @@ -24,7 +24,7 @@ minetest.register_on_mods_loaded(function() end) local timer = 0 -minetest.register_globalstep(function(dtime) +core.register_globalstep(function(dtime) timer = timer + dtime if timer >= 0.6 then for _, player in pairs(get_connected_players()) do diff --git a/mods/ENTITIES/pyutest_entities/api.lua b/mods/ENTITIES/pyutest_entities/api.lua index 3fcb6b5..99f3308 100644 --- a/mods/ENTITIES/pyutest_entities/api.lua +++ b/mods/ENTITIES/pyutest_entities/api.lua @@ -15,7 +15,7 @@ PyuTest.get_nearest_entity = function(entity, pos, range, only_player, dont_igno closet_distance = d end - for obj in minetest.objects_inside_radius(pos, range) do + for obj in core.objects_inside_radius(pos, range) do local dist = vector.distance(pos, obj:get_pos()) if dist < closet_distance and obj ~= entity then @@ -53,7 +53,7 @@ PyuTest.register_entity_spawn = function(name, entity, def) error("Table expected for options!") end - minetest.register_node(name, { + core.register_node(name, { description = "Entity Spawner", groups = { not_in_creative_inventory = 1, @@ -63,7 +63,7 @@ PyuTest.register_entity_spawn = function(name, entity, def) pointable = false }) - minetest.register_decoration({ + core.register_decoration({ sidelen = 80, decoration = name, deco_type = "simple", @@ -76,21 +76,21 @@ PyuTest.register_entity_spawn = function(name, entity, def) biomes = {} }) - minetest.register_lbm({ + core.register_lbm({ name = name .. "_spawn", run_at_every_load = true, nodenames = { name }, action = function(pos) - minetest.remove_node(pos) + core.remove_node(pos) local min = def.min or 1 local max = def.max or 1 if max == 1 then - minetest.add_entity(pos, entity) + core.add_entity(pos, entity) else for _ = min, math.random(min, max) do - minetest.add_entity(pos, entity) + core.add_entity(pos, entity) end end end @@ -128,7 +128,7 @@ function class:path_find_nearest_entity(follow_only_player) end state.target.position = state.target.object:get_pos() - state.target.path = minetest.find_path(pos, state.target.position, cfg.view_range, cfg.max_jump, cfg.max_drop, + state.target.path = core.find_path(pos, state.target.position, cfg.view_range, cfg.max_jump, cfg.max_drop, PATH_FIND_ALGORITHM) state.target.pathindex = 1 else @@ -177,7 +177,7 @@ PyuTest.make_mob = function(name, properties, options) local collisionbox = properties.collisionbox or PyuTest.HUMAN_LIKE_CBOX - minetest.register_entity(name, setmetatable({ + core.register_entity(name, setmetatable({ initial_properties = PyuTest.util.tableconcat(properties, { hp_max = properties.hp_max or 20, physical = true, @@ -232,9 +232,9 @@ PyuTest.make_mob = function(name, properties, options) on_punch = function(self) local pos = self.object:get_pos() - minetest.sound_play(self.options.sounds.hurt, { pos = pos }) + core.sound_play(self.options.sounds.hurt, { pos = pos }) - minetest.add_particlespawner({ + core.add_particlespawner({ amount = 8, time = 0.4, minexptime = 0.4, @@ -242,7 +242,7 @@ PyuTest.make_mob = function(name, properties, options) minsize = 1.5, maxsize = 1.62, vertical = false, - glow = minetest.LIGHT_MAX, + glow = core.LIGHT_MAX, collisiondetection = false, texture = "pyutest-blood.png", diff --git a/mods/ENTITIES/pyutest_entities/init.lua b/mods/ENTITIES/pyutest_entities/init.lua index a0768a7..b5d172c 100644 --- a/mods/ENTITIES/pyutest_entities/init.lua +++ b/mods/ENTITIES/pyutest_entities/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("pyutest_entities") +local modpath = core.get_modpath("pyutest_entities") dofile(modpath .. "/api.lua") PyuTest.make_mob("pyutest_entities:test_follower", { diff --git a/mods/ENTITIES/pyutest_fireworks/init.lua b/mods/ENTITIES/pyutest_fireworks/init.lua index 1a7bdba..45b9471 100644 --- a/mods/ENTITIES/pyutest_fireworks/init.lua +++ b/mods/ENTITIES/pyutest_fireworks/init.lua @@ -1,9 +1,9 @@ -minetest.register_entity("pyutest_fireworks:firework", { +core.register_entity("pyutest_fireworks:firework", { initial_properties = { visual = "upright_sprite", textures = { "pyutest-firework.png", "pyutest-firework.png" }, physical = true, - glow = minetest.LIGHT_MAX + glow = core.LIGHT_MAX }, on_activate = function(self) @@ -29,11 +29,11 @@ minetest.register_entity("pyutest_fireworks:firework", { local velocity = vector.new(math.random(-1, 1), 0, math.random(-1, 1)) if math.random(1, 2) == 1 then - minetest.add_particle({ + core.add_particle({ pos = pos, size = 1.2, expirationtime = 0.6, - glow = minetest.LIGHT_MAX, + glow = core.LIGHT_MAX, vertical = true, velocity = velocity, collisiondetection = true, @@ -41,11 +41,11 @@ minetest.register_entity("pyutest_fireworks:firework", { texture = "pyutest-firework-trail1.png" }) else - minetest.add_particle({ + core.add_particle({ pos = pos, size = 1.2, expirationtime = 0.6, - glow = minetest.LIGHT_MAX, + glow = core.LIGHT_MAX, vertical = true, velocity = velocity, collisiondetection = true, @@ -61,11 +61,11 @@ minetest.register_entity("pyutest_fireworks:firework", { g = math.random(50, 255), b = math.random(50, 255), } - local texture = string.format("pyutest-firework-blast.png^[colorize:%s", minetest.colorspec_to_colorstring(color)) + local texture = string.format("pyutest-firework-blast.png^[colorize:%s", core.colorspec_to_colorstring(color)) local pos = self.object:get_pos() - minetest.add_particlespawner({ + core.add_particlespawner({ amount = math.random(20, 40), time = 0.8, minexptime = 0.4, @@ -73,7 +73,7 @@ minetest.register_entity("pyutest_fireworks:firework", { minsize = 2, maxsize = 2, vertical = false, - glow = minetest.LIGHT_MAX, + glow = core.LIGHT_MAX, collisiondetection = false, texture = texture, @@ -83,7 +83,7 @@ minetest.register_entity("pyutest_fireworks:firework", { maxvel = vector.new(6, 6, 6), }) - minetest.sound_play({ + core.sound_play({ name = "pyutest-firework", gain = 1.2, pos = pos, @@ -96,7 +96,7 @@ PyuTest.make_item("pyutest_fireworks:firework", "Firework", {}, "pyutest-firewor on_place = function(itemstack, placer, pointed_thing) if pointed_thing.type == "node" then local pos = pointed_thing.above - minetest.add_entity(pos, "pyutest_fireworks:firework") + core.add_entity(pos, "pyutest_fireworks:firework") itemstack:take_item() end diff --git a/mods/ENTITIES/pyutest_mobs/api.lua b/mods/ENTITIES/pyutest_mobs/api.lua index 58dc2ae..de3898a 100644 --- a/mods/ENTITIES/pyutest_mobs/api.lua +++ b/mods/ENTITIES/pyutest_mobs/api.lua @@ -1,7 +1,7 @@ PyuTest.create_boss_egg = function(mob_id, desc, texture, addegg, no_creative, craft) mobs:register_egg(mob_id, desc, texture, addegg, no_creative) - minetest.register_craft({ + core.register_craft({ output = mob_id, recipe = { { "", craft, "" }, @@ -24,7 +24,7 @@ PyuTest.create_boss_egg = function(mob_id, desc, texture, addegg, no_creative, c child = false, ignore_count = true }) - minetest.remove_node(pos) + core.remove_node(pos) end }) end diff --git a/mods/ENTITIES/pyutest_mobs/init.lua b/mods/ENTITIES/pyutest_mobs/init.lua index 57f5da3..1f654fe 100644 --- a/mods/ENTITIES/pyutest_mobs/init.lua +++ b/mods/ENTITIES/pyutest_mobs/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("pyutest_mobs") +local modpath = core.get_modpath("pyutest_mobs") mobs.fallback_node = "pyutest_blocks:dirt_block" @@ -17,7 +17,7 @@ if not PyuTest.is_flat() then chance = 1, active_object_count = 5, min_light = 0, - max_light = minetest.LIGHT_MAX, + max_light = core.LIGHT_MAX, max_height = PyuTest.OVERWORLD_TOP, min_height = PyuTest.OVERWORLD_SURFACE_BOTTOM, day_toggle = false @@ -30,7 +30,7 @@ if not PyuTest.is_flat() then chance = 1, active_object_count = 7, min_light = 0, - max_light = minetest.LIGHT_MAX, + max_light = core.LIGHT_MAX, max_height = PyuTest.OVERWORLD_SURFACE_BOTTOM - 1, min_height = PyuTest.OVERWORLD_BOTTOM }) diff --git a/mods/ITEMS/pyutest_blocks/api.lua b/mods/ITEMS/pyutest_blocks/api.lua index 8af8d5c..8935c7f 100644 --- a/mods/ITEMS/pyutest_blocks/api.lua +++ b/mods/ITEMS/pyutest_blocks/api.lua @@ -25,7 +25,7 @@ PyuTest.make_node = function(name, desc, groups, tiles, extra_conf) conf["sounds"] = PyuTest.make_node_sounds(extra_conf.sounds) end - minetest.register_node(name, conf) + core.register_node(name, conf) end PyuTest.NODE_BOXES = { @@ -82,7 +82,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext econf = econf }) - minetest.register_node(id_block, PyuTest.util.tableconcat({ + core.register_node(id_block, PyuTest.util.tableconcat({ description = Translate(desc), tiles = tex, groups = PyuTest.util.tableconcat(groups, { @@ -91,7 +91,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext sounds = PyuTest.make_node_sounds(), }, econf)) - minetest.register_node(id_carpet, PyuTest.util.tableconcat({ + core.register_node(id_carpet, PyuTest.util.tableconcat({ description = Translate(desc .. " Carpet"), tiles = tex, groups = PyuTest.util.tableconcat(PyuTest.util.tablecopy(groups), { @@ -106,7 +106,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext floodable = true }, econf)) - minetest.register_node(id_slab, PyuTest.util.tableconcat({ + core.register_node(id_slab, PyuTest.util.tableconcat({ description = Translate(desc .. " Slab"), tiles = tex, groups = groups, @@ -117,7 +117,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext sounds = PyuTest.make_node_sounds(), }, econf)) - minetest.register_node(id_pillar, PyuTest.util.tableconcat({ + core.register_node(id_pillar, PyuTest.util.tableconcat({ description = Translate(desc .. " Pillar"), tiles = tex, groups = groups, @@ -127,7 +127,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext sounds = PyuTest.make_node_sounds() }, econf)) - minetest.register_node(id_stairs, PyuTest.util.tableconcat({ + core.register_node(id_stairs, PyuTest.util.tableconcat({ description = Translate(desc .. " Stairs"), tiles = tex, groups = groups, @@ -138,7 +138,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext sounds = PyuTest.make_node_sounds(), }, econf)) - minetest.register_node(id_fence, PyuTest.util.tableconcat({ + core.register_node(id_fence, PyuTest.util.tableconcat({ description = Translate(desc .. " Fence"), tiles = tex, groups = groups, @@ -152,21 +152,21 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext sounds = PyuTest.make_node_sounds(), }, econf)) - minetest.register_craft({ + core.register_craft({ output = id_carpet .. " 2", recipe = { { id_block, id_block } } }) - minetest.register_craft({ + core.register_craft({ output = id_slab .. " 3", recipe = { { id_block, id_block, id_block } } }) - minetest.register_craft({ + core.register_craft({ output = id_pillar .. " 3", recipe = { { id_block }, @@ -175,7 +175,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext } }) - minetest.register_craft({ + core.register_craft({ output = id_stairs .. " 4", recipe = { { id_block, "", "" }, @@ -184,7 +184,7 @@ PyuTest.make_building_blocks = function(name, desc, tex, colortint, cgroups, ext } }) - minetest.register_craft({ + core.register_craft({ output = id_fence .. " 4", recipe = { { id_block, "pyutest_tools:stick", id_block }, diff --git a/mods/ITEMS/pyutest_blocks/basic.lua b/mods/ITEMS/pyutest_blocks/basic.lua index fcbc71e..068cbef 100644 --- a/mods/ITEMS/pyutest_blocks/basic.lua +++ b/mods/ITEMS/pyutest_blocks/basic.lua @@ -214,7 +214,7 @@ PyuTest.make_building_blocks("pyutest_blocks:crystal_lantern", "Crystal Lantern" { cracky = PyuTest.BLOCK_FAST, }, { - light_source = minetest.LIGHT_MAX, + light_source = core.LIGHT_MAX, paramtype = "light" }) @@ -252,7 +252,7 @@ PyuTest.make_building_blocks("pyutest_blocks:glowshroom", "Glowshroom", { }, { is_ground_content = false, paramtype = "light", - light_source = minetest.LIGHT_MAX + light_source = core.LIGHT_MAX }) -- Breakable by hand diff --git a/mods/ITEMS/pyutest_blocks/crate.lua b/mods/ITEMS/pyutest_blocks/crate.lua index f9da28e..a29b02c 100644 --- a/mods/ITEMS/pyutest_blocks/crate.lua +++ b/mods/ITEMS/pyutest_blocks/crate.lua @@ -2,7 +2,7 @@ PyuTest.make_node("pyutest_blocks:crate", "Crate", { choppy = PyuTest.BLOCK_NORMAL }, { "pyutest-crate.png" }, { on_construct = function(pos) - local meta = minetest.get_meta(pos) + local meta = core.get_meta(pos) local inventory = meta:get_inventory() inventory:set_size("main", 8 * 4) end, @@ -12,7 +12,7 @@ PyuTest.make_node("pyutest_blocks:crate", "Crate", { PyuTest.get_inventory_drops(pos, "main", drops) for _, v in pairs(drops) do - minetest.add_item(pos, v) + core.add_item(pos, v) end end, @@ -24,9 +24,9 @@ PyuTest.make_node("pyutest_blocks:crate", "Crate", { "list[current_player;main;0,5;8,4;]" .. "listring[nodemeta:" .. spos .. ";main]" .. "listring[current_player;main]" - minetest.show_formspec(clicker:get_player_name(), string.format("pyutest_blocks:crate_%d_%d_%d", pos.x, pos.y, pos.z), + core.show_formspec(clicker:get_player_name(), string.format("pyutest_blocks:crate_%d_%d_%d", pos.x, pos.y, pos.z), formspec) - minetest.sound_play({ name = "crate_open", gain = 1 }, { pos = pos }) + core.sound_play({ name = "crate_open", gain = 1 }, { pos = pos }) end, _pyutest_blast_resistance = 2 }) diff --git a/mods/ITEMS/pyutest_blocks/fire.lua b/mods/ITEMS/pyutest_blocks/fire.lua index c2e2d00..2d7ad46 100644 --- a/mods/ITEMS/pyutest_blocks/fire.lua +++ b/mods/ITEMS/pyutest_blocks/fire.lua @@ -26,34 +26,34 @@ PyuTest.make_node("pyutest_blocks:fire", "Fire", { _pyutest_blast_resistance = 0, }) -minetest.register_abm({ +core.register_abm({ label = "Fire Spread", nodenames = { "group:flammable" }, neighbors = { "group:fire_spreading" }, interval = 1, chance = 4, action = function(pos) - if not minetest.settings:get_bool("fire_spreads", true) then + if not core.settings:get_bool("fire_spreads", true) then return end - minetest.set_node(pos, { + core.set_node(pos, { name = "pyutest_blocks:fire" }) end }) -minetest.register_abm({ +core.register_abm({ label = "Fire Extinguish", nodenames = { "pyutest_blocks:fire" }, interval = 1, chance = 16, action = function(pos) - local name = minetest.get_node(pos - vector.new(0, 1, 0)).name - if minetest.get_item_group(name, "fire_persist") ~= 0 then + local name = core.get_node(pos - vector.new(0, 1, 0)).name + if core.get_item_group(name, "fire_persist") ~= 0 then return end - minetest.remove_node(pos) + core.remove_node(pos) end }) diff --git a/mods/ITEMS/pyutest_blocks/init.lua b/mods/ITEMS/pyutest_blocks/init.lua index e0cec5e..c827a6e 100644 --- a/mods/ITEMS/pyutest_blocks/init.lua +++ b/mods/ITEMS/pyutest_blocks/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("pyutest_blocks") +local modpath = core.get_modpath("pyutest_blocks") dofile(modpath .. "/api.lua") dofile(modpath .. "/basic.lua") diff --git a/mods/ITEMS/pyutest_blocks/special.lua b/mods/ITEMS/pyutest_blocks/special.lua index c6e0ede..9907e9b 100644 --- a/mods/ITEMS/pyutest_blocks/special.lua +++ b/mods/ITEMS/pyutest_blocks/special.lua @@ -15,7 +15,7 @@ PyuTest.make_node("pyutest_blocks:light", "Light", { walkable = false, paramtype = "light", sunlight_propagates = true, - light_source = minetest.LIGHT_MAX, + light_source = core.LIGHT_MAX, floodable = true, _pyutest_blast_resistance = 0 }) @@ -31,7 +31,7 @@ PyuTest.make_node("pyutest_blocks:torch", "Torch", { "pyutest-torch.png^[transform6", "pyutest-torch.png^[transform1" }, { - light_source = minetest.LIGHT_MAX, + light_source = core.LIGHT_MAX, walkable = false, drawtype = "torchlike", paramtype = "light", @@ -80,8 +80,8 @@ PyuTest.make_node("pyutest_blocks:tnt", "TNT", { "pyutest-tnt-side.png" -- Affects all other sides }, { on_rightclick = function(pos, node, clicker) - minetest.after(3, function() - if minetest.get_node(pos).name ~= "pyutest_blocks:tnt" then + core.after(3, function() + if core.get_node(pos).name ~= "pyutest_blocks:tnt" then return end PyuTest.create_explosion(pos, 2, true, 12) @@ -89,8 +89,8 @@ PyuTest.make_node("pyutest_blocks:tnt", "TNT", { end, __on_electricity_activated = function(pos, node, sender_pos) - minetest.after(3, function() - if minetest.get_node(pos).name ~= "pyutest_blocks:tnt" then + core.after(3, function() + if core.get_node(pos).name ~= "pyutest_blocks:tnt" then return end PyuTest.create_explosion(pos, 3, true, 12) @@ -107,7 +107,7 @@ PyuTest.make_node("pyutest_blocks:workbench", "Workbench", { "pyutest-workbench-sides.png" }, { on_rightclick = function(pos, node, clicker) - minetest.show_formspec(clicker:get_player_name(), "pyutest_blocks:workbench", table.concat({ + core.show_formspec(clicker:get_player_name(), "pyutest_blocks:workbench", table.concat({ "size[8,7.5]", "list[current_player;craft;2.5,0;3,3;]", "list[current_player;craftpreview;6.5,1;1,1;]", @@ -184,11 +184,11 @@ PyuTest.make_node("pyutest_blocks:weak_ice", "Weak Ice", { cracky = PyuTest.BLOCK_FAST }, { "pyutest-ice.png" }, { on_walk_over = function(pos) - minetest.set_node(pos, { name = "pyutest_blocks:water_source" }) + core.set_node(pos, { name = "pyutest_blocks:water_source" }) end, }) -minetest.register_abm({ +core.register_abm({ label = "Sponge Loop", nodenames = { "pyutest_blocks:sponge" }, neighbors = { "group:liquid" }, @@ -198,12 +198,12 @@ minetest.register_abm({ local range = 4 local function replace(npos) - local node = minetest.get_node(npos) + local node = core.get_node(npos) if node.name == "air" then return end - local def = minetest.registered_nodes[node.name] + local def = core.registered_nodes[node.name] if def.groups["liquid"] == 1 then - minetest.remove_node(npos) + core.remove_node(npos) end end @@ -213,7 +213,7 @@ minetest.register_abm({ end }) -minetest.register_abm({ +core.register_abm({ label = "Contagious Acid Spread", nodenames = { "group:acid_vulnerable" }, neighbors = { "pyutest_blocks:contagious_acid" }, @@ -221,11 +221,11 @@ minetest.register_abm({ chance = 2.2, catchup = true, action = function(pos) - if not minetest.settings:get_bool("acid_spreads", true) then + if not core.settings:get_bool("acid_spreads", true) then return end - minetest.set_node(pos, { + core.set_node(pos, { name = "pyutest_blocks:contagious_acid" }) end diff --git a/mods/ITEMS/pyutest_buckets/init.lua b/mods/ITEMS/pyutest_buckets/init.lua index 83ad669..9fdd291 100644 --- a/mods/ITEMS/pyutest_buckets/init.lua +++ b/mods/ITEMS/pyutest_buckets/init.lua @@ -12,12 +12,12 @@ PyuTest.make_item("pyutest_buckets:bucket", "Empty Bucket", {}, "pyutest-bucket. if pointed_thing.type == "node" then local pos = pointed_thing.under - local node = minetest.get_node(pos) - local def = minetest.registered_nodes[node.name] + local node = core.get_node(pos) + local def = core.registered_nodes[node.name] if def.__bucket then PyuTest.give_item_or_drop(ItemStack(def.__bucket), user:get_inventory(), "main", user:get_pos()) - minetest.remove_node(pos) + core.remove_node(pos) itemstack:take_item() return itemstack @@ -26,7 +26,7 @@ PyuTest.make_item("pyutest_buckets:bucket", "Empty Bucket", {}, "pyutest-bucket. end }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_buckets:bucket", recipe = { { "pyutest_ores:iron_ingot", "", "pyutest_ores:iron_ingot" }, @@ -49,11 +49,11 @@ PyuTest.make_liquid_bucket = function(name, desc, source, color) after_place_node = function(pos, placer) if placer == nil then return end PyuTest.give_item_or_drop(ItemStack("pyutest_buckets:bucket"), placer:get_inventory(), "main", placer:get_pos()) - minetest.set_node(pos, { name = source }) + core.set_node(pos, { name = source }) end, }) - minetest.override_item(source, { + core.override_item(source, { __bucket = name, }) end diff --git a/mods/ITEMS/pyutest_crafts/init.lua b/mods/ITEMS/pyutest_crafts/init.lua index b3de500..f547fbc 100644 --- a/mods/ITEMS/pyutest_crafts/init.lua +++ b/mods/ITEMS/pyutest_crafts/init.lua @@ -1,4 +1,4 @@ -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:wooden_pickaxe 1", recipe = { { "group:wooden_planks", "group:wooden_planks", "group:wooden_planks" }, @@ -7,7 +7,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:wooden_axe 1", recipe = { { "group:wooden_planks", "group:wooden_planks", "" }, @@ -16,7 +16,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:wooden_sword 1", recipe = { { "", "group:wooden_planks", "" }, @@ -25,7 +25,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:stone_pickaxe", recipe = { { "group:stone", "group:stone", "group:stone" }, @@ -34,7 +34,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:stone_axe", recipe = { { "group:stone", "group:stone", "" }, @@ -43,7 +43,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:stone_sword", recipe = { { "", "group:stone", "" }, @@ -52,7 +52,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:iron_pickaxe", recipe = { { "pyutest_ores:iron_ingot", "pyutest_ores:iron_ingot", "pyutest_ores:iron_ingot" }, @@ -61,7 +61,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:iron_axe", recipe = { { "pyutest_ores:iron_ingot", "pyutest_ores:iron_ingot", "" }, @@ -70,7 +70,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:iron_sword", recipe = { { "pyutest_ores:iron_ingot" }, @@ -79,7 +79,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_farming:hoe", recipe = { { "pyutest_ores:iron_ingot", "pyutest_ores:iron_ingot", "" }, @@ -88,7 +88,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:shears", recipe = { "pyutest_ores:iron_ingot", @@ -97,7 +97,7 @@ minetest.register_craft({ type = "shapeless" }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:diamond_pickaxe", recipe = { { "pyutest_ores:diamond_shard", "pyutest_ores:diamond_shard", "pyutest_ores:diamond_shard" }, @@ -106,7 +106,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:diamond_axe", recipe = { { "pyutest_ores:diamond_shard", "pyutest_ores:diamond_shard", "" }, @@ -115,7 +115,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:diamond_sword", recipe = { { "pyutest_ores:diamond_shard" }, @@ -124,7 +124,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:flint_and_steel", recipe = { "pyutest_tools:flint", "pyutest_ores:iron_ingot" @@ -133,7 +133,7 @@ minetest.register_craft({ }) -- not tools -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:crate", recipe = { { "group:wooden_planks", "group:wooden_planks", "group:wooden_planks" }, @@ -142,7 +142,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:brick_block 4", recipe = { { "pyutest_tools:brick", "pyutest_tools:brick" }, @@ -150,7 +150,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_furnace:furnace", recipe = { { "group:stone", "group:stone", "group:stone" }, @@ -159,7 +159,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:workbench", recipe = { { "group:wooden_planks", "group:wooden_planks" }, @@ -167,7 +167,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:slime_block", type = "shapeless", recipe = { @@ -176,7 +176,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:sugar 3", type = "shapeless", recipe = { @@ -184,7 +184,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:clay_block 4", recipe = { { "pyutest_tools:clay", "pyutest_tools:clay" }, @@ -192,7 +192,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:bone_block 4", recipe = { { "pyutest_tools:bone", "pyutest_tools:bone" }, @@ -200,7 +200,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:stick 4", recipe = { { "group:wooden_planks" }, @@ -208,7 +208,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:coin", recipe = { { "pyutest_ores:gold_ingot", "pyutest_ores:gold_ingot", "pyutest_ores:gold_ingot" }, @@ -217,7 +217,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_ores:gold_ingot 9", recipe = { { "pyutest_tools:coin" } @@ -225,7 +225,7 @@ minetest.register_craft({ }) -- this recipe makes no sense, but who cares? -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:contagious_acid 3", recipe = { "pyutest_blocks:mushroom_block", @@ -236,7 +236,7 @@ minetest.register_craft({ type = "shapeless" }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:light 4", recipe = { { "pyutest_blocks:torch", "pyutest_blocks:torch" }, @@ -244,7 +244,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:tnt 4", recipe = { { "pyutest_blocks:sand_block", "pyutest_tools:gunpowder" }, @@ -252,7 +252,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:tnt 4", recipe = { { "pyutest_tools:gunpowder", "pyutest_blocks:sand_block" }, @@ -260,7 +260,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:torch 4", recipe = { { "pyutest_ores:coal_lump" }, @@ -268,7 +268,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:ladder 16", recipe = { { "pyutest_tools:stick", "", "pyutest_tools:stick" }, @@ -277,7 +277,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:wheat 4", recipe = { "pyutest_blocks:haybale_block" @@ -285,7 +285,7 @@ minetest.register_craft({ type = "shapeless" }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_blocks:haybale_block", recipe = { { "pyutest_tools:wheat", "pyutest_tools:wheat" }, @@ -293,7 +293,7 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:bread 3", recipe = { "pyutest_tools:wheat", @@ -303,7 +303,7 @@ minetest.register_craft({ type = "shapeless" }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:paper 3", recipe = { "pyutest_flowers:sugarcane", @@ -313,7 +313,7 @@ minetest.register_craft({ type = "shapeless", }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_fireworks:firework 3", recipe = { "pyutest_tools:gunpowder", @@ -322,7 +322,7 @@ minetest.register_craft({ type = "shapeless" }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_tools:sliced_potato 2", recipe = { "pyutest_tools:potato" @@ -330,13 +330,13 @@ minetest.register_craft({ type = "shapeless" }) -minetest.register_craft({ +core.register_craft({ type = "cooking", output = "pyutest_blocks:glass", recipe = "pyutest_blocks:sand_block" }) -minetest.register_craft({ +core.register_craft({ type = "cooking", output = "pyutest_blocks:brick", recipe = "pyutest_tools:clay", diff --git a/mods/ITEMS/pyutest_electricity/delayer.lua b/mods/ITEMS/pyutest_electricity/delayer.lua index d101fe7..48acccb 100644 --- a/mods/ITEMS/pyutest_electricity/delayer.lua +++ b/mods/ITEMS/pyutest_electricity/delayer.lua @@ -28,12 +28,12 @@ for i, v in ipairs(delay_multipliers) do ni = i + 1 end - minetest.set_node(pos, { name = index_name(ni) }) + core.set_node(pos, { name = index_name(ni) }) end }, string.format("pyutest-wire-d%d.png", i), v) end -minetest.register_craft({ +core.register_craft({ output = string.format("%s 4", index_name()), recipe = { "pyutest_ores:zinc_ingot" diff --git a/mods/ITEMS/pyutest_electricity/devices.lua b/mods/ITEMS/pyutest_electricity/devices.lua index 0a579cb..9639ff5 100644 --- a/mods/ITEMS/pyutest_electricity/devices.lua +++ b/mods/ITEMS/pyutest_electricity/devices.lua @@ -4,14 +4,14 @@ PyuTest.make_electricity_device("pyutest_electricity:freezer_device", "Freezer D cracky = PyuTest.BLOCK_FAST }, { "pyutest-freezer.png" }, "pyutest_blocks:ice_block", nil, function(pos, node, sender_pos) PyuTest.dorange(pos, 2, function(p) - local n = minetest.get_node(p) + local n = core.get_node(p) - if minetest.get_item_group(n.name, "freezable") ~= 0 then - minetest.set_node(p, { name = "pyutest_blocks:ice_block" }) - elseif minetest.get_item_group(n.name, "coolable") ~= 0 then - local def = minetest.registered_nodes[n.name] + if core.get_item_group(n.name, "freezable") ~= 0 then + core.set_node(p, { name = "pyutest_blocks:ice_block" }) + elseif core.get_item_group(n.name, "coolable") ~= 0 then + local def = core.registered_nodes[n.name] local cool_into = def.__cool_into or "pyutest_blocks:water_source" - minetest.set_node(p, { name = cool_into }) + core.set_node(p, { name = cool_into }) end end) end) @@ -20,16 +20,16 @@ PyuTest.make_electricity_device("pyutest_electricity:heater_device", "Heater Dev cracky = PyuTest.BLOCK_FAST }, { "pyutest-heater.png" }, "pyutest_blocks:fire", nil, function(pos, node, sender_pos) PyuTest.dorange(pos, 2, function(p) - local n = minetest.get_node(p) + local n = core.get_node(p) - if minetest.get_item_group(n.name, "thawable") ~= 0 then - local def = minetest.registered_nodes[n.name] + if core.get_item_group(n.name, "thawable") ~= 0 then + local def = core.registered_nodes[n.name] local thaw_into = def.__thaw_into or "pyutest_blocks:water_source" - minetest.set_node(p, { name = thaw_into }) - elseif minetest.get_item_group(n.name, "heatable") ~= 0 then - local def = minetest.registered_nodes[n.name] + core.set_node(p, { name = thaw_into }) + elseif core.get_item_group(n.name, "heatable") ~= 0 then + local def = core.registered_nodes[n.name] local heat_into = def.__heat_into or "pyutest_blocks:lava_source" - minetest.set_node(p, { name = heat_into }) + core.set_node(p, { name = heat_into }) end end) end) @@ -38,27 +38,27 @@ end) PyuTest.make_electricity_device("pyutest_electricity:lamp_device", "Lamp Device", { cracky = PyuTest.BLOCK_FAST, }, { "pyutest-lamp.png" }, "pyutest_blocks:light", nil, function(pos, node, sender_pos) - minetest.set_node(pos, { name = "pyutest_electricity:lamp_device_on" }) + core.set_node(pos, { name = "pyutest_electricity:lamp_device_on" }) end) PyuTest.make_electricity_device("pyutest_electricity:lamp_device_on", "Lamp Device", { cracky = PyuTest.BLOCK_FAST, not_in_creative_inventory = 1 }, { "pyutest-lamp.png" }, nil, { - light_source = minetest.LIGHT_MAX, + light_source = core.LIGHT_MAX, drop = "pyutest_electricity:lamp_device" }, function(pos, node, sender_pos) - minetest.set_node(pos, { name = "pyutest_electricity:lamp_device" }) + core.set_node(pos, { name = "pyutest_electricity:lamp_device" }) end) PyuTest.make_electricity_device("pyutest_electricity:time_device", "Time Device", { cracky = PyuTest.BLOCK_FAST }, { "pyutest-time-device.png" }, nil, nil, function(pos, node) - local time = minetest.get_timeofday() + local time = core.get_timeofday() if math.round(time) ~= 1 then - minetest.set_timeofday(0.5) + core.set_timeofday(0.5) else - minetest.set_timeofday(1) + core.set_timeofday(1) end end) diff --git a/mods/ITEMS/pyutest_electricity/init.lua b/mods/ITEMS/pyutest_electricity/init.lua index e652e0f..c2feb55 100644 --- a/mods/ITEMS/pyutest_electricity/init.lua +++ b/mods/ITEMS/pyutest_electricity/init.lua @@ -1,9 +1,9 @@ -local modpath = minetest.get_modpath("pyutest_electricity") +local modpath = core.get_modpath("pyutest_electricity") PyuTest.ELECTRICITY_TICK = 1 / 1000 PyuTest.electricity_activate = function(pos, node, sender_pos) - local def = minetest.registered_nodes[node.name] + local def = core.registered_nodes[node.name] if def.__on_electricity_activated then def.__on_electricity_activated(pos, node, sender_pos) @@ -16,14 +16,14 @@ PyuTest.make_button = function(id, desc, groups, tiles) }), tiles, { is_ground_content = false, on_rightclick = function(pos, node, clicker) - minetest.sound_play("button", { + core.sound_play("button", { pos = pos, gain = 1 }) for _, v in pairs(PyuTest.get_full_neighbours(pos)) do - local n = minetest.get_node(v) - minetest.after(PyuTest.ELECTRICITY_TICK, function() + local n = core.get_node(v) + core.after(PyuTest.ELECTRICITY_TICK, function() PyuTest.electricity_activate(v, n, pos) end) end @@ -53,11 +53,11 @@ PyuTest.make_wire = function(id, desc, groups, color, opts, texture, delay) __on_electricity_activated = function(pos, node, sender_pos) for _, v in pairs(PyuTest.get_full_neighbours(pos)) do - local n = minetest.get_node(v) + local n = core.get_node(v) -- To prevent infinite loops if v ~= sender_pos then - minetest.after(del, function() + core.after(del, function() PyuTest.electricity_activate(v, n, pos) end) end @@ -75,7 +75,7 @@ PyuTest.make_electricity_device = function(id, desc, groups, tiles, craftitem, o -- Dont create a recipe if it is nil if craftitem ~= nil then - minetest.register_craft({ + core.register_craft({ output = id, recipe = { { "pyutest_blocks:stone_block", "pyutest_blocks:stone_block", "pyutest_blocks:stone_block" }, @@ -95,7 +95,7 @@ PyuTest.make_wire("pyutest_electricity:copper_wire", "Copper Wire", { }, "darkgoldenrod", nil, nil, 1) -minetest.register_craft({ +core.register_craft({ output = "pyutest_electricity:copper_wire 4", recipe = { "pyutest_ores:copper_ingot" @@ -103,7 +103,7 @@ minetest.register_craft({ type = "shapeless" }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_electricity:button", recipe = { { "pyutest_blocks:stone_block", "pyutest_blocks:stone_block", "pyutest_blocks:stone_block" }, diff --git a/mods/ITEMS/pyutest_farming/api.lua b/mods/ITEMS/pyutest_farming/api.lua index d8af670..594256c 100644 --- a/mods/ITEMS/pyutest_farming/api.lua +++ b/mods/ITEMS/pyutest_farming/api.lua @@ -15,10 +15,10 @@ PyuTest.make_item("pyutest_farming:hoe", "Hoe", { on_place = function(itemstack, user, pointed_thing) if pointed_thing.type == "node" then local pos = pointed_thing.under - local node = minetest.get_node(pos) + local node = core.get_node(pos) - if minetest.get_item_group(node.name, "dirt") ~= 0 then - minetest.set_node(pos, { name = "pyutest_farming:farmland" }) + if core.get_item_group(node.name, "dirt") ~= 0 then + core.set_node(pos, { name = "pyutest_farming:farmland" }) end end end @@ -48,11 +48,11 @@ PyuTest.make_crop = function(name, desc, output, growtime, water_multiplier, tex time = time * (water_multiplier or 0.5) end - local timer = minetest.get_node_timer(pos) + local timer = core.get_node_timer(pos) timer:start(time) end, on_timer = function(pos) - minetest.set_node(pos, { name = grow_into or name .. "_grown" }) + core.set_node(pos, { name = grow_into or name .. "_grown" }) end, _pyutest_blast_resistance = 0 }) @@ -88,10 +88,10 @@ PyuTest.make_crop = function(name, desc, output, growtime, water_multiplier, tex on_place = function(itemstack, user, pointed_thing) if pointed_thing.type == "node" then local pos = pointed_thing.under - local node = minetest.get_node(pos) + local node = core.get_node(pos) if node.name == "pyutest_farming:farmland" then - minetest.place_node(pointed_thing.under + vector.new(0, 1, 0), { name = name .. "_crop" }, user) + core.place_node(pointed_thing.under + vector.new(0, 1, 0), { name = name .. "_crop" }, user) itemstack:set_count(itemstack:get_count() - 1) return itemstack end diff --git a/mods/ITEMS/pyutest_farming/init.lua b/mods/ITEMS/pyutest_farming/init.lua index c1588da..05339d9 100644 --- a/mods/ITEMS/pyutest_farming/init.lua +++ b/mods/ITEMS/pyutest_farming/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath(minetest.get_current_modname()) +local modpath = core.get_modpath(core.get_current_modname()) dofile(modpath .. "/api.lua") @@ -38,7 +38,7 @@ PyuTest.make_crop("pyutest_farming:pumpkin", "Pumpkin", "", to_minutes(8), 0.33, seed_color = "#ce6b28" }, "pyutest_farming:pumpkin") -minetest.register_craft({ +core.register_craft({ output = "pyutest_farming:pumpkin_seeds 4", recipe = { "pyutest_farming:pumpkin" diff --git a/mods/ITEMS/pyutest_flowers/init.lua b/mods/ITEMS/pyutest_flowers/init.lua index a7e2905..e7b9684 100644 --- a/mods/ITEMS/pyutest_flowers/init.lua +++ b/mods/ITEMS/pyutest_flowers/init.lua @@ -20,7 +20,7 @@ PyuTest.make_flower = function(name, desc, texture, dye, add_to_registry, drawty }, econf or {})) if dye ~= nil then - minetest.register_craft({ + core.register_craft({ output = dye .. " 2", recipe = { name }, type = "shapeless" diff --git a/mods/ITEMS/pyutest_furnace/init.lua b/mods/ITEMS/pyutest_furnace/init.lua index 361e74c..a6512fc 100644 --- a/mods/ITEMS/pyutest_furnace/init.lua +++ b/mods/ITEMS/pyutest_furnace/init.lua @@ -29,7 +29,7 @@ PyuTest.make_node("pyutest_furnace:furnace", "Furnace", { is_ground_content = false, paramtype2 = "facedir", on_construct = function(pos) - local meta = minetest.get_meta(pos) + local meta = core.get_meta(pos) local inventory = meta:get_inventory() inventory:set_size("src", 1) inventory:set_size("fuel", 1) @@ -43,7 +43,7 @@ PyuTest.make_node("pyutest_furnace:furnace", "Furnace", { PyuTest.get_inventory_drops(pos, "dst", drops) for _, v in pairs(drops) do - minetest.add_item(pos, v) + core.add_item(pos, v) end end, on_receive_fields = function(pos, formname, fields, player) @@ -51,18 +51,18 @@ PyuTest.make_node("pyutest_furnace:furnace", "Furnace", { return end - local meta = minetest.get_meta(pos) + local meta = core.get_meta(pos) local inv = meta:get_inventory() local function smelt() local src = inv:get_stack("src", 1) local fuel = inv:get_stack("fuel", 1) - if minetest.get_item_group(fuel:get_name(), "fuel") == 0 then + if core.get_item_group(fuel:get_name(), "fuel") == 0 then return end - local output, decremented_input = minetest.get_craft_result({ + local output, decremented_input = core.get_craft_result({ method = "cooking", width = 1, items = { diff --git a/mods/ITEMS/pyutest_furniture/init.lua b/mods/ITEMS/pyutest_furniture/init.lua index a65b279..b5294d1 100644 --- a/mods/ITEMS/pyutest_furniture/init.lua +++ b/mods/ITEMS/pyutest_furniture/init.lua @@ -21,7 +21,7 @@ PyuTest.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf) local id_chair = name .. "_chair" local id_mtable = name .. "_mtable" - minetest.register_node(id_table, PyuTest.util.tableconcat({ + core.register_node(id_table, PyuTest.util.tableconcat({ description = Translate(desc .. " Table"), tiles = tiles, groups = PyuTest.util.tableconcat(groups, { @@ -34,7 +34,7 @@ PyuTest.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf) connects_to = { "group:table" } }, econf)) - minetest.register_node(id_chair, PyuTest.util.tableconcat({ + core.register_node(id_chair, PyuTest.util.tableconcat({ description = Translate(desc .. " Chair"), tiles = tiles, groups = PyuTest.util.tableconcat(groups, { @@ -58,7 +58,7 @@ PyuTest.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf) } }, econf)) - minetest.register_node(id_mtable, PyuTest.util.tableconcat({ + core.register_node(id_mtable, PyuTest.util.tableconcat({ description = Translate(desc .. " Mini Table"), tiles = tiles, groups = PyuTest.util.tableconcat(groups, { @@ -82,7 +82,7 @@ PyuTest.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf) } }, econf)) - minetest.register_craft({ + core.register_craft({ output = id_table .. " 4", recipe = { { craft, craft, craft }, @@ -91,7 +91,7 @@ PyuTest.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf) } }) - minetest.register_craft({ + core.register_craft({ output = id_chair .. " 4", recipe = { { craft, "", "" }, @@ -100,7 +100,7 @@ PyuTest.make_furniture = function(name, desc, craft, tiles, cgroups, extra_conf) } }) - minetest.register_craft({ + core.register_craft({ output = id_mtable .. " 4", recipe = { { craft, craft, craft }, diff --git a/mods/ITEMS/pyutest_grass/init.lua b/mods/ITEMS/pyutest_grass/init.lua index 5fa7acd..15642ef 100644 --- a/mods/ITEMS/pyutest_grass/init.lua +++ b/mods/ITEMS/pyutest_grass/init.lua @@ -37,8 +37,8 @@ PyuTest.make_grass = function(name, desc, groups, color, dont_make_flora, ttex, }) end - minetest.override_item(name .. "_block", econf or {}) - minetest.register_craft({ + core.override_item(name .. "_block", econf or {}) + core.register_craft({ output = name .. "_block 2", recipe = { name .. "_block", "pyutest_blocks:dirt_block" @@ -46,7 +46,7 @@ PyuTest.make_grass = function(name, desc, groups, color, dont_make_flora, ttex, type = "shapeless" }) - minetest.register_decoration({ + core.register_decoration({ deco_type = "simple", place_on = { name .. "_block" }, sidelen = 16, @@ -54,7 +54,7 @@ PyuTest.make_grass = function(name, desc, groups, color, dont_make_flora, ttex, decoration = name .. "_plant" }) - minetest.register_decoration({ + core.register_decoration({ deco_type = "simple", place_on = { name .. "_block" }, sidelen = 16, diff --git a/mods/ITEMS/pyutest_leaves/init.lua b/mods/ITEMS/pyutest_leaves/init.lua index 3982661..ef138ba 100644 --- a/mods/ITEMS/pyutest_leaves/init.lua +++ b/mods/ITEMS/pyutest_leaves/init.lua @@ -14,7 +14,7 @@ PyuTest.make_leaves = function(id, desc, color, overlay, special_drops, drops) _pyutest_blast_resistance = 0 }) if special_drops == nil or special_drops == true then - minetest.override_item(leaves_id, { + core.override_item(leaves_id, { drop = drops or { max_items = 1, items = { diff --git a/mods/ITEMS/pyutest_lootboxes/init.lua b/mods/ITEMS/pyutest_lootboxes/init.lua index 049b8ef..9925358 100644 --- a/mods/ITEMS/pyutest_lootboxes/init.lua +++ b/mods/ITEMS/pyutest_lootboxes/init.lua @@ -2,7 +2,7 @@ PyuTest.registered_lootboxes = {} PyuTest.spawning_lootboxes = {} PyuTest.make_lootbox = function(name, dname, items, spawn) local id = name .. "_lootbox" - minetest.register_node(id, { + core.register_node(id, { description = Translate(dname .. " Lootbox"), groups = { choppy = PyuTest.BLOCK_NORMAL, @@ -13,14 +13,14 @@ PyuTest.make_lootbox = function(name, dname, items, spawn) drop = "", after_destruct = function(pos) for _, v in pairs(items) do - minetest.add_item(pos, v) + core.add_item(pos, v) end - minetest.sound_play("lootbox_unlock", { + core.sound_play("lootbox_unlock", { pos = pos, gain = 1 }) - minetest.remove_node(pos) + core.remove_node(pos) end }) PyuTest.registered_lootboxes[name] = { diff --git a/mods/ITEMS/pyutest_magic/init.lua b/mods/ITEMS/pyutest_magic/init.lua index ee79796..2bba0eb 100644 --- a/mods/ITEMS/pyutest_magic/init.lua +++ b/mods/ITEMS/pyutest_magic/init.lua @@ -11,12 +11,12 @@ PyuTest.make_spellbook = function(nsname, desc, color, craftitem, action) color = color, on_use = function(itemstack, user, pointed_thing) local pos = user:get_pos() - minetest.sound_play({ name = "spellbook_action", gain = 0.75 }, { pos = pos }) + core.sound_play({ name = "spellbook_action", gain = 0.75 }, { pos = pos }) action(itemstack, user, pointed_thing) end }) - minetest.register_craft({ + core.register_craft({ output = nsname, recipe = { { "", "pyutest_magic:magic_shards", "" }, @@ -42,15 +42,15 @@ PyuTest.make_spellbook("pyutest_magic:fire_spellbook", "Spellbook of Fire", "cri local range = 2 local function replace(pos) - local node = minetest.get_node_or_nil(pos) + local node = core.get_node_or_nil(pos) if node == nil then return end if node.name ~= "air" then return end local pos2 = vector.new(pos.x, pos.y - 1, pos.z) - node = minetest.get_node_or_nil(pos) + node = core.get_node_or_nil(pos) if node == nil then return end if node.name ~= "air" then return end - minetest.set_node(pos, { name = "pyutest_blocks:fire" }) + core.set_node(pos, { name = "pyutest_blocks:fire" }) end for dx = -range, range do @@ -66,7 +66,7 @@ PyuTest.make_item("pyutest_magic:enchanted_shard", "Enchanted Shard", {}, "pyute color = "indigo", }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_magic:enchanted_shard 2", recipe = { { "pyutest_magic:magic_shards", "pyutest_ores:diamond_shard", "pyutest_magic:magic_shards" }, @@ -92,7 +92,7 @@ PyuTest.make_tool("pyutest_magic:enchanted_pickaxe", "Enchanted Pickaxe", {}, "p }), }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_magic:enchanted_pickaxe", recipe = { { "pyutest_magic:enchanted_shard", "pyutest_magic:enchanted_shard", "pyutest_magic:enchanted_shard" }, @@ -119,7 +119,7 @@ PyuTest.make_tool("pyutest_magic:enchanted_axe", "Enchanted Axe", {}, "pyutest-e }) }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_magic:enchanted_axe", recipe = { { "pyutest_magic:enchanted_shard", "pyutest_magic:enchanted_shard", "" }, @@ -131,7 +131,7 @@ minetest.register_craft({ PyuTest.make_sword("pyutest_magic:enchanted_sword", "Enchanted Sword", "pyutest-enchanted-sword.png", 9, 3600, 0.7) -minetest.register_craft({ +core.register_craft({ output = "pyutest_magic:enchanted_sword", recipe = { { "pyutest_magic:enchanted_shard" }, @@ -149,7 +149,7 @@ PyuTest.make_item("pyutest_magic:windball", "Windball", {}, "pyutest-windball.pn end local pos = user:get_pos() - minetest.sound_play({ name = "spellbook_action", gain = 0.75 }, { pos = pos }) + core.sound_play({ name = "spellbook_action", gain = 0.75 }, { pos = pos }) local vel = user:get_velocity() diff --git a/mods/ITEMS/pyutest_overrides/init.lua b/mods/ITEMS/pyutest_overrides/init.lua index 7f53baa..3b631c5 100644 --- a/mods/ITEMS/pyutest_overrides/init.lua +++ b/mods/ITEMS/pyutest_overrides/init.lua @@ -1,13 +1,13 @@ -minetest.override_item("pyutest_blocks:clay_block", { +core.override_item("pyutest_blocks:clay_block", { drop = "pyutest_tools:clay 3" }) -minetest.override_item("pyutest_blocks:bone_block", { +core.override_item("pyutest_blocks:bone_block", { paramtype2 = "facedir", - on_place = minetest.rotate_node + on_place = core.rotate_node }) -minetest.override_item("pyutest_blocks:gravel_block", { +core.override_item("pyutest_blocks:gravel_block", { drop = { max_items = 1, items = { diff --git a/mods/ITEMS/pyutest_tools/api.lua b/mods/ITEMS/pyutest_tools/api.lua index 2447a73..7e89efd 100644 --- a/mods/ITEMS/pyutest_tools/api.lua +++ b/mods/ITEMS/pyutest_tools/api.lua @@ -12,7 +12,7 @@ PyuTest.make_item = function(nsname, desc, groups, wield_image, extra_conf) end end - minetest.register_craftitem(nsname, conf) + core.register_craftitem(nsname, conf) end PyuTest.make_tool = function(nsname, desc, groups, wield_image, extra_conf) @@ -31,7 +31,7 @@ PyuTest.make_tool = function(nsname, desc, groups, wield_image, extra_conf) end end - minetest.register_tool(nsname, conf) + core.register_tool(nsname, conf) end PyuTest.make_sword = function(nsname, desc, texture, damage, durability, atkspeed) @@ -55,14 +55,14 @@ PyuTest.make_food = function(nsname, desc, wield_image, health_fill, cook_into, }, wield_image, { on_use = function(itemstack, user, pt) if user == nil then return end - minetest.sound_play({ name = "eat", gain = 1 }, { pos = user:get_pos(), start_time = 1.2 }) - minetest.do_item_eat(health_fill, "", itemstack, user, pt) + core.sound_play({ name = "eat", gain = 1 }, { pos = user:get_pos(), start_time = 1.2 }) + core.do_item_eat(health_fill, "", itemstack, user, pt) if extra_code then extra_code() end end, }) if cook_into ~= nil then - minetest.register_craft({ + core.register_craft({ type = "cooking", output = cook_into, recipe = nsname diff --git a/mods/ITEMS/pyutest_tools/init.lua b/mods/ITEMS/pyutest_tools/init.lua index 940bc09..161fbe6 100644 --- a/mods/ITEMS/pyutest_tools/init.lua +++ b/mods/ITEMS/pyutest_tools/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("pyutest_tools") +local modpath = core.get_modpath("pyutest_tools") dofile(modpath .. "/api.lua") dofile(modpath .. "/tools.lua") diff --git a/mods/ITEMS/pyutest_tools/items.lua b/mods/ITEMS/pyutest_tools/items.lua index 0a3ec90..c010397 100644 --- a/mods/ITEMS/pyutest_tools/items.lua +++ b/mods/ITEMS/pyutest_tools/items.lua @@ -13,7 +13,7 @@ PyuTest.make_item("pyutest_tools:sugar", "Sugar", {}, "pyutest-powder.png") PyuTest.make_item("pyutest_tools:coin", "Coin", {}, "pyutest-coin.png", { on_secondary_use = function(_, user) local pos = user:get_pos() - minetest.sound_play({ name = "coin", gain = 1 }, { + core.sound_play({ name = "coin", gain = 1 }, { pos = pos }) return nil diff --git a/mods/ITEMS/pyutest_tools/tools.lua b/mods/ITEMS/pyutest_tools/tools.lua index 01a2c4f..0aa55e4 100644 --- a/mods/ITEMS/pyutest_tools/tools.lua +++ b/mods/ITEMS/pyutest_tools/tools.lua @@ -182,9 +182,9 @@ PyuTest.make_item("pyutest_tools:flint_and_steel", "Flint and Steel", {}, "pyute stack_max = 1, on_place = function(itemstack, user, pointed_thing) if pointed_thing.type == "node" then - minetest.set_node(pointed_thing.above, { name = "pyutest_blocks:fire" }) + core.set_node(pointed_thing.above, { name = "pyutest_blocks:fire" }) - minetest.sound_play({ + core.sound_play({ name = "alt_place", gain = 1 }, { diff --git a/mods/ITEMS/pyutest_upgrades/init.lua b/mods/ITEMS/pyutest_upgrades/init.lua index 08d72d3..a7cf38b 100644 --- a/mods/ITEMS/pyutest_upgrades/init.lua +++ b/mods/ITEMS/pyutest_upgrades/init.lua @@ -20,14 +20,14 @@ PyuTest.make_upgrade_rune = function(name, desc, stat, increase, max, color, cra PyuTest.set_player_stat(user, stat, value + increase) - minetest.sound_play({ name = "spellbook_action", gain = 0.75 }, { pos = user:get_pos() }) + core.sound_play({ name = "spellbook_action", gain = 0.75 }, { pos = user:get_pos() }) itemstack:take_item() return itemstack end }) if craftitem ~= nil then - minetest.register_craft({ + core.register_craft({ output = name, recipe = { { "", "pyutest_ores:emerald_shard", "" }, diff --git a/mods/ITEMS/pyutest_wood/init.lua b/mods/ITEMS/pyutest_wood/init.lua index 062f0cb..3b64e2f 100644 --- a/mods/ITEMS/pyutest_wood/init.lua +++ b/mods/ITEMS/pyutest_wood/init.lua @@ -21,23 +21,23 @@ PyuTest.make_wood = function(id, desc, ltiles, btiles) local log_id = id .. "_log_block" local planks_id = id .. "_wood_block" - minetest.override_item(log_id, { - groups = PyuTest.util.tableconcat(minetest.registered_nodes[log_id].groups, { + core.override_item(log_id, { + groups = PyuTest.util.tableconcat(core.registered_nodes[log_id].groups, { wooden_log = 1, fuel = 1 }), paramtype2 = "facedir", - on_place = minetest.rotate_node + on_place = core.rotate_node }) - minetest.override_item(planks_id, { - groups = PyuTest.util.tableconcat(minetest.registered_nodes[planks_id].groups, { + core.override_item(planks_id, { + groups = PyuTest.util.tableconcat(core.registered_nodes[planks_id].groups, { wooden_planks = 1, fuel = 1 }) }) - minetest.register_craft({ + core.register_craft({ output = planks_id .. " 4", recipe = { log_id }, type = "shapeless" diff --git a/mods/ITEMS/pyutest_wool/init.lua b/mods/ITEMS/pyutest_wool/init.lua index 101d0ba..e0960e8 100644 --- a/mods/ITEMS/pyutest_wool/init.lua +++ b/mods/ITEMS/pyutest_wool/init.lua @@ -32,7 +32,7 @@ PyuTest.make_colored_blocks = function(name, desc, color) color = color or "white" }) - minetest.register_craft({ + core.register_craft({ output = name .. "_wool_block", type = "shapeless", recipe = { @@ -41,7 +41,7 @@ PyuTest.make_colored_blocks = function(name, desc, color) } }) - minetest.register_craft({ + core.register_craft({ output = name .. "_terracotta_block", type = "shapeless", recipe = { @@ -50,7 +50,7 @@ PyuTest.make_colored_blocks = function(name, desc, color) } }) - minetest.register_craft({ + core.register_craft({ output = name .. "_concrete_block", type = "shapeless", recipe = { @@ -67,7 +67,7 @@ PyuTest.make_colored_blocks = function(name, desc, color) end PyuTest.make_colored_blocks("pyutest_wool:white", "White", "white") -minetest.register_craft({ +core.register_craft({ output = "pyutest_wool:white_wool_block 4", recipe = { { "pyutest_tools:string", "pyutest_tools:string" }, @@ -75,13 +75,13 @@ minetest.register_craft({ } }) -minetest.register_craft({ +core.register_craft({ type = "cooking", output = "pyutest_wool:white_terracotta_block", recipe = "pyutest_blocks:clay_block" }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_wool:white_concrete_block 4", recipe = { "pyutest_blocks:clay_block" @@ -138,7 +138,7 @@ for k, v in pairs(PyuTest.COLORS) do sunlight_propagates = true }) - minetest.register_craft({ + core.register_craft({ output = id, recipe = { "pyutest_blocks:glass", @@ -150,7 +150,7 @@ for k, v in pairs(PyuTest.COLORS) do end PyuTest.make_dye_mixing_recipe = function(c1, c2, out) - minetest.register_craft({ + core.register_craft({ type = "shapeless", output = out .. " 2", recipe = { diff --git a/mods/PLAYER/pyutest_cmds/fun.lua b/mods/PLAYER/pyutest_cmds/fun.lua index 49df7b7..3c2c418 100644 --- a/mods/PLAYER/pyutest_cmds/fun.lua +++ b/mods/PLAYER/pyutest_cmds/fun.lua @@ -1,16 +1,16 @@ -minetest.register_privilege("fun", { +core.register_privilege("fun", { description = "Access to \"powerful\" fun commands", give_to_singeplayer = true }) -minetest.register_chatcommand("explode", { +core.register_chatcommand("explode", { params = "", description = "Create an explosion of size RANGE.", privs = { fun = true }, func = function(name, param) - local player = minetest.get_player_by_name(name) + local player = core.get_player_by_name(name) local range = tonumber(param) if range == nil then @@ -21,11 +21,11 @@ minetest.register_chatcommand("explode", { end }) -minetest.register_chatcommand("rtp", { +core.register_chatcommand("rtp", { description = [[Teleport to a random location in the world. This command may or may not kill you.]], func = function(name) - local player = minetest.get_player_by_name(name) + local player = core.get_player_by_name(name) local player_pos = player:get_pos() diff --git a/mods/PLAYER/pyutest_cmds/gameplay.lua b/mods/PLAYER/pyutest_cmds/gameplay.lua index d24ad86..61e729f 100644 --- a/mods/PLAYER/pyutest_cmds/gameplay.lua +++ b/mods/PLAYER/pyutest_cmds/gameplay.lua @@ -1,20 +1,20 @@ -minetest.register_chatcommand("biome", { +core.register_chatcommand("biome", { description = "Return the current biome name", func = function(name) - local player = minetest.get_player_by_name(name) + local player = core.get_player_by_name(name) if player == nil then return end local pos = player:get_pos() - local name = minetest.get_biome_name(minetest.get_biome_data(pos).biome) + local name = core.get_biome_name(core.get_biome_data(pos).biome) return true, string.format("Current biome name: %s", name) end }) -minetest.register_chatcommand("day", { +core.register_chatcommand("day", { description = "Return the current day", func = function(name) - local day = minetest.get_day_count() + local day = core.get_day_count() return true, string.format("Current day is: %d", day) end }) diff --git a/mods/PLAYER/pyutest_cmds/init.lua b/mods/PLAYER/pyutest_cmds/init.lua index 4cc72fe..e9c209e 100644 --- a/mods/PLAYER/pyutest_cmds/init.lua +++ b/mods/PLAYER/pyutest_cmds/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("pyutest_cmds") +local modpath = core.get_modpath("pyutest_cmds") dofile(modpath .. "/worldedit.lua") dofile(modpath .. "/gameplay.lua") dofile(modpath .. "/fun.lua") diff --git a/mods/PLAYER/pyutest_cmds/worldedit.lua b/mods/PLAYER/pyutest_cmds/worldedit.lua index 3657d28..d19d186 100644 --- a/mods/PLAYER/pyutest_cmds/worldedit.lua +++ b/mods/PLAYER/pyutest_cmds/worldedit.lua @@ -1,9 +1,9 @@ -minetest.register_privilege("builder", { +core.register_privilege("builder", { description = "Builder/World Edit Privilege", give_to_singeplayer = true }) -minetest.register_chatcommand("replacenear", { +core.register_chatcommand("replacenear", { params = " ", description = [[Replace blocks around RANGE from FROM to TO. FROM can be comma seperated, or it can be `any` which replaces any node. @@ -15,7 +15,7 @@ minetest.register_chatcommand("replacenear", { func = function(name, param) local parts = param:split(" ") if #parts == 3 then - local player = minetest.get_player_by_name(name) + local player = core.get_player_by_name(name) local pos = player:get_pos() local range = tonumber(parts[1]) or 5 local from = parts[2]:split(",") @@ -24,11 +24,11 @@ minetest.register_chatcommand("replacenear", { local function replace(p) for _, v in pairs(from) do - local name = minetest.get_node(p).name + local name = core.get_node(p).name local anyblock_match = (v == "anyblock" or v == "anynode" and name ~= "air" and name ~= "ignore") if name == v or v == "any" or anyblock_match then - minetest.set_node(p, { name = to }) + core.set_node(p, { name = to }) replaced = replaced + 1 end end @@ -44,15 +44,15 @@ minetest.register_chatcommand("replacenear", { end }) -minetest.register_chatcommand("place", { +core.register_chatcommand("place", { params = "", description = "Place SCHEMATIC at player position", privs = { builder = true }, func = function(name, param) - local player = minetest.get_player_by_name(name) - minetest.place_schematic(player:get_pos(), + local player = core.get_player_by_name(name) + core.place_schematic(player:get_pos(), PyuTest.get_schematic_path(param), "random", nil, @@ -62,21 +62,21 @@ minetest.register_chatcommand("place", { end }) -minetest.register_chatcommand("drain", { +core.register_chatcommand("drain", { params = "", description = "Drain all liquid in RANGE", privs = { builder = true }, func = function(name, param) - local player = minetest.get_player_by_name(name) + local player = core.get_player_by_name(name) local range = tonumber(param) or 1 PyuTest.dorange(player:get_pos(), range, function(p) - local node = minetest.get_node(p) + local node = core.get_node(p) - if minetest.get_item_group(node.name, "liquid") ~= 0 then - minetest.remove_node(p) + if core.get_item_group(node.name, "liquid") ~= 0 then + core.remove_node(p) end end) end diff --git a/mods/PLAYER/pyutest_home/init.lua b/mods/PLAYER/pyutest_home/init.lua index fa5bdcf..bb6a9f1 100644 --- a/mods/PLAYER/pyutest_home/init.lua +++ b/mods/PLAYER/pyutest_home/init.lua @@ -1,29 +1,29 @@ -local storage = minetest.get_mod_storage() -local homes = minetest.deserialize(storage:get("player_homes")) or {} +local storage = core.get_mod_storage() +local homes = core.deserialize(storage:get("player_homes")) or {} -minetest.register_on_joinplayer(function(player) +core.register_on_joinplayer(function(player) local name = player:get_player_name() if homes[name] == nil then homes[name] = {} end end) -minetest.register_chatcommand("sethome", { +core.register_chatcommand("sethome", { params = "", description = "Sets the position of home ", func = function(name, param) - local player = minetest.get_player_by_name(name) + local player = core.get_player_by_name(name) local pos = player:get_pos() homes[name][param] = pos return true, string.format("Set home `%s` position to (%d, %d, %d)", param, pos.x, pos.y, pos.z) end }) -minetest.register_chatcommand("tphome", { +core.register_chatcommand("tphome", { params = "", description = "Teleports to home ", func = function(name, param) - local player = minetest.get_player_by_name(name) + local player = core.get_player_by_name(name) local home = homes[name][param] if home ~= nil then @@ -35,17 +35,17 @@ minetest.register_chatcommand("tphome", { end }) -minetest.register_chatcommand("listhomes", { +core.register_chatcommand("listhomes", { description = "Lists all your homes", func = function(name) for k, v in pairs(homes[name]) do - minetest.chat_send_player(name, string.format("%s - (%d, %d, %d)", k, v.x, v.y, v.z)) + core.chat_send_player(name, string.format("%s - (%d, %d, %d)", k, v.x, v.y, v.z)) end return true, "Listed all homes" end }) -minetest.register_chatcommand("deletehome", { +core.register_chatcommand("deletehome", { description = "Delete a home", func = function(name, param) homes[name][param] = nil @@ -54,10 +54,10 @@ minetest.register_chatcommand("deletehome", { }) local function save_data() - storage:set_string("player_homes", minetest.serialize(homes)) + storage:set_string("player_homes", core.serialize(homes)) end -minetest.register_on_shutdown(save_data) +core.register_on_shutdown(save_data) local first_run = true local function interval() @@ -67,7 +67,7 @@ local function interval() save_data() end - minetest.after(10, interval) + core.after(10, interval) end interval() diff --git a/mods/PLAYER/pyutest_inventory/init.lua b/mods/PLAYER/pyutest_inventory/init.lua index 7be16c1..0a6486a 100644 --- a/mods/PLAYER/pyutest_inventory/init.lua +++ b/mods/PLAYER/pyutest_inventory/init.lua @@ -1,7 +1,7 @@ local function get_items_from_group(name) local list = {} - for k, v in pairs(minetest.registered_items) do - if minetest.get_item_group(k, name) ~= 0 then + for k, v in pairs(core.registered_items) do + if core.get_item_group(k, name) ~= 0 then table.insert(list, k) end end diff --git a/mods/PLAYER/pyutest_player/init.lua b/mods/PLAYER/pyutest_player/init.lua index fa1bfdf..b935505 100644 --- a/mods/PLAYER/pyutest_player/init.lua +++ b/mods/PLAYER/pyutest_player/init.lua @@ -1,9 +1,9 @@ -local modpath = minetest.get_modpath(minetest.get_current_modname()) +local modpath = core.get_modpath(core.get_current_modname()) dofile(modpath .. "/stats.lua") -- player setup -minetest.register_on_joinplayer(function(player) +core.register_on_joinplayer(function(player) if player == nil then return end local name = player:get_player_name() @@ -24,17 +24,17 @@ minetest.register_on_joinplayer(function(player) }) -- creative mode privs - if minetest.is_creative_enabled(name) then - minetest.set_player_privs(name, PyuTest.util.tableconcat({ + if core.is_creative_enabled(name) then + core.set_player_privs(name, PyuTest.util.tableconcat({ fly = true, fast = true, creative = true, - }, minetest.get_player_privs(name))) + }, core.get_player_privs(name))) end end) -- player hand -minetest.register_item(":", { +core.register_item(":", { type = "none", description = "Hands", wield_image = "pyutest-hand.png", @@ -44,8 +44,8 @@ minetest.register_item(":", { }) -- player effects -minetest.register_globalstep(function () - for _, v in pairs(minetest.get_connected_players()) do +core.register_globalstep(function () + for _, v in pairs(core.get_connected_players()) do local speed_multiplier = 1 v:set_physics_override({ @@ -54,8 +54,8 @@ minetest.register_globalstep(function () end end) -if minetest.is_creative_enabled("") then - minetest.override_item("", { +if core.is_creative_enabled("") then + core.override_item("", { range = 9, tool_capabilities = PyuTest.tool_caps({ uses = 0, @@ -75,7 +75,7 @@ if minetest.is_creative_enabled("") then }) }) else - minetest.override_item("", { + core.override_item("", { range = 5, tool_capabilities = PyuTest.tool_caps({ uses = 0, @@ -131,15 +131,15 @@ else end -- unlimited blocks in creative mode -minetest.register_on_placenode(function(_, _, placer) +core.register_on_placenode(function(_, _, placer) if placer and placer:is_player() then - return minetest.is_creative_enabled(placer:get_player_name()) + return core.is_creative_enabled(placer:get_player_name()) end end) -- player lighting, and sky effects for different biomes -minetest.register_globalstep(function() - local players = minetest.get_connected_players() +core.register_globalstep(function() + local players = core.get_connected_players() for _, player in pairs(players) do local pos = player:get_pos() diff --git a/mods/PLAYER/pyutest_player/stats.lua b/mods/PLAYER/pyutest_player/stats.lua index b53c55e..7099f83 100644 --- a/mods/PLAYER/pyutest_player/stats.lua +++ b/mods/PLAYER/pyutest_player/stats.lua @@ -5,12 +5,12 @@ PyuTest.DEFAULT_PLAYER_STATS = { PyuTest.get_player_stats = function(player) local meta = player:get_meta() - return minetest.deserialize(meta:get("stats") or minetest.serialize(PyuTest.DEFAULT_PLAYER_STATS)) + return core.deserialize(meta:get("stats") or core.serialize(PyuTest.DEFAULT_PLAYER_STATS)) end PyuTest.save_player_stats = function(player, stats) local meta = player:get_meta() - meta:set_string("stats", minetest.serialize(stats)) + meta:set_string("stats", core.serialize(stats)) end PyuTest.set_player_stat = function(player, stat, value) @@ -24,7 +24,7 @@ PyuTest.get_player_stat = function(player, stat) return stats[stat] end -minetest.register_on_player_hpchange(function(player, hp_change, reason) +core.register_on_player_hpchange(function(player, hp_change, reason) local max_hp = player:get_properties().hp_max local current_hp = player:get_hp() local new_hp_change = hp_change @@ -65,14 +65,14 @@ minetest.register_on_player_hpchange(function(player, hp_change, reason) return new_hp_change end, true) -minetest.register_on_joinplayer(function(player) +core.register_on_joinplayer(function(player) if player == nil then return end -- This saves the default stats if none exist. PyuTest.save_player_stats(player, PyuTest.get_player_stats(player)) end) -minetest.register_chatcommand("setstat", { +core.register_chatcommand("setstat", { params = " []", privs = { give = 1 @@ -89,19 +89,19 @@ minetest.register_chatcommand("setstat", { value = 1 end - PyuTest.set_player_stat(minetest.get_player_by_name(player), statname, value) + PyuTest.set_player_stat(core.get_player_by_name(player), statname, value) return true, string.format("Set stat %s value to %s", statname, tostring(value)) end }) -minetest.register_chatcommand("getstat", { +core.register_chatcommand("getstat", { params = " []", description = "Gets the value of PLAYER's player stat: STAT", func = function(name, param) local split = param:split(" ") local statname = split[1] local player = split[2] or name - local stat = PyuTest.get_player_stat(minetest.get_player_by_name(player), statname) + local stat = PyuTest.get_player_stat(core.get_player_by_name(player), statname) return true, string.format("%s of %s: %s", statname, player, tostring(stat or 0)) end }) diff --git a/mods/PLAYER/pyutest_spawnpoints/init.lua b/mods/PLAYER/pyutest_spawnpoints/init.lua index 1a08608..b065aff 100644 --- a/mods/PLAYER/pyutest_spawnpoints/init.lua +++ b/mods/PLAYER/pyutest_spawnpoints/init.lua @@ -1,14 +1,14 @@ -local storage = minetest.get_mod_storage() -local spawnpoints = minetest.deserialize(storage:get("player_spawns")) or {} +local storage = core.get_mod_storage() +local spawnpoints = core.deserialize(storage:get("player_spawns")) or {} -minetest.register_on_joinplayer(function(player) +core.register_on_joinplayer(function(player) local name = player:get_player_name() if spawnpoints[name] == nil then spawnpoints[name] = player:get_pos() end end) -minetest.register_on_respawnplayer(function(player) +core.register_on_respawnplayer(function(player) local name = player:get_player_name() if spawnpoints[name] ~= nil then player:set_pos(spawnpoints[name]) @@ -17,10 +17,10 @@ minetest.register_on_respawnplayer(function(player) end) local function save_data() - storage:set_string("player_spawns", minetest.serialize(spawnpoints)) + storage:set_string("player_spawns", core.serialize(spawnpoints)) end -minetest.register_on_shutdown(save_data) +core.register_on_shutdown(save_data) PyuTest.register_interval(save_data, 10) PyuTest.make_node("pyutest_spawnpoints:spawnpoint", "Spawnpoint", { @@ -35,7 +35,7 @@ PyuTest.make_node("pyutest_spawnpoints:spawnpoint", "Spawnpoint", { end }) -minetest.register_craft({ +core.register_craft({ output = "pyutest_spawnpoints:spawnpoint", recipe = { { "pyutest_blocks:stone_block", "pyutest_blocks:stone_block", "pyutest_blocks:stone_block" }, diff --git a/mods/WORLD/pyutest_environment/init.lua b/mods/WORLD/pyutest_environment/init.lua index 6aa8ece..efcc6f3 100644 --- a/mods/WORLD/pyutest_environment/init.lua +++ b/mods/WORLD/pyutest_environment/init.lua @@ -1,4 +1,4 @@ -minetest.register_abm({ +core.register_abm({ label = "Water freezing/evaporating", nodenames = { "group:water" }, interval = 1.2, @@ -13,15 +13,15 @@ minetest.register_abm({ if not def then return end local heat = def.heat_point or 50 - local found = minetest.find_node_near(pos, 2, { "group:emits_heat" }) ~= nil + local found = core.find_node_near(pos, 2, { "group:emits_heat" }) ~= nil if heat <= 12 and not found then - minetest.set_node(pos, { name = "pyutest_blocks:ice_block" }) + core.set_node(pos, { name = "pyutest_blocks:ice_block" }) end end }) -minetest.register_abm({ +core.register_abm({ label = "Water evaporating", nodenames = { "group:water" }, interval = 0.1, @@ -33,12 +33,12 @@ minetest.register_abm({ local heat = def.heat_point or 50 if heat >= 85 then - minetest.remove_node(pos) + core.remove_node(pos) end end }) -minetest.register_abm({ +core.register_abm({ label = "Ice thawing", nodenames = { "group:thawable" }, neighbors = { "group:emits_heat" }, @@ -46,21 +46,21 @@ minetest.register_abm({ chance = 2.5, catch_up = true, action = function(pos, node) - local def = minetest.registered_nodes[node.name] + local def = core.registered_nodes[node.name] local thaw_into = def.__thaw_into or "pyutest_blocks:water_source" - minetest.set_node(pos, { name = thaw_into }) + core.set_node(pos, { name = thaw_into }) end }) -minetest.register_abm({ +core.register_abm({ nodenames = { "group:lava" }, interval = 0.25, chance = 1, action = function(pos) local function is_water(p) - local name = minetest.get_node(p).name + local name = core.get_node(p).name - if minetest.get_item_group(name, "water") ~= 0 then + if core.get_item_group(name, "water") ~= 0 then return true end @@ -68,7 +68,7 @@ minetest.register_abm({ end local function replace(name, p) - minetest.set_node(p or pos, { name = name }) + core.set_node(p or pos, { name = name }) end PyuTest.dorange(pos, 1, function(p) diff --git a/mods/WORLD/pyutest_mapgen/api.lua b/mods/WORLD/pyutest_mapgen/api.lua index f6f6b47..9c11eaf 100644 --- a/mods/WORLD/pyutest_mapgen/api.lua +++ b/mods/WORLD/pyutest_mapgen/api.lua @@ -1,7 +1,7 @@ -- This function is used for structures because it will update the lighting when placed. PyuTest.register_structure = function(name, schematic, def) - local id = minetest.get_current_modname() .. ":structure_block_" .. name - minetest.register_node(id, { + local id = core.get_current_modname() .. ":structure_block_" .. name + core.register_node(id, { description = string.format("Structure Block (%s)", name), groups = { not_in_creative_inventory = 1 @@ -11,7 +11,7 @@ PyuTest.register_structure = function(name, schematic, def) pointable = false, }) - minetest.register_decoration({ + core.register_decoration({ sidelen = 80, decoration = id, deco_type = "simple", @@ -26,20 +26,20 @@ PyuTest.register_structure = function(name, schematic, def) y_min = def.y_min }) - minetest.register_lbm({ - name = minetest.get_current_modname() .. ":spawn_" .. name, + core.register_lbm({ + name = core.get_current_modname() .. ":spawn_" .. name, run_at_every_load = true, nodenames = { id }, action = function(pos, node) - minetest.remove_node(pos) - minetest.place_schematic(pos, PyuTest.get_schematic_path(schematic), def.rotation or "random", + core.remove_node(pos) + core.place_schematic(pos, PyuTest.get_schematic_path(schematic), def.rotation or "random", def.replacements or {}, def.force_placement or true, def.flags or "place_center_x, place_center_z") end }) end PyuTest.is_flat = function() - return minetest.get_mapgen_setting("mg_name") == "flat" + return core.get_mapgen_setting("mg_name") == "flat" end PyuTest.SPECIAL_STONE_NOISE_PARAMS = { @@ -107,7 +107,7 @@ PyuTest.BIOME_TYPES = { PyuTest.get_biomes_from_type = function(type) local biomes = {} - for k, v in pairs(minetest.registered_biomes) do + for k, v in pairs(core.registered_biomes) do if v._pyutest_biome_type == type then biomes[k] = v end @@ -119,7 +119,7 @@ end PyuTest.get_flowering_biomes = function() local biomes = {} - for k, v in pairs(minetest.registered_biomes) do + for k, v in pairs(core.registered_biomes) do if v._pyutest_biome_flowering == true and v._pyutest_biome_flowering_extra == false then table.insert(biomes, k) end @@ -131,7 +131,7 @@ end PyuTest.get_extra_flowering_biomes = function() local biomes = {} - for k, v in pairs(minetest.registered_biomes) do + for k, v in pairs(core.registered_biomes) do if v._pyutest_biome_flowering == true and v._pyutest_biome_flowering_extra == true then table.insert(biomes, k) end @@ -164,7 +164,7 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base) local y_min = (nopts["enable_beaches"] and not only_base) and nopts["y_min"] + 2 or nopts["y_min"] - minetest.register_biome(PyuTest.util.tableconcat(nopts, { + core.register_biome(PyuTest.util.tableconcat(nopts, { _pyutest_biome_type = type, y_min = y_min })) @@ -174,7 +174,7 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base) end if nopts["enable_beaches"] then - minetest.register_biome(PyuTest.util.tableconcat(nopts, { + core.register_biome(PyuTest.util.tableconcat(nopts, { name = name .. "_beach", y_max = y_min, y_min = PyuTest.OVERWORLD_SURFACE_BOTTOM, @@ -190,7 +190,7 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base) })) end - minetest.register_biome(PyuTest.util.tableconcat({ + core.register_biome(PyuTest.util.tableconcat({ name = name .. "_ocean", node_top = nopts["node_riverbed"], depth_top = 2, @@ -211,7 +211,7 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base) _pyutest_ocean_type = type })) - minetest.register_biome(PyuTest.util.tableconcat({ + core.register_biome(PyuTest.util.tableconcat({ name = name .. "_deep_ocean", node_top = nopts["node_riverbed"], @@ -234,7 +234,7 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base) _pyutest_ocean_type = type })) - minetest.register_biome(PyuTest.util.tableconcat({ + core.register_biome(PyuTest.util.tableconcat({ name = name .. "_cave", heat_point = nopts["heat_point"], humidity_point = nopts["humidity_point"], @@ -245,7 +245,7 @@ PyuTest.register_overworld_biome = function(name, type, opts, only_base) _pyutest_cave_type = type })) - minetest.register_biome(PyuTest.util.tableconcat({ + core.register_biome(PyuTest.util.tableconcat({ name = name .. "_deep_cave", heat_point = nopts["heat_point"], humidity_point = nopts["humidity_point"], diff --git a/mods/WORLD/pyutest_mapgen/init.lua b/mods/WORLD/pyutest_mapgen/init.lua index 5c8a172..7227f98 100644 --- a/mods/WORLD/pyutest_mapgen/init.lua +++ b/mods/WORLD/pyutest_mapgen/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("pyutest_mapgen") +local modpath = core.get_modpath("pyutest_mapgen") dofile(modpath .. "/api.lua") dofile(modpath .. "/mapgen.lua") diff --git a/mods/WORLD/pyutest_mapgen/mapgen.lua b/mods/WORLD/pyutest_mapgen/mapgen.lua index a92d5e0..2caa03e 100644 --- a/mods/WORLD/pyutest_mapgen/mapgen.lua +++ b/mods/WORLD/pyutest_mapgen/mapgen.lua @@ -1,13 +1,13 @@ -minetest.register_alias("mapgen_stone", "pyutest_blocks:stone_block") -minetest.register_alias("mapgen_water_source", "pyutest_blocks:water_source") -minetest.register_alias("mapgen_river_water_source", "pyutest_blocks:water_source") -minetest.register_alias("mapgen_lava_source", "pyutest_blocks:lava_source") -minetest.register_alias("mapgen_singlenode", "air") +core.register_alias("mapgen_stone", "pyutest_blocks:stone_block") +core.register_alias("mapgen_water_source", "pyutest_blocks:water_source") +core.register_alias("mapgen_river_water_source", "pyutest_blocks:water_source") +core.register_alias("mapgen_lava_source", "pyutest_blocks:lava_source") +core.register_alias("mapgen_singlenode", "air") -local mg_flags = minetest.settings:get_flags("mg_flags") -local mg_name = minetest.get_mapgen_setting("mg_name") -minetest.set_mapgen_setting(string.format("mg%s_cavern_threshold", mg_name), "0.20", true) -minetest.set_mapgen_setting(string.format("mg%s_mount_zero_level", mg_name), "1.4", true) +local mg_flags = core.settings:get_flags("mg_flags") +local mg_name = core.get_mapgen_setting("mg_name") +core.set_mapgen_setting(string.format("mg%s_cavern_threshold", mg_name), "0.20", true) +core.set_mapgen_setting(string.format("mg%s_mount_zero_level", mg_name), "1.4", true) mg_flags.caverns = true mg_flags.dungeons = false @@ -23,4 +23,4 @@ end if string.len(mg_flags_str) > 0 then mg_flags_str = string.sub(mg_flags_str, 1, string.len(mg_flags_str) - 1) end -minetest.set_mapgen_setting("mg_flags", mg_flags_str, true) +core.set_mapgen_setting("mg_flags", mg_flags_str, true) diff --git a/mods/WORLD/pyutest_ores/api.lua b/mods/WORLD/pyutest_ores/api.lua index 36640b2..839dd52 100644 --- a/mods/WORLD/pyutest_ores/api.lua +++ b/mods/WORLD/pyutest_ores/api.lua @@ -28,7 +28,7 @@ PyuTest.make_ore = function(id, desc, options) end end - minetest.register_node(id, PyuTest.util.tableconcat({ + core.register_node(id, PyuTest.util.tableconcat({ description = Translate(desc), groups = PyuTest.util.tableconcat({ cracky = conf.ore_strength, @@ -41,7 +41,7 @@ PyuTest.make_ore = function(id, desc, options) _pyutest_blast_resistance = conf.ore_blast_resistance }, conf.ore_conf)) - minetest.register_ore({ + core.register_ore({ ore_type = "scatter", ore = id, wherein = conf.wherein, @@ -52,7 +52,7 @@ PyuTest.make_ore = function(id, desc, options) y_min = conf.y_min, }) - minetest.register_ore({ + core.register_ore({ ore_type = "scatter", ore = id, wherein = conf.wherein, @@ -63,7 +63,7 @@ PyuTest.make_ore = function(id, desc, options) y_min = conf.y_min, }) - minetest.register_ore({ + core.register_ore({ ore_type = "scatter", ore = id, wherein = conf.wherein, @@ -116,7 +116,7 @@ PyuTest.make_ore_and_item = function(id, desc, item_id_suffix, item_description_ ore_drop = conf.ore_options.ore_drop or (rid or iid) })) - minetest.register_craftitem(iid, PyuTest.util.tableconcat({ + core.register_craftitem(iid, PyuTest.util.tableconcat({ description = Translate(desc .. " " .. item_description_suffix), groups = PyuTest.util.tableconcat({ mineral = 1 @@ -126,7 +126,7 @@ PyuTest.make_ore_and_item = function(id, desc, item_id_suffix, item_description_ }, conf.item_conf)) if conf.make_raw then - minetest.register_craftitem(rid, PyuTest.util.tableconcat({ + core.register_craftitem(rid, PyuTest.util.tableconcat({ description = Translate("Raw " .. desc), groups = PyuTest.util.tableconcat({ mineral = 1, @@ -136,7 +136,7 @@ PyuTest.make_ore_and_item = function(id, desc, item_id_suffix, item_description_ inventory_image = conf.raw_texture }, conf.raw_conf)) - minetest.register_craft({ + core.register_craft({ type = "cooking", output = iid, recipe = rid @@ -153,11 +153,11 @@ PyuTest.make_ore_and_item = function(id, desc, item_id_suffix, item_description_ local bid = id .. "_block" - minetest.override_item(bid, { + core.override_item(bid, { description = desc .. " Block" }) - minetest.register_craft({ + core.register_craft({ output = bid, recipe = { { iid, iid }, @@ -165,7 +165,7 @@ PyuTest.make_ore_and_item = function(id, desc, item_id_suffix, item_description_ } }) - minetest.register_craft({ + core.register_craft({ output = iid .. " 4", recipe = { bid diff --git a/mods/WORLD/pyutest_ores/init.lua b/mods/WORLD/pyutest_ores/init.lua index 41d3ac1..da89fa1 100644 --- a/mods/WORLD/pyutest_ores/init.lua +++ b/mods/WORLD/pyutest_ores/init.lua @@ -1,7 +1,7 @@ -local modpath = minetest.get_modpath(minetest.get_current_modname()) +local modpath = core.get_modpath(core.get_current_modname()) dofile(modpath .. "/api.lua") -minetest.register_ore({ +core.register_ore({ ore_type = "blob", ore = "pyutest_blocks:granite_block", wherein = "pyutest_blocks:stone_block", @@ -13,7 +13,7 @@ minetest.register_ore({ noise_params = PyuTest.SPECIAL_STONE_NOISE_PARAMS }) -minetest.register_ore({ +core.register_ore({ ore_type = "blob", ore = "pyutest_blocks:andesite_block", wherein = "pyutest_blocks:stone_block", @@ -25,7 +25,7 @@ minetest.register_ore({ noise_params = PyuTest.SPECIAL_STONE_NOISE_PARAMS }) -minetest.register_ore({ +core.register_ore({ ore_type = "blob", ore = "pyutest_blocks:diorite_block", wherein = "pyutest_blocks:stone_block", @@ -37,7 +37,7 @@ minetest.register_ore({ noise_params = PyuTest.SPECIAL_STONE_NOISE_PARAMS }) -minetest.register_ore({ +core.register_ore({ ore_type = "blob", ore = "pyutest_blocks:tuff_block", wherein = "pyutest_blocks:stone_block", @@ -49,7 +49,7 @@ minetest.register_ore({ noise_params = PyuTest.SPECIAL_STONE_NOISE_PARAMS }) -minetest.register_ore({ +core.register_ore({ ore_type = "blob", ore = "pyutest_blocks:clay_block", wherein = "pyutest_blocks:gravel_block", @@ -71,7 +71,7 @@ PyuTest.ORE_STONES = { "pyutest_blocks:darkstone_block" } -minetest.register_ore({ +core.register_ore({ ore_type = "blob", ore = "pyutest_blocks:dirt_block", wherein = "pyutest_blocks:stone_block", diff --git a/mods/WORLD/pyutest_overworld/features.lua b/mods/WORLD/pyutest_overworld/features.lua index eb08493..27e8c7f 100644 --- a/mods/WORLD/pyutest_overworld/features.lua +++ b/mods/WORLD/pyutest_overworld/features.lua @@ -1,5 +1,5 @@ -- Springs -minetest.register_ore({ +core.register_ore({ ore_type = "scatter", ore = "pyutest_blocks:water_source", wherein = PyuTest.ORE_STONES, @@ -10,7 +10,7 @@ minetest.register_ore({ y_min = PyuTest.OVERWORLD_SURFACE_BOTTOM, }) -minetest.register_ore({ +core.register_ore({ ore_type = "scatter", ore = "pyutest_blocks:lava_source", wherein = PyuTest.ORE_STONES, @@ -21,7 +21,7 @@ minetest.register_ore({ y_min = PyuTest.BIOME_TOPS.normal, }) -minetest.register_ore({ +core.register_ore({ ore_type = "scatter", ore = "pyutest_blocks:lava_source", wherein = PyuTest.ORE_STONES, @@ -33,7 +33,7 @@ minetest.register_ore({ }) -- Mountain Strips -minetest.register_ore({ +core.register_ore({ ore_type = "sheet", ore = "pyutest_blocks:calcite_block", wherein = "pyutest_blocks:stone_block", diff --git a/mods/WORLD/pyutest_overworld/init.lua b/mods/WORLD/pyutest_overworld/init.lua index 5acc4ff..91087bc 100644 --- a/mods/WORLD/pyutest_overworld/init.lua +++ b/mods/WORLD/pyutest_overworld/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("pyutest_overworld") +local modpath = core.get_modpath("pyutest_overworld") dofile(modpath .. "/biomes.lua") diff --git a/mods/WORLD/pyutest_overworld/structures.lua b/mods/WORLD/pyutest_overworld/structures.lua index 8a68e59..24e491f 100644 --- a/mods/WORLD/pyutest_overworld/structures.lua +++ b/mods/WORLD/pyutest_overworld/structures.lua @@ -1,4 +1,4 @@ -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", sidelen = 16, fill_ratio = 0.0003, diff --git a/mods/WORLD/pyutest_overworld/trees.lua b/mods/WORLD/pyutest_overworld/trees.lua index cbb883a..dd9039c 100644 --- a/mods/WORLD/pyutest_overworld/trees.lua +++ b/mods/WORLD/pyutest_overworld/trees.lua @@ -1,5 +1,5 @@ -- plants and other small decorations -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", place_on = { "group:grass" }, sidelen = 16, @@ -8,7 +8,7 @@ minetest.register_decoration({ decoration = PyuTest.registered_flowers }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", place_on = { "group:grass" }, sidelen = 16, @@ -17,7 +17,7 @@ minetest.register_decoration({ decoration = PyuTest.registered_flowers }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", place_on = { "group:grass" }, sidelen = 16, @@ -26,7 +26,7 @@ minetest.register_decoration({ decoration = "pyutest_grass:grass_plant" }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", place_on = { "group:grass" }, sidelen = 16, @@ -35,7 +35,7 @@ minetest.register_decoration({ decoration = "pyutest_blocks:haybale_block" }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", place_on = { "pyutest_blocks:dirt_block", "pyutest_blocks:sand_block" }, sidelen = 16, @@ -44,7 +44,7 @@ minetest.register_decoration({ decoration = "pyutest_flowers:deadbush" }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", place_on = { "group:sand" }, fill_ratio = 0.0009, @@ -55,7 +55,7 @@ minetest.register_decoration({ height_max = 5 }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", sidelen = 16, fill_ratio = 0.03, @@ -67,7 +67,7 @@ minetest.register_decoration({ flags = "liquid_surface" }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "simple", sidelen = 16, fill_ratio = 0.04, @@ -82,7 +82,7 @@ minetest.register_decoration({ }) -- trees -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -94,7 +94,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -106,7 +106,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -119,7 +119,7 @@ minetest.register_decoration({ place_offset_y = 1 }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "pyutest_blocks:mycelium_block" }, sidelen = 16, @@ -132,7 +132,7 @@ minetest.register_decoration({ place_offset_y = 1 }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -145,7 +145,7 @@ minetest.register_decoration({ place_offset_y = 1 }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -157,7 +157,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -169,7 +169,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -182,7 +182,7 @@ minetest.register_decoration({ place_offset_y = 1 }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "pyutest_blocks:snow_block" }, sidelen = 16, @@ -194,7 +194,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "pyutest_blocks:snow_block" }, sidelen = 16, @@ -207,7 +207,7 @@ minetest.register_decoration({ place_offset_y = 1 }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -219,7 +219,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -231,7 +231,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -243,7 +243,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "group:grass" }, sidelen = 16, @@ -255,7 +255,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "pyutest_blocks:podzol_block" }, sidelen = 16, @@ -267,7 +267,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "pyutest_blocks:mycelium_block" }, sidelen = 16, @@ -279,7 +279,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "pyutest_blocks:mycelium_block" }, sidelen = 16, @@ -292,7 +292,7 @@ minetest.register_decoration({ force_placement = true }) -minetest.register_decoration({ +core.register_decoration({ deco_type = "schematic", place_on = { "pyutest_blocks:mycelium_block" }, sidelen = 16, diff --git a/mods/WORLD/pyutest_worlds/api.lua b/mods/WORLD/pyutest_worlds/api.lua index c0e5a55..61a3fa9 100644 --- a/mods/WORLD/pyutest_worlds/api.lua +++ b/mods/WORLD/pyutest_worlds/api.lua @@ -20,7 +20,7 @@ PyuTest.register_world = function(options) error("Please supply 'name' in the options table!") end - minetest.register_decoration({ + core.register_decoration({ deco_type = "simple", decoration = "pyutest_blocks:bedrock", place_on = "group:block", @@ -31,7 +31,7 @@ PyuTest.register_world = function(options) flags = "force_placement" }) - minetest.register_decoration({ + core.register_decoration({ deco_type = "simple", decoration = "pyutest_blocks:bedrock", place_on = "group:block", @@ -75,14 +75,14 @@ PyuTest.register_world = function(options) end function World:register_ore(o) - minetest.register_ore(PyuTest.util.tableconcat(o, { + core.register_ore(PyuTest.util.tableconcat(o, { y_max = conf.y_max, y_min = conf.y_min, })) end function World:register_decoration(o) - minetest.register_decoration(PyuTest.util.tableconcat(o, { + core.register_decoration(PyuTest.util.tableconcat(o, { y_max = conf.y_max, y_min = conf.y_min })) @@ -103,15 +103,15 @@ PyuTest.register_world = function(options) itemstack:take_item() user:set_pos(npos) - minetest.sound_play({ name = "spellbook_action", gain = 1 }, { pos = npos }) + core.sound_play({ name = "spellbook_action", gain = 1 }, { pos = npos }) local min = npos - vector.new(range, range, range) local max = npos + vector.new(range, range, range) - local c_air = minetest.get_content_id("air") - local c_obsidian = minetest.get_content_id("pyutest_blocks:obsidian_block") + local c_air = core.get_content_id("air") + local c_obsidian = core.get_content_id("pyutest_blocks:obsidian_block") - local vm = minetest.get_voxel_manip() + local vm = core.get_voxel_manip() local emin, emax = vm:read_from_map(min, max) local a = VoxelArea:new { MinEdge = emin, @@ -144,7 +144,7 @@ PyuTest.register_world = function(options) local p = vector.new(ax, emin.y + 1, az) - minetest.set_node(p, { + core.set_node(p, { name = "pyutest_blocks:light" }) @@ -154,7 +154,7 @@ PyuTest.register_world = function(options) end }) - minetest.register_craft({ + core.register_craft({ output = name, recipe = { craftitem, diff --git a/mods/WORLD/pyutest_worlds/init.lua b/mods/WORLD/pyutest_worlds/init.lua index 9c20c3c..041182b 100644 --- a/mods/WORLD/pyutest_worlds/init.lua +++ b/mods/WORLD/pyutest_worlds/init.lua @@ -1,4 +1,4 @@ -local modpath = minetest.get_modpath("pyutest_worlds") +local modpath = core.get_modpath("pyutest_worlds") dofile(modpath .. "/api.lua")