Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 commits
Select commit Hold shift + click to select a range
b855ba7
Add fishing nets to boat
mcscoobe Dec 2, 2025
67943aa
- Add fishing net capacity
mcscoobe Dec 2, 2025
7e8a24c
- Add fishing net capacity
mcscoobe Dec 2, 2025
6582fba
debug shit for finding net widgets
mcscoobe Dec 4, 2025
e27158a
Replace hard code sprite ids
mcscoobe Dec 4, 2025
60693bc
Debug logic, this now highlights all 4 net buttons
mcscoobe Dec 4, 2025
7210b4d
Update for interactive net button highlighting and trawling configura…
mcscoobe Dec 5, 2025
d927cbb
Fix issue where highlight occurred when widget not in view
mcscoobe Dec 5, 2025
d889dd4
Update to single color for widget highlights
mcscoobe Dec 5, 2025
06d7b0d
Add overlay to fishing shoals
mcscoobe Dec 5, 2025
904db32
Add basic fish net capacity tracking
mcscoobe Dec 5, 2025
fb46408
Undo import changes and add bin/ to gitignore
mcscoobe Dec 5, 2025
c937750
Merge pull request #1 from mcscoobe/trawling
mcscoobe Dec 5, 2025
cdc20a0
Merge branch 'main' into main
mcscoobe Dec 5, 2025
a11f7b8
Remove unneeded null check and fix bug with fish caught tracking
mcscoobe Dec 5, 2025
367e7ec
Merge branch 'trawling' of https://github.com/mcscoobe/sailing into t…
mcscoobe Dec 5, 2025
2ffbfd5
feat(trawling): Add shoal route recording for mapping
mcscoobe Dec 5, 2025
826884a
refactor(trawling): Remove shoal route recording feature
mcscoobe Dec 5, 2025
974b02d
Merge pull request #2 from mcscoobe/trawling
mcscoobe Dec 5, 2025
0adf520
refactor(fishing-net-tracker): Clean up imports and extract chat cons…
mcscoobe Dec 5, 2025
0b331e3
test(fishing-net-tier): Add comprehensive unit tests for FishingNetTier
mcscoobe Dec 6, 2025
bb14281
refactor(trawling): Extract net capacity tracking logic into separate…
mcscoobe Dec 7, 2025
8053e68
Update Highlight condition, opacity 0 means net is being operated
mcscoobe Dec 7, 2025
b681c5b
Remove old tracker
mcscoobe Dec 7, 2025
a63272a
Code cleanup
mcscoobe Dec 7, 2025
1f201c4
- Added visual timer for net changes
mcscoobe Dec 7, 2025
f07986a
code cleanup
mcscoobe Dec 7, 2025
03379b0
Re-add accidentally removed semicolon
mcscoobe Dec 7, 2025
174244e
Update shoal tracing functionality
mcscoobe Dec 8, 2025
6fc8cd7
feat(trawling): Add region-based filtering for shoal path rendering
mcscoobe Dec 8, 2025
66e551e
feat(trawling): Add stop point visualization and shoal path tracking …
mcscoobe Dec 8, 2025
8430393
WIP Bluefin routes
mcscoobe Dec 8, 2025
897c67c
Add render areas for halibut shoals
mcscoobe Dec 8, 2025
94a98f4
feat(trawling): Add Rainbow Reef shoal path and improve stop point re…
mcscoobe Dec 8, 2025
6b1e8c2
Merge pull request #3 from mcscoobe/trawling-trace-shoals
mcscoobe Dec 8, 2025
fad00f1
feat(trawling): Add Buccaneers Haven shoal path and refactor area bou…
mcscoobe Dec 8, 2025
e4d384c
refactor(trawling): Replace hardcoded shoal paths with dynamic tracke…
mcscoobe Dec 9, 2025
c42acaf
feat(trawling): Add shoal path tracer command and refactor configuration
mcscoobe Dec 9, 2025
3ad2c19
feat(trawling): Extract shoal data constants into dedicated ShoalData…
mcscoobe Dec 9, 2025
b8a87f4
refactor(trawling): Consolidate shoal data into TrawlingData class
mcscoobe Dec 9, 2025
642ae6d
Remove magic numbers for sprite ids
mcscoobe Dec 9, 2025
37cd3b1
Remove unused variables
mcscoobe Dec 9, 2025
25e23e4
refactor(trawling): Consolidate shoal timing data and improve net dep…
mcscoobe Dec 9, 2025
744ce83
Add green highlight to mixef fish shoals
mcscoobe Dec 9, 2025
158787f
feat(trawling): Add net depth tracking and button highlighting system
mcscoobe Dec 10, 2025
12cc257
fix(trawling): Handle edge case in net depth button highlighting logic
mcscoobe Dec 10, 2025
6cce762
wip debugging
mcscoobe Dec 10, 2025
13a18da
add cred change to build
mcscoobe Dec 10, 2025
670c7d9
Revert "add cred change to build"
mcscoobe Dec 10, 2025
9792ffb
refactor(trawling): Extract net depth tracking into dedicated NetDept…
mcscoobe Dec 10, 2025
c464fbb
fix(trawling): Correct net depth level mapping to match varbit values
mcscoobe Dec 11, 2025
5aaa76a
refactor(trawling): Simplify shoal depth tracking to use chat message…
mcscoobe Dec 11, 2025
0fdf9f2
docs(trawling): Add comprehensive system documentation
mcscoobe Dec 11, 2025
34c1aba
refactor(trawling): Consolidate overlay classes into unified Trawling…
mcscoobe Dec 11, 2025
e8b531a
fix tracking when catching a single fish
rmobis Dec 11, 2025
6cc5b2c
draw waypoint indexes on tracker overlay
rmobis Dec 11, 2025
26736cd
add 3/4 of the giant krill shoal paths
rmobis Dec 11, 2025
9fc4841
print more info on path tracker + improve waypoint creation
rmobis Dec 11, 2025
302092f
Merge pull request #4 from rmobis/rmobis/shoal-paths-and-tracker
mcscoobe Dec 11, 2025
dee3a5f
simplify tracked path by merging sequential segments with same slope
rmobis Dec 12, 2025
1abc25a
update old krill paths with new tracker
rmobis Dec 12, 2025
8bf23bd
add sunset ray griant krill shoal path
rmobis Dec 12, 2025
c27a8ad
trawling: disable incorrect net depth highlighting when shoal depth a…
mcscoobe Dec 12, 2025
4fffb9b
Merge pull request #5 from rmobis/rmobis/patch-2
mcscoobe Dec 12, 2025
87d57d4
Disable ShoalPathOverlay logs to reduce noise
mcscoobe Dec 12, 2025
3b5bf92
refactor(trawling): Simplify net depth timer and shoal tracking logic
mcscoobe Dec 12, 2025
6f094b4
add fish caught tracking
rmobis Dec 12, 2025
b3023eb
Merge pull request #6 from rmobis/rmobis/patch-3
mcscoobe Dec 12, 2025
6ef6b26
refactor(trawling): Extract shoal tracking logic into dedicated Shoal…
mcscoobe Dec 12, 2025
b50f293
refactor(trawling): Remove duplicate shoal ID tracking logic
mcscoobe Dec 12, 2025
ff0c536
Add Yellowfin route for Deepfin Point
mcscoobe Dec 12, 2025
11db95f
fix trawler's trust fish counting
rmobis Dec 12, 2025
592b845
Merge pull request #7 from rmobis/rmobis/patch-4
mcscoobe Dec 12, 2025
af9145a
feat. trawler
mcscoobe Dec 12, 2025
3c8002f
feat(trawling): Add support for one-depth fishing areas (Giant Krill)
mcscoobe Dec 12, 2025
812a07a
feat(trawling): Update Weissmere Marlin shoal path with corrected way…
mcscoobe Dec 12, 2025
ad644c2
feat(trawling): Update Buccaneers Haven shoal path with optimized way…
mcscoobe Dec 12, 2025
1a21987
cleanup slightly in fish caught tracker
rmobis Dec 12, 2025
45ebee0
Merge pull request #8 from rmobis/rmobis/patch-5
mcscoobe Dec 12, 2025
543b5a1
feat. trawling
mcscoobe Dec 12, 2025
9d08bb5
refactor(trawling): Replace NetDepth enum with ShoalDepth model
mcscoobe Dec 13, 2025
b87492c
Code cleanup
mcscoobe Dec 13, 2025
b193996
break segments that are too long (fix path display issue)
rmobis Dec 13, 2025
adf97c4
Code Cleanup
mcscoobe Dec 13, 2025
9f47615
refactor(trawling): Add comprehensive JavaDoc and improve logging
mcscoobe Dec 13, 2025
8968e18
Remove personal tools / data prior to PR
mcscoobe Dec 13, 2025
b8ccec6
Merge remote-tracking branch 'upstream/main'
mcscoobe Dec 13, 2025
3d99c8a
Merge pull request #9 from rmobis/rmobis/patch-6
mcscoobe Dec 13, 2025
798837a
Fix a few more resolve issues
mcscoobe Dec 13, 2025
90abfd5
Merge branch 'main' of https://github.com/mcscoobe/sailing
mcscoobe Dec 13, 2025
4e7594e
Re-add accidentally removed lines during resolve
mcscoobe Dec 13, 2025
cc64332
Add notification for shoal depth change
Dec 13, 2025
4fb1d45
Set notifyDepthChange config default to OFF
Dec 13, 2025
c4a7c05
Add check for boat + net facilities for depth change notification
Dec 13, 2025
560fe34
Merge pull request #10 from pwatts6060/main
mcscoobe Dec 13, 2025
43d387a
Add a point to PORT_ROBERTS path so that overlay doesn't fail to rend…
mcscoobe Dec 13, 2025
631e5e8
refactor(trawling)
mcscoobe Dec 13, 2025
c430908
add haddock locations: anglerfishs light, the onyx crest
marknewan Dec 13, 2025
665797e
feat. trawling
mcscoobe Dec 13, 2025
c49edab
Merge pull request #11 from marknewan/haddock
mcscoobe Dec 13, 2025
1f4ea73
Merge branch 'main' of https://github.com/mcscoobe/sailing
mcscoobe Dec 13, 2025
bcac67e
feat. trawling
mcscoobe Dec 14, 2025
da0436e
add yellowfin locations: sea of souls, the crown jewel
marknewan Dec 14, 2025
623ffd3
Merge pull request #12 from marknewan/yellowfin
mcscoobe Dec 14, 2025
45ef47e
refactor(trawling): Update Weissmere shoal path waypoints
mcscoobe Dec 14, 2025
33768eb
split long path segments when drawing
rmobis Dec 15, 2025
2ca2f52
Merge pull request #13 from rmobis/rmobis/patch-7
mcscoobe Dec 16, 2025
91dc914
refactor ShoalFishingArea
marknewan Dec 16, 2025
f20ede0
feat(facilities): add drag-and-drop facility row reordering (eventually)
mcscoobe Dec 17, 2025
6e921ae
feat(sailing): add chum station and fishing net tracking
mcscoobe Dec 17, 2025
61bd1ee
undo newline add
mcscoobe Dec 17, 2025
e280f51
feat(sailing): add cannon and wind catcher tracking
mcscoobe Dec 17, 2025
181304b
feat(sailing): change wind catcher from collection to single object
mcscoobe Dec 17, 2025
5dfef02
remove trawler's trust from fish tracking
marknewan Dec 17, 2025
255f79c
Merge pull request #14 from marknewan/trawler
mcscoobe Dec 18, 2025
3d03fb3
Merge pull request #15 from marknewan/bugfix
mcscoobe Dec 18, 2025
420efc0
Revert "feat(facilities): add drag-and-drop facility row reordering (…
mcscoobe Dec 18, 2025
b96c4fd
feat. trawling
mcscoobe Dec 19, 2025
4b80ce3
Merge branch 'main' into main
mcscoobe Dec 19, 2025
289788b
Merge branch 'main' into reorder-facilities
mcscoobe Dec 19, 2025
8b256eb
Fix merge issue
mcscoobe Dec 19, 2025
d6e5381
Merge branch 'reorder-facilities' of https://github.com/mcscoobe/sail…
mcscoobe Dec 19, 2025
1aa8639
Merge pull request #16 from mcscoobe/reorder-facilities
mcscoobe Dec 19, 2025
499ed92
feat. trawling
mcscoobe Dec 19, 2025
1be3b94
feat. trawling
mcscoobe Dec 19, 2025
fbb64dd
Update Sunset Bay Giant Krill path
Dec 19, 2025
78a37d8
Update Simian Sea Giant Krill path
Dec 19, 2025
b2da257
Update Turtle Belt Giant Krill path
Dec 19, 2025
0cb84fe
Update Great Sound Giant Krill path
Dec 19, 2025
4451122
feat(trawling): make net depth button highlighter dynamic for boat types
mcscoobe Dec 19, 2025
eeb371f
Merge pull request #18 from pwatts6060/updated-paths
mcscoobe Dec 20, 2025
cf62908
track net being emptied on logout/hop
rmobis Dec 20, 2025
3916b7e
Merge pull request #21 from rmobis/rmobis/empty-net-on-logout
mcscoobe Dec 20, 2025
a999f36
Fix null pointer
Dec 20, 2025
da1d13f
Update Deepfin point Yellowfin path
Dec 20, 2025
f81204e
Update Crown Jewel Yellowfin path
Dec 20, 2025
aaac070
Update Sea of Souls Yellowfin path
Dec 20, 2025
997ea96
Update Anglerfish's Light Haddock path
Dec 20, 2025
9c46cee
Update Onyx Crest Haddock path
Dec 20, 2025
bd549f3
Update Misty Sea Haddock path
Dec 20, 2025
a4e3e07
Update Southern Expanse Halibut path
Dec 20, 2025
17c8a7f
Merge pull request #22 from pwatts6060/more-paths
mcscoobe Dec 20, 2025
59dc422
feat. trawling
mcscoobe Dec 21, 2025
2b3cc8d
feat(trawling): Add Bluefin Rainbow Reef shoal path and direction arrows
mcscoobe Dec 21, 2025
2cdc7c5
feat. trawling
mcscoobe Dec 21, 2025
e07b1ec
feat trawling
mcscoobe Dec 21, 2025
f803f14
feat. trawling
mcscoobe Dec 21, 2025
b68f653
feat. trawling
mcscoobe Dec 21, 2025
92102dc
feat. trawling
mcscoobe Dec 21, 2025
5f72781
update fishtracker to use Shoal
marknewan Dec 22, 2025
9b7e6a7
use EnumMap
marknewan Dec 22, 2025
2d883d7
Update halibut - marlin for smoothed pathing to reduce array size
mcscoobe Dec 22, 2025
4e90ede
support matching on exotic fish names
marknewan Dec 22, 2025
b256d34
Merge pull request #24 from marknewan/fishtracker
mcscoobe Dec 22, 2025
8f7d1b9
simpler way to check net capacity
marknewan Dec 23, 2025
066913e
Merge pull request #25 from marknewan/netcapacity
mcscoobe Dec 23, 2025
3187edb
Merge pull request #26 from mcscoobe/main
mcscoobe Dec 24, 2025
0ab1afb
feat(trawling): improve shoal detection and tracking
mcscoobe Dec 24, 2025
98723b1
Merge pull request #27 from mcscoobe/smooth-pathing
mcscoobe Dec 24, 2025
e9fefb9
Merge branch 'LlemonDuck:main' into main
mcscoobe Mar 22, 2026
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
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ build
nbactions.xml
nb-configuration.xml
nbproject/

