diff options
3 files changed, 118 insertions, 88 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java b/src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java new file mode 100644 index 0000000..c057a93 --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/MixinKeyBinding.java @@ -0,0 +1,16 @@ +package moe.nea.firmament.mixins; + +import moe.nea.firmament.features.fixes.Fixes; +import net.minecraft.client.option.KeyBinding; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(KeyBinding.class) +public class MixinKeyBinding { + @Inject(method = "isPressed", at = @At("HEAD"), cancellable = true) + public void onIsPressed(CallbackInfoReturnable<Boolean> cir) { + Fixes.INSTANCE.handleIsPressed((KeyBinding) (Object) this, cir); + } +} diff --git a/src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt b/src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt index 77397bc..1077f31 100644 --- a/src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt +++ b/src/main/kotlin/moe/nea/firmament/features/fixes/Fixes.kt @@ -8,6 +8,10 @@ package moe.nea.firmament.features.fixes import moe.nea.firmament.features.FirmamentFeature import moe.nea.firmament.gui.config.ManagedConfig +import moe.nea.firmament.util.MC +import net.minecraft.client.MinecraftClient +import net.minecraft.client.option.KeyBinding +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable object Fixes : FirmamentFeature { override val identifier: String @@ -15,11 +19,20 @@ object Fixes : FirmamentFeature { object TConfig : ManagedConfig(identifier) { val fixUnsignedPlayerSkins by toggle("player-skins") { true } + val autoSprint by toggle("auto-sprint") { false } } override val config: ManagedConfig get() = TConfig + fun handleIsPressed( + keyBinding: KeyBinding, + cir: CallbackInfoReturnable<Boolean> + ) { + if (keyBinding === MinecraftClient.getInstance().options.sprintKey && TConfig.autoSprint && MC.player?.isSprinting != true) + cir.returnValue = true + } + override fun onLoad() { } } diff --git a/src/main/resources/assets/firmament/lang/en_us.json b/src/main/resources/assets/firmament/lang/en_us.json index ad799e2..8315cef 100644 --- a/src/main/resources/assets/firmament/lang/en_us.json +++ b/src/main/resources/assets/firmament/lang/en_us.json @@ -1,90 +1,91 @@ { - "firmament.dev.resourcerebuild.start": "Invoking gradle resource rebuild (./gradlew :processResources)", - "firmament.dev.resourcerebuild.done": "Gradle resource rebuild done in %s", - "firmament.config.developer": "Developer Settings", - "firmament.config.developer.auto-rebuild": "Automatically rebuild resources", - "firmament.price": "Checking price for %s", - "firmament.price.bazaar": "Bazaar stats:", - "firmament.price.bazaar.productid": "Stock id: %s", - "firmament.price.bazaar.buy.price": "Buy Price: %s", - "firmament.price.bazaar.buy.order": "Buy orders: %d", - "firmament.pv.pets": "Pets", - "firmament.debug.skyblockid": "SkyBlock ID: %s", - "firmament.debug.skyblockid.copy": "Click to copy SkyBlock ID", - "firmament.price.bazaar.sell.price": "Sell Price: %s", - "firmament.price.bazaar.sell.order": "Sell orders: %d", - "firmament.price.lowestbin": "Lowest BIN: %s", - "firmament.repo.reload.network": "Trying to redownload the repository", - "firmament.repo.reload.disk": "Reloading repository from disk. This may lag a bit.", - "firmament.repo.cache": "Recaching items", - "firmament.repo.brokenitem": "Failed to render item: %s", - "firmanent.config.edit": "Edit", - "firmament.config.repo": "Firmament Repo Settings", - "firmament.config.repo.autoUpdate": "Auto Update", - "firmament.config.repo.username": "Repo Username", - "firmament.config.repo.username.hint": "NotEnoughUpdates", - "firmament.config.repo.reponame": "Repo Name", - "firmament.config.repo.reponame.hint": "NotEnoughUpdates-REPO", - "firmament.config.repo.branch": "Repo Branch", - "firmament.config.repo.branch.hint": "dangerous", - "firmament.config.repo.reset": "Reset", - "firmament.ursa.debugrequest.start": "Ursa request launched", - "firmament.ursa.debugrequest.result": "Ursa request succeeded: %s", - "firmament.sbinfo.nolocraw": "No locraw data available", - "firmament.sbinfo.profile": "Current profile cutename: %s", - "firmament.sbinfo.server": "Locraw Server: %s", - "firmament.sbinfo.gametype": "Locraw Gametype: %s", - "firmament.sbinfo.mode": "Locraw Mode: %s", - "firmament.sbinfo.map": "Locraw Map: %s", - "firmament.config.fairy-souls": "Fairy Souls", - "firmament.config.fairy-souls.show": "Show Fairy Soul Waypoints", - "firmament.config.fairy-souls.reset": "Reset Collected Fairy Souls", - "firmament.config.fishing-warning": "Fishing Warning", - "firmament.config.fishing-warning.display-warning": "Display a warning when you are about to hook a fish", - "firmament.config.fishing-warning.highlight-wake-chain": "Highlight fishing particles", - "firmament.key.slotlocking": "Lock Slot / Slot Binding", - "firmament.key.category": "Firmament", - "firmament.protectitem": "Firmament protected your item: ", - "firmament.recipe.forge.time": "Forging Time: %s", - "firmament.pv.skills": "Skills", - "firmament.pv.skills.farming": "Farming", - "firmament.pv.skills.foraging": "Foraging", - "firmament.pv.skills.mining": "Mining", - "firmament.pv.skills.alchemy": "Alchemy", - "firmament.pv.skills.taming": "Taming", - "firmament.pv.skills.fishing": "Fishing", - "firmament.pv.skills.runecrafting": "Runecrafting", - "firmament.pv.skills.carpentry": "Carpentry", - "firmament.pv.skills.combat": "Combat", - "firmament.pv.skills.social": "Social", - "firmament.pv.skills.rift": "Rift", - "firmament.pv.skills.enchanting": "Enchanting", - "firmament.pv.skills.total": "Total Exp: %s", - "firmament.pv.lookingup": "Looking up %s", - "firmament.pv.noprofile": "%s has no SkyBlock profiles", - "firmament.pv.noplayer": "%s is not a Minecraft player", - "firmament.config.save-cursor-position.enable": "Enable", - "firmament.config.save-cursor-position.tolerance": "Tolerance", - "firmament.config.save-cursor-position": "Save Cursor Position", - "firmament.config.storage-overlay": "Storage Overlay", - "firmament.config.storage-overlay.rows": "Rows", - "firmament.config.storage-overlay.padding": "Padding", - "firmament.config.storage-overlay.scroll-speed": "Scroll Speed", - "firmament.config.storage-overlay.inverse-scroll": "Invert Scroll", - "firmament.config.storage-overlay.margin": "Margin", - "firmament.config.chat-links": "Chat Links", - "firmament.config.chat-links.links-enabled": "Enable Clickable Links", - "firmament.config.chat-links.image-enabled": "Enable Image Preview", - "firmament.config.chat-links.allow-all-hosts": "Allow all Image Hosts", - "firmament.config.chat-links.allowed-hosts": "Allowed Image Hosts", - "firmament.config.chat-links.position": "Chat Image Preview", - "firmament.hud.edit": "Edit %s", - "firmament.keybinding.external": "External", - "firmament.config.slot-locking": "Slot Locking", - "firmament.config.slot-locking.lock": "Lock Slot", - "firmament.config.custom-skyblock-textures": "Custom SkyBlock Item Textures", - "firmament.config.custom-skyblock-textures.cache-duration": "Model Cache Duration", - "firmament.config.custom-skyblock-textures.enabled": "Enable Custom Item Textures", - "firmament.config.fixes": "Fixes", - "firmament.config.fixes.player-skins": "Fix unsigned Player Skins" + "firmament.dev.resourcerebuild.start": "Invoking gradle resource rebuild (./gradlew :processResources)", + "firmament.dev.resourcerebuild.done": "Gradle resource rebuild done in %s", + "firmament.config.developer": "Developer Settings", + "firmament.config.developer.auto-rebuild": "Automatically rebuild resources", + "firmament.price": "Checking price for %s", + "firmament.price.bazaar": "Bazaar stats:", + "firmament.price.bazaar.productid": "Stock id: %s", + "firmament.price.bazaar.buy.price": "Buy Price: %s", + "firmament.price.bazaar.buy.order": "Buy orders: %d", + "firmament.pv.pets": "Pets", + "firmament.debug.skyblockid": "SkyBlock ID: %s", + "firmament.debug.skyblockid.copy": "Click to copy SkyBlock ID", + "firmament.price.bazaar.sell.price": "Sell Price: %s", + "firmament.price.bazaar.sell.order": "Sell orders: %d", + "firmament.price.lowestbin": "Lowest BIN: %s", + "firmament.repo.reload.network": "Trying to redownload the repository", + "firmament.repo.reload.disk": "Reloading repository from disk. This may lag a bit.", + "firmament.repo.cache": "Recaching items", + "firmament.repo.brokenitem": "Failed to render item: %s", + "firmanent.config.edit": "Edit", + "firmament.config.repo": "Firmament Repo Settings", + "firmament.config.repo.autoUpdate": "Auto Update", + "firmament.config.repo.username": "Repo Username", + "firmament.config.repo.username.hint": "NotEnoughUpdates", + "firmament.config.repo.reponame": "Repo Name", + "firmament.config.repo.reponame.hint": "NotEnoughUpdates-REPO", + "firmament.config.repo.branch": "Repo Branch", + "firmament.config.repo.branch.hint": "dangerous", + "firmament.config.repo.reset": "Reset", + "firmament.ursa.debugrequest.start": "Ursa request launched", + "firmament.ursa.debugrequest.result": "Ursa request succeeded: %s", + "firmament.sbinfo.nolocraw": "No locraw data available", + "firmament.sbinfo.profile": "Current profile cutename: %s", + "firmament.sbinfo.server": "Locraw Server: %s", + "firmament.sbinfo.gametype": "Locraw Gametype: %s", + "firmament.sbinfo.mode": "Locraw Mode: %s", + "firmament.sbinfo.map": "Locraw Map: %s", + "firmament.config.fairy-souls": "Fairy Souls", + "firmament.config.fairy-souls.show": "Show Fairy Soul Waypoints", + "firmament.config.fairy-souls.reset": "Reset Collected Fairy Souls", + "firmament.config.fishing-warning": "Fishing Warning", + "firmament.config.fishing-warning.display-warning": "Display a warning when you are about to hook a fish", + "firmament.config.fishing-warning.highlight-wake-chain": "Highlight fishing particles", + "firmament.key.slotlocking": "Lock Slot / Slot Binding", + "firmament.key.category": "Firmament", + "firmament.protectitem": "Firmament protected your item: ", + "firmament.recipe.forge.time": "Forging Time: %s", + "firmament.pv.skills": "Skills", + "firmament.pv.skills.farming": "Farming", + "firmament.pv.skills.foraging": "Foraging", + "firmament.pv.skills.mining": "Mining", + "firmament.pv.skills.alchemy": "Alchemy", + "firmament.pv.skills.taming": "Taming", + "firmament.pv.skills.fishing": "Fishing", + "firmament.pv.skills.runecrafting": "Runecrafting", + "firmament.pv.skills.carpentry": "Carpentry", + "firmament.pv.skills.combat": "Combat", + "firmament.pv.skills.social": "Social", + "firmament.pv.skills.rift": "Rift", + "firmament.pv.skills.enchanting": "Enchanting", + "firmament.pv.skills.total": "Total Exp: %s", + "firmament.pv.lookingup": "Looking up %s", + "firmament.pv.noprofile": "%s has no SkyBlock profiles", + "firmament.pv.noplayer": "%s is not a Minecraft player", + "firmament.config.save-cursor-position.enable": "Enable", + "firmament.config.save-cursor-position.tolerance": "Tolerance", + "firmament.config.save-cursor-position": "Save Cursor Position", + "firmament.config.storage-overlay": "Storage Overlay", + "firmament.config.storage-overlay.rows": "Rows", + "firmament.config.storage-overlay.padding": "Padding", + "firmament.config.storage-overlay.scroll-speed": "Scroll Speed", + "firmament.config.storage-overlay.inverse-scroll": "Invert Scroll", + "firmament.config.storage-overlay.margin": "Margin", + "firmament.config.chat-links": "Chat Links", + "firmament.config.chat-links.links-enabled": "Enable Clickable Links", + "firmament.config.chat-links.image-enabled": "Enable Image Preview", + "firmament.config.chat-links.allow-all-hosts": "Allow all Image Hosts", + "firmament.config.chat-links.allowed-hosts": "Allowed Image Hosts", + "firmament.config.chat-links.position": "Chat Image Preview", + "firmament.hud.edit": "Edit %s", + "firmament.keybinding.external": "External", + "firmament.config.slot-locking": "Slot Locking", + "firmament.config.slot-locking.lock": "Lock Slot", + "firmament.config.fixes.auto-sprint": "Auto Sprint", + "firmament.config.custom-skyblock-textures": "Custom SkyBlock Item Textures", + "firmament.config.custom-skyblock-textures.cache-duration": "Model Cache Duration", + "firmament.config.custom-skyblock-textures.enabled": "Enable Custom Item Textures", + "firmament.config.fixes": "Fixes", + "firmament.config.fixes.player-skins": "Fix unsigned Player Skins" } |