From c14ef7bef1638a122c174fe4ff828798b79f7c09 Mon Sep 17 00:00:00 2001 From: Username404 Date: Fri, 25 Mar 2022 15:40:56 +0100 Subject: [PATCH] Remove "Risky Cheats" Signed-off-by: Username404 --- .../snowygui/mixins/RendererMixin.java | 17 ----------------- .../username404/snowygui/config/ConfigScreen.kt | 13 +------------ .../snowygui/gui/feature/ButtonInfo.kt | 1 - .../snowygui/gui/feature/RiskyCheats.kt | 16 ---------------- .../resources/assets/snowygui/lang/en_us.json | 1 - .../resources/assets/snowygui/lang/fr_fr.json | 1 - .../main/resources/snowygui-common.mixins.json | 3 +-- 7 files changed, 2 insertions(+), 50 deletions(-) delete mode 100644 common/src/main/java/fr/username404/snowygui/mixins/RendererMixin.java delete mode 100644 common/src/main/kotlin/fr/username404/snowygui/gui/feature/RiskyCheats.kt diff --git a/common/src/main/java/fr/username404/snowygui/mixins/RendererMixin.java b/common/src/main/java/fr/username404/snowygui/mixins/RendererMixin.java deleted file mode 100644 index 9f8e943..0000000 --- a/common/src/main/java/fr/username404/snowygui/mixins/RendererMixin.java +++ /dev/null @@ -1,17 +0,0 @@ -package fr.username404.snowygui.mixins; - -import com.mojang.blaze3d.vertex.PoseStack; -import fr.username404.snowygui.gui.feature.NoHurtCamera; -import net.minecraft.client.renderer.GameRenderer; -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.CallbackInfo; - -@Mixin(GameRenderer.class) -abstract class RendererMixin { - @Inject(method = "bobHurt", at = @At("HEAD"), cancellable = true) - private void onHurt(PoseStack poseStack, float f, CallbackInfo ci) { - if (NoHurtCamera.INSTANCE.getToggled()) ci.cancel(); - } -} diff --git a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt index 66738e4..aa655de 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/config/ConfigScreen.kt @@ -10,11 +10,9 @@ import fr.username404.snowygui.gui.feature.Category import fr.username404.snowygui.gui.feature.Colors import fr.username404.snowygui.gui.feature.Macro import fr.username404.snowygui.gui.feature.Keystrokes -import fr.username404.snowygui.gui.feature.riskyCheats import fr.username404.snowygui.gui.feature.Zoom import net.minecraft.client.gui.screens.Screen import net.minecraft.network.chat.Component -import net.minecraft.network.chat.TextComponent import net.minecraft.network.chat.TranslatableComponent import java.util.Optional @@ -70,16 +68,7 @@ val SnowyConfigScreen: Screen = object: Screen(translationComponent) { ) ) }.build()) - .addEntry( - startBooleanToggle(Component.nullToEmpty("Risky Cheats"), riskyCheats) - .setDefaultValue(false) - .requireRestart() - .setSaveConsumer { - riskyCheats = it - }.setTooltip(TextComponent("WARNING: Do not use this on servers or you might get banned.").apply { - style = style.withColor(Colors.RED.asTextColor()) - }).build() - ).addEntry(startSubCategory(TranslatableComponent("$confPrefix.colors")).also { builder -> + .addEntry(startSubCategory(TranslatableComponent("$confPrefix.colors")).also { builder -> builder.addAll( ClickGui.clickBoxes.map { box -> startColorField(box.name, box.color).setSaveConsumer { diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt index 0b1f222..99a39c9 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonInfo.kt @@ -24,7 +24,6 @@ annotation class ButtonInfo( enum class Category(val translationKey: String, val categoryColor: Int, val shouldHide: Boolean = false) { MISC("snowy.clickbox.misc", Colors.BLUE), HUD("snowy.clickbox.hud", Colors.DARK_PURPLE), - RISKY("snowy.clickbox.risky", Colors.RED, !riskyCheats), MACROS("snowy.clickbox.macros", Colors.GREEN); companion object { fun fromBox(box: ClickBox): Category? = values().find { diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/RiskyCheats.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/RiskyCheats.kt deleted file mode 100644 index b14ac4d..0000000 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/RiskyCheats.kt +++ /dev/null @@ -1,16 +0,0 @@ -package fr.username404.snowygui.gui.feature - -import fr.username404.snowygui.config.Configuration -import net.minecraft.client.Minecraft - -internal var riskyCheats: Boolean by Configuration - -@ButtonInfo(Category.RISKY) -object NoHurtCamera: ButtonImpl() - -@ButtonInfo(Category.RISKY) -object NoGravity: ButtonImpl() { - override fun execAction() { - Minecraft.getInstance().player?.isNoGravity = this.toggled - } -} diff --git a/common/src/main/resources/assets/snowygui/lang/en_us.json b/common/src/main/resources/assets/snowygui/lang/en_us.json index 85ef2e9..2ce6b76 100644 --- a/common/src/main/resources/assets/snowygui/lang/en_us.json +++ b/common/src/main/resources/assets/snowygui/lang/en_us.json @@ -19,6 +19,5 @@ "key.snowy.configkey": "Open the snowy configuration screen", "snowy.clickbox.misc": "Miscellaneous", "snowy.clickbox.hud": "HUD", - "snowy.clickbox.risky": "Risky", "snowy.clickbox.macros": "Macros" } \ No newline at end of file diff --git a/common/src/main/resources/assets/snowygui/lang/fr_fr.json b/common/src/main/resources/assets/snowygui/lang/fr_fr.json index 3f4fe51..0aa901c 100644 --- a/common/src/main/resources/assets/snowygui/lang/fr_fr.json +++ b/common/src/main/resources/assets/snowygui/lang/fr_fr.json @@ -19,6 +19,5 @@ "key.snowy.configkey": "Ouvrir l'écran de configuration de snowy", "snowy.clickbox.misc": "Divers", "snowy.clickbox.hud": "ATH", - "snowy.clickbox.risky": "Risqué", "snowy.clickbox.macros": "Macros" } \ No newline at end of file diff --git a/common/src/main/resources/snowygui-common.mixins.json b/common/src/main/resources/snowygui-common.mixins.json index d89de99..0603454 100644 --- a/common/src/main/resources/snowygui-common.mixins.json +++ b/common/src/main/resources/snowygui-common.mixins.json @@ -6,8 +6,7 @@ "KeysAccessor", "KeyMappings", "EndTickMixin", - "TitleScreenMixin", - "RendererMixin" + "TitleScreenMixin" ], "injectors": { "defaultRequire": 1