Remove "Risky Cheats"

Signed-off-by: Username404 <w.iron.zombie@gmail.com>
This commit is contained in:
Username404 2022-03-25 15:40:56 +01:00
parent 22b8bc19e1
commit c14ef7bef1
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
7 changed files with 2 additions and 50 deletions

View File

@ -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();
}
}

View File

@ -10,11 +10,9 @@ import fr.username404.snowygui.gui.feature.Category
import fr.username404.snowygui.gui.feature.Colors import fr.username404.snowygui.gui.feature.Colors
import fr.username404.snowygui.gui.feature.Macro import fr.username404.snowygui.gui.feature.Macro
import fr.username404.snowygui.gui.feature.Keystrokes import fr.username404.snowygui.gui.feature.Keystrokes
import fr.username404.snowygui.gui.feature.riskyCheats
import fr.username404.snowygui.gui.feature.Zoom import fr.username404.snowygui.gui.feature.Zoom
import net.minecraft.client.gui.screens.Screen import net.minecraft.client.gui.screens.Screen
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.network.chat.TextComponent
import net.minecraft.network.chat.TranslatableComponent import net.minecraft.network.chat.TranslatableComponent
import java.util.Optional import java.util.Optional
@ -70,16 +68,7 @@ val SnowyConfigScreen: Screen = object: Screen(translationComponent) {
) )
) )
}.build()) }.build())
.addEntry( .addEntry(startSubCategory(TranslatableComponent("$confPrefix.colors")).also { builder ->
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 ->
builder.addAll( builder.addAll(
ClickGui.clickBoxes.map { box -> ClickGui.clickBoxes.map { box ->
startColorField(box.name, box.color).setSaveConsumer { startColorField(box.name, box.color).setSaveConsumer {

View File

@ -24,7 +24,6 @@ annotation class ButtonInfo(
enum class Category(val translationKey: String, val categoryColor: Int, val shouldHide: Boolean = false) { enum class Category(val translationKey: String, val categoryColor: Int, val shouldHide: Boolean = false) {
MISC("snowy.clickbox.misc", Colors.BLUE), MISC("snowy.clickbox.misc", Colors.BLUE),
HUD("snowy.clickbox.hud", Colors.DARK_PURPLE), HUD("snowy.clickbox.hud", Colors.DARK_PURPLE),
RISKY("snowy.clickbox.risky", Colors.RED, !riskyCheats),
MACROS("snowy.clickbox.macros", Colors.GREEN); MACROS("snowy.clickbox.macros", Colors.GREEN);
companion object { companion object {
fun fromBox(box: ClickBox): Category? = values().find { fun fromBox(box: ClickBox): Category? = values().find {

View File

@ -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
}
}

View File

@ -19,6 +19,5 @@
"key.snowy.configkey": "Open the snowy configuration screen", "key.snowy.configkey": "Open the snowy configuration screen",
"snowy.clickbox.misc": "Miscellaneous", "snowy.clickbox.misc": "Miscellaneous",
"snowy.clickbox.hud": "HUD", "snowy.clickbox.hud": "HUD",
"snowy.clickbox.risky": "Risky",
"snowy.clickbox.macros": "Macros" "snowy.clickbox.macros": "Macros"
} }

View File

@ -19,6 +19,5 @@
"key.snowy.configkey": "Ouvrir l'écran de configuration de snowy", "key.snowy.configkey": "Ouvrir l'écran de configuration de snowy",
"snowy.clickbox.misc": "Divers", "snowy.clickbox.misc": "Divers",
"snowy.clickbox.hud": "ATH", "snowy.clickbox.hud": "ATH",
"snowy.clickbox.risky": "Risqué",
"snowy.clickbox.macros": "Macros" "snowy.clickbox.macros": "Macros"
} }

View File

@ -6,8 +6,7 @@
"KeysAccessor", "KeysAccessor",
"KeyMappings", "KeyMappings",
"EndTickMixin", "EndTickMixin",
"TitleScreenMixin", "TitleScreenMixin"
"RendererMixin"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1