Skip to content

Commit fb15153

Browse files
committed
fix: remove useless block pickaxe ability option
1 parent af7e161 commit fb15153

File tree

2 files changed

+4
-51
lines changed

2 files changed

+4
-51
lines changed

src/main/kotlin/features/mining/PickaxeAbility.kt

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,16 @@ import kotlin.time.Duration
77
import kotlin.time.Duration.Companion.seconds
88
import net.minecraft.client.Minecraft
99
import net.minecraft.client.gui.components.toasts.SystemToast
10-
import net.minecraft.world.item.ItemStack
11-
import net.minecraft.world.item.DyeColor
12-
import net.minecraft.world.InteractionHand
1310
import net.minecraft.resources.ResourceLocation
1411
import net.minecraft.util.StringRepresentable
12+
import net.minecraft.world.InteractionHand
13+
import net.minecraft.world.item.DyeColor
14+
import net.minecraft.world.item.ItemStack
1515
import moe.nea.firmament.annotations.Subscribe
1616
import moe.nea.firmament.events.HudRenderEvent
1717
import moe.nea.firmament.events.ProcessChatEvent
1818
import moe.nea.firmament.events.ProfileSwitchEvent
1919
import moe.nea.firmament.events.SlotClickEvent
20-
import moe.nea.firmament.events.UseItemEvent
2120
import moe.nea.firmament.events.WorldReadyEvent
2221
import moe.nea.firmament.util.DurabilityBarEvent
2322
import moe.nea.firmament.util.MC
@@ -33,7 +32,6 @@ import moe.nea.firmament.util.mc.displayNameAccordingToNbt
3332
import moe.nea.firmament.util.mc.loreAccordingToNbt
3433
import moe.nea.firmament.util.parseShortNumber
3534
import moe.nea.firmament.util.parseTimePattern
36-
import moe.nea.firmament.util.red
3735
import moe.nea.firmament.util.render.RenderCircleProgress
3836
import moe.nea.firmament.util.render.lerp
3937
import moe.nea.firmament.util.skyblock.AbilityUtils
@@ -69,24 +67,9 @@ object PickaxeAbility {
6967
val disableInDungeons by toggle("disable-in-dungeons") { true }
7068
val showOnTools by choice("show-on-tools") { ShowOnTools.PICKAXES_AND_DRILLS }
7169
val cooldownScale by integer("ability-scale", 16, 64) { 16 }
72-
val cooldownColour by colour("ability-colour") { ChromaColour.fromStaticRGB(187, 54, 44, 128) }
70+
val cooldownColour by colour("ability-colour") { ChromaColour.fromStaticRGB(187, 54, 44, 128) }
7371
val cooldownReadyToast by toggle("ability-cooldown-toast") { false }
7472
val drillFuelBar by toggle("fuel-bar") { true }
75-
val blockOnPrivateIsland by choice(
76-
"block-on-dynamic",
77-
) {
78-
BlockPickaxeAbility.ONLY_DESTRUCTIVE
79-
}
80-
}
81-
82-
enum class BlockPickaxeAbility : StringRepresentable {
83-
NEVER,
84-
ALWAYS,
85-
ONLY_DESTRUCTIVE;
86-
87-
override fun getSerializedName(): String {
88-
return name
89-
}
9073
}
9174

9275
var lobbyJoinTime = TimeMark.farPast()
@@ -100,7 +83,6 @@ object PickaxeAbility {
10083
"Maniac Miner" to 59.seconds,
10184
"Vein Seeker" to 60.seconds
10285
)
103-
val destructiveAbilities = setOf("Pickobulus")
10486
val pickaxeTypes = setOf(ItemType.PICKAXE, ItemType.DRILL, ItemType.GAUNTLET)
10587

10688
fun getCooldownPercentage(name: String, cooldown: Duration): Double {
@@ -116,30 +98,6 @@ object PickaxeAbility {
11698
return 1.0
11799
}
118100

119-
@Subscribe
120-
fun onPickaxeRightClick(event: UseItemEvent) {
121-
if (TConfig.blockOnPrivateIsland == BlockPickaxeAbility.NEVER) return
122-
if (SBData.skyblockLocation != SkyBlockIsland.PRIVATE_ISLAND && SBData.skyblockLocation != SkyBlockIsland.GARDEN) return
123-
val itemType = ItemType.fromItemStack(event.item)
124-
if (itemType !in pickaxeTypes) return
125-
val ability = AbilityUtils.getAbilities(event.item)
126-
val shouldBlock = when (TConfig.blockOnPrivateIsland) {
127-
BlockPickaxeAbility.NEVER -> false
128-
BlockPickaxeAbility.ALWAYS -> ability.any()
129-
BlockPickaxeAbility.ONLY_DESTRUCTIVE -> ability.any { it.name in destructiveAbilities }
130-
}
131-
if (shouldBlock) {
132-
MC.sendChat(
133-
tr(
134-
"firmament.pickaxe.blocked",
135-
"Firmament blocked a pickaxe ability from being used on a private island."
136-
)
137-
.red() // TODO: .clickCommand("firm confignavigate ${TConfig.identifier} block-on-dynamic")
138-
)
139-
event.cancel()
140-
}
141-
}
142-
143101
@Subscribe
144102
fun onSlotClick(it: SlotClickEvent) {
145103
if (MC.screen?.title?.unformattedString == "Heart of the Mountain") {

translations/en_us.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,6 @@
275275
"firmament.config.pickaxe-info.ability-cooldown.description": "Show a cooldown on your cross-hair for your pickaxe ability.",
276276
"firmament.config.pickaxe-info.ability-scale": "Ability Cooldown Scale",
277277
"firmament.config.pickaxe-info.ability-scale.description": "Resize the cooldown around your cross-hair for your pickaxe ability.",
278-
"firmament.config.pickaxe-info.block-on-dynamic": "Block on Private Island",
279-
"firmament.config.pickaxe-info.block-on-dynamic.choice.always": "Always Block",
280-
"firmament.config.pickaxe-info.block-on-dynamic.choice.never": "Never Block",
281-
"firmament.config.pickaxe-info.block-on-dynamic.choice.only_destructive": "Only with dangerous",
282-
"firmament.config.pickaxe-info.block-on-dynamic.description": "Block pickaxe abilities on private islands by preventing you from right clicking.",
283278
"firmament.config.pickaxe-info.disable-in-dungeons": "Disable cross-hair cooldown in Dungeons",
284279
"firmament.config.pickaxe-info.disable-in-dungeons.description": "Disables the cooldown around your cross-hair while in Dungeons.",
285280
"firmament.config.pickaxe-info.fuel-bar": "Drill Fuel Durability Bar",

0 commit comments

Comments
 (0)