simplified killme/game_commands into default mod

master
mckaygerhard 2023-06-07 17:55:05 -04:00
parent d8b13f420d
commit 260ff7143a
5 changed files with 106 additions and 37 deletions

View File

@ -1,20 +1,69 @@
License of media (textures and sounds)
--------------------------------------
Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
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 <celeron55@gmail.com>
LGPL, base default mods Copyright (C) 2010-2012 celeron55, Perttu Ahola <celeron55@gmail.com>
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 <celeron55@gmail.com>
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 <mckaygerhard@gmail.com>, mckayshirou <mckayshirou@gmail.com>
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

View File

@ -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

42
mods/default/commands.lua Normal file
View File

@ -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

View File

@ -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")

View File

@ -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
})