From 22df02d25bb1ddb1de48e645c5256621ce9a9ed9 Mon Sep 17 00:00:00 2001 From: you Date: Sun, 20 May 2018 14:51:50 +0200 Subject: [PATCH] Fix missing ignore textures (#7326) --- builtin/game/register.lua | 10 +--------- src/nodedef.cpp | 8 +------- src/script/lua_api/l_item.cpp | 9 +++++++-- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/builtin/game/register.lua b/builtin/game/register.lua index 43bb9e067..15c08b045 100644 --- a/builtin/game/register.lua +++ b/builtin/game/register.lua @@ -116,8 +116,6 @@ function core.register_item(name, itemdef) end itemdef.name = name - local is_overriding = core.registered_items[name] - -- Apply defaults and add to registered_* table if itemdef.type == "node" then -- Use the nodebox as selection box if it's not set manually @@ -179,13 +177,7 @@ function core.register_item(name, itemdef) --core.log("Registering item: " .. itemdef.name) core.registered_items[itemdef.name] = itemdef core.registered_aliases[itemdef.name] = nil - - -- Used to allow builtin to register ignore to registered_items - if name ~= "ignore" then - register_item_raw(itemdef) - elseif is_overriding then - core.log("warning", "Attempted redefinition of \"ignore\"") - end + register_item_raw(itemdef) end function core.unregister_item(name) 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"<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 + ")"); -- 2.25.1