mirror of
https://github.com/SmallJoker/exchange_shop.git
synced 2025-07-27 04:12:39 +02:00
First version 🐈
This commit is contained in:
19
currency_override.lua
Normal file
19
currency_override.lua
Normal file
@ -0,0 +1,19 @@
|
||||
local def = table.copy(minetest.registered_nodes["currency:shop"])
|
||||
def.groups.not_in_creative_inventory = 1
|
||||
|
||||
minetest.override_item("currency:shop", {
|
||||
groups = def.groups,
|
||||
on_construct = function() end,
|
||||
after_place_node = function(pos, ...)
|
||||
local node = minetest.get_node(pos)
|
||||
node.name = exchange_shop.shopname
|
||||
minetest.swap_node(pos, node)
|
||||
|
||||
local new_def = minetest.registered_nodes[exchange_shop.shopname]
|
||||
if new_def.on_construct then
|
||||
new_def.on_construct(pos)
|
||||
end
|
||||
new_def.after_place_node(pos, unpack({...}))
|
||||
|
||||
end
|
||||
})
|
Reference in New Issue
Block a user