.junie
.claude
bin/*
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Sailing quality-of-life for charting, navigation, facilities, and more.

![Trimmable Sails](docs/trimmable-sails.png)

## Trawling
- Highlight Net Buttons: Automatically highlights fishing net depth adjustment buttons when they need to be changed to match the current shoal depth.
- Calibration: Shows "Calibrating Nets..." message until the plugin observes a complete shoal movement cycle to sync timing.
- Show Net Capacity: Displays the current fish count in your nets (max 250 for two nets, 125 for one net).

## Crewmates
- Mute Overhead Text: Mute crewmate overhead messages.
- Modes: `None` (default), `Other boats`, `All`.
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies {
testAnnotationProcessor 'org.projectlombok:lombok:1.18.30'

testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:3.12.4'
testImplementation group: 'net.runelite', name:'client', version: runeLiteVersion
testImplementation group: 'net.runelite', name:'jshell', version: runeLiteVersion
}
Expand Down
142 changes: 142 additions & 0 deletions src/main/java/com/duckblade/osrs/sailing/SailingConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public interface SailingConfig extends Config
)
String SECTION_FACILITIES = "facilities";

@ConfigSection(
name = "Trawling",
description = "Settings for fishing net trawling.",
position = 250,
closedByDefault = true
)
String SECTION_TRAWLING = "trawling";

@ConfigSection(
name = "Crewmates",
description = "Settings for your crewmates.",
Expand Down Expand Up @@ -399,6 +407,140 @@ default Color highlightCrystalExtractorInactiveColour()
return Color.YELLOW;
}

@ConfigItem(
keyName = "trawlingHighlightShoals",
name = "Highlight Shoals",
description = "Highlight fish shoals with a 10x10 tile area.",
section = SECTION_TRAWLING,
position = 1
)
default boolean trawlingHighlightShoals()
{
return false;
}

@ConfigItem(
keyName = "trawlingShoalHighlightColour",
name = "Shoal Highlight Colour",
description = "Colour to highlight fish shoals.",
section = SECTION_TRAWLING,
position = 2
)
@Alpha
default Color trawlingShoalHighlightColour()
{
return Color.CYAN;
}

@ConfigItem(
keyName = "trawlingShowNetCapacity",
name = "Show Net Capacity",
description = "Display the current fish count in your nets.",
section = SECTION_TRAWLING,
position = 3
)
default boolean trawlingShowNetCapacity()
{
return true;
}

@ConfigItem(
keyName = "trawlingShowFishCaught",
name = "Show Fish Caught",
description = "Display the number of each fish caught in the session.",
section = SECTION_TRAWLING,
position = 4
)
default boolean trawlingShowFishCaught()
{
return true;
}

@ConfigItem(
keyName = "trawlingShowNetDepthTimer",
name = "Show Net Depth Timer",
description = "Display an overlay showing ticks until net depth change.",
section = SECTION_TRAWLING,
position = 5
)
default boolean trawlingShowNetDepthTimer()
{
return false;
}

@ConfigItem(
keyName = "trawlingShowShoalPaths",
name = "Show Shoal Routes",
description = "Display the known routes for shoals.",
section = SECTION_TRAWLING,
position = 6
)
default boolean trawlingShowShoalPaths()
{
return true;
}

@ConfigItem(
keyName = "trawlingShoalPathColour",
name = "Route Colour",
description = "Colour for displaying shoal routes.",
section = SECTION_TRAWLING,
position = 7
)
@Alpha
default Color trawlingShoalPathColour()
{
return Color.WHITE;
}

@ConfigItem(
keyName = "trawlingShowShoalDirectionArrows",
name = "Show Direction Arrows",
description = "Display directional arrows along shoal routes to indicate movement direction.",
section = SECTION_TRAWLING,
position = 8
)
default boolean trawlingShowShoalDirectionArrows()
{
return true;
}

@ConfigItem(
keyName = "highlightNetButtons",
name = "Highlight Net Buttons ",
description = "Highlight the net button to move to the correct shoal depth.",
section = SECTION_TRAWLING,
position = 9
)
default boolean highlightNetButtons()
{
return true;
}

@ConfigItem(
keyName = "notifyDepthChange",
name = "Notify Shoal Depth Changed",
description = "Notify you when the shoal changes depth.",
section = SECTION_TRAWLING,
position = 9
)
default Notification notifyDepthChange()
{
return Notification.OFF;
}

@ConfigItem(
keyName = "notifyShoalMove",
name = "Notify Shoal Move",
description = "Notify you when the shoal moves.",
section = SECTION_TRAWLING,
position = 10
)
default Notification notifyShoalMove()
{
return Notification.OFF;
}

enum CrewmateMuteMode
{
NONE,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
package com.duckblade.osrs.sailing.features.trawling;

import com.duckblade.osrs.sailing.features.util.BoatTracker;
import com.duckblade.osrs.sailing.features.util.SailingUtil;
import com.duckblade.osrs.sailing.model.Boat;
import com.duckblade.osrs.sailing.module.PluginLifecycleComponent;
import java.util.Collections;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.inject.Inject;
import javax.inject.Singleton;
import lombok.extern.slf4j.Slf4j;
import net.runelite.api.ChatMessageType;
import net.runelite.api.Client;
import net.runelite.api.GameState;
import net.runelite.api.events.ChatMessage;
import net.runelite.api.events.GameStateChanged;
import net.runelite.client.eventbus.Subscribe;
import org.apache.commons.lang3.ArrayUtils;

@Slf4j
@Singleton
public class FishCaughtTracker implements PluginLifecycleComponent {
public static final Pattern CATCH_FISH_REGEX =
Pattern.compile("^(.+?) catch(?:es)? (an?|two|three|four|five|six) (.+?)!$");
private final Client client;
private final BoatTracker boatTracker;

/**
* All the fish that was caught into the net since it was last emptied.
*/
private final EnumMap<Shoal, Integer> fishInNet = new EnumMap<>(Shoal.class);

