Skip to content

Commit

Permalink
Fix for #289
Browse files Browse the repository at this point in the history
  • Loading branch information
NightKosh committed Oct 19, 2018
1 parent c542c68 commit 7af8a7f
Showing 1 changed file with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package nightkosh.gravestone.core.compatibility;

import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import nightkosh.gravestone.api.GraveStoneAPI;
import nightkosh.gravestone.config.Config;
Expand All @@ -22,17 +21,17 @@ protected CompatibilityBaubles() {
if (isModLoaded(MOD_ID) && Config.storeBaublesItems) {
GraveStoneAPI.graveGenerationAtDeath.addPlayerItemsHandler((player, source) -> {
List<ItemStack> items = new ArrayList<>();
IInventory inventory = baubles.api.BaublesApi.getBaubles(player);
if (inventory != null) {
for (int slot = 0; slot < inventory.getSizeInventory(); slot++) {
ItemStack stack = inventory.getStackInSlot(slot);
if (stack != null && !stack.isEmpty()) {
items.add(stack.copy());
inventory.setInventorySlotContents(slot, ItemStack.EMPTY);
}

}
}
// IInventory inventory = baubles.api.BaublesApi.getBaubles(player);
// if (inventory != null) {
// for (int slot = 0; slot < inventory.getSizeInventory(); slot++) {
// ItemStack stack = inventory.getStackInSlot(slot);
// if (stack != null && !stack.isEmpty()) {
// items.add(stack.copy());
// inventory.setInventorySlotContents(slot, ItemStack.EMPTY);
// }
//
// }
// }
return items;
});
}
Expand Down

0 comments on commit 7af8a7f

Please sign in to comment.