Don't forbid playernames anymore

This commit is contained in:
Lars Mueller 2022-09-17 19:09:09 +02:00
parent 73aa67213e
commit cba28a6ad5
4 changed files with 2 additions and 22 deletions

@ -56,7 +56,6 @@ player:set_hp(0, {
"hud_base_offset": {"x":0,"y":-122},
"enable_environmental": true,
"enable_unknown": false,
"enable_forbidden_playernames": true,
"environmental_reasons": {
"falling":{
"name":"Falling",
@ -137,4 +136,4 @@ Player died through falling or an unknown reason; no node responsible. One defin
##### `drowning` / `node_damage`
Player died by drowning node or by taking node damage. A node *must* be responsible.
Using the `nodes` table/dictionairy, you can specify overrides for each specific node concerning `name`, `color`, and `method`. If not specified, default values are taken.
Using the `nodes` table/dictionairy, you can specify overrides for each specific node concerning `name`, `color`, and `method`. If not specified, default values are taken.

@ -6,7 +6,6 @@
"hud_base_offset": {"x":0,"y":-122},
"enable_environmental": true,
"enable_unknown": true,
"enable_forbidden_playernames": true,
"environmental_reasons": {
"falling":{
"name":"Falling",
@ -34,4 +33,4 @@
}
}
}
}
}

@ -48,7 +48,6 @@ local config = modlib.conf.import("deathlist", {
hud_base_offset = coordinate,
enable_environmental = { type = "boolean" },
enable_unknown = { type = "boolean" },
enable_forbidden_playernames = { type = "boolean" },
environmental_reasons = {
children = {
falling = name_color_method,
@ -60,22 +59,6 @@ local config = modlib.conf.import("deathlist", {
}
})
modlib.table.add_all(getfenv(1), config)
if enable_forbidden_playernames then
modlib.player.register_forbidden_name(environmental_reasons.falling.name)
if enable_unknown then
modlib.player.register_forbidden_name(environmental_reasons.unknown.name)
end
for name, node in pairs(minetest.registered_nodes) do
if (node.drowning or 0) > 0 then
local title = (environmental_reasons.drowning.nodes[name] or {}).name or node.description
modlib.player.register_forbidden_name(title)
end
if (node.damage_per_second or 0) > 0 then
local title = (environmental_reasons.node_damage.nodes[name] or {}).name or node.description
modlib.player.register_forbidden_name(title)
end
end
end
for _, table in pairs{ environmental_reasons, environmental_reasons.drowning.nodes, environmental_reasons.node_damage.nodes } do
for _, value in pairs(table) do
if value.color then

@ -27,4 +27,3 @@ deathlist.environmental_reasons.node_damage.color.r (Deathlist environmental_rea
deathlist.environmental_reasons.node_damage.color.b (Deathlist environmental_reasons node_damage color b) int 255
deathlist.environmental_reasons.node_damage.color.g (Deathlist environmental_reasons node_damage color g) int 255
deathlist.max_messages (Deathlist max_messages) float 5
deathlist.enable_forbidden_playernames (Deathlist enable_forbidden_playernames) bool true