Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minetest.settings to CSM API and allow CSMs to provide settingtypes.txt #12131

Merged
merged 8 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix
  • Loading branch information
AFCMS committed Jul 13, 2022
commit 4021becadca2810b96a89083102635087fa7b040
1 change: 1 addition & 0 deletions builtin/client/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ dofile(commonpath .. "after.lua")
dofile(commonpath .. "chatcommands.lua")
dofile(clientpath .. "chatcommands.lua")
dofile(clientpath .. "death_formspec.lua")
dofile(clientpath .. "misc.lua")
7 changes: 7 additions & 0 deletions builtin/client/misc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
function core.setting_get_pos(name)
local value = core.settings:get(name)
if not value then
return nil
end
return core.string_to_pos(value)
end
9 changes: 0 additions & 9 deletions builtin/common/misc_helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,6 @@ function core.wrap_text(text, max_length, as_table)
return as_table and result or table.concat(result, '\n')
end


function core.setting_get_pos(name)
local value = core.settings:get(name)
if not value then
return nil
end
return core.string_to_pos(value)
end

--------------------------------------------------------------------------------

if INIT == "game" then
Expand Down
39 changes: 0 additions & 39 deletions builtin/game/misc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,45 +120,6 @@ function core.get_player_radius_area(player_name, radius)
return p1, p2
end


function core.hash_node_position(pos)
return (pos.z + 32768) * 65536 * 65536
+ (pos.y + 32768) * 65536
+ pos.x + 32768
end


function core.get_position_from_hash(hash)
local x = (hash % 65536) - 32768
hash = math.floor(hash / 65536)
local y = (hash % 65536) - 32768
hash = math.floor(hash / 65536)
local z = (hash % 65536) - 32768
return vector.new(x, y, z)
end


function core.get_item_group(name, group)
if not core.registered_items[name] or not
core.registered_items[name].groups[group] then
return 0
end
return core.registered_items[name].groups[group]
end


function core.get_node_group(name, group)
core.log("deprecated", "Deprecated usage of get_node_group, use get_item_group instead")
return core.get_item_group(name, group)
end


-- See l_env.cpp for the other functions
function core.get_artificial_light(param1)
return math.floor(param1 / 16)
end


-- To be overriden by protection mods

function core.is_protected(pos, name)
Expand Down