Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable "Ignoring CONTENT_IGNORE redefinition" warning #4393

Merged
merged 1 commit into from Feb 18, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion builtin/game/register.lua
Expand Up @@ -116,6 +116,8 @@ 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
Expand Down Expand Up @@ -177,7 +179,13 @@ function core.register_item(name, itemdef)
--core.log("Registering item: " .. itemdef.name)
core.registered_items[itemdef.name] = itemdef
core.registered_aliases[itemdef.name] = nil
register_item_raw(itemdef)

-- 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
end

function core.unregister_item(name)
Expand Down