Skip to content

Commit

Permalink
Improvement: Added option to show the barn fishing timer anywhere. (#…
Browse files Browse the repository at this point in the history
…2735)

Co-authored-by: martimavocado <39881008+martimavocado@users.noreply.github.com>
Co-authored-by: Cal <cwolfson58@gmail.com>
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
  • Loading branch information
4 people authored Oct 16, 2024
1 parent 56707dc commit 17b3900
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ public class BarnTimerConfig {
@FeatureToggle
public Property<Boolean> enabled = Property.of(true);

@Expose
@ConfigOption(
name = "Show Anywhere",
desc = "Show the Barn Fishing Timer whenever you fish up a sea creature, regardless of location."
)
@ConfigEditorBoolean
public boolean showAnywhere = false;

@Expose
@ConfigOption(
name = "Worm Fishing",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ object FishingTimer {
@SubscribeEvent
fun onSecondPassed(event: SecondPassedEvent) {
if (!isEnabled()) return
updateLocation()
rightLocation = updateLocation()
if (startTime.passedSince().inWholeSeconds - config.alertTime in 0..3) {
playSound()
}
Expand Down Expand Up @@ -170,8 +170,10 @@ object FishingTimer {
display = createDisplay()
}

private fun updateLocation() {
rightLocation = when (LorenzUtils.skyBlockIsland) {
private fun updateLocation(): Boolean {
if (config.showAnywhere) return true

return when (LorenzUtils.skyBlockIsland) {
IslandType.CRYSTAL_HOLLOWS -> config.crystalHollows.get()
IslandType.CRIMSON_ISLE -> config.crimsonIsle.get()
IslandType.WINTER -> config.winterIsland.get()
Expand Down

0 comments on commit 17b3900

Please sign in to comment.