From cba28a6ad5787e0dbb58d632c7a7ecd3c4a2f3ee Mon Sep 17 00:00:00 2001 From: Lars Mueller Date: Sat, 17 Sep 2022 19:09:09 +0200 Subject: [PATCH] Don't forbid playernames anymore --- Readme.md | 3 +-- default_config.json | 3 +-- main.lua | 17 ----------------- settingtypes.txt | 1 - 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/Readme.md b/Readme.md index 2301eb0..48ad748 100644 --- a/Readme.md +++ b/Readme.md @@ -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. \ No newline at end of file +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. diff --git a/default_config.json b/default_config.json index e4c05b8..ae3a950 100644 --- a/default_config.json +++ b/default_config.json @@ -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 @@ } } } -} \ No newline at end of file +} diff --git a/main.lua b/main.lua index b76519d..5e120a7 100644 --- a/main.lua +++ b/main.lua @@ -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 diff --git a/settingtypes.txt b/settingtypes.txt index 0a41d6d..5abff0e 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -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 \ No newline at end of file