diff --git a/mods/CORE/mcl_init/compatibility.lua b/mods/CORE/mcl_init/compatibility.lua new file mode 100644 index 000000000..6172430c1 --- /dev/null +++ b/mods/CORE/mcl_init/compatibility.lua @@ -0,0 +1,3 @@ +function minetest.is_creative_enabled() + return false +end diff --git a/mods/CORE/mcl_init/init.lua b/mods/CORE/mcl_init/init.lua index a495935f5..4e5b5b675 100644 --- a/mods/CORE/mcl_init/init.lua +++ b/mods/CORE/mcl_init/init.lua @@ -30,3 +30,7 @@ minetest.craftitemdef_default.stack_max = 64 -- Set random seed for all other mods (Remember to make sure no other mod calls this function) math.randomseed(os.time()) + +local modname = minetest.get_current_modname() +local modpath = minetest.get_modpath(modname) +dofile(modpath .. "/compatibility.lua") diff --git a/mods/ENTITIES/mcl_burning/api.lua b/mods/ENTITIES/mcl_burning/api.lua index 969985205..bfd21acdb 100644 --- a/mods/ENTITIES/mcl_burning/api.lua +++ b/mods/ENTITIES/mcl_burning/api.lua @@ -11,6 +11,7 @@ function mcl_burning.is_affected_by_rain(obj) end function mcl_burning.get_collisionbox(obj, smaller, storage) + if not storage then return end local cache = storage.collisionbox_cache if cache then local box = cache[smaller and 2 or 1] @@ -29,6 +30,7 @@ end function mcl_burning.get_touching_nodes(obj, nodenames, storage) local pos = obj:get_pos() local minp, maxp = mcl_burning.get_collisionbox(obj, true, storage) + if not minp or not maxp then return {} end local nodes = minetest.find_nodes_in_area(vector.add(pos, minp), vector.add(pos, maxp), nodenames) return nodes end diff --git a/mods/ENTITIES/mcl_burning/init.lua b/mods/ENTITIES/mcl_burning/init.lua index a47824537..2e01411b6 100644 --- a/mods/ENTITIES/mcl_burning/init.lua +++ b/mods/ENTITIES/mcl_burning/init.lua @@ -16,7 +16,7 @@ dofile(modpath .. "/api.lua") minetest.register_globalstep(function(dtime) for _, player in pairs(get_connected_players()) do local storage = mcl_burning.storage[player] - if not mcl_burning.tick(player, dtime, storage) and not mcl_burning.is_affected_by_rain(player) then + if not mcl_burning.tick(player, dtime, storage or {}) and not mcl_burning.is_affected_by_rain(player) then local nodes = mcl_burning.get_touching_nodes(player, {"group:puts_out_fire", "group:set_on_fire"}, storage) local burn_time = 0 diff --git a/mods/ENVIRONMENT/mcl_moon/init.lua b/mods/ENVIRONMENT/mcl_moon/init.lua index 200c6ca41..09b080810 100644 --- a/mods/ENVIRONMENT/mcl_moon/init.lua +++ b/mods/ENVIRONMENT/mcl_moon/init.lua @@ -53,7 +53,9 @@ minetest.register_globalstep(function(dtime) local moon_arg = {texture = get_moon_texture()} local players = minetest.get_connected_players() for p=1, #players do - players[p]:set_moon(moon_arg) + if players[p].set_moon then + players[p]:set_moon(moon_arg) + end end end) diff --git a/mods/HELP/mcl_craftguide/init.lua b/mods/HELP/mcl_craftguide/init.lua index 3bc7b705a..439d80ae9 100644 --- a/mods/HELP/mcl_craftguide/init.lua +++ b/mods/HELP/mcl_craftguide/init.lua @@ -1077,10 +1077,10 @@ if progressive_mode then local name = player:get_player_name() local data = player_data[name] local inv_items = get_inv_items(player) - local diff = table_diff(inv_items, data.inv_items) + local diff = table_diff(inv_items, data and data.inv_items or {}) if #diff > 0 then - data.inv_items = table_merge(diff, data.inv_items) + data.inv_items = table_merge(diff, data and data.inv_items or {}) end end diff --git a/mods/MAPGEN/mcl_mapgen_core/init.lua b/mods/MAPGEN/mcl_mapgen_core/init.lua index 88fa0dabf..4664c0a22 100644 --- a/mods/MAPGEN/mcl_mapgen_core/init.lua +++ b/mods/MAPGEN/mcl_mapgen_core/init.lua @@ -1113,7 +1113,7 @@ local function register_mgv6_decorations() end -local mg_flags = minetest.settings:get_flags("mg_flags") +local mg_flags = minetest.settings.get_flags and minetest.settings:get_flags("mg_flags") or {} -- Inform other mods of dungeon setting for MCL2-style dungeons mcl_vars.mg_dungeons = mcl_mapgen.dungeons diff --git a/mods/MISC/mcl_commands/gamemode.lua b/mods/MISC/mcl_commands/gamemode.lua index bd24a7685..e73591e70 100644 --- a/mods/MISC/mcl_commands/gamemode.lua +++ b/mods/MISC/mcl_commands/gamemode.lua @@ -20,6 +20,7 @@ minetest.register_on_shutdown(function() end) local core_is_creative_enabled = minetest.is_creative_enabled + or function() return false end minetest.is_creative_enabled = function(name) local id = player_to_gamemode_id[name] diff --git a/mods/PLAYER/mcl_anticheat/init.lua b/mods/PLAYER/mcl_anticheat/init.lua index 25ec3fd48..adaddfcb7 100644 --- a/mods/PLAYER/mcl_anticheat/init.lua +++ b/mods/PLAYER/mcl_anticheat/init.lua @@ -45,7 +45,7 @@ local function update_player(player_object) local player_data = { pos = pos, - velocity = player_object:get_velocity(), + velocity = player_object:get_velocity() or player_object:get_player_velocity(), air = air } @@ -92,7 +92,7 @@ local function check_player(name) if not obj_player then kick_player(name, "flights") end - local velocity = obj_player:get_velocity() + local velocity = obj_player:get_velocity() or obj_player:get_player_velocity() local pos = obj_player:get_pos() local x, y, z = floor(pos.x), floor(pos.y), floor(pos.z) while ( get_node({x = x , y = y, z = z }).name == "air" diff --git a/mods/PLAYER/mcl_player/mod.conf b/mods/PLAYER/mcl_player/mod.conf index 97ccce8e6..2443524dd 100644 --- a/mods/PLAYER/mcl_player/mod.conf +++ b/mods/PLAYER/mcl_player/mod.conf @@ -1,3 +1,4 @@ name = mcl_player author = celeron55 description = Adds the 3D player model, taken from Minetest Game 0.4.16. +depends = mcl_playerinfo