Skip to content

Commit

Permalink
Prevent Moving On Death
Browse files Browse the repository at this point in the history
See #350

Original feature credit:

Co-authored-by: HighCrit <35771251+HighCrit@users.noreply.github.com>
  • Loading branch information
My-Name-Is-Jeff and HighCrit committed Mar 21, 2023
1 parent bd0981d commit 9c0073a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/kotlin/gg/skytils/skytilsmod/core/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1977,6 +1977,13 @@ object Config : Vigilant(
)
var preventCursorReset = false

@Property(
type = PropertyType.SWITCH, name = "Prevent Moving on Death",
description = "Unpresses all keys on death to prevent you from moving.",
category = "Miscellaneous", subcategory = "Quality of Life"
)
var preventMovingOnDeath = false

@Property(
type = PropertyType.SWITCH, name = "Power Orb Lock",
description = "Prevents placing the power orb if the same or better power orb is within range.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import net.minecraft.client.entity.EntityOtherPlayerMP
import net.minecraft.client.gui.GuiScreen
import net.minecraft.client.gui.inventory.GuiChest
import net.minecraft.client.renderer.GlStateManager
import net.minecraft.client.settings.KeyBinding
import net.minecraft.entity.EntityLivingBase
import net.minecraft.entity.effect.EntityLightningBolt
import net.minecraft.entity.item.EntityArmorStand
Expand Down Expand Up @@ -139,6 +140,9 @@ object MiscFeatures {
if (!Utils.inSkyblock) return
val unformatted = event.message.unformattedText.stripControlCodes().trim()
val formatted = event.message.formattedText
if (formatted.startsWith("§r§cYou died") && Skytils.config.preventMovingOnDeath) {
KeyBinding.unPressAllKeys()
}
if (unformatted == "The ground begins to shake as an Endstone Protector rises from below!") {
golemSpawnTime = System.currentTimeMillis() + 20000
}
Expand Down

0 comments on commit 9c0073a

Please sign in to comment.