changes to the ore dict list related to changing stacks

This commit is contained in:
way2muchnoise
2017-02-03 15:45:44 +01:00
parent 21917db0f9
commit 530fa7acac

View File

@@ -58,9 +58,12 @@ public class StackListItemOredicted implements IStackList<ItemStack> {
@Override @Override
public boolean trackedRemove(@Nonnull ItemStack stack, int size) { public boolean trackedRemove(@Nonnull ItemStack stack, int size) {
// Calling tracked remove with a stack from get causes the reference to be the same
// When the underlying list empties the stack the reference will become empty, thus we need to copy before hand
ItemStack original = stack.copy();
boolean rvalue = underlyingList.trackedRemove(stack, size); boolean rvalue = underlyingList.trackedRemove(stack, size);
if (underlyingList.needsCleanup) { if (underlyingList.needsCleanup) {
touchedIds.addAll(Arrays.stream(OreDictionary.getOreIDs(stack)).boxed().collect(Collectors.toList())); touchedIds.addAll(Arrays.stream(OreDictionary.getOreIDs(original)).boxed().collect(Collectors.toList()));
clean(); clean();
} }
return rvalue; return rvalue;