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:
DesertMermaid 2024-12-10 15:23:36 -08:00
parent 3d6a93b885
commit a7ac9c29b2
39 changed files with 788 additions and 3 deletions

2
mods/BLOCKS/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = BLOCKS
description = Meta-modpack containing the blocks-related mods for Voxelis

View file

@ -0,0 +1,19 @@
---------------------------------------------------------------------------
-- 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/>.
---------------------------------------------------------------------------
core.register_node("vox:grass", {
description = "Grass",
tiles = {"vox_grass.png"},
groups = {cracky = 3}
})
core.register_alias("grass", "vox:grass")

View file

@ -0,0 +1,2 @@
name = vox_overworld
description = Voxelis - overworld: General Overworld blocks

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 B

0
mods/COMPAT/README.md Normal file
View file

View file

@ -0,0 +1,5 @@
# Voxelis API - `default` namespace
This is present so that Voxelis may reimplement the `default` API, of which minetest_game provides, so that many mods may work.
The API is based on, and intended to be compatible with, the API described here: <https://github.com/minetest/minetest_game/blob/master/game_api.txt> (as of December of 2024)

View file

@ -0,0 +1,12 @@
---------------------------------------------------------------------------
-- 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/>.
---------------------------------------------------------------------------

View file

@ -0,0 +1,2 @@
name = default
description = Voxelis API - default: A reimplementation of the minetest_game default for compatibility

2
mods/COMPAT/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = COMPAT
description = Meta-modpack containing the core mods for Voxelis for compatibilities

98
mods/CORE/colors/init.lua Normal file
View file

@ -0,0 +1,98 @@
---------------------------------------------------------------------------
-- 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_colors_bg_brightness = 0.8;
vox_colors = {
WHITE = "#FFFFFF",
LIGHTGREY = "#D3D3D3",
SILVER = "#C0C0C0",
GREY = "#808080",
BLACK = "#000000",
RED = "#FF0000",
DARK_RED = "#8B0000",
YELLOW = "#FFFF00",
GOLD = "#FFD700",
ORANGE = "#FFA500",
PUMPKIN = "#FF7518",
CREAM = "#FFFDD0",
TAN = "#D2B48C",
BROWN = "#A52A2A",
DARK_BROWN = "#8B4513",
LIME = "#00FF00",
MINT = "#98FF98",
EMERALD = "#50C878",
DARK_GREEN = "#006400",
TURQUOISE = "#40E0D0",
TEAL = "#008080",
CYAN = "#00FFFF",
BLUE = "#0000FF",
NAVY = "#000080",
MAGENTA = "#FF00FF",
VIOLET = "#EE82EE",
PURPLE = "#800080",
INDIGO = "#4B0082",
PINK = "#FF69B4",
FLAMINGO = "#FC8EAC",
}
function vox_colors.bg(color) {
return vox_colors_multiplier(color, vox_colors_bg_brightness);
}
-- Validate that the provided color string is a valid hex color
function vox_colors.validate(color) {
if (color == nil) {
return false;
}
-- Hex colors should always be a length of 7 (1 pound, 6 hex)
if (string.len(color) != 7) {
return false;
}
-- Ensure first character is a pound
if (string.sub(color, 1, 1) != "#") {
return false;
}
-- Ensure that RR, GG, and BB are valid hex fields
if (string.match(string.sub(color, 2, 3), "[0-9A-Fa-f]") == nil) {
return false;
}
return true;
}
-- Extract color information from the color and return a { red: Number, green: Number, blue: Number } table
function vox_colors.extract_channels(color) {
return {
red: tonumber(string.sub(color, 2, 3), 16),
green: tonumber(string.sub(color, 4, 5), 16),
blue: tonumber(string.sub(color, 6, 7), 16)
};
}
function vox_colors.from_channels(red, green, blue) {
return "#" .. string.format("%02X", red) .. string.format("%02X", green) .. string.format("%02X", blue);
}
-- Multiply the color by a percentage
function vox_colors.multiplier(color, percentage) {
local channels = vox_colors_extract_channels(color);
return vox_colors_from_channels(
math.floor(channels.red * percentage),
math.floor(channels.green * percentage),
math.floor(channels.blue * percentage)
);
}

View file

@ -0,0 +1,2 @@
name = vox_colors
description = Voxelis - colors: Collection of colors, color schemes, and color utilities for Voxelis.

0
mods/CORE/controls Normal file
View file

2
mods/CORE/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = CORE
description = Meta-modpack containing the core mods for Voxelis for core APIs, variables and definitions

View file

@ -0,0 +1,34 @@
---------------------------------------------------------------------------
-- 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/>.
---------------------------------------------------------------------------
-- This file is intended as the primary entry point for the game.
core.register_node("vox_main:grass", {
description = "Grass",
tiles = {"vox_main_grass.png"},
groups = {cracky = 3}
})
core.register_alias("grass", "vox_main:grass")
core.register_biome({
name = "grassland",
node_top = "vox_main:grass",
depth_top = 1,
node_filler = "vox_main:grass",
depth_filler = 3,
node_stone = "vox_main:grass",
height_min = 1,
height_max = 4,
heat_point = 50,
humidity_point = 50
})

View file

@ -0,0 +1,2 @@
name = vox_main
description = Voxelis - main: core mod

View file

@ -0,0 +1,2 @@
name = ENTITIES
description = Meta-modpack containing entity-related mods for Voxelis

View file

@ -0,0 +1,2 @@
name = ENVIRONMENT
description = Meta-modpack containing environment-related mods for Voxelis. This is useful for moon, weather, lightning, raids, sieges, ...

2
mods/HELP/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = HELP
description = Meta-modpack containing the help-related mods for Voxelis

View file

View 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

View file

@ -0,0 +1,2 @@
name = vox_inventory
description = Voxelis - inventory: Adds a new inventory system to the game.

View file

2
mods/HUD/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = HUD
description = Meta-modpack containing the HUD-related mods for Voxelis

2
mods/ITEMS/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = ITEMS
description = Meta-modpack containing the items-related mods for Voxelis

2
mods/MAPGEN/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = MAPGEN
description = Meta-modpack containing the mapgen-related mods for Voxelis

2
mods/MISC/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = MISC
description = Meta-modpack containing the misc/unsorted mods for Voxelis

2
mods/PLAYER/modpack.conf Normal file
View file

@ -0,0 +1,2 @@
name = PLAYER
description = Meta-modpack containing the player-related mods for Voxelis