Skip to content
This repository has been archived by the owner on Mar 8, 2022. It is now read-only.

Commit

Permalink
add market buy message
Browse files Browse the repository at this point in the history
  • Loading branch information
cyilin committed Jun 2, 2016
1 parent 3d7fbdf commit 7f3b62d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import cat.nyaa.HamsterEcoHelper.HamsterEcoHelper;
import cat.nyaa.HamsterEcoHelper.I18n;
import cat.nyaa.HamsterEcoHelper.utils.Database;
import cat.nyaa.HamsterEcoHelper.utils.Message;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
Expand Down Expand Up @@ -66,6 +67,11 @@ public static boolean buy(Player player, int itemId, int amount) {
return false;
}
if (!player.getUniqueId().equals(item.getPlayerId())) {
if(item.getPlayer().isOnline()){
new Message("")
.append(item.getItemStack(amount),I18n.get("user.market.someone_bought",player.getName(),price))
.send((Player) item.getPlayer());
}
plugin.eco.withdraw(player, price);
plugin.eco.deposit(item.getPlayer(), price);
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/lang/en_US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ user:
offered: "offered by: %s"
my_items: "My items"
broadcast: "New market offer! use '/heh view' view the items."
someone_bought: "%s bought {itemName} for $%.2f from you."
retrieve:
need_confirm: "The items will drop from your current position. Please ensure the safety. Use '/heh retrieve confirm'"
no_item: "You have no item to retrieve."
Expand Down

0 comments on commit 7f3b62d

Please sign in to comment.