diff options
author | HiZe_ <superhize@hotmail.com> | 2023-07-25 15:45:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-25 15:45:14 +0200 |
commit | 9b4c029bbe90a74845da7c0e3e732c7c03714536 (patch) | |
tree | 8d2e09431dcc21ceda5e590ddf2c48a611a3bb13 /src/main/java | |
parent | 48cff2f92ac59da9c0f796b88fe8478788f4039b (diff) | |
download | skyhanni-9b4c029bbe90a74845da7c0e3e732c7c03714536.tar.gz skyhanni-9b4c029bbe90a74845da7c0e3e732c7c03714536.tar.bz2 skyhanni-9b4c029bbe90a74845da7c0e3e732c7c03714536.zip |
Bypass visitor refusal key (#331)
Co-authored-by: superhize <superhize@gmail.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/config/features/Garden.java | 5 | ||||
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java index 0afc5d2fc..3091e4f85 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java +++ b/src/main/java/at/hannibal2/skyhanni/config/features/Garden.java @@ -171,6 +171,11 @@ public class Garden { @ConfigEditorBoolean public boolean preventRefusing = true; + @Expose + @ConfigOption(name = "Bypass Key", desc = "Hold that key to bypass the Prevent Refusing feature.") + @ConfigEditorKeybind(defaultKey = Keyboard.KEY_NONE) + public int bypassKey = Keyboard.KEY_NONE; + /** * Sync up with {at.hannibal2.skyhanni.features.garden.visitor.VisitorReward} diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt index 5b0aafdb9..fcac2e663 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/visitor/GardenVisitorFeatures.kt @@ -23,6 +23,7 @@ import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.renderables.Renderable +import io.github.moulberry.moulconfig.internal.KeybindHelper import io.github.moulberry.notenoughupdates.events.SlotClickEvent import io.github.moulberry.notenoughupdates.util.MinecraftExecutor import net.minecraft.client.Minecraft @@ -269,6 +270,10 @@ class GardenVisitorFeatures { visitor.hasReward()?.let { if (config.visitorRewardWarning.preventRefusing) { + if (KeybindHelper.isKeyDown(config.visitorRewardWarning.bypassKey)) { + LorenzUtils.chat("§e[SkyHanni] §cBypassed blocking refusal of visitor ${visitor.visitorName} §7(${it.displayName}§7)") + return + } event.isCanceled = true LorenzUtils.chat("§e[SkyHanni] §cBlocked refusing visitor ${visitor.visitorName} §7(${it.displayName}§7)") Minecraft.getMinecraft().thePlayer.closeScreen() |