diff --git a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
index 36d4189..c09d107 100644
--- a/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
+++ b/BankEconomyMod/src/me/kaZep/Base/PlayerListener.java
@@ -5188,32 +5188,21 @@ public ItemStack getGoodie() {
Bukkit.getLogger().info("We have "+piecount+" pies.");
if (ideal_pie!=null && magic_pie!=null && piecount>=pies) {
p.getInventory().remove(magic_pie);
- int deductpies=pies;
- int itemslot=0;
- while (deductpies>0 || itemslot
0) {
- if (p.getInventory().getItem(itemslot).getType()==Material.PUMPKIN_PIE && p.getInventory().getItem(itemslot).getItemMeta().getDisplayName()==null) {
- if (p.getInventory().getItem(itemslot).getAmount()>1) {
- p.getInventory().remove(p.getInventory().getItem(itemslot));
- deductpies-=p.getInventory().getItem(itemslot).getAmount();
- } else {
- p.getInventory().remove(p.getInventory().getItem(itemslot));
- deductpies-=1;
- }
- itemslot++;
- } else {
- itemslot++;
- }
- } else {
- itemslot++;
+ //Check to see if there are any pies we need to keep for later.
+ List items = new ArrayList();
+ for (int i=0;i0) {
if (amountleft>=64) {
@@ -5223,7 +5212,10 @@ public ItemStack getGoodie() {
p.getInventory().addItem(new ItemStack(Material.PUMPKIN_PIE,1));
amountleft--;
}
- }*/
+ }
+ for (int i=0;i