diff --git a/src/main/java/com/songoda/epicheads/economy/ItemEconomy.java b/src/main/java/com/songoda/epicheads/economy/ItemEconomy.java index bedb044..a8e604e 100644 --- a/src/main/java/com/songoda/epicheads/economy/ItemEconomy.java +++ b/src/main/java/com/songoda/epicheads/economy/ItemEconomy.java @@ -1,7 +1,7 @@ package com.songoda.epicheads.economy; import com.songoda.epicheads.utils.Methods; -import org.bukkit.entity.Player; +import org.bukkit.OfflinePlayer; import org.bukkit.inventory.ItemStack; public class ItemEconomy implements Economy { @@ -19,9 +19,9 @@ public class ItemEconomy implements Economy { } @Override - public boolean hasBalance(Player player, double cost) { + public boolean hasBalance(OfflinePlayer player, double cost) { int amount = convertAmount(cost); - for (ItemStack item : player.getInventory().getContents()) { + for (ItemStack item : player.getPlayer().getInventory().getContents()) { if (!isItem(item)) continue; if (amount <= item.getAmount()) @@ -33,9 +33,9 @@ public class ItemEconomy implements Economy { @Override - public boolean withdrawBalance(Player player, double cost) { + public boolean withdrawBalance(OfflinePlayer player, double cost) { int amount = convertAmount(cost); - ItemStack[] contents = player.getInventory().getContents(); + ItemStack[] contents = player.getPlayer().getInventory().getContents(); for (int index = 0; index < contents.length; ++index) { ItemStack item = contents[index]; if (!isItem(item)) @@ -52,9 +52,14 @@ public class ItemEconomy implements Economy { } if (amount != 0) return false; - player.getInventory().setContents(contents); + player.getPlayer().getInventory().setContents(contents); return true; } + + @Override + public boolean deposit(OfflinePlayer player, double amount) { + return false; + } }