Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,15 @@ public class CargoHoldTracker
"Woooo wooo wooooo woooo."
);

private static final Set<Integer> SAILING_CARGO_TOOLS = ImmutableSet.of(
ItemID.SAILING_LOG,
ItemID.SAILING_CHARTING_SPYGLASS,
ItemID.HUNDRED_PIRATE_DIVING_HELMET,
ItemID.HUNDRED_PIRATE_DIVING_BACKPACK,
ItemID.SAILING_CHARTING_CROWBAR,
ItemID.SAILING_CHARTING_CURRENT_DUCK
);

private static final Set<Integer> CARGO_INVENTORY_IDS = ImmutableSet.of(
InventoryID.SAILING_BOAT_1_CARGOHOLD,
InventoryID.SAILING_BOAT_2_CARGOHOLD,
Expand Down Expand Up @@ -317,8 +326,8 @@ public void onGameTick(GameTick e)
log.trace("deposited: {}", deposited);

Multisets.removeOccurrences(cargoHoldToUpdate, withdrawn);
deposited.entrySet().forEach(entry -> cargoHoldToUpdate.add(entry.getElement(), entry.getCount()));

Multisets.filter(deposited, id -> !SAILING_CARGO_TOOLS.contains(id))
.forEachEntry(cargoHoldToUpdate::add); // cargo tools do not count towards total
log.debug("updated cargo hold from inventory delta {}", cargoHoldToUpdate);
writeToConfig();
}
Expand Down