diff --git a/mods/mapgen/init.lua b/mods/mapgen/init.lua index 4992c89..c326ffc 100644 --- a/mods/mapgen/init.lua +++ b/mods/mapgen/init.lua @@ -1,16 +1,16 @@ -local mgparams = minetest.get_mapgen_params() +local mgparams = core.get_mapgen_params() if mgparams.mgname == "v6" then error("Mapgen 'v6' is not supported by Cave Game.", 0) end -minetest.register_alias("mapgen_stone", "minecraft:stone") -minetest.register_alias("mapgen_water_source", "air") -minetest.register_alias("mapgen_river_water_source", "air") +core.register_alias("mapgen_stone", "minecraft:stone") +core.register_alias("mapgen_water_source", "air") +core.register_alias("mapgen_river_water_source", "air") -- FIXME: Why dosen't node_top work properly? -minetest.register_biome({ +core.register_biome({ name = "cavegame", node_dust = "minecraft:grass", -- node_top = "minecraft:grass", @@ -23,13 +23,13 @@ minetest.register_biome({ if mgparams.mgname == "singlenode" then - local ground_level = tonumber(minetest.settings:get("water_level") or 1) - local air = minetest.get_content_id("air") - local stone = minetest.get_content_id("minecraft:stone") - local grass = minetest.get_content_id("minecraft:grass") + local ground_level = tonumber(core.settings:get("water_level") or 1) + local air = core.get_content_id("air") + local stone = core.get_content_id("minecraft:stone") + local grass = core.get_content_id("minecraft:grass") - minetest.register_on_generated(function(minp, maxp, blockseed) - local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + core.register_on_generated(function(minp, maxp, blockseed) + local vm, emin, emax = core.get_mapgen_object("voxelmanip") local va = VoxelArea:new({MinEdge=emin, MaxEdge=emax}) local nodes = vm:get_data() @@ -50,14 +50,14 @@ if mgparams.mgname == "singlenode" then end) -- see https://github.com/minetest/minetest/issues/12782 - if not minetest.settings:get("static_spawnpoint") then + if not core.settings:get("static_spawnpoint") then local spawnpos = vector.new(0, ground_level+1, 0) - minetest.register_on_joinplayer(function(player, lastlogin) + core.register_on_joinplayer(function(player, lastlogin) if not lastlogin then player:set_pos(spawnpos) end end) - minetest.register_on_respawnplayer(function(player) + core.register_on_respawnplayer(function(player) player:set_pos(spawnpos) return true end) diff --git a/mods/nodes/init.lua b/mods/nodes/init.lua index a3c7133..d41baa6 100644 --- a/mods/nodes/init.lua +++ b/mods/nodes/init.lua @@ -1,8 +1,8 @@ -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.order then - minetest.register_alias(tostring(def.order), name) + core.register_alias(tostring(def.order), name) end end end) @@ -11,7 +11,7 @@ end) -- nodes -- -minetest.register_node(":minecraft:stone", { +core.register_node(":minecraft:stone", { order = 1, description = "Stone", tiles = { "default_cobble.png" }, @@ -19,7 +19,7 @@ minetest.register_node(":minecraft:stone", { is_ground_content = true, }) -minetest.register_node(":minecraft:grass", { +core.register_node(":minecraft:grass", { order = 2, description = "Grass", tiles = { "default_grass.png" }, diff --git a/mods/player/init.lua b/mods/player/init.lua index 8223236..4234263 100644 --- a/mods/player/init.lua +++ b/mods/player/init.lua @@ -13,14 +13,14 @@ local hud_flags = { local inv_list = {} local inv_size = 0 -minetest.register_on_mods_loaded(function() +core.register_on_mods_loaded(function() local unordered = {} - for name,def in pairs(minetest.registered_nodes) do + for name,def in pairs(core.registered_nodes) do if def.order then inv_size = math.max(inv_size, def.order) inv_list[def.order] = name - minetest.override_item(name, { + core.override_item(name, { -- drop = "", -- stack_max = 1, range = 16, @@ -37,7 +37,7 @@ minetest.register_on_mods_loaded(function() end end) -minetest.register_on_joinplayer(function(player, last_login) +core.register_on_joinplayer(function(player, last_login) -- player:set_sky({}) --TODO player:set_sun({ visible=false, sunrise_visible=false }) player:set_moon({ visible=false }) @@ -53,7 +53,7 @@ minetest.register_on_joinplayer(function(player, last_login) player:hud_set_hotbar_itemcount(inv_size) local name = player:get_player_name() - local inv = minetest.get_inventory({ type="player", name=name }) + local inv = core.get_inventory({ type="player", name=name }) inv:set_size("main", inv_size) inv:set_list("main", inv_list) @@ -78,7 +78,7 @@ for _,group in ipairs(groups) do groupcaps[group] = cap end -minetest.register_item(":", { +core.register_item(":", { type = "none", tool_capabilities = { full_punch_interval = 0.2, @@ -92,13 +92,13 @@ minetest.register_item(":", { -- in-world items -- ---local old_item_drop = minetest.item_drop -minetest.item_drop = function(itemstack, ...) +--local old_item_drop = core.item_drop +core.item_drop = function(itemstack, ...) return itemstack end -local old_item_place = minetest.item_place -minetest.item_place = function(...) +local old_item_place = core.item_place +core.item_place = function(...) old_item_place(...) return nil end