Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Get ascension rope at selectable cold level #1905

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
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 @@ -47,9 +47,17 @@ public class MiningNotificationsConfig {
@Expose
@ConfigOption(
name = "Get Ascension Rope",
desc = "Click on a chat message to get an Ascension Rope when you're at 90 Cold and in the §bMineshaft§7. " +
desc = "Click on a chat message to get an Ascension Rope when you're at a certain amount of Cold and in the §bMineshaft§7. " +
"§cOnly works if you have an Ascension Rope in your sacks."
)
@ConfigEditorBoolean
public boolean getAscensionRope = true;

@Expose
@ConfigOption(
name = "Cold Amount to Show Message",
desc = "Customise the amount of Cold you need to have to get the Ascension Rope message."
)
@ConfigEditorSlider(minValue = 1, maxValue = 100, minStep = 1)
public int coldAmount = 90;
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,6 @@ object MiningNotifications {
"goblin.diamondspawn",
"§6A §r§bDiamond Goblin §r§6has spawned!"
)
private val frostbitePattern by patternGroup.pattern(
"cold.frostbite",
"§9§lBRRR! §r§bYou're freezing! All you can think about is getting out of here to a warm campfire\\.\\.\\."
)

private val config get() = SkyHanniMod.feature.mining.notifications

Expand All @@ -73,13 +69,6 @@ object MiningNotifications {
scrapDrop.matches(message) -> sendNotification(MiningNotificationList.SCRAP)
goldenGoblinSpawn.matches(message) -> sendNotification(MiningNotificationList.GOLDEN_GOBLIN)
diamondGoblinSpawn.matches(message) -> sendNotification(MiningNotificationList.DIAMOND_GOBLIN)
frostbitePattern.matches(message) -> {
if (IslandType.MINESHAFT.isInIsland() && config.getAscensionRope) {
runDelayed(0.5.seconds) {
GetFromSackAPI.getFromChatMessageSackItems(ASCENSION_ROPE)
}
}
}
}
}

Expand All @@ -93,6 +82,11 @@ object MiningNotifications {
hasSentCold = true
sendNotification(MiningNotificationList.COLD)
}
if (IslandType.MINESHAFT.isInIsland() && config.getAscensionRope && config.coldAmount == event.cold) {
runDelayed(0.5.seconds) {
GetFromSackAPI.getFromChatMessageSackItems(ASCENSION_ROPE)
}
}
}

@SubscribeEvent
Expand Down
Loading