/**
* All the fish that was collected by emptying the nets.
*/
private final EnumMap<Shoal, Integer> fishCollected = new EnumMap<>(Shoal.class);

/**
* Creates a new FishCaughtTracker with the specified dependencies.
*
* @param client the RuneLite client instance
* @param boatTracker tracker for boat information including net capacity
*/
@Inject
public FishCaughtTracker(Client client, BoatTracker boatTracker) {
this.client = client;
this.boatTracker = boatTracker;
}

@Override
public void startUp() {
log.debug("FishCaughtTracker started");
reset();
}

@Override
public void shutDown() {
log.debug("FishCaughtTracker shut down");
reset();
}

@Subscribe
public void onGameStateChanged(GameStateChanged e) {
GameState state = e.getGameState();
if (state == GameState.HOPPING || state == GameState.LOGGING_IN) {
log.debug("{}; nets are forcibly emptied", state);
log.debug("lost fish: {}", fishInNet);
fishInNet.clear();
}
}

@Subscribe
public void onChatMessage(ChatMessage e) {
if (!SailingUtil.isSailing(client) ||
(e.getType() != ChatMessageType.GAMEMESSAGE && e.getType() != ChatMessageType.SPAM)) {
return;
}

String message = e.getMessage();
if (message.equals("You empty the nets into the cargo hold.")) {
// TODO: handle trying to empty net when already empty (in case of desync)
log.debug("Nets manually emptied; collecting fish: {}", fishInNet);

for (var entry : fishInNet.entrySet()) {
fishCollected.merge(entry.getKey(), entry.getValue(), Integer::sum);
}

fishInNet.clear();
return;
}

Matcher matcher = CATCH_FISH_REGEX.matcher(message);
if (!matcher.find()) {
return;
}

String catcher = matcher.group(1);
String quantityWord = matcher.group(2);
String fish = matcher.group(3);

int quantity = wordToNumber(quantityWord);
if (quantity == -1) {
log.debug("Unable to find quantity for message {}", message);
return;
}

final var shoal = Shoal.byName(fish);
if (shoal == null) {
return;
}

log.debug(message);
log.debug("{} {} caught by {}; total: {}", quantity, fish, catcher, fishInNet.get(shoal));
fishInNet.merge(shoal, quantity, Integer::sum);
}

private int wordToNumber(String word) {
if (word.equals("an")) {
word = "a";
}

String[] words = {"a", "two", "three", "four", "five", "six"};
int wordIndex = ArrayUtils.indexOf(words, word);

if (wordIndex == ArrayUtils.INDEX_NOT_FOUND) {
log.debug("Unable to find quantity for word {}", word);
return -1;
}

return wordIndex + 1;
}

/**
* Gets the current net capacity based on the player's boat.
*
* @return the net capacity, or 0 if no boat is available
*/
public int getNetCapacity() {
Boat boat = boatTracker.getBoat();
return boat != null ? boat.getNetCapacity() : 0;
}

public int getFishInNetCount() {
return fishInNet.values()
.stream()
.reduce(Integer::sum)
.orElse(0);
}

/**
* All fish caught, either currently in the net or previously collected.
*/
public Map<Shoal, Integer> getFishCaught() {
var fishCaught = new EnumMap<>(fishCollected);
for (var entry : fishInNet.entrySet()) {
fishCaught.merge(entry.getKey(), entry.getValue(), Integer::sum);
}

return Collections.unmodifiableMap(fishCaught);
}

private void reset() {
fishInNet.clear();
fishCollected.clear();
}
}
Loading