aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nodedef.cpp8
-rw-r--r--src/script/lua_api/l_item.cpp9
2 files changed, 8 insertions, 9 deletions
diff --git a/src/nodedef.cpp b/src/nodedef.cpp
index e40a45f97..c3f2ccd60 100644
--- a/src/nodedef.cpp
+++ b/src/nodedef.cpp
@@ -1228,15 +1228,9 @@ content_t NodeDefManager::set(const std::string &name, const ContentFeatures &de
{
// Pre-conditions
assert(name != "");
+ assert(name != "ignore");
assert(name == def.name);
- // Don't allow redefining ignore (but allow air and unknown)
- if (name == "ignore") {
- warningstream << "NodeDefManager: Ignoring "
- "CONTENT_IGNORE redefinition"<<std::endl;
- return CONTENT_IGNORE;
- }
-
content_t id = CONTENT_IGNORE;
if (!m_name_id_mapping.getId(name, id)) { // ignore aliases
// Get new id
diff --git a/src/script/lua_api/l_item.cpp b/src/script/lua_api/l_item.cpp
index d7e9f0a5b..46c1c98a0 100644
--- a/src/script/lua_api/l_item.cpp
+++ b/src/script/lua_api/l_item.cpp
@@ -536,11 +536,16 @@ int ModApiItemMod::l_register_item_raw(lua_State *L)
idef->registerItem(def);
// Read the node definition (content features) and register it
- if(def.type == ITEM_NODE){
+ if (def.type == ITEM_NODE) {
ContentFeatures f = read_content_features(L, table);
+ // when a mod reregisters ignore, only texture changes and such should
+ // be done
+ if (f.name == "ignore")
+ return 0;
+
content_t id = ndef->set(f.name, f);
- if(id > MAX_REGISTERED_CONTENT){
+ if (id > MAX_REGISTERED_CONTENT) {
throw LuaError("Number of registerable nodes ("
+ itos(MAX_REGISTERED_CONTENT+1)
+ ") exceeded (" + name + ")");