diff --git a/bank.lua b/bank.lua index b0d1434..085a658 100644 --- a/bank.lua +++ b/bank.lua @@ -31,7 +31,7 @@ function emeraldbank.add_emeralds(player, num) local name = player:get_player_name() if num then meta:set_int("emeraldbank:emerald", bankemeralds+num) - core.chat_send_player(name, S("Emeralds in Bank: @1", bankemeralds+num) ) + mcl_title.set(player, "actionbar", {text=S("Emeralds in Bank: @1", bankemeralds+num), color="yellow"}) return true end return false @@ -51,7 +51,7 @@ function emeraldbank.keep(player, itemstack) emeraldbank.add_emeralds(player, itemcount*9) return true end - core.chat_send_player(name, S("You need keep emeralds or emeraldblocks in your hand!") ) + mcl_title.set(player, "actionbar", {text=S("You need keep emeralds or emeraldblocks in your hand!"), color="red"}) return false end @@ -69,7 +69,7 @@ function emeraldbank.take(player) core.add_item(pos, "mcl_core:emerald "..num) return true end - core.chat_send_player(name, S("Not enough Emeralds in your account") ) + mcl_title.set(player, "actionbar", {text=S("Not enough Emeralds in your account"), color="red"}) return false end diff --git a/mod.conf b/mod.conf index 29b3d75..420e405 100644 --- a/mod.conf +++ b/mod.conf @@ -1,5 +1,5 @@ name = emeraldbank -depends = mcl_core, mcl_sounds, mcl_inventory, mcl_formspec +depends = mcl_core, mcl_sounds, mcl_inventory, mcl_formspec, mcl_title optional_depends = irc -description = Keep your Emeralds in a bank +description = Keep your Emeralds in a bank! And trade with shops. supported_games = mineclone2, mineclone5 \ No newline at end of file diff --git a/shop.lua b/shop.lua index af2338f..25b95c0 100644 --- a/shop.lua +++ b/shop.lua @@ -298,7 +298,7 @@ core.register_on_player_receive_fields(function(sender, formname, fields) -- owner try exchanges if meta:get_string("owner") == name then - core.chat_send_player(name, S("This is your own shop, you can't exchange to yourself!")) + mcl_title.set(sender, "subtitle", {text=S("This is your own shop, you can't exchange to yourself!"), color="red"}) else @@ -307,13 +307,13 @@ core.register_on_player_receive_fields(function(sender, formname, fields) -- have u money? if bankemeralds < old_price then can_exchange = false - core.chat_send_player(name, S("Not enough Emeralds in your account") ) + mcl_title.set(sender, "subtitle", {text=S("Not enough Emeralds in your account"), color="red"}) end --there are enough items? if not minv:contains_item("stock", shop_item.." "..old_count, true) then can_exchange = false - core.chat_send_player(name, S("Out of Stock!") ) + mcl_title.set(sender, "subtitle", {text=S("Out of Stock!"), color="red"}) end -- do not trade air