forked from mad-star-studio/Voxelis
new file: .forgejo/workflows/error_check.yml
new file: .forgejo/workflows/unit_test.yml new file: .luacheckrc new file: .vscode/settings.json new file: LICENSE new file: default.nix modified: game.conf modified: minetest.conf new file: mods/BLOCKS/modpack.conf new file: mods/BLOCKS/overworld/init.lua new file: mods/BLOCKS/overworld/mod.conf new file: mods/BLOCKS/overworld/textures/vox_grass.png new file: mods/COMPAT/README.md new file: mods/COMPAT/minetest_default/README.md new file: mods/COMPAT/minetest_default/init.lua new file: mods/COMPAT/minetest_default/mod.conf new file: mods/COMPAT/modpack.conf new file: mods/CORE/colors/init.lua new file: mods/CORE/colors/mod.conf new file: mods/CORE/controls new file: mods/CORE/modpack.conf new file: mods/CORE/vox_main/init.lua new file: mods/CORE/vox_main/mod.conf new file: mods/ENTITIES/modpack.conf new file: mods/ENVIRONMENT/modpack.conf new file: mods/HELP/modpack.conf new file: mods/HUD/inventory/creative.lua new file: mods/HUD/inventory/init.lua new file: mods/HUD/inventory/mod.conf new file: mods/HUD/inventory/survival.lua new file: mods/HUD/modpack.conf new file: mods/ITEMS/modpack.conf new file: mods/MAPGEN/modpack.conf new file: mods/MISC/modpack.conf new file: mods/PLAYER/modpack.conf modified: settingtypes.txt new file: tests/CORE/colors.lua new file: tests/README.md new file: tests/sanity.lua
This commit is contained in:
parent
3d6a93b885
commit
a7ac9c29b2
39 changed files with 788 additions and 3 deletions
0
mods/HUD/inventory/creative.lua
Normal file
0
mods/HUD/inventory/creative.lua
Normal file
41
mods/HUD/inventory/init.lua
Normal file
41
mods/HUD/inventory/init.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
---------------------------------------------------------------------------
|
||||
-- Voxelis - Voxel survival sandbox for Luanti
|
||||
-- Copyright (C) 2024 Mad Star Studio LLC
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; either version 3 of the License, or
|
||||
-- (at your option) any later version.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License along
|
||||
-- with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
vox_inventory {}
|
||||
|
||||
-- Includes
|
||||
|
||||
dofile(core.get_modpath(core.get_current_modname()) .. "/survival.lua")
|
||||
dofile(core.get_modpath(core.get_current_modname()) .. "/creative.lua")
|
||||
|
||||
-- Utility functions
|
||||
|
||||
function core.creative_enabled_for(name)
|
||||
assert(type(name) == "string", "core.creative_enabled_for requires an argument - a player name")
|
||||
local player = core.get_player_by_name(name)
|
||||
if player then
|
||||
return player:get_meta():get_string("gamemode") == "creative"
|
||||
end
|
||||
core.log(["warning"], "core.creative_enabled_for: player not found: " .. name)
|
||||
return false
|
||||
end
|
||||
|
||||
function core.survival_enabled_for(name)
|
||||
assert(type(name) == "string", "core.survival_enabled_for requires an argument - a player name")
|
||||
local player = core.get_player_by_name(name)
|
||||
if player then
|
||||
return player:get_meta():get_string("gamemode") == "survival"
|
||||
end
|
||||
core.log(["warning"], "core.survival_enabled_for: player not found: " .. name)
|
||||
return false
|
||||
end
|
2
mods/HUD/inventory/mod.conf
Normal file
2
mods/HUD/inventory/mod.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
name = vox_inventory
|
||||
description = Voxelis - inventory: Adds a new inventory system to the game.
|
0
mods/HUD/inventory/survival.lua
Normal file
0
mods/HUD/inventory/survival.lua
Normal file
2
mods/HUD/modpack.conf
Normal file
2
mods/HUD/modpack.conf
Normal file
|
@ -0,0 +1,2 @@
|
|||
name = HUD
|
||||
description = Meta-modpack containing the HUD-related mods for Voxelis
|
Loading…
Add table
Add a link
Reference in a new issue