Skip to content

Commit

Permalink
Fix crash from card_cloner on energy cards - Fixes #236
Browse files Browse the repository at this point in the history
  • Loading branch information
Direwolf20-MC committed Feb 1, 2024
1 parent d0035d7 commit b04a717
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,15 @@ public static int getOverclockCount(ItemStack stack) {
}

public static ItemStack getOverclocker(ItemStack stack) {
String cardType = getItemType(stack);
CompoundTag compoundTag = getSettings(stack);
ItemStackHandler itemStackHandler = new ItemStackHandler(CardItemContainer.SLOTS);
itemStackHandler.deserializeNBT(compoundTag.getCompound("inv"));
ItemStack overclockStack = itemStackHandler.getStackInSlot(1);
ItemStack overclockStack;
if (cardType.equals("card_energy"))
overclockStack = itemStackHandler.getStackInSlot(0);
else
overclockStack = itemStackHandler.getStackInSlot(1);
return overclockStack;
}
}

0 comments on commit b04a717

Please sign in to comment.