Skip to content

Commit

Permalink
Permit duplicate materials for item objectives, part 1. See #1646
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaMug committed May 13, 2021
1 parent ebda399 commit 9949365
Show file tree
Hide file tree
Showing 4 changed files with 600 additions and 565 deletions.
23 changes: 16 additions & 7 deletions main/src/main/java/me/blackvein/quests/QuestData.java
Original file line number Diff line number Diff line change
Expand Up @@ -395,21 +395,29 @@ public void putAll(final Map<? extends ItemStack, ? extends Integer> m) {
}
};

public LinkedHashMap<ItemStack, Integer> itemsConsumed = new LinkedHashMap<ItemStack, Integer>() {
public LinkedList<ItemStack> itemsConsumed = new LinkedList<ItemStack>() {

private static final long serialVersionUID = -5475073316902757883L;

@Override
public ItemStack set(final int index, final ItemStack key) {
final ItemStack data = super.set(index, key);
if (doJournalUpdate)
quester.updateJournal();
return data;
}

@Override
public Integer put(final ItemStack key, final Integer val) {
final Integer data = super.put(key, val);
public boolean add(final ItemStack key) {
final boolean data = super.add(key);
if (doJournalUpdate)
quester.updateJournal();
return data;
}

@Override
public Integer remove(final Object key) {
final Integer i = super.remove(key);
public boolean remove(final Object key) {
final boolean i = super.remove(key);
if (doJournalUpdate)
quester.updateJournal();
return i;
Expand All @@ -423,10 +431,11 @@ public void clear() {
}

@Override
public void putAll(final Map<? extends ItemStack, ? extends Integer> m) {
super.putAll(m);
public boolean addAll(final Collection<? extends ItemStack> m) {
final boolean i = super.addAll(m);
if (doJournalUpdate)
quester.updateJournal();
return i;
}
};

Expand Down
Loading

0 comments on commit 9949365

Please sign in to comment.