forked from mad-star-studio/Voxelis
Some renames
This commit is contained in:
parent
70e6cd7ab4
commit
45ecb37f1b
7 changed files with 0 additions and 0 deletions
0
mods/HUD/vox_inventory/creative.lua
Normal file
0
mods/HUD/vox_inventory/creative.lua
Normal file
39
mods/HUD/vox_inventory/init.lua
Normal file
39
mods/HUD/vox_inventory/init.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
---------------------------------------------------------------------------
|
||||
-- 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/>.
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
-- 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/vox_inventory/mod.conf
Normal file
2
mods/HUD/vox_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/vox_inventory/survival.lua
Normal file
0
mods/HUD/vox_inventory/survival.lua
Normal file
Loading…
Add table
Add a link
Reference in a new issue