From 260ff7143ac39b1e862999b7c0b7f1911ddd7c55 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Wed, 7 Jun 2023 17:55:05 -0400 Subject: [PATCH] simplified killme/game_commands into default mod --- LICENSE.txt | 75 ++++++++++++++++++++++++++++++++------- README.md | 1 + mods/default/commands.lua | 42 ++++++++++++++++++++++ mods/default/init.lua | 1 + mods/killme/init.lua | 24 ------------- 5 files changed, 106 insertions(+), 37 deletions(-) create mode 100644 mods/default/commands.lua delete mode 100644 mods/killme/init.lua diff --git a/LICENSE.txt b/LICENSE.txt index 0bb3a4a..aff7dfd 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,20 +1,69 @@ -License of media (textures and sounds) --------------------------------------- -Copyright (C) 2010-2012 celeron55, Perttu Ahola -See README.txt in each mod directory for information about other authors. - -Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) -http://creativecommons.org/licenses/by-sa/3.0/ - -License of menu/header.png -Copyright (C) 2015 unkown user CC BY-SA 3.0 - - License of source code ---------------------- -Copyright (C) 2010-2012 celeron55, Perttu Ahola + +LGPL, base default mods Copyright (C) 2010-2012 celeron55, Perttu Ahola See README.txt in each mod directory for information about other authors. +License of media (textures and sounds) +-------------------------------------- + +Default minetest mod textures Copyright (C) 2010-2012 celeron55, Perttu Ahola +See README.txt in each mod directory for information about other authors. + +License of menu/header.png +Copyright (C) 2015 unkown user CC BY-SA 4.0 + + +License of modified or added source code +---------------------------------------- +Copyright (C) 2020-2023 mckaygerhard , mckayshirou +See README in each mod directory for information about modified or taken code +cos mostly those were made or taken when license are not existing, check headers of each file + + +CC-BY-SA-NC 4.0 +=============== + + Attribution-ShareAlike 4.0 Unported (CC BY-SA 4.0) + http://creativecommons.org/licenses/by-sa/4.0/ + +You are free to: + +* Share — copy and redistribute the material in any medium or format +* Adapt — remix, transform, and build upon the material + +The licensor cannot revoke these freedoms as long as you follow +the license terms. + +Under the following terms: + +* Attribution — You must give appropriate credit, provide a link to +the license, and indicate if changes were made. You may do so in any +reasonable manner, but not in any way that suggests the licensor +endorses you or your use. +* NonCommercial — You may not use the material for commercial purposes. +* ShareAlike — If you remix, transform, or build upon the material, +you must distribute your contributions under the same license as the +original. +* No additional restrictions — You may not apply legal terms or technological +measures that legally restrict others from doing anything the license permits. + +Notices: + +You do not have to comply with the license for elements of the material in +the public domain or where your use is permitted by an applicable exception +or limitation. + +No warranties are given. The license may not give you all of the permissions +necessary for your intended use. For example, other rights such as publicity, +privacy, or moral rights may limit how you use the material. + + + + +LGPL v 2.1 +=========== + GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 diff --git a/README.md b/README.md index 0629180..ff580fa 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ To download you can play this game with the following minetest engines: #### Mods * minetest default + * killme/game_commands were simplified into default mod, and provide CC-BY-SA-NC license * sorceredkid auth mod * minetest Auth Redux as `auth_rx` [mods/auth_rx](mods/auth_rx) from https://codeberg.org/minenux/minetest-mod-auth_rx * so then minetest Formspecs as `formspecs` [mods/formspecs](mods/formspecs) from https://codeberg.org/minenux/minetest-mod-formspecs diff --git a/mods/default/commands.lua b/mods/default/commands.lua new file mode 100644 index 0000000..64f81e0 --- /dev/null +++ b/mods/default/commands.lua @@ -0,0 +1,42 @@ +-- mod governor by mckaygerhard -- minimal subset of commands extracted +-- Copyright 2020 + +---------------------------------------------------------------------------- +-- this program can be used free but cannot be used commertially or +-- modified for, licenced only to CC BY-NC-SA 4.0 + +-- This program is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +---------------------------------------------------------------------------- + +local killme_mod = minetest.get_modpath("killme") +local killme_mod = minetest.get_modpath("game_commands") + + +if not killme_mod then + minetest.register_chatcommand("killme", { + description = "Kill yourself to respawn", + func = function(name) + local player = minetest.get_player_by_name(name) + if player then + if minetest.settings:get_bool("enable_damage") and player:is_player then + player:set_hp(0) + return true + else + for _, callback in pairs(core.registered_on_respawnplayers) do + if callback(player) then + return true + end + end + -- There doesn't seem to be a way to get a default spawn pos from the lua API + return false, "No static_spawnpoint defined" + end + else + -- Show error message if used when not logged in, eg: from IRC mod + return false, "You need to be online to be killed!" + end + end + }) +end diff --git a/mods/default/init.lua b/mods/default/init.lua index 7b5f62f..871e5ab 100644 --- a/mods/default/init.lua +++ b/mods/default/init.lua @@ -50,3 +50,4 @@ dofile(default_path.."/mapgen.lua") dofile(default_path.."/player.lua") dofile(default_path.."/aliases.lua") dofile(default_path.."/legacy.lua") +dofile(default_path.."/commands.lua") diff --git a/mods/killme/init.lua b/mods/killme/init.lua deleted file mode 100644 index 9b67475..0000000 --- a/mods/killme/init.lua +++ /dev/null @@ -1,24 +0,0 @@ -minetest.register_chatcommand("killme", { - description = "Kill yourself to respawn", - func = function(name) - local player = minetest.get_player_by_name(name) - if player then - if minetest.settings:get_bool("enable_damage") then - player:set_hp(0) - return true - else - for _, callback in pairs(core.registered_on_respawnplayers) do - if callback(player) then - return true - end - end - - -- There doesn't seem to be a way to get a default spawn pos from the lua API - return false, "No static_spawnpoint defined" - end - else - -- Show error message if used when not logged in, eg: from IRC mod - return false, "You need to be online to be killed!" - end - end -})