disallow putting stacks w/metadata into stations (currently, metadata is lost)

This commit is contained in:
flux
2022-09-23 09:57:17 -07:00
parent 16c72b1aa3
commit b342247367
2 changed files with 82 additions and 68 deletions

View File

@ -2,6 +2,7 @@
local api = stairsplus.api
local has_metadata = stairsplus.util.has_metadata
local resolve_aliases = stairsplus.util.resolve_aliases
local default_stack_max = tonumber(minetest.settings:get("default_stack_max")) or 99
@ -171,6 +172,10 @@ function station.allow_inventory_put(meta, inv, listname, index, stack, player)
return 0
end
if has_metadata(stack) then
return 0
end
local to_put_node = resolve_aliases(stack:get_name())
local node = api.get_node_of_shaped_node(to_put_node)
local shape = api.get_shape_of_shaped_node(to_put_node)