mirror of
https://github.com/songoda/EpicHeads.git
synced 2024-11-26 04:25:16 +01:00
Oops
This commit is contained in:
parent
0f8611403c
commit
87d9565818
@ -1,7 +1,7 @@
|
|||||||
package com.songoda.epicheads.economy;
|
package com.songoda.epicheads.economy;
|
||||||
|
|
||||||
import com.songoda.epicheads.utils.Methods;
|
import com.songoda.epicheads.utils.Methods;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
public class ItemEconomy implements Economy {
|
public class ItemEconomy implements Economy {
|
||||||
@ -19,9 +19,9 @@ public class ItemEconomy implements Economy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasBalance(Player player, double cost) {
|
public boolean hasBalance(OfflinePlayer player, double cost) {
|
||||||
int amount = convertAmount(cost);
|
int amount = convertAmount(cost);
|
||||||
for (ItemStack item : player.getInventory().getContents()) {
|
for (ItemStack item : player.getPlayer().getInventory().getContents()) {
|
||||||
if (!isItem(item))
|
if (!isItem(item))
|
||||||
continue;
|
continue;
|
||||||
if (amount <= item.getAmount())
|
if (amount <= item.getAmount())
|
||||||
@ -33,9 +33,9 @@ public class ItemEconomy implements Economy {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean withdrawBalance(Player player, double cost) {
|
public boolean withdrawBalance(OfflinePlayer player, double cost) {
|
||||||
int amount = convertAmount(cost);
|
int amount = convertAmount(cost);
|
||||||
ItemStack[] contents = player.getInventory().getContents();
|
ItemStack[] contents = player.getPlayer().getInventory().getContents();
|
||||||
for (int index = 0; index < contents.length; ++index) {
|
for (int index = 0; index < contents.length; ++index) {
|
||||||
ItemStack item = contents[index];
|
ItemStack item = contents[index];
|
||||||
if (!isItem(item))
|
if (!isItem(item))
|
||||||
@ -52,9 +52,14 @@ public class ItemEconomy implements Economy {
|
|||||||
}
|
}
|
||||||
if (amount != 0)
|
if (amount != 0)
|
||||||
return false;
|
return false;
|
||||||
player.getInventory().setContents(contents);
|
player.getPlayer().getInventory().setContents(contents);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean deposit(OfflinePlayer player, double amount) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user