mirror of
https://codeberg.org/usrib/emeraldbank.git
synced 2024-12-23 06:32:25 +01:00
global func get_stonks, old shop drops is not a variable
This commit is contained in:
parent
decf90ac92
commit
f2f9cf9fc7
2
init.lua
2
init.lua
@ -30,6 +30,6 @@ if income_enabled then
|
||||
end
|
||||
|
||||
dofile(modpath .. "/bank.lua")
|
||||
dofile(modpath .. "/fancyshop.lua")
|
||||
dofile(modpath .. "/shop.lua")
|
||||
dofile(modpath .. "/fancyshop.lua")
|
||||
dofile(modpath .. "/commands.lua")
|
||||
|
15
shop.lua
15
shop.lua
@ -117,7 +117,7 @@ local function check_empty(pos)
|
||||
end
|
||||
end
|
||||
|
||||
local function get_stonks(pos, player)
|
||||
function emeraldbank.get_stonks(pos, player)
|
||||
local name = player:get_player_name()
|
||||
local meta = core.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
@ -152,14 +152,14 @@ local function on_rightclick(pos, node, clicker, itemstack)
|
||||
local nodename = core.get_node(pos).name
|
||||
local owner = meta:get_string("owner")
|
||||
local pname = clicker:get_player_name()
|
||||
get_stonks(pos, clicker)
|
||||
emeraldbank.get_stonks(pos, clicker)
|
||||
--if nodename == "emeraldbank:shop" or pname == owner then
|
||||
core.show_formspec(pname, formspec_prefix..core.pos_to_string(pos), emeraldbank.get_shop_fs(pos, clicker) )
|
||||
--end
|
||||
end
|
||||
|
||||
local function on_punch(pos, node, puncher, pointed_thing)
|
||||
get_stonks(pos, puncher)
|
||||
emeraldbank.get_stonks(pos, puncher)
|
||||
end
|
||||
|
||||
local function on_metadata_inventory_put(pos, listname, index, stack, player)
|
||||
@ -187,7 +187,7 @@ local function on_timer(pos, elapsed)
|
||||
if is_online then
|
||||
local player = core.get_player_by_name(owner)
|
||||
if not player or player.is_fake_player then return end
|
||||
get_stonks(pos, player)
|
||||
emeraldbank.get_stonks(pos, player)
|
||||
end
|
||||
end
|
||||
|
||||
@ -197,9 +197,7 @@ local function can_dig(pos, player)
|
||||
local meta = core.get_meta(pos)
|
||||
local owner = meta:get_string("owner")
|
||||
local inv = meta:get_inventory()
|
||||
if inv:is_empty("stock") and (pname == owner or is_admin) then
|
||||
return true
|
||||
end
|
||||
return inv:is_empty("stock") and (pname == owner or is_admin)
|
||||
end
|
||||
|
||||
-- register shop node
|
||||
@ -215,7 +213,6 @@ core.register_node("emeraldbank:shop", {
|
||||
stack_max = 64,
|
||||
groups = {axey=1, handy=1, building_block=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
drop = emeraldbank.shop_drop,
|
||||
_mcl_blast_resistance = 5,
|
||||
_mcl_hardness = 1,
|
||||
|
||||
@ -242,7 +239,7 @@ core.register_node("emeraldbank:shop_empty", {
|
||||
stack_max = 64,
|
||||
groups = {axey=1, handy=1, building_block=1, not_in_creative_inventory=1},
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
drop = emeraldbank.shop_empty_drop,
|
||||
drop = "emeraldbank:shop",
|
||||
_mcl_blast_resistance = 5,
|
||||
_mcl_hardness = 1,
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user