From 785d23f0d27e34df39db87d68c72c527e9317faa Mon Sep 17 00:00:00 2001 From: Tai Kedzierski Date: Tue, 8 Jan 2019 11:25:50 +0000 Subject: [PATCH] document the new options for unswappable nodes and spears adjustment --- LICENSE_ART.txt => LICENSE_MEDIA.txt | 0 README.md | 13 +++++++++++-- api/main_api.lua | 14 +++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) rename LICENSE_ART.txt => LICENSE_MEDIA.txt (100%) diff --git a/LICENSE_ART.txt b/LICENSE_MEDIA.txt similarity index 100% rename from LICENSE_ART.txt rename to LICENSE_MEDIA.txt diff --git a/README.md b/README.md index 80a0631..9bf7b72 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This mod is a continuation of NPX Team's Not So Simple Mobs. Notes from the orig * License for the code: `LGPLv2.1 or later` * see [LICENSE.txt](LICENSE.txt) and [license_notes.md](license_notes.md) for info on the license update * Copyright NPX Team and contributors -* License for non-code assets: see `LICENSE_ART.txt` +* License for non-code assets: see `LICENSE_MEDIA.txt` ## Core Dependencies @@ -29,8 +29,15 @@ This mod provides some extra settings for fine tuning the experience: * `nssm.energy_lights` - allows placing energy as temporary light sources +* `nssm.unswappable_nodes` - Various mobs and tools replace nodes int he environment as part of their attacks and movements. + * This list defines nodes that cannot be swapped by such activities + * `bones:bones` and `default:chest_locked` are always unswappable -## Some notes from NPX Team ! +* `nssm.spearmodifier` - Allows slowing down spears. `1` for default speed, `0.5` for half speed + * Impact is still preserved + * Use this setting if the server experiences lag ; fast spears on laggy servers rarely get collision-detected + +## The original notes from NPX Team ! --¬ We suggest that you play nssm with: @@ -54,3 +61,5 @@ Here are the trailers of the mod: * nssm 2.1: * nssm 3.0: + +NPX Team ~ diff --git a/api/main_api.lua b/api/main_api.lua index 5c3e949..2f338a4 100644 --- a/api/main_api.lua +++ b/api/main_api.lua @@ -5,14 +5,22 @@ local c_obsidian = minetest.get_content_id("default:obsidian") local c_brick = minetest.get_content_id("default:obsidianbrick") local c_chest = minetest.get_content_id("default:chest_locked") -nssm.unswappable_nodes[#nssm.unswappable_nodes+1] = "bones:bones" -nssm.unswappable_nodes[#nssm.unswappable_nodes+1] = "default:chest_locked" +local always_unswappable_nodes = { + "bones:bones", + "default:chest_locked", +} +for _,v in ipairs(always_unswappable_nodes) do + if not nssm.unswappable_nodes[v] then + nssm.unswappable_nodes[#nssm.unswappable_nodes+1] = v + end +end + +-- Return true if the original_node should not be swapped nssm.unswappable_node = function (pos, node_list) local _, node, original_node original_node = minetest.env:get_node(pos).name - -- Return true if the original_node should not be swapped if original_node ~= "air" and not minetest.registered_nodes[original_node] then -- remnant unknown block return true