MelaHack (ThunderHack fork)

MelaHack (ThunderHack fork) modules for Minecraft 26.2: 201 modules across 6 categories, each with its complete source file.

Minecraft 26.2201 modulesJava94 mixins

Mixins (94)

Every mixin MelaHack (ThunderHack fork) ships, complete and verbatim, with the vanilla classes it modifies. Target links open that class in the site source browser.

JsonEffectGlShaderMixinsrc/main/java/thunder/hack/injection/JsonEffectGlShaderMixin.javaJava · 9 lines · 194 B
@Mixin(GlProgram.class)
ModifiesGlProgram
JsonEffectGlShaderMixin.javaJava · 9 lines · 194 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.blaze3d.opengl.GlProgram;
4
import org.spongepowered.asm.mixin.Mixin;
5
6
@Mixin(GlProgram.class)
7
public abstract class JsonEffectGlShaderMixin {
8
}
9
MixinAbstractBlocksrc/main/java/thunder/hack/injection/MixinAbstractBlock.javaJava · 44 lines · 2.1 KB
@Mixin({BlockBehaviour.class})
MixinAbstractBlock.javaJava · 44 lines · 2.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.manager.client.ModuleManager;
4
import thunder.hack.features.modules.player.AutoTool;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
9
10
import static net.minecraft.world.item.enchantment.Enchantments.EFFICIENCY;
11
import static thunder.hack.core.manager.IManager.mc;
12
13
import net.minecraft.core.BlockPos;
14
import net.minecraft.core.registries.Registries;
15
import net.minecraft.world.entity.player.Player;
16
import net.minecraft.world.item.ItemStack;
17
import net.minecraft.world.item.enchantment.EnchantmentHelper;
18
import net.minecraft.world.level.BlockGetter;
19
import net.minecraft.world.level.block.state.BlockBehaviour;
20
import net.minecraft.world.level.block.state.BlockState;
21
22
@Mixin({BlockBehaviour.class})
23
public abstract class MixinAbstractBlock {
24
    @Inject(method = "getDestroyProgress", at = @At("HEAD"), cancellable = true)
25
    public void calcBlockBreakingDeltaHook(BlockState state, Player player, BlockGetter world, BlockPos pos, CallbackInfoReturnable<Float> ci)  {
26
        if(ModuleManager.autoTool.isEnabled() && AutoTool.silent.getValue()) {
27
            float f = state.getDestroySpeed(world, pos);
28
            if (f < 0.0F) {
29
                ci.setReturnValue(0.0f);
30
            } else {
31
                float dig_speed = getDigSpeed(state, player.getInventory().getItem(AutoTool.itemIndex)) / f;
32
                ci.setReturnValue(player.getInventory().getItem(AutoTool.itemIndex).isCorrectToolForDrops(state) ? dig_speed / 30.0F : dig_speed / 100.0F);
33
            }
34
        }
35
    }
36
37
    public float getDigSpeed(BlockState state, ItemStack stack)
38
    {
39
        double str = stack.getDestroySpeed(state);
40
        int effect = EnchantmentHelper.getItemEnchantmentLevel(mc.level.registryAccess().lookupOrThrow(Registries.ENCHANTMENT).getOrThrow(EFFICIENCY), stack);
41
        return (float) Math.max(str + (str > 1.0 ? (effect * effect + 1.0) : 0.0), 0.0);
42
    }
43
}
44
MixinAbstractBlockStatesrc/main/java/thunder/hack/injection/MixinAbstractBlockState.javaJava · 19 lines · 747 B
@Mixin(BlockBehaviour.BlockStateBase.class)
MixinAbstractBlockState.javaJava · 19 lines · 747 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.world.level.block.*;
4
import net.minecraft.world.level.block.state.BlockBehaviour;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
9
import thunder.hack.core.manager.client.ModuleManager;
10
11
@Mixin(BlockBehaviour.BlockStateBase.class)
12
public class MixinAbstractBlockState {
13
    @Inject(method = "getLightEmission", at = @At("HEAD"), cancellable = true)
14
    public void getLuminanceHook(CallbackInfoReturnable<Integer> cir) {
15
        if (ModuleManager.xray.isEnabled()) {
16
            cir.setReturnValue(15);
17
        }
18
    }
19
}
MixinAbstractHorseEntitysrc/main/java/thunder/hack/injection/MixinAbstractHorseEntity.javaJava · 17 lines · 577 B
@Mixin(AbstractHorse.class)
MixinAbstractHorseEntity.javaJava · 17 lines · 577 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.world.entity.EntityType;
4
import net.minecraft.world.entity.animal.Animal;
5
import net.minecraft.world.entity.animal.equine.AbstractHorse;
6
import net.minecraft.world.level.Level;
7
import org.spongepowered.asm.mixin.Mixin;
8
9
@Mixin(AbstractHorse.class)
10
public abstract class MixinAbstractHorseEntity extends Animal {
11
    protected MixinAbstractHorseEntity(EntityType<? extends Animal> entityType, Level world) {
12
        super(entityType, world);
13
    }
14
15
    // isSaddled() removed in 1.21.5 - needs porting to new saddle check
16
}
17
MixinArmorFeatureRenderersrc/main/java/thunder/hack/injection/MixinArmorFeatureRenderer.javaJava · 22 lines · 1001 B
@Mixin(HumanoidArmorLayer.class)
MixinArmorFeatureRenderer.javaJava · 22 lines · 1001 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.manager.client.ModuleManager;
4
import com.mojang.blaze3d.vertex.PoseStack;
5
import net.minecraft.client.renderer.SubmitNodeCollector;
6
import net.minecraft.client.renderer.entity.layers.HumanoidArmorLayer;
7
import net.minecraft.client.renderer.entity.state.HumanoidRenderState;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.Inject;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12
13
@Mixin(HumanoidArmorLayer.class)
14
public class MixinArmorFeatureRenderer {
15
    @Inject(method = "submit", at = @At("HEAD"), cancellable = true)
16
    private void onRender(PoseStack matrices, SubmitNodeCollector vertexConsumers, int light, HumanoidRenderState state, float limbAngle, float limbDistance, CallbackInfo ci) {
17
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.armor.getValue()) {
18
            ci.cancel();
19
        }
20
    }
21
}
22
MixinBackgroundRenderersrc/main/java/thunder/hack/injection/MixinBackgroundRenderer.javaJava · 48 lines · 2.1 KB
@Mixin(FogRenderer.class)
ModifiesFogRenderer
MixinBackgroundRenderer.javaJava · 48 lines · 2.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.Camera;
4
import net.minecraft.client.DeltaTracker;
5
import net.minecraft.client.multiplayer.ClientLevel;
6
import net.minecraft.client.renderer.fog.FogData;
7
import net.minecraft.client.renderer.fog.FogRenderer;
8
import org.joml.Vector4f;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.injection.At;
11
import org.spongepowered.asm.mixin.injection.Inject;
12
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
13
import thunder.hack.core.manager.client.ModuleManager;
14
import thunder.hack.features.modules.render.WorldTweaks;
15
16
@Mixin(FogRenderer.class)
17
public class MixinBackgroundRenderer {
18
    @Inject(method = "setupFog", at = @At("RETURN"), cancellable = true)
19
    private void modifyFog(Camera camera, int viewDistance, DeltaTracker tickCounter,
20
                           float skyDarkness, ClientLevel world, CallbackInfoReturnable<FogData> cir) {
21
        FogData fog = cir.getReturnValue();
22
23
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.fog.getValue()) {
24
            float start = viewDistance * 4.0f;
25
            float end = viewDistance * 4.25f;
26
            fog.environmentalStart = start;
27
            fog.renderDistanceStart = start;
28
            fog.environmentalEnd = end;
29
            fog.renderDistanceEnd = end;
30
            fog.skyEnd = end;
31
            fog.cloudEnd = end;
32
        }
33
34
        if (ModuleManager.worldTweaks.isEnabled() && WorldTweaks.fogModify.getValue().isEnabled()) {
35
            fog.color = new Vector4f(
36
                    WorldTweaks.fogColor.getValue().getGlRed(),
37
                    WorldTweaks.fogColor.getValue().getGlGreen(),
38
                    WorldTweaks.fogColor.getValue().getGlBlue(),
39
                    fog.color.w
40
            );
41
            fog.environmentalStart = WorldTweaks.fogStart.getValue().floatValue();
42
            fog.renderDistanceStart = WorldTweaks.fogStart.getValue().floatValue();
43
            fog.environmentalEnd = WorldTweaks.fogEnd.getValue().floatValue();
44
            fog.renderDistanceEnd = WorldTweaks.fogEnd.getValue().floatValue();
45
        }
46
    }
47
}
48
MixinBlocksrc/main/java/thunder/hack/injection/MixinBlock.javaJava · 58 lines · 2.8 KB
@Mixin(Block.class)
ModifiesBlock
MixinBlock.javaJava · 58 lines · 2.8 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
7
import thunder.hack.core.manager.client.ModuleManager;
8
import thunder.hack.features.modules.render.XRay;
9
10
import static thunder.hack.core.manager.IManager.mc;
11
12
import net.minecraft.core.Direction;
13
import net.minecraft.world.level.block.Block;
14
import net.minecraft.world.level.block.Blocks;
15
import net.minecraft.world.level.block.FireBlock;
16
import net.minecraft.world.level.block.state.BlockState;
17
18
@Mixin(Block.class)
19
public abstract class MixinBlock {
20
21
    @Inject(method = "shouldRenderFace", at = @At("HEAD"), cancellable = true)
22
    private static void shouldDrawSideHook(BlockState state, BlockState otherState, Direction side, CallbackInfoReturnable<Boolean> cir) {
23
        if (ModuleManager.xray.isEnabled() && ModuleManager.xray.wallHack.getValue())
24
            cir.setReturnValue(XRay.isCheckableOre(state.getBlock()));
25
        if(ModuleManager.autoAnchor.isEnabled() && state.getBlock() instanceof FireBlock)
26
            cir.setReturnValue(false);
27
    }
28
29
    /*
30
    @Inject(method = "isTransparent", at = @At("HEAD"), cancellable = true)
31
    public void isTransparentHook(BlockState state, BlockView world, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
32
        if (MinecraftClient.getInstance() == null) return;
33
        if (ModuleManager.xray.isEnabled() && ModuleManager.xray.wallHack.getValue())
34
            cir.setReturnValue(!XRay.isCheckableOre(state.getBlock()));
35
    }
36
     */
37
38
    @Inject(method = "getSpeedFactor", at = @At("HEAD"), cancellable = true)
39
    public void getVelocityMultiplierHook(CallbackInfoReturnable<Float> cir) {
40
        if (ModuleManager.noSlow.isEnabled()) {
41
            if (ModuleManager.noSlow.soulSand.getValue() && (Object) this == Blocks.SOUL_SAND)
42
                cir.setReturnValue(Blocks.DIRT.getSpeedFactor());
43
            if (ModuleManager.noSlow.honey.getValue() && (Object) this == Blocks.HONEY_BLOCK)
44
                cir.setReturnValue(Blocks.DIRT.getSpeedFactor());
45
        }
46
    }
47
48
    @Inject(method = "getFriction", at = @At("HEAD"), cancellable = true)
49
    public void getSlipperinessHook(CallbackInfoReturnable<Float> cir) {
50
        if (ModuleManager.noSlow.isEnabled()) {
51
            if (ModuleManager.noSlow.slime.getValue() && (Object) this == Blocks.SLIME_BLOCK)
52
                cir.setReturnValue(Blocks.DIRT.getFriction());
53
            if (ModuleManager.noSlow.ice.getValue() && ((Object) this == Blocks.ICE || (Object) this == Blocks.PACKED_ICE || (Object) this == Blocks.BLUE_ICE || (Object) this == Blocks.FROSTED_ICE) && !mc.options.keyJump.isDown())
54
                cir.setReturnValue(Blocks.DIRT.getFriction());
55
        }
56
    }
57
}
58
MixinBlockCollisionSpliteratorsrc/main/java/thunder/hack/injection/MixinBlockCollisionSpliterator.javaJava · 28 lines · 1.3 KB
@Mixin(value = BlockCollisions.class, priority = 800)priority 800
MixinBlockCollisionSpliterator.javaJava · 28 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.world.level.BlockCollisions;
5
import net.minecraft.world.level.BlockGetter;
6
import net.minecraft.world.level.block.state.BlockState;
7
import org.spongepowered.asm.mixin.Mixin;
8
import org.spongepowered.asm.mixin.injection.At;
9
import org.spongepowered.asm.mixin.injection.Redirect;
10
import thunder.hack.ThunderHack;
11
import thunder.hack.core.manager.client.ModuleManager;
12
import thunder.hack.events.impl.EventCollision;
13
14
@Mixin(value = BlockCollisions.class, priority = 800)
15
public abstract class MixinBlockCollisionSpliterator {
16
    // я надеюсь это никто не будет редиректить
17
    // I hope no one will redirect this
18
    @Redirect(method = "computeNext", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/BlockGetter;getBlockState(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/block/state/BlockState;"))
19
    private BlockState computeNextHook(BlockGetter instance, BlockPos blockPos) {
20
        if(!ModuleManager.antiWeb.isEnabled() && !ModuleManager.phase.isEnabled() && !ModuleManager.jesus.isEnabled())
21
            return instance.getBlockState(blockPos);
22
        EventCollision event = new EventCollision(instance.getBlockState(blockPos), blockPos);
23
        ThunderHack.EVENT_BUS.post(event);
24
        return event.getState();
25
    }
26
}
27
28
MixinBlockItemsrc/main/java/thunder/hack/injection/MixinBlockItem.javaJava · 24 lines · 1.1 KB
@Mixin(BlockItem.class)
ModifiesBlockItem
MixinBlockItem.javaJava · 24 lines · 1.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.world.item.BlockItem;
4
import net.minecraft.world.item.context.BlockPlaceContext;
5
import net.minecraft.world.level.block.state.BlockState;
6
import org.jetbrains.annotations.NotNull;
7
import org.spongepowered.asm.mixin.Mixin;
8
import org.spongepowered.asm.mixin.injection.At;
9
import org.spongepowered.asm.mixin.injection.Inject;
10
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
11
import thunder.hack.ThunderHack;
12
import thunder.hack.events.impl.EventPlaceBlock;
13
import thunder.hack.features.modules.Module;
14
15
@Mixin(BlockItem.class)
16
public class MixinBlockItem {
17
    @Inject(method = "placeBlock(Lnet/minecraft/world/item/context/BlockPlaceContext;Lnet/minecraft/world/level/block/state/BlockState;)Z", at = @At("RETURN"))
18
    private void onPlace(@NotNull BlockPlaceContext context, BlockState state, CallbackInfoReturnable<Boolean> info) {
19
        if(Module.fullNullCheck()) return;
20
        if (context.getLevel().isClientSide())
21
            ThunderHack.EVENT_BUS.post(new EventPlaceBlock(context.getClickedPos(), state.getBlock()));
22
    }
23
}
24
MixinBoatEntitysrc/main/java/thunder/hack/injection/MixinBoatEntity.javaJava · 34 lines · 1.2 KB
@Mixin(AbstractBoat.class)
ModifiesAbstractBoat
MixinBoatEntity.javaJava · 34 lines · 1.2 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.world.entity.Entity;
4
import net.minecraft.world.entity.vehicle.boat.AbstractBoat;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.Unique;
7
import org.spongepowered.asm.mixin.injection.At;
8
import org.spongepowered.asm.mixin.injection.Inject;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10
import thunder.hack.core.manager.client.ModuleManager;
11
12
@Mixin(AbstractBoat.class)
13
public class MixinBoatEntity {
14
15
    @Unique
16
    private float prevYaw, prevHeadYaw;
17
18
    @Inject(method = "positionRider", at = @At("HEAD"))
19
    protected void updatePassengerPositionHookPre(Entity passenger, Entity.MoveFunction positionUpdater, CallbackInfo ci) {
20
        if(ModuleManager.boatFly.isEnabled()) {
21
            prevYaw = passenger.getYRot();
22
            prevHeadYaw = passenger.getYHeadRot();
23
        }
24
    }
25
26
    @Inject(method = "positionRider", at = @At("RETURN"))
27
    protected void updatePassengerPositionHookPost(Entity passenger, Entity.MoveFunction positionUpdater, CallbackInfo ci) {
28
        if(ModuleManager.boatFly.isEnabled()) {
29
            passenger.setYRot(prevYaw);
30
            passenger.setYHeadRot(prevHeadYaw);
31
        }
32
    }
33
}
34
MixinBoatEntityRenderersrc/main/java/thunder/hack/injection/MixinBoatEntityRenderer.javaJava · 23 lines · 1.3 KB
@Mixin(AbstractBoatRenderer.class)
MixinBoatEntityRenderer.javaJava · 23 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.blaze3d.vertex.PoseStack;
4
import net.minecraft.client.renderer.SubmitNodeCollector;
5
import net.minecraft.client.renderer.entity.AbstractBoatRenderer;
6
import net.minecraft.client.renderer.entity.state.BoatRenderState;
7
import net.minecraft.client.renderer.state.level.CameraRenderState;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.Inject;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12
import thunder.hack.core.manager.client.ModuleManager;
13
14
@Mixin(AbstractBoatRenderer.class)
15
public class MixinBoatEntityRenderer {
16
17
    @Inject(method = "submit(Lnet/minecraft/client/renderer/entity/state/BoatRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/level/CameraRenderState;)V", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/vertex/PoseStack;scale(FFF)V", shift = At.Shift.AFTER))
18
    public void render(BoatRenderState boatEntityRenderState, PoseStack matrixStack, SubmitNodeCollector vertexConsumerProvider, CameraRenderState cameraState, CallbackInfo ci) {
19
        if (ModuleManager.boatFly.isEnabled() && ModuleManager.boatFly.hideBoat.getValue())
20
            matrixStack.scale(0.3f, 0.3f, 0.3f);
21
    }
22
}
23
MixinBossBarHudsrc/main/java/thunder/hack/injection/MixinBossBarHud.javaJava · 20 lines · 774 B
@Mixin(BossHealthOverlay.class)
MixinBossBarHud.javaJava · 20 lines · 774 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.manager.client.ModuleManager;
4
import net.minecraft.client.gui.components.BossHealthOverlay;
5
import net.minecraft.client.gui.GuiGraphicsExtractor;
6
import org.spongepowered.asm.mixin.Mixin;
7
import org.spongepowered.asm.mixin.injection.At;
8
import org.spongepowered.asm.mixin.injection.Inject;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10
11
@Mixin(BossHealthOverlay.class)
12
public class MixinBossBarHud {
13
    @Inject(method = "extractRenderState", at = @At("HEAD"), cancellable = true)
14
    private void render(GuiGraphicsExtractor extractor, CallbackInfo ci) {
15
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.bossbar.getValue()) {
16
            ci.cancel();
17
        }
18
    }
19
}
20
MixinCamerasrc/main/java/thunder/hack/injection/MixinCamera.javaJava · 57 lines · 2.4 KB
@Mixin(Camera.class)
ModifiesCamera
MixinCamera.javaJava · 57 lines · 2.4 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
4
import thunder.hack.core.manager.client.ModuleManager;
5
import net.minecraft.client.Camera;
6
import net.minecraft.client.DeltaTracker;
7
import net.minecraft.world.entity.Entity;
8
import net.minecraft.world.level.BlockGetter;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.Shadow;
11
import org.spongepowered.asm.mixin.injection.At;
12
import org.spongepowered.asm.mixin.injection.Inject;
13
import org.spongepowered.asm.mixin.injection.ModifyArgs;
14
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
15
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
16
17
@Mixin(Camera.class)
18
public abstract class MixinCamera {
19
    @Shadow
20
    protected abstract float getMaxZoom(float desiredCameraDistance);
21
22
    @Shadow
23
    private boolean detached;
24
25
    @ModifyArgs(method = "alignWithEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;move(FFF)V", ordinal = 0))
26
    private void modifyCameraDistance(Args args) {
27
        if (ModuleManager.noCameraClip.isEnabled()) {
28
            args.set(0, -getMaxZoom(ModuleManager.noCameraClip.getDistance()));
29
        }
30
    }
31
32
    @Inject(method = "getMaxZoom", at = @At("HEAD"), cancellable = true)
33
    private void onClipToSpace(float f, CallbackInfoReturnable<Float> cir) {
34
        if (ModuleManager.noCameraClip.isEnabled()) {
35
            cir.setReturnValue(ModuleManager.noCameraClip.getDistance());
36
        }
37
    }
38
39
    @Inject(method = "update", at = @At("TAIL"))
40
    private void updateHook(DeltaTracker tickCounter, CallbackInfo ci) {
41
        if (ModuleManager.freeCam.isEnabled()) {
42
            this.detached = true;
43
        }
44
    }
45
46
    @ModifyArgs(method = "alignWithEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;setRotation(FF)V"))
47
    private void setRotationHook(Args args) {
48
        if(ModuleManager.freeCam.isEnabled())
49
            args.setAll(ModuleManager.freeCam.getFakeYaw(), ModuleManager.freeCam.getFakePitch());
50
    }
51
52
    @ModifyArgs(method = "alignWithEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Camera;setPosition(DDD)V"))
53
    private void setPosHook(Args args) {
54
        if(ModuleManager.freeCam.isEnabled())
55
            args.setAll(ModuleManager.freeCam.getFakeX(), ModuleManager.freeCam.getFakeY(), ModuleManager.freeCam.getFakeZ());
56
    }
57
}
MixinCapeFeatureRenderersrc/main/java/thunder/hack/injection/MixinCapeFeatureRenderer.javaJava · 19 lines · 958 B
@Mixin(CapeLayer.class)not in mixin config
ModifiesCapeLayer
MixinCapeFeatureRenderer.javaJava · 19 lines · 958 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.blaze3d.vertex.PoseStack;
4
import net.minecraft.client.player.AbstractClientPlayer;
5
import net.minecraft.client.renderer.SubmitNodeCollector;
6
import net.minecraft.client.renderer.entity.layers.CapeLayer;
7
import net.minecraft.util.Mth;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.ModifyVariable;
11
12
@Mixin(CapeLayer.class)
13
public class MixinCapeFeatureRenderer {
14
    @ModifyVariable(method = "render", at = @At("STORE"), ordinal = 6)
15
    private float renderHook(float n, PoseStack matrixStack, SubmitNodeCollector vertexConsumerProvider, int i, AbstractClientPlayer abstractClientPlayerEntity, float f, float g, float h, float j, float k, float l) {
16
        return Mth.lerp(h, ((thunder.hack.injection.accesors.ILivingEntity) abstractClientPlayerEntity).getLastBodyYaw(), abstractClientPlayerEntity.yBodyRot);
17
    }
18
}
19
MixinChatInputSuggestorsrc/main/java/thunder/hack/injection/MixinChatInputSuggestor.javaJava · 54 lines · 2.4 KB
@Mixin(CommandSuggestions.class)
MixinChatInputSuggestor.javaJava · 54 lines · 2.4 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.brigadier.ParseResults;
4
import com.mojang.brigadier.StringReader;
5
import com.mojang.brigadier.suggestion.Suggestions;
6
import org.spongepowered.asm.mixin.Final;
7
import org.spongepowered.asm.mixin.Mixin;
8
import org.spongepowered.asm.mixin.Shadow;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.Inject;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
13
import thunder.hack.ThunderHack;
14
import thunder.hack.core.Managers;
15
import thunder.hack.features.modules.Module;
16
17
import java.util.concurrent.CompletableFuture;
18
import net.minecraft.client.gui.components.CommandSuggestions;
19
import net.minecraft.client.gui.components.EditBox;
20
import net.minecraft.commands.SharedSuggestionProvider;
21
22
@Mixin(CommandSuggestions.class)
23
public abstract class MixinChatInputSuggestor {
24
    @Final @Shadow EditBox input;
25
    @Shadow boolean keepSuggestions;
26
    @Shadow private ParseResults<SharedSuggestionProvider> currentParse;
27
    @Shadow private CompletableFuture<Suggestions> pendingSuggestions;
28
    @Shadow private CommandSuggestions.SuggestionsList suggestions;
29
30
    @Shadow protected abstract void updateUsageInfo();
31
32
    @Inject(method = "updateCommandInfo", at = @At(value = "INVOKE", target = "Lcom/mojang/brigadier/StringReader;canRead()Z", remap = false), cancellable = true, locals = LocalCapture.CAPTURE_FAILHARD)
33
    public void refreshHook(CallbackInfo ci, String string, StringReader reader) {
34
        if(Module.fullNullCheck()) return;
35
        if (reader.canRead(Managers.COMMAND.getPrefix().length()) && reader.getString().startsWith(Managers.COMMAND.getPrefix(), reader.getCursor())) {
36
            reader.setCursor(reader.getCursor() + 1);
37
38
            if (currentParse == null)
39
                currentParse = Managers.COMMAND.getDispatcher().parse(reader, Managers.COMMAND.getSource());
40
41
            final int cursor = input.getCursorPosition();
42
43
            if (cursor >= 1 && (suggestions == null || !keepSuggestions)) {
44
                pendingSuggestions = Managers.COMMAND.getDispatcher().getCompletionSuggestions(currentParse, cursor);
45
                pendingSuggestions.thenRun(() -> {
46
                    if (pendingSuggestions.isDone()) updateUsageInfo();
47
                });
48
            }
49
50
            ci.cancel();
51
        }
52
    }
53
}
54
MixinClientBrandRetrieversrc/main/java/thunder/hack/injection/MixinClientBrandRetriever.javaJava · 17 lines · 750 B
@Mixin({ClientBrandRetriever.class})
MixinClientBrandRetriever.javaJava · 17 lines · 750 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.ClientBrandRetriever;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.injection.At;
6
import org.spongepowered.asm.mixin.injection.Inject;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
8
import thunder.hack.core.manager.client.ModuleManager;
9
10
@Mixin({ClientBrandRetriever.class})
11
public class MixinClientBrandRetriever {
12
    @Inject(method = "getClientModName", at = {@At("HEAD")}, cancellable = true, remap = false)
13
    private static void getClientModNameHook(CallbackInfoReturnable<String> cir) {
14
        if(ModuleManager.clientSpoof.isEnabled())
15
            cir.setReturnValue(ModuleManager.clientSpoof.getClientName());
16
    }
17
}
MixinClientConnectionsrc/main/java/thunder/hack/injection/MixinClientConnection.javaJava · 105 lines · 4.4 KB
@Mixin(Connection.class)
ModifiesConnection
MixinClientConnection.javaJava · 105 lines · 4.4 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import io.netty.channel.ChannelHandlerContext;
4
import io.netty.channel.ChannelPipeline;
5
import io.netty.handler.proxy.Socks5ProxyHandler;
6
import thunder.hack.ThunderHack;
7
import thunder.hack.core.Managers;
8
import thunder.hack.core.manager.client.ModuleManager;
9
import thunder.hack.core.manager.client.ProxyManager;
10
import thunder.hack.events.impl.PacketEvent;
11
import thunder.hack.features.modules.Module;
12
import org.spongepowered.asm.mixin.Mixin;
13
import org.spongepowered.asm.mixin.injection.At;
14
import org.spongepowered.asm.mixin.injection.Inject;
15
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16
17
import java.net.InetSocketAddress;
18
import net.minecraft.network.BandwidthDebugMonitor;
19
import net.minecraft.network.Connection;
20
import net.minecraft.network.PacketListener;
21
import net.minecraft.network.protocol.Packet;
22
import net.minecraft.network.protocol.PacketFlow;
23
import net.minecraft.network.protocol.game.ClientboundBundlePacket;
24
25
@Mixin(Connection.class)
26
public class MixinClientConnection {
27
28
    @Inject(method = "exceptionCaught", at = @At("HEAD"), cancellable = true)
29
    private void exceptionCaughtHook(ChannelHandlerContext context, Throwable t, CallbackInfo ci) {
30
        if (ModuleManager.antiPacketException.isEnabled()) {
31
            ModuleManager.antiPacketException.sendChatMessage(t.getMessage());
32
            ci.cancel();
33
        }
34
    }
35
36
    @Inject(method = "genericsFtw", at = @At("HEAD"), cancellable = true)
37
    private static <T extends PacketListener> void onHandlePacket(Packet<T> packet, PacketListener listener, CallbackInfo info) {
38
        if(Module.fullNullCheck()) return;
39
        if (packet instanceof ClientboundBundlePacket packs) {
40
            packs.subPackets().forEach(p -> {
41
                PacketEvent.Receive event = new PacketEvent.Receive(p);
42
                ThunderHack.EVENT_BUS.post(event);
43
                if (event.isCancelled()) {
44
                    info.cancel();
45
                }
46
            });
47
        } else {
48
            PacketEvent.Receive event = new PacketEvent.Receive(packet);
49
            ThunderHack.EVENT_BUS.post(event);
50
            if (event.isCancelled()) {
51
                info.cancel();
52
            }
53
        }
54
    }
55
56
57
    @Inject(method = "genericsFtw", at = @At("TAIL"), cancellable = true)
58
    private static <T extends PacketListener> void onHandlePacketPost(Packet<T> packet, PacketListener listener, CallbackInfo info) {
59
        if(Module.fullNullCheck()) return;
60
        if (packet instanceof ClientboundBundlePacket packs) {
61
            packs.subPackets().forEach(p -> {
62
                PacketEvent.ReceivePost event = new PacketEvent.ReceivePost(p);
63
                ThunderHack.EVENT_BUS.post(event);
64
                if (event.isCancelled()) {
65
                    info.cancel();
66
                }
67
            });
68
        } else {
69
            PacketEvent.ReceivePost event = new PacketEvent.ReceivePost(packet);
70
            ThunderHack.EVENT_BUS.post(event);
71
            if (event.isCancelled()) {
72
                info.cancel();
73
            }
74
        }
75
    }
76
77
    @Inject(method = "send(Lnet/minecraft/network/protocol/Packet;)V", at = @At("HEAD"),cancellable = true)
78
    private void onSendPacketPre(Packet<?> packet, CallbackInfo info) {
79
        if(Module.fullNullCheck()) return;
80
        if(ThunderHack.core.silentPackets.contains(packet)) {
81
            ThunderHack.core.silentPackets.remove(packet);
82
            return;
83
        }
84
85
        PacketEvent.Send event = new PacketEvent.Send(packet);
86
        ThunderHack.EVENT_BUS.post(event);
87
        if (event.isCancelled()) info.cancel();
88
    }
89
90
    @Inject(method = "send(Lnet/minecraft/network/protocol/Packet;)V", at = @At("RETURN"),cancellable = true)
91
    private void onSendPacketPost(Packet<?> packet, CallbackInfo info) {
92
        if(Module.fullNullCheck()) return;
93
        PacketEvent.SendPost event = new PacketEvent.SendPost(packet);
94
        ThunderHack.EVENT_BUS.post(event);
95
        if (event.isCancelled()) info.cancel();
96
    }
97
98
    // Thanks to Meteor
99
    @Inject(method = "configureSerialization", at = @At("RETURN"))
100
    private static void addHandlersHook(ChannelPipeline pipeline, PacketFlow side, boolean local, BandwidthDebugMonitor packetSizeLogger, CallbackInfo ci) {
101
        ProxyManager.ThProxy proxy = Managers.PROXY.getActiveProxy();
102
        if (proxy != null && side == PacketFlow.CLIENTBOUND && !local)
103
            pipeline.addFirst(new Socks5ProxyHandler(new InetSocketAddress(proxy.getIp(), proxy.getPort()), proxy.getL(), proxy.getP()));
104
    }
105
}
MixinClientPlayNetworkHandlersrc/main/java/thunder/hack/injection/MixinClientPlayNetworkHandler.javaJava · 35 lines · 1.4 KB
@Mixin(ClientPacketListener.class)
MixinClientPlayNetworkHandler.javaJava · 35 lines · 1.4 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.brigadier.exceptions.CommandSyntaxException;
4
import net.minecraft.client.multiplayer.ClientPacketListener;
5
import org.jetbrains.annotations.NotNull;
6
import org.spongepowered.asm.mixin.Mixin;
7
import org.spongepowered.asm.mixin.injection.At;
8
import org.spongepowered.asm.mixin.injection.Inject;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10
import thunder.hack.ThunderHack;
11
import thunder.hack.core.Managers;
12
import thunder.hack.core.manager.client.ModuleManager;
13
import thunder.hack.features.modules.Module;
14
15
@Mixin(ClientPacketListener.class)
16
public class MixinClientPlayNetworkHandler {
17
    @Inject(method = "sendChat", at = @At("HEAD"), cancellable = true)
18
    private void sendChatMessageHook(@NotNull String message, CallbackInfo ci) {
19
        if (message.equals(String.valueOf(ModuleManager.unHook.code)) && ModuleManager.unHook.isEnabled())
20
            ModuleManager.unHook.disable();
21
22
        if(Module.fullNullCheck()) return;
23
        if (message.startsWith(Managers.COMMAND.getPrefix())) {
24
            try {
25
                Managers.COMMAND.getDispatcher().execute(
26
                        message.substring(Managers.COMMAND.getPrefix().length()),
27
                        Managers.COMMAND.getSource()
28
                );
29
            } catch (CommandSyntaxException ignored) {}
30
31
            ci.cancel();
32
        }
33
    }
34
}
35
MixinClientPlayerEntitysrc/main/java/thunder/hack/injection/MixinClientPlayerEntity.javaJava · 154 lines · 6.2 KB
@Mixin(value = LocalPlayer.class, priority = 800)priority 800
ModifiesLocalPlayer
MixinClientPlayerEntity.javaJava · 154 lines · 6.2 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.authlib.GameProfile;
4
import net.minecraft.client.multiplayer.ClientLevel;
5
import net.minecraft.client.player.AbstractClientPlayer;
6
import net.minecraft.client.player.LocalPlayer;
7
import net.minecraft.network.protocol.game.ServerboundPlayerCommandPacket;
8
import net.minecraft.world.entity.MoverType;
9
import net.minecraft.world.phys.Vec3;
10
import org.spongepowered.asm.mixin.Mixin;
11
import org.spongepowered.asm.mixin.Shadow;
12
import org.spongepowered.asm.mixin.Unique;
13
import org.spongepowered.asm.mixin.injection.At;
14
import org.spongepowered.asm.mixin.injection.Inject;
15
import org.spongepowered.asm.mixin.injection.Redirect;
16
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
17
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
18
import thunder.hack.ThunderHack;
19
import thunder.hack.core.Core;
20
import thunder.hack.core.manager.client.ModuleManager;
21
import thunder.hack.events.impl.*;
22
import thunder.hack.features.modules.Module;
23
24
import static thunder.hack.features.modules.Module.fullNullCheck;
25
import static thunder.hack.features.modules.Module.mc;
26
27
@Mixin(value = LocalPlayer.class, priority = 800)
28
public abstract class MixinClientPlayerEntity extends AbstractClientPlayer {
29
    @Unique
30
    boolean pre_sprint_state = false;
31
    @Unique
32
    private boolean updateLock = false;
33
    @Unique
34
    private Runnable postAction;
35
36
    @Shadow
37
    public abstract float getViewXRot(float tickDelta);
38
    @Shadow
39
    protected abstract void sendPosition();
40
41
    public MixinClientPlayerEntity(ClientLevel world, GameProfile profile) {
42
        super(world, profile);
43
    }
44
45
    @Inject(method = "tick", at = @At("HEAD"))
46
    public void tickHook(CallbackInfo info) {
47
        if(Module.fullNullCheck()) return;
48
        ThunderHack.EVENT_BUS.post(new PlayerUpdateEvent());
49
    }
50
51
    @Redirect(method = "aiStep", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isUsingItem()Z"), require = 0)
52
    private boolean tickMovementHook(LocalPlayer player) {
53
        if (ModuleManager.noSlow.isEnabled() && ModuleManager.noSlow.canNoSlow())
54
            return false;
55
        return player.isUsingItem();
56
    }
57
58
    @Inject(method = "isMovingSlowly", at = @At("HEAD"), cancellable = true)
59
    public void shouldSlowDownHook(CallbackInfoReturnable<Boolean> cir) {
60
        if(ModuleManager.noSlow.isEnabled()) {
61
            if (isVisuallyCrawling()) {
62
                if (ModuleManager.noSlow.crawl.getValue())
63
                    cir.setReturnValue(false);
64
            } else {
65
                if (ModuleManager.noSlow.sneak.getValue())
66
                    cir.setReturnValue(false);
67
            }
68
        }
69
    }
70
71
    @Inject(method = "move", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/AbstractClientPlayer;move(Lnet/minecraft/world/entity/MoverType;Lnet/minecraft/world/phys/Vec3;)V"), cancellable = true)
72
    public void onMoveHook(MoverType movementType, Vec3 movement, CallbackInfo ci) {
73
        if(Module.fullNullCheck()) return;
74
        EventMove event = new EventMove(movement.x, movement.y, movement.z);
75
        ThunderHack.EVENT_BUS.post(event);
76
        if (event.isCancelled()) {
77
            super.move(movementType, new Vec3(event.getX(), event.getY(), event.getZ()));
78
            ci.cancel();
79
        }
80
    }
81
82
    @Inject(method = "sendPosition", at = @At("HEAD"), cancellable = true)
83
    private void sendMovementPacketsHook(CallbackInfo info) {
84
        if (fullNullCheck()) return;
85
        EventSync event = new EventSync(getYRot(), getXRot());
86
        ThunderHack.EVENT_BUS.post(event);
87
        postAction = event.getPostAction();
88
        EventSprint e = new EventSprint(isSprinting());
89
        ThunderHack.EVENT_BUS.post(e);
90
        ThunderHack.EVENT_BUS.post(new EventAfterRotate());
91
        if (e.getSprintState() != mc.player.wasSprinting) {
92
            if (e.getSprintState())
93
                mc.player.connection.send(new ServerboundPlayerCommandPacket(this, ServerboundPlayerCommandPacket.Action.START_SPRINTING));
94
            else
95
                mc.player.connection.send(new ServerboundPlayerCommandPacket(this, ServerboundPlayerCommandPacket.Action.STOP_SPRINTING));
96
97
            mc.player.wasSprinting = e.getSprintState();
98
        }
99
        pre_sprint_state = mc.player.wasSprinting;
100
        Core.lockSprint = true;
101
102
        if (event.isCancelled()) info.cancel();
103
    }
104
105
    @Inject(method = "sendPosition", at = @At("RETURN"), cancellable = true)
106
    private void sendMovementPacketsPostHook(CallbackInfo info) {
107
        if (fullNullCheck()) return;
108
        mc.player.wasSprinting = pre_sprint_state;
109
        Core.lockSprint = false;
110
        EventPostSync event = new EventPostSync();
111
        ThunderHack.EVENT_BUS.post(event);
112
        if(postAction != null) {
113
            postAction.run();
114
            postAction = null;
115
        }
116
        if (event.isCancelled())
117
            info.cancel();
118
    }
119
120
    @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;sendPosition()V", ordinal = 0, shift = At.Shift.AFTER), cancellable = true)
121
    private void PostUpdateHook(CallbackInfo info) {
122
        if(Module.fullNullCheck()) return;
123
        if (updateLock) {
124
            return;
125
        }
126
        PostPlayerUpdateEvent playerUpdateEvent = new PostPlayerUpdateEvent();
127
        ThunderHack.EVENT_BUS.post(playerUpdateEvent);
128
        if (playerUpdateEvent.isCancelled()) {
129
            info.cancel();
130
            if (playerUpdateEvent.getIterations() > 0) {
131
                for (int i = 0; i < playerUpdateEvent.getIterations(); i++) {
132
                    updateLock = true;
133
                    tick();
134
                    updateLock = false;
135
                    sendPosition();
136
                }
137
            }
138
        }
139
    }
140
141
    @Inject(method = "moveTowardsClosestSpace", at = @At("HEAD"), cancellable = true)
142
    private void onPushOutOfBlocksHook(double x, double d, CallbackInfo info) {
143
        if (ModuleManager.noPush.isEnabled() && ModuleManager.noPush.blocks.getValue()) {
144
            info.cancel();
145
        }
146
    }
147
148
    @Inject(method = "handlePortalTransitionEffect", at = @At("HEAD"), cancellable = true)
149
    private void updateNauseaHook(CallbackInfo ci) {
150
        if(ModuleManager.portalInventory.isEnabled())
151
            ci.cancel();
152
    }
153
}
154
MixinClientPlayerInteractionManagersrc/main/java/thunder/hack/injection/MixinClientPlayerInteractionManager.javaJava · 124 lines · 5.7 KB
@Mixin(MultiPlayerGameMode.class)
MixinClientPlayerInteractionManager.javaJava · 124 lines · 5.7 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.multiplayer.MultiPlayerGameMode;
4
import net.minecraft.client.player.LocalPlayer;
5
import net.minecraft.core.BlockPos;
6
import net.minecraft.core.Direction;
7
import net.minecraft.world.InteractionHand;
8
import net.minecraft.world.InteractionResult;
9
import net.minecraft.world.entity.player.Player;
10
import net.minecraft.world.inventory.ContainerInput;
11
import net.minecraft.world.item.Items;
12
import net.minecraft.world.level.block.*;
13
import net.minecraft.world.phys.BlockHitResult;
14
import org.objectweb.asm.Opcodes;
15
import org.spongepowered.asm.mixin.Mixin;
16
import org.spongepowered.asm.mixin.Shadow;
17
import org.spongepowered.asm.mixin.injection.At;
18
import org.spongepowered.asm.mixin.injection.Inject;
19
import org.spongepowered.asm.mixin.injection.Redirect;
20
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
21
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
22
import thunder.hack.ThunderHack;
23
import thunder.hack.core.manager.client.ModuleManager;
24
import thunder.hack.events.impl.EventAttackBlock;
25
import thunder.hack.events.impl.EventBreakBlock;
26
import thunder.hack.events.impl.EventClickSlot;
27
import thunder.hack.features.modules.Module;
28
import thunder.hack.features.modules.player.NoInteract;
29
import thunder.hack.features.modules.player.SpeedMine;
30
31
import static thunder.hack.features.modules.Module.mc;
32
33
@Mixin(MultiPlayerGameMode.class)
34
public class MixinClientPlayerInteractionManager {
35
36
    @Shadow
37
    private int destroyDelay;
38
39
    @Inject(method = "useItemOn", at = @At("HEAD"), cancellable = true)
40
    private void interactBlock(LocalPlayer player, InteractionHand hand, BlockHitResult hitResult, CallbackInfoReturnable<InteractionResult> cir) {
41
        Block bs = mc.level.getBlockState(hitResult.getBlockPos()).getBlock();
42
        if (ModuleManager.noInteract.isEnabled() && (
43
                bs == Blocks.CHEST ||
44
                        bs == Blocks.TRAPPED_CHEST ||
45
                        bs == Blocks.FURNACE ||
46
                        bs == Blocks.ANVIL ||
47
                        bs == Blocks.CRAFTING_TABLE ||
48
                        bs == Blocks.HOPPER ||
49
                        bs == Blocks.JUKEBOX ||
50
                        bs == Blocks.NOTE_BLOCK ||
51
                        bs == Blocks.ENDER_CHEST ||
52
                        bs == Blocks.DISPENSER ||
53
                        bs == Blocks.DROPPER ||
54
                        bs == Blocks.BELL ||
55
                        bs instanceof ShulkerBoxBlock ||
56
                        bs instanceof FenceBlock ||
57
                        bs instanceof FenceGateBlock ||
58
                        bs instanceof DoorBlock ||
59
                        bs instanceof TrapDoorBlock)
60
                && (ModuleManager.aura.isEnabled() || !NoInteract.onlyAura.getValue())) {
61
            cir.setReturnValue(InteractionResult.PASS);
62
        }
63
64
        if(mc.player != null && ModuleManager.antiBallPlace.isEnabled()
65
                && ((mc.player.getOffhandItem().getItem() == Items.PLAYER_HEAD && hand == InteractionHand.OFF_HAND) || (mc.player.getMainHandItem().getItem() == Items.PLAYER_HEAD && hand == InteractionHand.MAIN_HAND)))
66
            cir.setReturnValue(InteractionResult.PASS);
67
    }
68
69
    @Redirect(method = "continueDestroyBlock", at = @At(value = "FIELD", target = "Lnet/minecraft/client/multiplayer/MultiPlayerGameMode;destroyDelay:I", opcode = Opcodes.GETFIELD, ordinal = 0))
70
    public int updateBlockBreakingProgressHook(MultiPlayerGameMode clientPlayerInteractionManager) {
71
        return ModuleManager.speedMine.isEnabled() ? 0 : this.destroyDelay;
72
    }
73
74
    @Inject(method = "continueDestroyBlock", at = @At("HEAD"), cancellable = true)
75
    public void updateBlockBreakingProgress(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
76
        if (ModuleManager.speedMine.isEnabled() && ModuleManager.speedMine.mode.getValue() == SpeedMine.Mode.Packet) {
77
            cir.setReturnValue(false);
78
        }
79
    }
80
81
    @Inject(method = "startDestroyBlock", at = @At("HEAD"), cancellable = true)
82
    private void attackBlockHook(BlockPos pos, Direction direction, CallbackInfoReturnable<Boolean> cir) {
83
        if(Module.fullNullCheck()) return;
84
        EventAttackBlock event = new EventAttackBlock(pos, direction);
85
        ThunderHack.EVENT_BUS.post(event);
86
        if (event.isCancelled())
87
            cir.setReturnValue(false);
88
    }
89
90
    /*
91
    @Inject(method = "getReachDistance", at = @At("HEAD"), cancellable = true)
92
    private void getReachDistanceHook(CallbackInfoReturnable<Float> cir) {
93
        if (ModuleManager.reach.isEnabled()) {
94
            cir.setReturnValue(Reach.range.getValue());
95
        }
96
    }
97
98
    @Inject(method = "hasExtendedReach", at = @At("HEAD"), cancellable = true)
99
    private void hasExtendedReachHook(CallbackInfoReturnable<Boolean> cir) {
100
        if (ModuleManager.reach.isEnabled()) {
101
            cir.setReturnValue(true);
102
        }
103
    }
104
     */
105
106
    @Inject(method = "destroyBlock", at = @At("RETURN"), cancellable = true)
107
    public void breakBlockHook(BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
108
        if(Module.fullNullCheck()) return;
109
        EventBreakBlock event = new EventBreakBlock(pos);
110
        ThunderHack.EVENT_BUS.post(event);
111
        if (event.isCancelled())
112
            cir.setReturnValue(false);
113
    }
114
115
    @Inject(method = "handleContainerInput", at = @At("HEAD"), cancellable = true)
116
    public void clickSlotHook(int syncId, int slotId, int button, ContainerInput actionType, Player player, CallbackInfo ci) {
117
        if(Module.fullNullCheck()) return;
118
        EventClickSlot event = new EventClickSlot(actionType, slotId, button, syncId);
119
        ThunderHack.EVENT_BUS.post(event);
120
        if (event.isCancelled())
121
            ci.cancel();
122
    }
123
}
124
MixinClientWorldsrc/main/java/thunder/hack/injection/MixinClientWorld.javaJava · 72 lines · 3.1 KB
@Mixin(ClientLevel.class)
ModifiesClientLevel
MixinClientWorld.javaJava · 72 lines · 3.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
8
import thunder.hack.ThunderHack;
9
import thunder.hack.core.manager.client.ModuleManager;
10
import thunder.hack.events.impl.EventEntityRemoved;
11
import thunder.hack.events.impl.EventEntitySpawn;
12
import thunder.hack.events.impl.EventEntitySpawnPost;
13
import thunder.hack.features.modules.Module;
14
import thunder.hack.features.modules.render.WorldTweaks;
15
import thunder.hack.setting.impl.ColorSetting;
16
17
import static thunder.hack.features.modules.Module.mc;
18
19
import net.minecraft.client.multiplayer.ClientLevel;
20
import net.minecraft.core.registries.BuiltInRegistries;
21
import net.minecraft.resources.Identifier;
22
import net.minecraft.sounds.SoundEvent;
23
import net.minecraft.sounds.SoundSource;
24
import net.minecraft.world.entity.Entity;
25
import net.minecraft.world.phys.Vec3;
26
27
@Mixin(ClientLevel.class)
28
public class MixinClientWorld {
29
    @Inject(method = "addEntity", at = @At("HEAD"), cancellable = true)
30
    public void addEntityHook(Entity entity, CallbackInfo ci) {
31
        if(Module.fullNullCheck()) return;
32
        EventEntitySpawn ees = new EventEntitySpawn(entity);
33
        ThunderHack.EVENT_BUS.post(ees);
34
        if (ees.isCancelled()) {
35
            ci.cancel();
36
        }
37
    }
38
39
    @Inject(method = "addEntity", at = @At("RETURN"), cancellable = true)
40
    public void addEntityHookPost(Entity entity, CallbackInfo ci) {
41
        if(Module.fullNullCheck()) return;
42
        EventEntitySpawnPost ees = new EventEntitySpawnPost(entity);
43
        ThunderHack.EVENT_BUS.post(ees);
44
        if (ees.isCancelled()) {
45
            ci.cancel();
46
        }
47
    }
48
49
    @Inject(method = "removeEntity", at = @At("HEAD"))
50
    public void removeEntityHook(int entityId, Entity.RemovalReason removalReason, CallbackInfo ci) {
51
        if(Module.fullNullCheck()) return;
52
        EventEntityRemoved eer = new EventEntityRemoved(mc.level.getEntity(entityId));
53
        ThunderHack.EVENT_BUS.post(eer);
54
    }
55
56
    @Inject(method = "getSkyColor", at = @At("HEAD"), cancellable = true, require = 0)
57
    private void getSkyColorHook(Vec3 cameraPos, float tickDelta, CallbackInfoReturnable<Integer> cir) {
58
        if (ModuleManager.worldTweaks.isEnabled() && WorldTweaks.fogModify.getValue().isEnabled()) {
59
            ColorSetting c = WorldTweaks.fogColor.getValue();
60
            cir.setReturnValue(0xFF000000 | (c.getRed() << 16) | (c.getGreen() << 8) | c.getBlue());
61
        }
62
    }
63
64
    @Inject(method = "playSound(DDDLnet/minecraft/sounds/SoundEvent;Lnet/minecraft/sounds/SoundSource;FFZJ)V", at = @At("HEAD"))
65
    private void playSoundHoof(double x, double y, double z, SoundEvent event, SoundSource category, float volume, float pitch, boolean useDistance, long seed, CallbackInfo ci) {
66
        if (ModuleManager.soundESP.isEnabled()) {
67
            Identifier id = BuiltInRegistries.SOUND_EVENT.getKey(event);
68
            ModuleManager.soundESP.add(x, y, z, id != null ? id.toLanguageKey() : "unknown");
69
        }
70
    }
71
}
72
MixinCobwebBlocksrc/main/java/thunder/hack/injection/MixinCobwebBlock.javaJava · 32 lines · 1.5 KB
@Mixin(WebBlock.class)
ModifiesWebBlock
MixinCobwebBlock.javaJava · 32 lines · 1.5 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7
import thunder.hack.core.manager.client.ModuleManager;
8
import thunder.hack.features.modules.movement.AntiWeb;
9
import thunder.hack.utility.player.InteractionUtility;
10
11
import static thunder.hack.core.manager.IManager.mc;
12
13
import net.minecraft.core.BlockPos;
14
import net.minecraft.core.Direction;
15
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
16
import net.minecraft.world.entity.Entity;
17
import net.minecraft.world.entity.InsideBlockEffectApplier;
18
import net.minecraft.world.level.Level;
19
import net.minecraft.world.level.block.WebBlock;
20
import net.minecraft.world.level.block.state.BlockState;
21
22
@Mixin(WebBlock.class)
23
public class MixinCobwebBlock {
24
    @Inject(method = "entityInside", at = @At("HEAD"), cancellable = true)
25
    public void onEntityCollisionHook(BlockState state, Level world, BlockPos pos, Entity entity, InsideBlockEffectApplier handler, boolean isClient, CallbackInfo ci) {
26
        if (ModuleManager.antiWeb.isEnabled() && AntiWeb.mode.getValue() == AntiWeb.Mode.Ignore && entity == mc.player) {
27
            ci.cancel();
28
            if (AntiWeb.grim.getValue())
29
                InteractionUtility.sendSequencedPacket(id -> new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.STOP_DESTROY_BLOCK, pos, Direction.UP, id));
30
        }
31
    }
32
}
MixinCoreShadersrc/main/java/thunder/hack/injection/MixinCoreShader.javaJava · 42 lines · 1.3 KB
@Mixin(GlProgram.class)
ModifiesGlProgram
MixinCoreShader.javaJava · 42 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
/*
2
 * Satin
3
 * Copyright (C) 2019-2024 Ladysnake
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 3 of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public License
16
 * along with this program; If not, see <https://www.gnu.org/licenses>.
17
 */
18
package thunder.hack.injection;
19
20
import org.spongepowered.asm.mixin.Mixin;
21
import thunder.hack.utility.render.shaders.satin.impl.SamplerAccess;
22
import com.mojang.blaze3d.opengl.GlProgram;
23
import java.util.List;
24
25
@Mixin(GlProgram.class)
26
public abstract class MixinCoreShader implements SamplerAccess {
27
    @Override
28
    public boolean hasSampler(String name) {
29
        return false;
30
    }
31
32
    @Override
33
    public List<String> getSamplerNames() {
34
        return List.of();
35
    }
36
37
    @Override
38
    public List<Integer> getSamplerShaderLocs() {
39
        return List.of();
40
    }
41
}
42
MixinDrawContextsrc/main/java/thunder/hack/injection/MixinDrawContext.javaJava · 36 lines · 1.5 KB
@Mixin(GuiGraphicsExtractor.class)
MixinDrawContext.javaJava · 36 lines · 1.5 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.gui.Font;
4
import net.minecraft.client.gui.GuiGraphicsExtractor;
5
import net.minecraft.network.chat.Component;
6
import net.minecraft.network.chat.MutableComponent;
7
import net.minecraft.util.FormattedCharSequence;
8
import org.joml.Matrix3x2fStack;
9
import org.spongepowered.asm.mixin.Final;
10
import org.spongepowered.asm.mixin.Mixin;
11
import org.spongepowered.asm.mixin.Shadow;
12
import org.spongepowered.asm.mixin.injection.At;
13
import org.spongepowered.asm.mixin.injection.Inject;
14
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
15
import thunder.hack.gui.font.FontRenderers;
16
17
@Mixin(GuiGraphicsExtractor.class)
18
public class MixinDrawContext {
19
20
    @Shadow
21
    @Final
22
    private Matrix3x2fStack pose;
23
24
 //   @Inject(method = "drawText(Lnet/minecraft/client/font/TextRenderer;Lnet/minecraft/text/OrderedText;IIIZ)I", at = @At("HEAD"), cancellable = true)
25
    public void drawTextHook(Font textRenderer, FormattedCharSequence text, int x, int y, int color, boolean shadow, CallbackInfoReturnable<Integer> cir) {
26
        MutableComponent text1 = Component.empty();
27
        text.accept((i, style, codePoint) -> {
28
            text1.append(Component.literal(new String(Character.toChars(codePoint))).setStyle(style));
29
            return true;
30
        });
31
32
        FontRenderers.sf_medium.drawString(pose, text1.getString(), x,y, color);
33
        cir.setReturnValue((int) FontRenderers.sf_medium.getStringWidth(text.toString()));
34
    }
35
}
36
MixinDynamicsrc/main/java/thunder/hack/injection/MixinDynamic.javaJava · 34 lines · 1.2 KB
@Mixin(DeltaTracker.Timer.class)
MixinDynamic.javaJava · 34 lines · 1.2 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.DeltaTracker;
4
import org.spongepowered.asm.mixin.Final;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.Shadow;
7
import org.spongepowered.asm.mixin.injection.At;
8
import org.spongepowered.asm.mixin.injection.Inject;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
10
import thunder.hack.ThunderHack;
11
@Mixin(DeltaTracker.Timer.class)
12
public class MixinDynamic {
13
    @Shadow
14
    private float deltaTicks;
15
    @Shadow
16
    private float deltaTickResidual;
17
    @Shadow private long lastMs;
18
    @Final
19
    @Shadow private float msPerTick;
20
21
    @Inject(method = "advanceGameTime(J)I", at = @At("HEAD"), cancellable = true)
22
    private void beginRenderTickHook(long timeMillis, CallbackInfoReturnable<Integer> cir) {
23
        if(ThunderHack.TICK_TIMER == 1)
24
            return;
25
26
        this.deltaTicks = ((timeMillis - this.lastMs) / this.msPerTick) * ThunderHack.TICK_TIMER;
27
        this.lastMs = timeMillis;
28
        this.deltaTickResidual += this.deltaTicks;
29
        int i = (int) this.deltaTickResidual;
30
        this.deltaTickResidual -= i;
31
        cir.setReturnValue(i);
32
    }
33
}
34
MixinEndCrystalsrc/main/java/thunder/hack/injection/MixinEndCrystal.javaJava · 33 lines · 855 B
@Mixin(EndCrystal.class)
ModifiesEndCrystal
MixinEndCrystal.javaJava · 33 lines · 855 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.world.entity.boss.enderdragon.EndCrystal;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.Unique;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9
import thunder.hack.utility.interfaces.ICrystal;
10
11
@Mixin(EndCrystal.class)
12
public class MixinEndCrystal implements ICrystal {
13
14
    @Unique
15
    int attacks, cooldown;
16
17
    @Override
18
    public boolean canAttack() {
19
        return cooldown == 0;
20
    }
21
22
    @Override
23
    public void attack() {
24
        if (attacks++ >= 5)
25
            cooldown = 20;
26
    }
27
28
    @Inject(method = "tick", at = {@At("HEAD")})
29
    public void tickHook(CallbackInfo ci) {
30
        if (cooldown > 0)
31
            cooldown--;
32
    }
33
}
MixinEndCrystalEntityRenderersrc/main/java/thunder/hack/injection/MixinEndCrystalEntityRenderer.javaJava · 33 lines · 1.6 KB
@Mixin(EndCrystalRenderer.class)
MixinEndCrystalEntityRenderer.javaJava · 33 lines · 1.6 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.blaze3d.vertex.PoseStack;
4
import net.minecraft.client.model.object.crystal.EndCrystalModel;
5
import net.minecraft.client.renderer.SubmitNodeCollector;
6
import net.minecraft.client.renderer.entity.EndCrystalRenderer;
7
import net.minecraft.client.renderer.entity.state.EndCrystalRenderState;
8
import net.minecraft.client.renderer.state.level.CameraRenderState;
9
import org.spongepowered.asm.mixin.Final;
10
import org.spongepowered.asm.mixin.Mixin;
11
import org.spongepowered.asm.mixin.Shadow;
12
import org.spongepowered.asm.mixin.injection.At;
13
import org.spongepowered.asm.mixin.injection.Inject;
14
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
15
import thunder.hack.core.manager.client.ModuleManager;
16
17
@Mixin(EndCrystalRenderer.class)
18
public class MixinEndCrystalEntityRenderer {
19
20
21
    @Shadow
22
    @Final
23
    private EndCrystalModel model;
24
25
    @Inject(method = "submit(Lnet/minecraft/client/renderer/entity/state/EndCrystalRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;Lnet/minecraft/client/renderer/state/level/CameraRenderState;)V", at = {@At("HEAD")}, cancellable = true)
26
    public void render(EndCrystalRenderState state, PoseStack matrixStack, SubmitNodeCollector vertexConsumerProvider, CameraRenderState cameraState, CallbackInfo ci) {
27
        if(ModuleManager.chams.isEnabled() && ModuleManager.chams.crystals.getValue()) {
28
            ci.cancel();
29
            ModuleManager.chams.renderCrystal(state, matrixStack, vertexConsumerProvider, state.lightCoords, model);
30
        }
31
    }
32
}
33
MixinEntitysrc/main/java/thunder/hack/injection/MixinEntity.javaJava · 198 lines · 8.2 KB
@Mixin(Entity.class)
ModifiesEntity
MixinEntity.javaJava · 198 lines · 8.2 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.Shadow;
5
import org.spongepowered.asm.mixin.Unique;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.ModifyArgs;
9
import org.spongepowered.asm.mixin.injection.ModifyVariable;
10
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
12
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
13
import thunder.hack.ThunderHack;
14
import thunder.hack.core.manager.client.ModuleManager;
15
import thunder.hack.events.impl.EventFixVelocity;
16
import thunder.hack.features.modules.Module;
17
import thunder.hack.features.modules.combat.Aura;
18
import thunder.hack.features.modules.combat.HitBox;
19
import thunder.hack.features.modules.render.Shaders;
20
import thunder.hack.features.modules.render.Trails;
21
import thunder.hack.utility.interfaces.IEntity;
22
import thunder.hack.utility.interfaces.IEntityLiving;
23
24
import java.util.ArrayList;
25
import java.util.List;
26
import net.minecraft.core.BlockPos;
27
import net.minecraft.util.Mth;
28
import net.minecraft.world.entity.Entity;
29
import net.minecraft.world.entity.player.Player;
30
import net.minecraft.world.phys.AABB;
31
import net.minecraft.world.phys.Vec3;
32
33
import static thunder.hack.features.modules.Module.mc;
34
35
@Mixin(Entity.class)
36
public abstract class MixinEntity implements IEntity, IEntityLiving {
37
38
    @Shadow
39
    protected abstract BlockPos getBlockPosBelowThatAffectsMyMovement();
40
41
    @Shadow
42
    public abstract Vec3 trackingPosition();
43
44
    @Shadow
45
    private AABB bb;
46
47
    @Override
48
    public List<Trails.Trail> getTrails() {
49
        return trails;
50
    }
51
52
    @Override
53
    public BlockPos thunderHack_Recode$getVelocityBP() {
54
        return getBlockPosBelowThatAffectsMyMovement();
55
    }
56
57
    @Unique
58
    public List<Trails.Trail> trails = new ArrayList<>();
59
60
    @Unique
61
    double prevServerX, prevServerY, prevServerZ;
62
63
    @Unique
64
    public List<Aura.Position> positonHistory = new ArrayList<>();
65
66
    @Override
67
    public List<Aura.Position> getPositionHistory() {
68
        return positonHistory;
69
    }
70
71
    @Inject(method = {"moveOrInterpolateTo"}, at = {@At("HEAD")})
72
    private void updateTrackedPositionAndAnglesHook(Vec3 pos, float yaw, float pitch, CallbackInfo ci) {
73
        if (Module.fullNullCheck()) return;
74
        Vec3 syncedPos = trackingPosition();
75
        prevServerX = syncedPos.x;
76
        prevServerY = syncedPos.y;
77
        prevServerZ = syncedPos.z;
78
        positonHistory.add(new Aura.Position(syncedPos.x, syncedPos.y, syncedPos.z));
79
        positonHistory.removeIf(Aura.Position::shouldRemove);
80
    }
81
82
    @Override
83
    public double getPrevServerX() {
84
        return prevServerX;
85
    }
86
87
    @Override
88
    public double getPrevServerY() {
89
        return prevServerY;
90
    }
91
92
    @Override
93
    public double getPrevServerZ() {
94
        return prevServerZ;
95
    }
96
97
    @ModifyArgs(method = "push(Lnet/minecraft/world/entity/Entity;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/Entity;push(DDD)V"))
98
    public void pushAwayFromHook(Args args) {
99
100
        //Condition '...' is always 'false' is a lie!!! do not delete
101
        if ((Object) this == mc.player && ModuleManager.noPush.isEnabled() && ModuleManager.noPush.players.getValue()) {
102
            args.set(0, 0.);
103
            args.set(1, 0.);
104
            args.set(2, 0.);
105
        }
106
    }
107
108
    @Inject(method = "moveRelative", at = {@At("HEAD")}, cancellable = true)
109
    public void updateVelocityHook(float speed, Vec3 movementInput, CallbackInfo ci) {
110
        if(Module.fullNullCheck()) return;
111
        if ((Object) this == mc.player) {
112
            Vec3 vanillaVelocity = movementInputToVelocityC(movementInput, speed, mc.player.getYRot());
113
            EventFixVelocity event = new EventFixVelocity(movementInput, speed, mc.player.getYRot(), vanillaVelocity);
114
            ThunderHack.EVENT_BUS.post(event);
115
116
            // Keep Minecraft's own movement path unless a module actually changed the
117
            // velocity. Reimplementing moveRelative globally makes vanilla movement
118
            // sensitive to mapping and behavior changes between game versions.
119
            if (!event.getVelocity().equals(vanillaVelocity)) {
120
                ci.cancel();
121
                mc.player.setDeltaMovement(mc.player.getDeltaMovement().add(event.getVelocity()));
122
            }
123
        }
124
    }
125
126
    @Unique
127
    private static Vec3 movementInputToVelocityC(Vec3 movementInput, float speed, float yaw) {
128
        double d = movementInput.lengthSqr();
129
        if (d < 1.0E-7) {
130
            return Vec3.ZERO;
131
        }
132
        Vec3 vec3d = (d > 1.0 ? movementInput.normalize() : movementInput).scale(speed);
133
        float f = Mth.sin(yaw * ((float) Math.PI / 180));
134
        float g = Mth.cos(yaw * ((float) Math.PI / 180));
135
        return new Vec3(vec3d.x * (double) g - vec3d.z * (double) f, vec3d.y, vec3d.z * (double) g + vec3d.x * (double) f);
136
    }
137
138
    @Inject(method = "getBoundingBox", at = {@At("HEAD")}, cancellable = true)
139
    public final void getBoundingBox(CallbackInfoReturnable<AABB> cir) {
140
        if (ModuleManager.hitBox.isEnabled() && mc != null && mc.player != null && ((Entity) (Object) this).getId() != mc.player.getId() && (ModuleManager.aura.isDisabled() || HitBox.affectToAura.getValue())) {
141
            cir.setReturnValue(new AABB(this.bb.minX - HitBox.XZExpand.getValue() / 2f, this.bb.minY - HitBox.YExpand.getValue() / 2f, this.bb.minZ - HitBox.XZExpand.getValue() / 2f, this.bb.maxX + HitBox.XZExpand.getValue() / 2f, this.bb.maxY + HitBox.YExpand.getValue() / 2f, this.bb.maxZ + HitBox.XZExpand.getValue() / 2f));
142
        }
143
    }
144
145
    @Inject(method = "isCurrentlyGlowing", at = @At("HEAD"), cancellable = true)
146
    public void isGlowingHook(CallbackInfoReturnable<Boolean> cir) {
147
        Shaders shaders = ModuleManager.shaders;
148
        if (shaders.isEnabled()) {
149
            cir.setReturnValue(shaders.shouldRender((Entity) (Object) this));
150
        }
151
    }
152
153
    @Inject(method = "isOnFire", at = @At("HEAD"), cancellable = true)
154
    public void isOnFireHook(CallbackInfoReturnable<Boolean> cir) {
155
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.fireEntity.getValue()) {
156
            cir.setReturnValue(false);
157
        }
158
    }
159
160
    @Inject(method = "isInvisibleTo", at = @At("HEAD"), cancellable = true)
161
    public void isInvisibleToHook(Player player, CallbackInfoReturnable<Boolean> cir) {
162
        if (ModuleManager.serverHelper.isEnabled() && ModuleManager.serverHelper.trueSight.getValue()) {
163
            cir.setReturnValue(false);
164
        }
165
    }
166
167
    @Inject(method = "isInLava", at = @At("HEAD"), cancellable = true)
168
    public void isInLavaHook(CallbackInfoReturnable<Boolean> cir) {
169
        if((ModuleManager.jesus.isEnabled() || ModuleManager.noWaterCollision.isEnabled()) && mc.player != null && ((Entity) (Object) this).getId() == mc.player.getId())
170
            cir.setReturnValue(false);
171
    }
172
173
    @Inject(method = "isInWater", at = @At("HEAD"), cancellable = true)
174
    public void isTouchingWaterHook(CallbackInfoReturnable<Boolean> cir) {
175
        if((ModuleManager.jesus.isEnabled() || ModuleManager.noWaterCollision.isEnabled()) && mc.player != null && ((Entity) (Object) this).getId() == mc.player.getId())
176
            cir.setReturnValue(false);
177
    }
178
179
    @Inject(method = "setSwimming", at = @At("HEAD"), cancellable = true)
180
    public void setSwimmingHook(boolean swimming, CallbackInfo ci) {
181
        if((ModuleManager.jesus.isEnabled() || ModuleManager.noWaterCollision.isEnabled()) && swimming && mc.player != null && ((Entity) (Object) this).getId() == mc.player.getId())
182
            ci.cancel();
183
    }
184
185
    @ModifyVariable(method = "turn", at = @At("HEAD"), ordinal = 0, argsOnly = true)
186
    private double changeLookDirectionHook0(double value) {
187
        if(ModuleManager.viewLock.isEnabled() && ModuleManager.viewLock.yaw.getValue())
188
            return 0d;
189
        return value;
190
    }
191
192
    @ModifyVariable(method = "turn", at = @At("HEAD"), ordinal = 1, argsOnly = true)
193
    private double changeLookDirectionHook1(double value) {
194
        if(ModuleManager.viewLock.isEnabled() && ModuleManager.viewLock.pitch.getValue())
195
            return 0d;
196
        return value;
197
    }
198
}
MixinEntityLivingsrc/main/java/thunder/hack/injection/MixinEntityLiving.javaJava · 133 lines · 5.3 KB
@Mixin(LivingEntity.class)
ModifiesLivingEntity
MixinEntityLiving.javaJava · 133 lines · 5.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.Shadow;
5
import org.spongepowered.asm.mixin.Unique;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.ModifyVariable;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
11
import thunder.hack.ThunderHack;
12
import thunder.hack.core.manager.client.ModuleManager;
13
import thunder.hack.events.impl.EventTravel;
14
import thunder.hack.events.impl.EventEatFood;
15
import thunder.hack.events.impl.EventPlayerJump;
16
import thunder.hack.features.modules.Module;
17
import thunder.hack.features.modules.render.Animations;
18
19
import static thunder.hack.features.modules.Module.mc;
20
import static thunder.hack.features.modules.movement.WaterSpeed.Mode.CancelResurface;
21
22
import net.minecraft.core.BlockPos;
23
import net.minecraft.world.InteractionHand;
24
import net.minecraft.world.entity.LivingEntity;
25
import net.minecraft.world.entity.MoverType;
26
import net.minecraft.world.item.ItemStack;
27
import net.minecraft.world.level.block.LiquidBlock;
28
import net.minecraft.world.phys.Vec3;
29
30
@Mixin(LivingEntity.class)
31
public abstract class MixinEntityLiving {
32
33
    @Shadow
34
    public abstract InteractionHand getUsedItemHand();
35
36
    @Shadow
37
    public abstract ItemStack getItemInHand(InteractionHand hand);
38
39
    @Inject(method = "getCurrentSwingDuration", at = {@At("HEAD")}, cancellable = true)
40
    private void getArmSwingAnimationEnd(final CallbackInfoReturnable<Integer> info) {
41
        if (!ModuleManager.noRender.noSwing.getValue() && ModuleManager.animations.shouldChangeAnimationDuration() && Animations.slowAnimation.getValue())
42
            info.setReturnValue(Animations.slowAnimationVal.getValue());
43
    }
44
45
    @Unique
46
    private boolean prevFlying = false;
47
48
    @Unique
49
    private InteractionHand lastConsumeHand;
50
51
    @Inject(method = "isFallFlying", at = @At("TAIL"), cancellable = true)
52
    public void isGlidingHook(CallbackInfoReturnable<Boolean> cir) {
53
        if (ModuleManager.elytraRecast.isEnabled()) {
54
            boolean elytra = cir.getReturnValue();
55
            if (prevFlying && !cir.getReturnValue()) {
56
                cir.setReturnValue(ModuleManager.elytraRecast.castElytra());
57
            }
58
            prevFlying = elytra;
59
        }
60
    }
61
62
    @Inject(method = "travel", at = @At("HEAD"), cancellable = true)
63
    public void travelHook(Vec3 movementInput, CallbackInfo ci) {
64
        if (Module.fullNullCheck()) return;
65
        if ((LivingEntity) (Object) this != mc.player) return;
66
        final EventTravel event = new EventTravel(mc.player.getDeltaMovement(), true);
67
        ThunderHack.EVENT_BUS.post(event);
68
        if (event.isCancelled()) {
69
            mc.player.move(MoverType.SELF, event.getmVec());
70
            ci.cancel();
71
        }
72
    }
73
74
    @Inject(method = "travel", at = @At("RETURN"), cancellable = true)
75
    public void travelPostHook(Vec3 movementInput, CallbackInfo ci) {
76
        if (Module.fullNullCheck()) return;
77
        if ((LivingEntity) (Object) this != mc.player) return;
78
        final EventTravel event = new EventTravel(movementInput, false);
79
        ThunderHack.EVENT_BUS.post(event);
80
        if (event.isCancelled()) {
81
            mc.player.move(MoverType.SELF, mc.player.getDeltaMovement());
82
            ci.cancel();
83
        }
84
    }
85
86
    @Inject(method = "jumpFromGround", at = @At("HEAD"))
87
    private void onJumpPre(CallbackInfo ci) {
88
        if ((LivingEntity) (Object) this == mc.player) {
89
            ThunderHack.EVENT_BUS.post(new EventPlayerJump(true));
90
        }
91
    }
92
93
    @Inject(method = "jumpFromGround", at = @At("RETURN"))
94
    private void onJumpPost(CallbackInfo ci) {
95
        if ((LivingEntity) (Object) this == mc.player) {
96
            ThunderHack.EVENT_BUS.post(new EventPlayerJump(false));
97
        }
98
    }
99
100
    @Inject(method = "completeUsingItem", at = @At("HEAD"))
101
    private void onConsumeItemStart(CallbackInfo ci) {
102
        if ((LivingEntity) (Object) this == mc.player) {
103
            lastConsumeHand = this.getUsedItemHand();
104
        }
105
    }
106
107
    @Inject(method = "completeUsingItem", at = @At("RETURN"))
108
    private void onConsumeItemEnd(CallbackInfo ci) {
109
        if ((LivingEntity) (Object) this == mc.player && lastConsumeHand != null) {
110
            ItemStack stack = this.getItemInHand(lastConsumeHand);
111
            ThunderHack.EVENT_BUS.post(new EventEatFood(stack));
112
            lastConsumeHand = null;
113
        }
114
    }
115
116
    @ModifyVariable(method = "setSprinting", at = @At("HEAD"), ordinal = 0, argsOnly = true)
117
    private boolean setSprintingHook(boolean sprinting) {
118
        if (mc.player != null && mc.level != null && ModuleManager.waterSpeed.isEnabled() && ModuleManager.waterSpeed.mode.is(CancelResurface)) {
119
            if (mc.player.isInWater() || mc.level.getBlockState(BlockPos.containing(mc.player.position().add(0, -0.5, 0))).getBlock() instanceof LiquidBlock)
120
                return true;
121
        }
122
        return sprinting;
123
    }
124
125
    @Inject(method = "getCurrentSwingDuration", at = @At("HEAD"), cancellable = true)
126
    private void onGetHandSwingDuration(CallbackInfoReturnable<Integer> cir) {
127
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.noSwing.getValue()) {
128
            cir.setReturnValue(0);
129
            cir.cancel();
130
        }
131
    }
132
}
133
MixinEntityRenderersrc/main/java/thunder/hack/injection/MixinEntityRenderer.javaJava · 27 lines · 1.1 KB
@Mixin(EntityRenderer.class)
MixinEntityRenderer.javaJava · 27 lines · 1.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.manager.client.ModuleManager;
4
import net.minecraft.client.renderer.entity.EntityRenderer;
5
import net.minecraft.world.entity.Entity;
6
import net.minecraft.world.entity.decoration.ArmorStand;
7
import net.minecraft.world.entity.player.Player;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.Inject;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
12
13
@Mixin(EntityRenderer.class)
14
public abstract class MixinEntityRenderer<T extends Entity> {
15
    @Inject(method = "shouldShowName", at = @At("HEAD"), cancellable = true)
16
    private void hasLabelHook(T entity, double squaredDistanceToCamera, CallbackInfoReturnable<Boolean> cir) {
17
        if (entity instanceof ArmorStand && ModuleManager.noRender.isEnabled() && ModuleManager.noRender.noArmorStands.getValue()) {
18
            cir.setReturnValue(false);
19
            return;
20
        }
21
22
        if (entity instanceof Player && ModuleManager.nameTags.isEnabled()) {
23
            cir.setReturnValue(false);
24
        }
25
    }
26
}
27
MixinFireWorkEntitysrc/main/java/thunder/hack/injection/MixinFireWorkEntity.javaJava · 34 lines · 1.4 KB
@Mixin(FireworkRocketEntity.class)
MixinFireWorkEntity.javaJava · 34 lines · 1.4 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.Shadow;
5
import org.spongepowered.asm.mixin.injection.At;
6
import org.spongepowered.asm.mixin.injection.Redirect;
7
import thunder.hack.core.Managers;
8
import thunder.hack.core.manager.client.ModuleManager;
9
import thunder.hack.features.modules.combat.Aura;
10
11
import static thunder.hack.core.manager.IManager.mc;
12
13
import net.minecraft.world.entity.LivingEntity;
14
import net.minecraft.world.entity.projectile.FireworkRocketEntity;
15
import net.minecraft.world.phys.Vec3;
16
17
@Mixin(FireworkRocketEntity.class)
18
public class MixinFireWorkEntity {
19
20
    @Shadow
21
    private LivingEntity attachedToEntity;
22
23
    @Redirect(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/LivingEntity;getLookAngle()Lnet/minecraft/world/phys/Vec3;"))
24
    private Vec3 tickHook(LivingEntity instance) {
25
        if (ModuleManager.aura.isEnabled() && ModuleManager.aura.rotationMode.not(Aura.Mode.None)
26
                && ModuleManager.aura.target != null && attachedToEntity == mc.player && ModuleManager.aura.elytraTarget.getValue()) {
27
28
          //  float[] nonLimitedRotation = PlayerManager.calcAngle(ModuleManager.aura.target.getEyePos().add(0, 0.5, 0));
29
            return Managers.PLAYER.getRotationVector(ModuleManager.aura.rotationPitch, ModuleManager.aura.rotationYaw);
30
        }
31
        return attachedToEntity.getLookAngle();
32
    }
33
}
34
MixinFlowableFluidsrc/main/java/thunder/hack/injection/MixinFlowableFluid.javaJava · 44 lines · 1.8 KB
@Mixin(FlowingFluid.class)
ModifiesFlowingFluid
MixinFlowableFluid.javaJava · 44 lines · 1.8 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.Shadow;
5
import org.spongepowered.asm.mixin.injection.At;
6
import org.spongepowered.asm.mixin.injection.Inject;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
8
import thunder.hack.core.manager.client.ModuleManager;
9
10
import static net.minecraft.world.level.material.FlowingFluid.FALLING;
11
12
import net.minecraft.core.BlockPos;
13
import net.minecraft.core.Direction;
14
import net.minecraft.world.level.BlockGetter;
15
import net.minecraft.world.level.material.FlowingFluid;
16
import net.minecraft.world.level.material.FluidState;
17
import net.minecraft.world.phys.Vec3;
18
19
@Mixin(FlowingFluid.class)
20
public abstract class MixinFlowableFluid {
21
22
    @Shadow
23
    protected abstract boolean isSolidFace(BlockGetter world, BlockPos pos, Direction direction);
24
25
    @Inject(method = "getFlow", at = @At(value = "HEAD"), cancellable = true)
26
    private void getVelocityHook(BlockGetter world, BlockPos pos, FluidState state, CallbackInfoReturnable<Vec3> cir) {
27
        if (ModuleManager.noPush.isEnabled() && ModuleManager.noPush.water.getValue()) {
28
            double d = 0.0;
29
            double e = 0.0;
30
            BlockPos.MutableBlockPos mutable = new BlockPos.MutableBlockPos();
31
            Vec3 vec3d = new Vec3(d, 0.0, e);
32
            if (state.getValue(FALLING)) {
33
                for (Direction direction2 : Direction.Plane.HORIZONTAL) {
34
                    mutable.setWithOffset(pos, direction2);
35
                    if (!this.isSolidFace(world, mutable, direction2) && !this.isSolidFace(world, mutable.above(), direction2))
36
                        continue;
37
                    vec3d = vec3d.normalize().add(0.0, -6.0, 0.0);
38
                    break;
39
                }
40
            }
41
            cir.setReturnValue(vec3d.normalize());
42
        }
43
    }
44
}
MixinGameRenderersrc/main/java/thunder/hack/injection/MixinGameRenderer.javaJava · 130 lines · 5.9 KB
@Mixin(GameRenderer.class)
ModifiesGameRenderer
MixinGameRenderer.javaJava · 130 lines · 5.9 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.utility.render.compat.RenderSystem;
4
import thunder.hack.core.Managers;
5
import net.minecraft.client.Camera;
6
import net.minecraft.client.CameraType;
7
import net.minecraft.client.DeltaTracker;
8
import net.minecraft.client.renderer.GameRenderer;
9
import net.minecraft.client.renderer.state.level.CameraRenderState;
10
import net.minecraft.core.*;
11
import net.minecraft.server.packs.resources.ResourceProvider;
12
import net.minecraft.tags.ItemTags;
13
import net.minecraft.util.Mth;
14
import net.minecraft.world.entity.Entity;
15
import net.minecraft.world.item.ItemStack;
16
import net.minecraft.world.phys.*;
17
import org.joml.Matrix4f;
18
import org.spongepowered.asm.mixin.Mixin;
19
import org.spongepowered.asm.mixin.Shadow;
20
import org.spongepowered.asm.mixin.Unique;
21
import org.spongepowered.asm.mixin.injection.At;
22
import org.spongepowered.asm.mixin.injection.Inject;
23
import org.spongepowered.asm.mixin.injection.Redirect;
24
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
25
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
26
import thunder.hack.ThunderHack;
27
import thunder.hack.core.manager.client.ModuleManager;
28
import thunder.hack.features.modules.Module;
29
import thunder.hack.features.modules.client.ClientSettings;
30
import thunder.hack.features.modules.player.NoEntityTrace;
31
import thunder.hack.utility.math.FrameRateCounter;
32
import thunder.hack.utility.render.BlockAnimationUtility;
33
import thunder.hack.utility.render.BufferRenderer;
34
import thunder.hack.utility.render.Render2DEngine;
35
import thunder.hack.utility.render.Render3DEngine;
36
37
import static thunder.hack.features.modules.Module.mc;
38
39
import com.mojang.blaze3d.vertex.PoseStack;
40
import com.mojang.math.Axis;
41
42
@Mixin(GameRenderer.class)
43
public abstract class MixinGameRenderer {
44
45
    @Shadow
46
    public abstract void tick();
47
48
    @Inject(method = "render", at = @At("TAIL"))
49
    void postHudRenderHook(DeltaTracker tickCounter, boolean tick, CallbackInfo ci) {
50
        // In game MelaHack's HUD belongs on top of the vanilla one, so whatever is still queued is
51
        // replayed here. Screen content was already replayed by MixinGuiRenderer between the
52
        // vanilla GUI layers.
53
        BufferRenderer.flushQueue();
54
        BufferRenderer.endFrame();
55
        FrameRateCounter.INSTANCE.recordFrame();
56
        Render2DEngine.BLUR_PROGRAM.invalidateCapture();
57
    }
58
59
    @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GameRenderer;renderItemInHand(Lnet/minecraft/client/renderer/state/level/CameraRenderState;FLorg/joml/Matrix4fc;)V"), method = "renderLevel")
60
    void render3dHook(DeltaTracker tickCounter, CallbackInfo ci) {
61
        if (Module.fullNullCheck()) return;
62
63
        Camera camera = mc.gameRenderer.mainCamera();
64
        PoseStack matrixStack = new PoseStack();
65
        RenderSystem.getModelViewStack().pushMatrix().mul(matrixStack.last().pose());
66
        matrixStack.mulPose(Axis.XP.rotationDegrees(camera.xRot()));
67
        matrixStack.mulPose(Axis.YP.rotationDegrees(camera.yRot() + 180.0f));
68
69
        // World space geometry is projected with the level projection and already carries the view
70
        // rotation, so the model view matrix stays at identity.
71
        Render3DEngine.lastProjMat.set(mc.gameRenderer.gameRenderState().levelRenderState.cameraRenderState.projectionMatrix);
72
        Render3DEngine.lastModMat.identity();
73
        Render3DEngine.lastWorldSpaceMatrix.set(matrixStack.last().pose());
74
75
        RenderSystem.beginWorldDrawing();
76
        try {
77
            Managers.MODULE.onRender3D(matrixStack);
78
            BlockAnimationUtility.onRender(matrixStack);
79
            Render3DEngine.onRender3D(matrixStack); // <- не двигать
80
        } finally {
81
            RenderSystem.endWorldDrawing();
82
        }
83
84
        RenderSystem.getModelViewStack().popMatrix();
85
    }
86
87
    @Inject(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GameRenderer;renderItemInHand(Lnet/minecraft/client/renderer/state/level/CameraRenderState;FLorg/joml/Matrix4fc;)V", shift = At.Shift.AFTER))
88
    public void postRender3dHook(DeltaTracker tickCounter, CallbackInfo ci) {
89
        if (Module.fullNullCheck()) return;
90
        Managers.SHADER.renderShaders();
91
    }
92
93
    @Redirect(method = "renderLevel", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/Mth;lerp(FFF)F"))
94
    private float renderWorldHook(float delta, float first, float second) {
95
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.nausea.getValue()) return 0;
96
        return Mth.lerp(delta, first, second);
97
    }
98
99
    @Inject(method = "preloadUiShader", at = @At(value = "RETURN"))
100
    private void loadSatinPrograms(ResourceProvider factory, CallbackInfo ci) {
101
        // Reload happens via ResourceManagerHelper to ensure mod assets are available.
102
    }
103
104
    @Unique
105
    private HitResult ensureTargetInRangeCustom(HitResult hitResult, Vec3 cameraPos, double interactionRange) {
106
        Vec3 vec3d = hitResult.getLocation();
107
        if (!vec3d.closerThan(cameraPos, interactionRange)) {
108
            Vec3 vec3d2 = hitResult.getLocation();
109
            Direction direction = Direction.getApproximateNearest(vec3d2.x - cameraPos.x, vec3d2.y - cameraPos.y, vec3d2.z - cameraPos.z);
110
            return BlockHitResult.miss(vec3d2, direction, BlockPos.containing(vec3d2));
111
        } else {
112
            return hitResult;
113
        }
114
    }
115
116
    @Inject(method = "displayItemActivation", at = @At("HEAD"), cancellable = true)
117
    private void showFloatingItemHook(ItemStack floatingItem, CallbackInfo info) {
118
        if (ModuleManager.totemAnimation.isEnabled()) {
119
            ModuleManager.totemAnimation.showFloatingItem(floatingItem);
120
            info.cancel();
121
        }
122
    }
123
124
    @Inject(method = "bobHurt", at = @At("HEAD"), cancellable = true)
125
    private void tiltViewWhenHurtHook(CameraRenderState cameraState, PoseStack matrices, CallbackInfo ci) {
126
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.hurtCam.getValue())
127
            ci.cancel();
128
    }
129
}
130
MixinGuiManagersrc/main/java/thunder/hack/injection/MixinGuiManager.javaJava · 54 lines · 2.3 KB
@Mixin(Gui.class)
ModifiesGui
MixinGuiManager.javaJava · 54 lines · 2.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.Minecraft;
4
import net.minecraft.client.gui.Gui;
5
import net.minecraft.client.gui.screens.Screen;
6
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen;
7
import net.minecraft.client.multiplayer.ServerData;
8
import org.spongepowered.asm.mixin.Final;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.Shadow;
11
import org.spongepowered.asm.mixin.injection.At;
12
import org.spongepowered.asm.mixin.injection.Inject;
13
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
14
import thunder.hack.ThunderHack;
15
import thunder.hack.core.manager.client.ModuleManager;
16
import thunder.hack.events.impl.EventScreen;
17
import thunder.hack.features.modules.Module;
18
import thunder.hack.gui.clickui.ClickGUI;
19
20
/** Screen lifecycle hooks moved from Minecraft to the 26.2 GUI manager. */
21
@Mixin(Gui.class)
22
public abstract class MixinGuiManager {
23
    @Shadow @Final private Minecraft minecraft;
24
25
    private static final String[] BLOCKED_SERVERS = {
26
            "mineblaze", "musteryworld", "dexland", "masedworld", "vimeworld", "hypemc", "vimemc"
27
    };
28
29
    @Inject(method = "setScreen", at = @At("HEAD"), cancellable = true)
30
    private void beforeSetScreen(Screen screen, CallbackInfo ci) {
31
        if (Module.fullNullCheck()) return;
32
        EventScreen event = new EventScreen(screen);
33
        ThunderHack.EVENT_BUS.post(event);
34
        if (event.isCancelled() || (ClickGUI.close && screen == null)) ci.cancel();
35
    }
36
37
    @Inject(method = "setScreen", at = @At("RETURN"))
38
    private void afterSetScreen(Screen screen, CallbackInfo ci) {
39
        if (Module.fullNullCheck() || !(screen instanceof JoinMultiplayerScreen multiplayer)
40
                || !ModuleManager.antiServerAdd.isEnabled() || multiplayer.getServers() == null) return;
41
        for (int i = multiplayer.getServers().size() - 1; i >= 0; i--) {
42
            ServerData info = multiplayer.getServers().get(i);
43
            if (info == null || info.ip == null) continue;
44
            for (String blocked : BLOCKED_SERVERS) {
45
                if (info.ip.toLowerCase().contains(blocked)) {
46
                    multiplayer.getServers().remove(info);
47
                    multiplayer.getServers().save();
48
                    break;
49
                }
50
            }
51
        }
52
    }
53
}
54
MixinGuiRenderersrc/main/java/thunder/hack/injection/MixinGuiRenderer.javaJava · 52 lines · 1.9 KB
@Mixin(GuiRenderer.class)
ModifiesGuiRenderer
MixinGuiRenderer.javaJava · 52 lines · 1.9 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.gui.render.GuiRenderer;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.injection.At;
6
import org.spongepowered.asm.mixin.injection.Inject;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
8
import thunder.hack.injection.accesors.IGuiRenderer;
9
import thunder.hack.utility.render.BufferRenderer;
10
11
import static thunder.hack.features.modules.Module.mc;
12
13
/**
14
 * MelaHack records its immediate mode screen geometry while vanilla extracts the frame, which is
15
 * before the main render target is cleared. The recorded draws are replayed here so that they end
16
 * up between the vanilla GUI layers:
17
 *
18
 * <ul>
19
 *     <li>above the (possibly blurred) screen backdrop,</li>
20
 *     <li>below the vanilla widgets, which vanilla draws after the blur pass.</li>
21
 * </ul>
22
 */
23
@Mixin(GuiRenderer.class)
24
public class MixinGuiRenderer {
25
    @Inject(method = "draw", at = @At("HEAD"))
26
    private void thunderhack$flushBeforeGuiElements(CallbackInfo ci) {
27
        if (mc.gui == null || mc.gui.screen() == null) {
28
            // HUD only content is replayed at the end of the frame so that it sits on top of the
29
            // vanilla HUD.
30
            return;
31
        }
32
33
        if (thunderhack$willBlur()) {
34
            // Wait for the blur pass, otherwise the backdrop would blur MelaHack's own panels.
35
            return;
36
        }
37
38
        BufferRenderer.flushQueue();
39
    }
40
41
    @Inject(method = "draw",
42
            at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GameRenderer;processBlurEffect()V", shift = At.Shift.AFTER))
43
    private void thunderhack$flushAfterBlur(CallbackInfo ci) {
44
        BufferRenderer.flushQueue();
45
    }
46
47
    private boolean thunderhack$willBlur() {
48
        IGuiRenderer accessor = (IGuiRenderer) this;
49
        return accessor.thunderhack$getFirstDrawIndexAfterBlur() < accessor.thunderhack$getDraws().size();
50
    }
51
}
52
MixinHandledScreensrc/main/java/thunder/hack/injection/MixinHandledScreen.javaJava · 294 lines · 13.1 KB
@Mixin(value = {AbstractContainerScreen.class})
MixinHandledScreen.javaJava · 294 lines · 13.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
import thunder.hack.utility.render.compat.RenderSystem;
3
import net.minecraft.client.Minecraft;
4
import net.minecraft.client.gui.GuiGraphicsExtractor;
5
import net.minecraft.client.input.MouseButtonEvent;
6
import net.minecraft.client.gui.screens.Screen;
7
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
8
import net.minecraft.client.gui.screens.inventory.MenuAccess;
9
import net.minecraft.client.renderer.SubmitNodeCollector;
10
import net.minecraft.client.renderer.state.MapRenderState;
11
import net.minecraft.core.component.DataComponents;
12
import net.minecraft.network.chat.Component;
13
import net.minecraft.world.SimpleContainer;
14
import net.minecraft.world.inventory.AbstractContainerMenu;
15
import net.minecraft.world.inventory.ContainerInput;
16
import net.minecraft.world.inventory.ShulkerBoxMenu;
17
import net.minecraft.world.inventory.Slot;
18
import net.minecraft.world.item.*;
19
import net.minecraft.world.item.component.ItemContainerContents;
20
import net.minecraft.world.level.block.ShulkerBoxBlock;
21
import net.minecraft.world.level.saveddata.maps.MapId;
22
import net.minecraft.world.level.saveddata.maps.MapItemSavedData;
23
import org.jetbrains.annotations.Nullable;
24
import org.lwjgl.glfw.GLFW;
25
import org.lwjgl.opengl.GL11;
26
import org.spongepowered.asm.mixin.Mixin;
27
import org.spongepowered.asm.mixin.Shadow;
28
import org.spongepowered.asm.mixin.Unique;
29
import org.spongepowered.asm.mixin.injection.At;
30
import org.spongepowered.asm.mixin.injection.Inject;
31
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
32
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
33
import thunder.hack.core.Core;
34
import thunder.hack.core.manager.client.ModuleManager;
35
import thunder.hack.gui.misc.PeekScreen;
36
import thunder.hack.features.modules.Module;
37
import thunder.hack.features.modules.render.Tooltips;
38
import thunder.hack.utility.Timer;
39
import thunder.hack.utility.render.Render2DEngine;
40
import thunder.hack.utility.render.TextureStorage;
41
import java.util.List;
42
43
import java.awt.*;
44
import java.util.*;
45
46
import static thunder.hack.features.modules.Module.mc;
47
import static thunder.hack.features.modules.render.Tooltips.hasItems;
48
49
import com.mojang.blaze3d.platform.InputConstants;
50
@Mixin(value = {AbstractContainerScreen.class})
51
public abstract class MixinHandledScreen<T extends AbstractContainerMenu> extends Screen implements MenuAccess<T> {
52
53
    @Unique
54
    private final Timer delayTimer = new Timer();
55
56
    @Unique
57
    private Runnable postRender;
58
59
    protected MixinHandledScreen(Component title) {
60
        super(title);
61
    }
62
63
    @Shadow
64
    protected abstract boolean isHovering(Slot slotIn, double mouseX, double mouseY);
65
66
    @Shadow
67
    protected abstract void slotClicked(Slot slotIn, int slotId, int mouseButton, ContainerInput type);
68
69
    @Inject(method = "extractRenderState", at = @At("HEAD"))
70
    private void drawScreenHook(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
71
        if (Module.fullNullCheck()) return;
72
        for (int i1 = 0; i1 < mc.player.containerMenu.slots.size(); ++i1) {
73
            Slot slot = mc.player.containerMenu.slots.get(i1);
74
            if (isHovering(slot, mouseX, mouseY) && slot.isActive()) {
75
                if (ModuleManager.itemScroller.isEnabled() && shit() && attack() && delayTimer.passedMs(ModuleManager.itemScroller.delay.getValue())) {
76
                    this.slotClicked(slot, slot.index, 0, ContainerInput.QUICK_MOVE);
77
                    delayTimer.reset();
78
                }
79
            }
80
        }
81
    }
82
83
    private boolean shit() {
84
        return InputConstants.isKeyDown(Minecraft.getInstance().getWindow(), 340) || InputConstants.isKeyDown(Minecraft.getInstance().getWindow(), 344);
85
    }
86
87
    private boolean attack() {
88
        return Core.hold_mouse0;
89
    }
90
91
    @Shadow
92
    @Nullable
93
    protected Slot hoveredSlot;
94
    @Shadow
95
    protected int leftPos;
96
    @Shadow
97
    protected int topPos;
98
99
    private static final ItemStack[] ITEMS = new ItemStack[27];
100
101
    private Map<Render2DEngine.Rectangle, Integer> clickableRects = new HashMap<>();
102
103
    @Inject(method = "extractRenderState", at = @At("TAIL"))
104
    private void onRender(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
105
        if (Module.fullNullCheck()) return;
106
        if (hoveredSlot != null && !hoveredSlot.getItem().isEmpty() && minecraft.player.inventoryMenu.getCarried().isEmpty()) {
107
            if (hasItems(hoveredSlot.getItem()) && Tooltips.storage.getValue()) {
108
                renderShulkerToolTip(context, mouseX, mouseY, 0, 0, hoveredSlot.getItem());
109
            } else if (hoveredSlot.getItem().getItem() == Items.FILLED_MAP && Tooltips.maps.getValue()) {
110
                drawMapPreview(context, hoveredSlot.getItem(), mouseX, mouseY);
111
            }
112
        }
113
        int xOffset = 0;
114
        int yOffset = 20;
115
        int stage = 0;
116
117
        if (ModuleManager.tooltips.isEnabled() && ModuleManager.tooltips.shulkerRegear.getValue()) {
118
            clickableRects.clear();
119
            for (int i1 = 0; i1 < mc.player.containerMenu.slots.size(); ++i1) {
120
                Slot slot = mc.player.containerMenu.slots.get(i1);
121
                if (slot.getItem().isEmpty()) continue;
122
123
                if (slot.getItem().getItem() instanceof BlockItem bi && bi.getBlock() instanceof ShulkerBoxBlock) {
124
                    if (!renderShulkerToolTip(context, xOffset, yOffset + 67, mouseX, mouseY, slot.getItem()))
125
                        continue;
126
                    clickableRects.put(new Render2DEngine.Rectangle(xOffset, yOffset, xOffset + 176, yOffset + 67), slot.index);
127
                    yOffset += 67;
128
                    if (stage == 0) {
129
                        if (yOffset + 67 >= mc.getWindow().getGuiScaledHeight()) {
130
                            yOffset = 20;
131
                            xOffset = mc.getWindow().getGuiScaledWidth() - 176;
132
                            stage = 1;
133
                        }
134
                    } else if (stage == 1) {
135
                        if (yOffset + 67 >= mc.getWindow().getGuiScaledHeight()) {
136
                            yOffset = 20;
137
                            xOffset = 170;
138
                            stage = 2;
139
                        }
140
                    } else {
141
                        if (yOffset + 67 >= mc.getWindow().getGuiScaledHeight()) {
142
                            yOffset = 20;
143
                            xOffset = mc.getWindow().getGuiScaledWidth() - 352;
144
                            stage = 0;
145
                        }
146
                    }
147
                }
148
            }
149
150
            if (postRender != null) {
151
                postRender.run();
152
                postRender = null;
153
            }
154
        }
155
    }
156
157
    @Inject(method = "extractSlot", at = @At("TAIL"))
158
    protected void drawSlotHook(GuiGraphicsExtractor context, Slot slot, int mouseX, int mouseY, CallbackInfo ci) {
159
        if (ModuleManager.serverHelper.isEnabled() && ModuleManager.serverHelper.aucHelper.getValue())
160
            ModuleManager.serverHelper.onRenderChest(context, slot);
161
    }
162
163
    public boolean renderShulkerToolTip(GuiGraphicsExtractor context, int offsetX, int offsetY, int mouseX, int mouseY, ItemStack stack) {
164
        try {
165
            ItemContainerContents compoundTag = stack.get(DataComponents.CONTAINER);
166
            if (compoundTag == null)
167
                return false;
168
169
            float[] colors = new float[]{1F, 1F, 1F};
170
            Item focusedItem = stack.getItem();
171
            if (focusedItem instanceof BlockItem bi && bi.getBlock() instanceof ShulkerBoxBlock) {
172
                try {
173
                    Color c = new Color(Objects.requireNonNull(((ShulkerBoxBlock) bi.getBlock()).getColor()).getTextureDiffuseColor());
174
                    colors = new float[]{c.getRed() / 255f, c.getGreen() / 255f, c.getRed() / 255f, c.getAlpha() / 255f};
175
                } catch (NullPointerException npe) {
176
                    colors = new float[]{1F, 1F, 1F};
177
                }
178
            }
179
            draw(context, compoundTag.allItemsCopyStream().toList(), offsetX, offsetY, mouseX, mouseY, colors);
180
        } catch (Exception ignore) {
181
            return false;
182
        }
183
        return true;
184
    }
185
186
    @Inject(method = "extractTooltip", at = @At("HEAD"), cancellable = true)
187
    private void onDrawMouseoverTooltip(GuiGraphicsExtractor context, int x, int y, CallbackInfo ci) {
188
        if (Module.fullNullCheck()) return;
189
        if (hoveredSlot != null && !hoveredSlot.getItem().isEmpty() && minecraft.player.inventoryMenu.getCarried().isEmpty()) {
190
            if (hoveredSlot.getItem().getItem() == Items.FILLED_MAP && Tooltips.maps.getValue()) ci.cancel();
191
        }
192
    }
193
194
    @Unique
195
    private void draw(GuiGraphicsExtractor context, List<ItemStack> itemStacks, int offsetX, int offsetY, int mouseX, int mouseY, float[] colors) {
196
        RenderSystem.disableDepthTest();
197
        GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
198
199
        offsetX += 8;
200
        offsetY -= 82;
201
202
        drawBackground(context, offsetX, offsetY, colors);
203
204
        RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
205
        int row = 0;
206
        int i = 0;
207
        for (ItemStack itemStack : itemStacks) {
208
            context.item(itemStack, offsetX + 8 + i * 18, offsetY + 7 + row * 18);
209
            context.itemDecorations(mc.font, itemStack, offsetX + 8 + i * 18, offsetY + 7 + row * 18);
210
211
            if (mouseX > offsetX + 8 + i * 18 && mouseX < offsetX + 28 + i * 18 && mouseY > offsetY + 7 + row * 18 && mouseY < offsetY + 27 + row * 18)
212
                postRender = () -> context.setTooltipForNextFrame(font, getTooltipFromItem(mc, itemStack), itemStack.getTooltipImage(), mouseX, mouseY);
213
214
            i++;
215
            if (i >= 9) {
216
                i = 0;
217
                row++;
218
            }
219
        }
220
        RenderSystem.enableDepthTest();
221
    }
222
223
    private void drawBackground(GuiGraphicsExtractor context, int x, int y, float[] colors) {
224
        RenderSystem.disableBlend();
225
        RenderSystem.setShaderColor(colors[0], colors[1], colors[2], 1F);
226
        RenderSystem.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
227
        RenderSystem.texParameter(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR);
228
        context.blit(net.minecraft.client.renderer.RenderPipelines.GUI_TEXTURED, TextureStorage.container, x, y, 0, 0, 176, 67, 176, 67);
229
        RenderSystem.enableBlend();
230
    }
231
232
    private void drawMapPreview(GuiGraphicsExtractor context, ItemStack stack, int x, int y) {
233
        RenderSystem.enableBlend();
234
        context.pose().pushMatrix();
235
        RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
236
237
        int y1 = y - 12;
238
        int x1 = x + 8;
239
        int z = 300;
240
241
        MapItemSavedData mapState = MapItem.getSavedData(stack, minecraft.level);
242
243
        if (mapState != null) {
244
            mapState.getHoldingPlayer(minecraft.player);
245
246
            x1 += 8;
247
            y1 += 8;
248
            z = 310;
249
            double scale = (double) (100 - 16) / 128.0D;
250
            context.pose().translate((float) (x1), (float) (y1));
251
            context.pose().scale((float) scale, (float) scale);
252
            MapRenderState renderState = new MapRenderState();
253
            minecraft.getMapRenderer().extractRenderState((MapId) stack.get(DataComponents.MAP_ID), mapState, renderState);
254
            context.map(renderState);
255
        }
256
        context.pose().popMatrix();
257
    }
258
259
    @Inject(method = "mouseClicked", at = @At("HEAD"), cancellable = true)
260
    private void mouseClicked(MouseButtonEvent event, boolean doubleClick, CallbackInfoReturnable<Boolean> cir) {
261
        double mouseX = event.x();
262
        double mouseY = event.y();
263
        int button = event.button();
264
        if (Module.fullNullCheck()) return;
265
        if (button == GLFW.GLFW_MOUSE_BUTTON_MIDDLE && hoveredSlot != null && !hoveredSlot.getItem().isEmpty() && minecraft.player.inventoryMenu.getCarried().isEmpty()) {
266
            ItemStack itemStack = hoveredSlot.getItem();
267
268
            if (hasItems(itemStack) && Tooltips.middleClickOpen.getValue()) {
269
270
                Arrays.fill(ITEMS, ItemStack.EMPTY);
271
                ItemContainerContents nbt = itemStack.get(DataComponents.CONTAINER);
272
273
                if (nbt != null) {
274
                    List<ItemStack> list = nbt.allItemsCopyStream().toList();
275
                    for (int i = 0; i < list.size(); i++)
276
                        ITEMS[i] = list.get(i);
277
                }
278
279
                minecraft.gui.setScreen(new PeekScreen(new ShulkerBoxMenu(0, minecraft.player.getInventory(), new SimpleContainer(ITEMS)), minecraft.player.getInventory(), hoveredSlot.getItem().getHoverName(), ((BlockItem) hoveredSlot.getItem().getItem()).getBlock()));
280
                cir.setReturnValue(true);
281
            }
282
        }
283
        for (Render2DEngine.Rectangle rect : clickableRects.keySet()) {
284
            if (rect.contains(mouseX, mouseY)) {
285
                if (ModuleManager.tooltips.shulkerRegearShiftMode.getValue()) {
286
                    mc.gameMode.handleContainerInput(mc.player.containerMenu.containerId, clickableRects.get(rect), 0, ContainerInput.QUICK_MOVE, mc.player);
287
                } else {
288
                    mc.gameMode.handleContainerInput(mc.player.containerMenu.containerId, clickableRects.get(rect), 0, ContainerInput.PICKUP, mc.player);
289
                }
290
            }
291
        }
292
    }
293
}
294
MixinHeldItemRenderersrc/main/java/thunder/hack/injection/MixinHeldItemRenderer.javaJava · 88 lines · 5.1 KB
@Mixin(ItemInHandRenderer.class)
ModifiesItemInHandRenderer not in 26.3
MixinHeldItemRenderer.javaJava · 88 lines · 5.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.utility.render.compat.RenderSystem;
4
import org.jetbrains.annotations.NotNull;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.ModifyArgs;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
11
import thunder.hack.ThunderHack;
12
import thunder.hack.core.Managers;
13
import thunder.hack.core.manager.client.ModuleManager;
14
import thunder.hack.events.impl.EventHeldItemRenderer;
15
import thunder.hack.features.modules.Module;
16
17
import static thunder.hack.features.modules.Module.mc;
18
19
import com.mojang.blaze3d.vertex.PoseStack;
20
import com.mojang.math.Axis;
21
import net.minecraft.client.player.AbstractClientPlayer;
22
import net.minecraft.client.renderer.ItemInHandRenderer;
23
import net.minecraft.client.renderer.SubmitNodeCollector;
24
import net.minecraft.util.Mth;
25
import net.minecraft.world.InteractionHand;
26
import net.minecraft.world.entity.HumanoidArm;
27
import net.minecraft.world.entity.player.Player;
28
import net.minecraft.world.item.ItemStack;
29
import net.minecraft.world.item.MapItem;
30
31
@Mixin(ItemInHandRenderer.class)
32
public abstract class MixinHeldItemRenderer {
33
34
    @Inject(method = "submitArmWithItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemInHandRenderer;renderItem(Lnet/minecraft/world/entity/LivingEntity;Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemDisplayContext;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;I)V"))
35
    private void onRenderItem(AbstractClientPlayer player, float tickDelta, float pitch, InteractionHand hand, float swingProgress, ItemStack item, float equipProgress, PoseStack matrices, SubmitNodeCollector vertexConsumers, int light, CallbackInfo ci) {
36
        if(Module.fullNullCheck()) return;
37
        EventHeldItemRenderer event = new EventHeldItemRenderer(hand, item, equipProgress, matrices);
38
        ThunderHack.EVENT_BUS.post(event);
39
    }
40
41
    @Inject(method = "submitArmWithItem", at = @At(value = "RETURN"))
42
    private void onRenderItemPost(AbstractClientPlayer player, float tickDelta, float pitch, InteractionHand hand, float swingProgress, ItemStack item, float equipProgress, PoseStack matrices, SubmitNodeCollector vertexConsumers, int light, CallbackInfo ci) {
43
        if (ModuleManager.chams.isEnabled() && ModuleManager.chams.handItems.getValue())
44
            RenderSystem.setShaderColor(1f,1f,1f,1f);
45
    }
46
47
    @Inject(method = "submitArmWithItem", at = @At(value = "HEAD"), cancellable = true)
48
    private void onRenderItemHook(AbstractClientPlayer player, float tickDelta, float pitch, InteractionHand hand, float swingProgress, ItemStack item, float equipProgress, PoseStack matrices, SubmitNodeCollector vertexConsumers, int light, CallbackInfo ci) {
49
        if (Managers.MODULE != null && ModuleManager.animations.shouldAnimate() && !(item.isEmpty()) && !(item.getItem() instanceof MapItem)) {
50
            ci.cancel();
51
            ModuleManager.animations.renderFirstPersonItemCustom(player, tickDelta, pitch, hand, swingProgress, item, equipProgress, matrices, vertexConsumers, light);
52
        }
53
    }
54
55
56
    private void applyEatOrDrinkTransformationCustom(PoseStack matrices, float tickDelta, HumanoidArm arm, @NotNull ItemStack stack) {
57
        float f = (float) mc.player.getUseItemRemainingTicks() - tickDelta + 1.0F;
58
        float g = f / (float) stack.getUseDuration(mc.player);
59
        float h;
60
        if (g < 0.8F) {
61
            h = Mth.abs(Mth.cos(f / 4.0F * 3.1415927F) * 0.005F);
62
            matrices.translate(0.0F, h, 0.0F);
63
        }
64
        h = 1.0F - (float) Math.pow(g, 27.0);
65
        int i = arm == HumanoidArm.RIGHT ? 1 : -1;
66
67
        matrices.translate(h * 0.6F * (float) i * ModuleManager.viewModel.eatX.getValue(), h * -0.5F * ModuleManager.viewModel.eatY.getValue(), h * 0.0F);
68
        matrices.mulPose(Axis.YP.rotationDegrees((float) i * h * 90.0F));
69
        matrices.mulPose(Axis.XP.rotationDegrees(h * 10.0F));
70
        matrices.mulPose(Axis.ZP.rotationDegrees((float) i * h * 30.0F));
71
    }
72
73
    @Inject(method = "applyEatTransform", at = @At(value = "HEAD"), cancellable = true)
74
    private void applyEatOrDrinkTransformationHook(PoseStack matrices, float tickDelta, HumanoidArm arm, ItemStack stack, Player player, CallbackInfo ci) {
75
        if (ModuleManager.animations.isEnabled()) {
76
            applyEatOrDrinkTransformationCustom(matrices, tickDelta, arm, stack);
77
            ci.cancel();
78
        }
79
    }
80
    @ModifyArgs(method = "submitHandsWithItems", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/ItemInHandRenderer;submitArmWithItem(Lnet/minecraft/client/player/AbstractClientPlayer;FFLnet/minecraft/world/InteractionHand;FLnet/minecraft/world/item/ItemStack;FLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/SubmitNodeCollector;I)V"))
81
    private void renderItem(Args args) {
82
        if (ModuleManager.noRender.noSwing.getValue()) {
83
            args.set(4, 0.0F);
84
        }
85
    }
86
87
}
88
MixinInGameHudsrc/main/java/thunder/hack/injection/MixinInGameHud.javaJava · 91 lines · 3.9 KB
@Mixin(Hud.class)
ModifiesHud
MixinInGameHud.javaJava · 91 lines · 3.9 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.Managers;
4
import thunder.hack.core.manager.client.ModuleManager;
5
import thunder.hack.features.hud.impl.Hotbar;
6
import thunder.hack.gui.windows.WindowsScreen;
7
import thunder.hack.features.modules.Module;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.Inject;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12
13
import static thunder.hack.core.manager.IManager.mc;
14
15
import net.minecraft.client.DeltaTracker;
16
import net.minecraft.client.gui.Hud;
17
import net.minecraft.client.gui.GuiGraphicsExtractor;
18
import net.minecraft.world.entity.Entity;
19
import net.minecraft.world.scores.Objective;
20
21
@Mixin(Hud.class)
22
public abstract class MixinInGameHud {
23
24
    @Inject(at = @At(value = "HEAD"), method = "extractRenderState")
25
    public void renderHook(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
26
        if(Module.fullNullCheck()) return;
27
        Managers.MODULE.onRender2D(context);
28
        Managers.NOTIFICATION.onRender2D(context);
29
        if (ModuleManager.totemAnimation.isEnabled()) {
30
            ModuleManager.totemAnimation.renderFloatingItem(context, tickCounter.getGameTimeDeltaPartialTick(true));
31
        }
32
    }
33
34
    @Inject(at = @At(value = "HEAD"), method = "extractPlayerHealth", cancellable = true)
35
    private void renderStatusBarsHook(GuiGraphicsExtractor context, CallbackInfo ci) {
36
        if (mc != null && mc.gui.screen() instanceof WindowsScreen) {
37
            ci.cancel();
38
        }
39
    }
40
41
    @Inject(at = @At(value = "HEAD"), method = "extractItemHotbar", cancellable = true)
42
    public void renderHotbarCustom(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
43
        if (mc != null && mc.gui.screen() instanceof WindowsScreen)
44
            ci.cancel();
45
46
        if (ModuleManager.hotbar.isEnabled()) {
47
            ci.cancel();
48
            Hotbar.renderHotBarItems(tickCounter.getGameTimeDeltaPartialTick(true), context);
49
        }
50
    }
51
52
53
    @Inject(at = @At(value = "HEAD"), method = "extractSelectedItemName", cancellable = true)
54
    public void renderHeldItemTooltipHook(GuiGraphicsExtractor context, CallbackInfo ci) {
55
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.hotbarItemName.getValue())
56
            ci.cancel();
57
    }
58
59
    @Inject(at = @At(value = "HEAD"), method = "extractEffects", cancellable = true)
60
    public void renderStatusEffectOverlayHook(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
61
        if (ModuleManager.potionHud.isEnabled() || (ModuleManager.legacyHud.isEnabled() && ModuleManager.legacyHud.potions.getValue())) {
62
            ci.cancel();
63
        }
64
    }
65
66
    @Inject(method = "extractScoreboardSidebar", at = @At(value = "HEAD"), cancellable = true)
67
    private void renderScoreboardSidebarHook(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
68
        if(ModuleManager.noRender.noScoreBoard.getValue() && ModuleManager.noRender.isEnabled()){
69
            ci.cancel();
70
        }
71
    }
72
73
    @Inject(method = "extractVignette", at = @At(value = "HEAD"), cancellable = true)
74
    private void renderVignetteOverlayHook(GuiGraphicsExtractor context, Entity entity, CallbackInfo ci) {
75
        if(ModuleManager.noRender.vignette.getValue())
76
            ci.cancel();
77
    }
78
79
    @Inject(method = "extractPortalOverlay", at = @At(value = "HEAD"), cancellable = true)
80
    private void renderPortalOverlayHook(GuiGraphicsExtractor context, float nauseaStrength, CallbackInfo ci) {
81
        if(ModuleManager.noRender.portal.getValue())
82
            ci.cancel();
83
    }
84
85
    @Inject(method = "extractCrosshair", at = @At(value = "HEAD"), cancellable = true)
86
    public void renderCrosshair(GuiGraphicsExtractor context, DeltaTracker tickCounter, CallbackInfo ci) {
87
        if (ModuleManager.crosshair.isEnabled())
88
            ci.cancel();
89
    }
90
}
91
MixinInGameOverlayRenderersrc/main/java/thunder/hack/injection/MixinInGameOverlayRenderer.javaJava · 34 lines · 1.8 KB
@Mixin(ScreenEffectRenderer.class)
MixinInGameOverlayRenderer.javaJava · 34 lines · 1.8 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.manager.client.ModuleManager;
4
import com.mojang.blaze3d.vertex.PoseStack;
5
import net.minecraft.client.Minecraft;
6
import net.minecraft.client.renderer.SubmitNodeCollector;
7
import net.minecraft.client.renderer.ScreenEffectRenderer;
8
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.injection.At;
11
import org.spongepowered.asm.mixin.injection.Inject;
12
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13
14
@Mixin(ScreenEffectRenderer.class)
15
public class MixinInGameOverlayRenderer {
16
    @Inject(method = "submitFire", at = @At("HEAD"), cancellable = true)
17
    private static void renderFireOverlayHook(PoseStack matrixStack, SubmitNodeCollector vertexConsumers, TextureAtlasSprite sprite, CallbackInfo ci) {
18
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.fireOverlay.getValue())
19
            ci.cancel();
20
    }
21
22
    @Inject(method = "submitWater", at = @At("HEAD"), cancellable = true)
23
    private static void renderUnderwaterOverlayHook(Minecraft minecraftClient, PoseStack matrixStack, SubmitNodeCollector vertexConsumers, CallbackInfo ci) {
24
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.waterOverlay.getValue() || ModuleManager.shaders.isEnabled())
25
            ci.cancel();
26
    }
27
28
    @Inject(method = "submitBlockSprite", at = @At("HEAD"), cancellable = true)
29
    private static void renderInWallOverlayHook(TextureAtlasSprite sprite, PoseStack matrices, SubmitNodeCollector vertexConsumers, int color, CallbackInfo ci) {
30
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.blockOverlay.getValue() || ModuleManager.shaders.isEnabled())
31
            ci.cancel();
32
    }
33
}
34
MixinKeyBindingsrc/main/java/thunder/hack/injection/MixinKeyBinding.javaJava · 33 lines · 1.3 KB
@Mixin(KeyMapping.class)
ModifiesKeyMapping
MixinKeyBinding.javaJava · 33 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.Shadow;
5
import org.spongepowered.asm.mixin.injection.At;
6
import org.spongepowered.asm.mixin.injection.Inject;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
8
import thunder.hack.core.manager.client.ModuleManager;
9
import static thunder.hack.ThunderHack.mc;
10
11
import net.minecraft.client.KeyMapping;
12
import net.minecraft.core.BlockPos;
13
14
15
@Mixin(KeyMapping.class)
16
public abstract class MixinKeyBinding {
17
    @Shadow public abstract boolean same(KeyMapping other);
18
19
    @Shadow public abstract boolean isDown();
20
21
    @Inject(method = "isDown",at = @At("HEAD"),cancellable = true)
22
    private void pressHook(CallbackInfoReturnable<Boolean> cir){
23
        if(     this.same(mc.options.keyShift)
24
                && mc.player != null
25
                && mc.level != null
26
                && ModuleManager.safeWalk.isEnabled()
27
                && mc.player.onGround() && mc.level.getBlockState(new BlockPos((int) Math.floor(mc.player.position().x), (int) Math.floor(mc.player.position().y) - 1, (int) Math.floor(mc.player.position().z))).isAir()
28
                && !ModuleManager.scaffold.isEnabled()){
29
            cir.setReturnValue(true);
30
        }
31
    }
32
}
33
MixinKeyboardsrc/main/java/thunder/hack/injection/MixinKeyboard.javaJava · 48 lines · 1.8 KB
@Mixin(KeyboardHandler.class)
MixinKeyboard.javaJava · 48 lines · 1.8 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.ThunderHack;
4
import thunder.hack.core.Managers;
5
import thunder.hack.events.impl.EventKeyPress;
6
import thunder.hack.events.impl.EventKeyRelease;
7
import thunder.hack.gui.clickui.ClickGUI;
8
import thunder.hack.gui.hud.HudEditorGui;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.injection.At;
11
import org.spongepowered.asm.mixin.injection.Inject;
12
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13
import thunder.hack.features.modules.Module;
14
15
import static thunder.hack.features.modules.Module.mc;
16
17
import net.minecraft.client.KeyboardHandler;
18
import net.minecraft.client.input.KeyEvent;
19
20
@Mixin(KeyboardHandler.class)
21
public class MixinKeyboard {
22
23
    @Inject(method = "keyPress", at = @At("HEAD"), cancellable = true)
24
    private void onKey(long windowPointer, int action, KeyEvent keyEvent, CallbackInfo ci) {
25
        int key = keyEvent.key();
26
        int scanCode = keyEvent.scancode();
27
        if(Module.fullNullCheck()) return;
28
        boolean whitelist = mc.gui.screen() == null || mc.gui.screen() instanceof ClickGUI || mc.gui.screen() instanceof HudEditorGui;
29
        if (!whitelist) return;
30
31
        if (action == 0) Managers.MODULE.onKeyReleased(key);
32
        if (action == 1) Managers.MODULE.onKeyPressed(key);
33
        if (action == 2) action = 1;
34
35
        switch (action) {
36
            case 0 -> {
37
                EventKeyRelease event = new EventKeyRelease(key, scanCode);
38
                ThunderHack.EVENT_BUS.post(event);
39
                if (event.isCancelled()) ci.cancel();
40
            }
41
            case 1 -> {
42
                EventKeyPress event = new EventKeyPress(key, scanCode);
43
                ThunderHack.EVENT_BUS.post(event);
44
                if (event.isCancelled()) ci.cancel();
45
            }
46
        }
47
    }
48
}
MixinKeyboardInputsrc/main/java/thunder/hack/injection/MixinKeyboardInput.javaJava · 22 lines · 800 B
@Mixin(KeyboardInput.class)
MixinKeyboardInput.javaJava · 22 lines · 800 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.player.KeyboardInput;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.injection.At;
6
import org.spongepowered.asm.mixin.injection.Inject;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
8
import thunder.hack.ThunderHack;
9
import thunder.hack.events.impl.EventKeyboardInput;
10
import thunder.hack.features.modules.Module;
11
12
@Mixin(KeyboardInput.class)
13
public class MixinKeyboardInput {
14
    @Inject(method = "tick", at = @At("HEAD"), cancellable = true)
15
    private void onSneak(CallbackInfo ci) {
16
        if(Module.fullNullCheck()) return;
17
        EventKeyboardInput event = new EventKeyboardInput();
18
        ThunderHack.EVENT_BUS.post(event);
19
        if (event.isCancelled()) ci.cancel();
20
    }
21
}
22
MixinLightmapTextureManagersrc/main/java/thunder/hack/injection/MixinLightmapTextureManager.javaJava · 25 lines · 1.0 KB
@Mixin(Lightmap.class)
ModifiesLightmap
MixinLightmapTextureManager.javaJava · 25 lines · 1.0 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.manager.client.ModuleManager;
4
import thunder.hack.features.modules.render.Fullbright;
5
import net.minecraft.client.renderer.Lightmap;
6
import net.minecraft.util.Mth;
7
import net.minecraft.world.level.dimension.DimensionType;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.Inject;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
12
13
@Mixin(Lightmap.class)
14
public class MixinLightmapTextureManager {
15
16
    @Inject(method = "getBrightness", at = @At("HEAD"), cancellable = true)
17
    private static void getBrightnessHook(DimensionType type, int lightLevel, CallbackInfoReturnable<Float> cir) {
18
        if (ModuleManager.fullbright.isEnabled()) {
19
            float f = (float)lightLevel / 15.0F;
20
            float g = f / (4.0F - 3.0F * f);
21
            cir.setReturnValue(Math.max(Mth.lerp(type.ambientLight(), g, 1.0F), Fullbright.minBright.getValue()));
22
        }
23
    }
24
}
25
MixinLivingEntityRenderersrc/main/java/thunder/hack/injection/MixinLivingEntityRenderer.javaJava · 165 lines · 7.9 KB
@Mixin(LivingEntityRenderer.class)
MixinLivingEntityRenderer.javaJava · 165 lines · 7.9 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.Shadow;
5
import org.spongepowered.asm.mixin.Unique;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.ModifyArgs;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
11
import thunder.hack.ThunderHack;
12
import thunder.hack.core.Managers;
13
import thunder.hack.core.manager.client.ModuleManager;
14
import thunder.hack.injection.accesors.IClientPlayerEntity;
15
import thunder.hack.injection.accesors.IEntity;
16
import thunder.hack.injection.accesors.ILivingEntity;
17
import thunder.hack.features.modules.Module;
18
import thunder.hack.features.modules.client.ClientSettings;
19
import thunder.hack.utility.math.MathUtility;
20
import thunder.hack.utility.render.Render2DEngine;
21
import thunder.hack.utility.render.Render3DEngine;
22
import thunder.hack.utility.render.compat.RenderSystem;
23
24
import static thunder.hack.features.modules.Module.mc;
25
26
import com.mojang.blaze3d.vertex.PoseStack;
27
import net.minecraft.client.Minecraft;
28
import net.minecraft.client.model.EntityModel;
29
import net.minecraft.client.renderer.SubmitNodeCollector;
30
import net.minecraft.client.renderer.state.level.CameraRenderState;
31
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
32
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
33
import net.minecraft.core.Direction;
34
import net.minecraft.util.Mth;
35
import net.minecraft.world.entity.Entity;
36
import net.minecraft.world.entity.LivingEntity;
37
import net.minecraft.world.entity.Pose;
38
import net.minecraft.world.entity.player.Player;
39
40
@Mixin(LivingEntityRenderer.class)
41
public abstract class MixinLivingEntityRenderer {
42
    private LivingEntity lastEntity;
43
44
    private float originalHeadYaw, originalPrevHeadYaw, originalPrevHeadPitch, originalHeadPitch;
45
46
    @Shadow
47
    protected EntityModel<LivingEntityRenderState> model;
48
49
    @Inject(method = "extractRenderState", at = @At("HEAD"))
50
    private void onUpdateRenderState(LivingEntity entity, LivingEntityRenderState state, float tickDelta, CallbackInfo ci) {
51
        lastEntity = entity;
52
    }
53
54
    @Inject(method = "submit", at = @At("HEAD"), cancellable = true)
55
    public void onRenderPre(LivingEntityRenderState state, PoseStack matrixStack, SubmitNodeCollector vertexConsumerProvider, CameraRenderState cameraState, CallbackInfo ci) {
56
        if (Module.fullNullCheck()) return;
57
        if (lastEntity == null) return;
58
59
        LivingEntity livingEntity = lastEntity;
60
        if (mc.player != null && livingEntity == mc.player && mc.player.getControlledVehicle() == null && ClientSettings.renderRotations.getValue() && !ThunderHack.isFuturePresent()) {
61
            originalHeadYaw = livingEntity.yHeadRot;
62
            originalPrevHeadYaw = ((ILivingEntity) livingEntity).getLastHeadYaw();
63
            originalPrevHeadPitch = ((IEntity) livingEntity).getLastPitch();
64
            originalHeadPitch = livingEntity.getXRot();
65
66
            livingEntity.setXRot(((IEntity) Minecraft.getInstance().player).getLastPitch());
67
            ((IEntity) livingEntity).setLastPitch(Managers.PLAYER.lastPitch);
68
            livingEntity.yHeadRot = ((IEntity) Minecraft.getInstance().player).getLastYaw();
69
            livingEntity.yBodyRot = Render2DEngine.interpolateFloat(Managers.PLAYER.prevBodyYaw, Managers.PLAYER.bodyYaw, Render3DEngine.getTickDelta());
70
            ((ILivingEntity) livingEntity).setLastHeadYaw(Managers.PLAYER.lastYaw);
71
            ((ILivingEntity) livingEntity).setLastBodyYaw(Render2DEngine.interpolateFloat(Managers.PLAYER.prevBodyYaw, Managers.PLAYER.bodyYaw, Render3DEngine.getTickDelta()));
72
        }
73
74
        if (livingEntity != mc.player && ModuleManager.freeCam.isEnabled() && ModuleManager.freeCam.track.getValue() && ModuleManager.freeCam.trackEntity != null && ModuleManager.freeCam.trackEntity == livingEntity) {
75
            ci.cancel();
76
            return;
77
        }
78
79
        if (livingEntity instanceof Player pe && ModuleManager.chams.isEnabled() && ModuleManager.chams.players.getValue()) {
80
            // Chams render world space geometry outside the level frame graph, so they use the
81
            // level projection instead of the GUI one.
82
            RenderSystem.beginWorldDrawing();
83
            try {
84
                ModuleManager.chams.renderPlayer(pe, state.bodyRot, Render3DEngine.getTickDelta(), matrixStack, state.lightCoords, model, ci, () -> postRender(livingEntity));
85
            } finally {
86
                RenderSystem.endWorldDrawing();
87
            }
88
89
            if (!pe.isSpectator()) {
90
                float g = Render3DEngine.getTickDelta();
91
                float n;
92
                Direction direction;
93
                Entity entity;
94
                matrixStack.pushPose();
95
                float h = Mth.rotLerp(g, ((ILivingEntity) pe).getLastBodyYaw(), pe.yBodyRot);
96
                float j = Mth.rotLerp(g, ((ILivingEntity) pe).getLastHeadYaw(), pe.yHeadRot);
97
                float k = j - h;
98
                if (pe.isPassenger() && (entity = pe.getVehicle()) instanceof LivingEntity) {
99
                    LivingEntity livingEntity2 = (LivingEntity) entity;
100
                    h = Mth.rotLerp(g, ((ILivingEntity) livingEntity2).getLastBodyYaw(), livingEntity2.yBodyRot);
101
                    k = j - h;
102
                    float l = Mth.wrapDegrees(k);
103
                    if (l < -85.0f) {
104
                        l = -85.0f;
105
                    }
106
                    if (l >= 85.0f) {
107
                        l = 85.0f;
108
                    }
109
                    h = j - l;
110
                    if (l * l > 2500.0f) {
111
                        h += l * 0.2f;
112
                    }
113
                    k = j - h;
114
                }
115
                float m = Mth.lerp(g, ((IEntity) pe).getLastPitch(), pe.getXRot());
116
                if (("Dinnerbone".equals(pe.getName().getString()) || "Grumm".equals(pe.getName().getString()))) {
117
                    m *= -1.0f;
118
                    k *= -1.0f;
119
                }
120
                if (pe.hasPose(Pose.SLEEPING) && (direction = pe.getBedOrientation()) != null) {
121
                    n = pe.getEyeHeight(Pose.STANDING) - 0.1f;
122
                    matrixStack.translate((float) (-direction.getStepX()) * n, 0.0f, (float) (-direction.getStepZ()) * n);
123
                }
124
                float l = pe.tickCount + g;
125
                ModuleManager.chams.setupTransforms1(pe, matrixStack, l, h, g);
126
                matrixStack.scale(-1.0f, -1.0f, 1.0f);
127
                matrixStack.scale(0.9375f, 0.9375f, 0.9375f);
128
                matrixStack.translate(0.0f, -1.501f, 0.0f);
129
                n = 0.0f;
130
                float o = 0.0f;
131
                if (!pe.isPassenger() && pe.isAlive()) {
132
                    n = pe.walkAnimation.speed();
133
                    o = pe.walkAnimation.position(g);
134
                    if (pe.isBaby())
135
                        o *= 3.0f;
136
137
                    if (n > 1.0f)
138
                        n = 1.0f;
139
                }
140
                matrixStack.popPose();
141
            }
142
        }
143
    }
144
145
    @Unique
146
    public void postRender(LivingEntity livingEntity) {
147
        if (Module.fullNullCheck()) return;
148
        if (mc.player != null && livingEntity == mc.player && mc.player.getControlledVehicle() == null && ClientSettings.renderRotations.getValue() && !ThunderHack.isFuturePresent()) {
149
            ((IEntity) livingEntity).setLastPitch(originalPrevHeadPitch);
150
            livingEntity.setXRot(originalHeadPitch);
151
            livingEntity.yHeadRot = originalHeadYaw;
152
            ((ILivingEntity) livingEntity).setLastHeadYaw(originalPrevHeadYaw);
153
        }
154
    }
155
156
    @Inject(method = "submit", at = @At("TAIL"))
157
    public void onRenderPost(LivingEntityRenderState state, PoseStack matrixStack, SubmitNodeCollector vertexConsumerProvider, CameraRenderState cameraState, CallbackInfo ci) {
158
        if (Module.fullNullCheck()) return;
159
        if (lastEntity != null) {
160
            postRender(lastEntity);
161
        }
162
    }
163
164
}
165
MixinMinecraftClientsrc/main/java/thunder/hack/injection/MixinMinecraftClient.javaJava · 170 lines · 6.9 KB
@Mixin(Minecraft.class)
ModifiesMinecraft
MixinMinecraftClient.javaJava · 170 lines · 6.9 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.jetbrains.annotations.Nullable;
4
import org.lwjgl.glfw.GLFW;
5
import org.lwjgl.glfw.GLFWImage;
6
import org.lwjgl.system.MemoryStack;
7
import org.lwjgl.system.MemoryUtil;
8
import org.spongepowered.asm.mixin.Final;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.Shadow;
11
import org.spongepowered.asm.mixin.Unique;
12
import org.spongepowered.asm.mixin.injection.At;
13
import org.spongepowered.asm.mixin.injection.Inject;
14
import org.spongepowered.asm.mixin.injection.Redirect;
15
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
16
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
17
import thunder.hack.ThunderHack;
18
import thunder.hack.core.manager.client.ModuleManager;
19
import thunder.hack.events.impl.*;
20
import thunder.hack.gui.clickui.ClickGUI;
21
import thunder.hack.gui.font.FontRenderers;
22
import thunder.hack.features.modules.Module;
23
import thunder.hack.utility.render.WindowResizeCallback;
24
25
import java.io.IOException;
26
import java.io.InputStream;
27
import java.nio.ByteBuffer;
28
import java.util.ArrayList;
29
import java.util.List;
30
import net.minecraft.client.Minecraft;
31
import net.minecraft.client.gui.screens.Overlay;
32
import net.minecraft.client.gui.screens.Screen;
33
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen;
34
import net.minecraft.client.main.GameConfig;
35
import net.minecraft.client.multiplayer.ServerData;
36
import net.minecraft.server.packs.PackResources;
37
38
import static thunder.hack.features.modules.Module.mc;
39
40
import com.mojang.blaze3d.platform.IconSet;
41
import com.mojang.blaze3d.platform.MacosUtil;
42
import com.mojang.blaze3d.platform.NativeImage;
43
import com.mojang.blaze3d.platform.Window;
44
45
@Mixin(Minecraft.class)
46
public abstract class MixinMinecraftClient {
47
48
    @Shadow
49
    @Final
50
    private Window window;
51
52
    @Unique
53
    private String[] shittyServers = {
54
            "mineblaze",
55
            "musteryworld",
56
            "dexland",
57
            "masedworld",
58
            "vimeworld",
59
            "hypemc",
60
            "vimemc"
61
    };
62
63
    @Inject(method = "<init>", at = @At("TAIL"))
64
    void postWindowInit(GameConfig args, CallbackInfo ci) {
65
        try {
66
            FontRenderers.settings = FontRenderers.create(12f, "comfortaa");
67
            FontRenderers.modules = FontRenderers.create(15f, "comfortaa");
68
            FontRenderers.categories = FontRenderers.create(18f, "comfortaa");
69
            FontRenderers.thglitch = FontRenderers.create(36f, "glitched");
70
            FontRenderers.thglitchBig = FontRenderers.create(72f, "glitched");
71
            FontRenderers.monsterrat = FontRenderers.create(18f, "monsterrat");
72
            FontRenderers.sf_bold = FontRenderers.create(16f, "sf_bold");
73
            FontRenderers.sf_medium = FontRenderers.create(16f, "sf_medium");
74
            FontRenderers.sf_medium_mini = FontRenderers.create(12f, "sf_medium");
75
            FontRenderers.sf_medium_modules = FontRenderers.create(14f, "sf_medium");
76
            FontRenderers.sf_bold_mini = FontRenderers.create(14f, "sf_bold");
77
            FontRenderers.sf_bold_micro = FontRenderers.create(12f, "sf_bold");
78
            FontRenderers.profont = FontRenderers.create(16f, "profont");
79
            FontRenderers.icons = FontRenderers.create(20, "icons");
80
            FontRenderers.mid_icons = FontRenderers.create(46, "icons");
81
            FontRenderers.big_icons = FontRenderers.create(72, "icons");
82
            FontRenderers.source_han_sans_normal = FontRenderers.create(16f, "source_han_sans_normal");
83
        } catch (Exception e) {
84
            e.printStackTrace();
85
        }
86
    }
87
88
    @Inject(method = "tick", at = @At("HEAD"))
89
    void preTickHook(CallbackInfo ci) {
90
        if (!Module.fullNullCheck()) ThunderHack.EVENT_BUS.post(new EventTick());
91
    }
92
93
    @Inject(method = "tick", at = @At("RETURN"))
94
    void postTickHook(CallbackInfo ci) {
95
        if (!Module.fullNullCheck()) ThunderHack.EVENT_BUS.post(new EventPostTick());
96
    }
97
98
    @Inject(method = "resizeGui", at = @At("TAIL"))
99
    private void captureResize(CallbackInfo ci) {
100
        WindowResizeCallback.EVENT.invoker().onResized((Minecraft) (Object) this, this.window);
101
    }
102
103
104
    @Inject(method = "pickBlockOrEntity", at = @At("HEAD"), cancellable = true)
105
    private void doItemPickHook(CallbackInfo ci) {
106
        if (ModuleManager.middleClick.isEnabled() && ModuleManager.middleClick.antiPickUp.getValue())
107
            ci.cancel();
108
    }
109
110
    @Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/platform/Window;setIcon(Lnet/minecraft/server/packs/PackResources;Lcom/mojang/blaze3d/platform/IconSet;)V"))
111
    private void onChangeIcon(Window instance, PackResources resourcePack, IconSet icons) throws IOException {
112
        // RenderSystem.assertInInitPhase();
113
114
        if (GLFW.glfwGetPlatform() == 393218) {
115
            MacosUtil.loadIcon(icons.getMacIcon(resourcePack));
116
            return;
117
        }
118
119
        setWindowIcon(ThunderHack.class.getResourceAsStream("/icon.png"), ThunderHack.class.getResourceAsStream("/icon.png"));
120
    }
121
122
    public void setWindowIcon(InputStream img16x16, InputStream img32x32) {
123
        try (MemoryStack memorystack = MemoryStack.stackPush()) {
124
            GLFWImage.Buffer buffer = GLFWImage.malloc(2, memorystack);
125
            List<InputStream> imgList = List.of(img16x16, img32x32);
126
            List<ByteBuffer> buffers = new ArrayList<>();
127
128
            for (int i = 0; i < imgList.size(); i++) {
129
                NativeImage nativeImage = NativeImage.read(imgList.get(i));
130
                ByteBuffer bytebuffer = MemoryUtil.memAlloc(nativeImage.getWidth() * nativeImage.getHeight() * 4);
131
132
                bytebuffer.asIntBuffer().put(nativeImage.getPixels());
133
                buffer.position(i);
134
                buffer.width(nativeImage.getWidth());
135
                buffer.height(nativeImage.getHeight());
136
                buffer.pixels(bytebuffer);
137
138
                buffers.add(bytebuffer);
139
            }
140
141
            try {
142
                if (GLFW.glfwGetPlatform() != GLFW.GLFW_PLATFORM_WAYLAND) {
143
                    GLFW.glfwSetWindowIcon(mc.getWindow().handle(), buffer);
144
                }
145
            } catch (Exception ignored) {
146
            }
147
            buffers.forEach(MemoryUtil::memFree);
148
        } catch (IOException ignored) {
149
        }
150
    }
151
152
    @Inject(method = "startAttack", at = @At("HEAD"), cancellable = true)
153
    private void doAttackHook(CallbackInfoReturnable<Boolean> cir) {
154
        final EventAttack event = new EventAttack(null, true);
155
        ThunderHack.EVENT_BUS.post(event);
156
        if (event.isCancelled()) {
157
            cir.setReturnValue(false);
158
        }
159
    }
160
161
    @Inject(method = "continueAttack", at = @At("HEAD"), cancellable = true)
162
    private void handleBlockBreakingHook(boolean breaking, CallbackInfo ci) {
163
        EventHandleBlockBreaking event = new EventHandleBlockBreaking();
164
        ThunderHack.EVENT_BUS.post(event);
165
        if (event.isCancelled()) {
166
            ci.cancel();
167
        }
168
    }
169
}
170
MixinMobSpawnerBlockEntityRenderersrc/main/java/thunder/hack/injection/MixinMobSpawnerBlockEntityRenderer.javaJava · 20 lines · 785 B
@Mixin(SpawnerRenderer.class)
MixinMobSpawnerBlockEntityRenderer.javaJava · 20 lines · 785 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.renderer.blockentity.SpawnerRenderer;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.injection.At;
6
import org.spongepowered.asm.mixin.injection.Inject;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
8
import thunder.hack.core.manager.client.ModuleManager;
9
import thunder.hack.features.modules.Module;
10
11
@Mixin(SpawnerRenderer.class)
12
public class MixinMobSpawnerBlockEntityRenderer {
13
14
    @Inject(method = "submitEntityInSpawner", at = @At("HEAD"), cancellable = true)
15
    private static void renderHook(CallbackInfo ci) {
16
        if (!Module.fullNullCheck() && ModuleManager.noRender.isOn() && ModuleManager.noRender.spawnerEntity.getValue())
17
            ci.cancel();
18
    }
19
}
20
MixinMousesrc/main/java/thunder/hack/injection/MixinMouse.javaJava · 35 lines · 1.3 KB
@Mixin(MouseHandler.class)
ModifiesMouseHandler
MixinMouse.javaJava · 35 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7
import thunder.hack.ThunderHack;
8
import thunder.hack.core.Managers;
9
import thunder.hack.events.impl.EventMouse;
10
11
import static thunder.hack.features.modules.Module.mc;
12
13
import net.minecraft.client.MouseHandler;
14
import net.minecraft.client.input.MouseButtonInfo;
15
16
@Mixin(MouseHandler.class)
17
public class MixinMouse {
18
    @Inject(method = "onButton", at = @At("HEAD"))
19
    public void onMouseButtonHook(long window, MouseButtonInfo info, int action, CallbackInfo ci) {
20
        int button = info.button();
21
        if (window == mc.getWindow().handle()) {
22
            if (action == 0) Managers.MODULE.onMoseKeyReleased(button);
23
            if (action == 1) Managers.MODULE.onMoseKeyPressed(button);
24
25
            ThunderHack.EVENT_BUS.post(new EventMouse(button, action));
26
        }
27
    }
28
29
    @Inject(method = "onScroll", at = @At("HEAD"))
30
    private void onMouseScrollHook(long window, double horizontal, double vertical, CallbackInfo ci) {
31
        if (window == mc.getWindow().handle()) {
32
            ThunderHack.EVENT_BUS.post(new EventMouse((int) vertical, 2));
33
        }
34
    }
35
}
MixinMultiplayerScreensrc/main/java/thunder/hack/injection/MixinMultiplayerScreen.javaJava · 37 lines · 2.4 KB
@Mixin(JoinMultiplayerScreen.class)
MixinMultiplayerScreen.javaJava · 37 lines · 2.4 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7
import thunder.hack.core.manager.client.ModuleManager;
8
import thunder.hack.gui.windows.WindowsScreen;
9
import thunder.hack.gui.windows.impl.*;
10
11
import static thunder.hack.core.manager.IManager.mc;
12
13
import net.minecraft.client.gui.components.Button;
14
import net.minecraft.client.gui.screens.Screen;
15
import net.minecraft.client.gui.screens.multiplayer.JoinMultiplayerScreen;
16
import net.minecraft.network.chat.Component;
17
18
@Mixin(JoinMultiplayerScreen.class)
19
public abstract class MixinMultiplayerScreen extends Screen {
20
    public MixinMultiplayerScreen(Component title) {
21
        super(title);
22
    }
23
24
    @Inject(method = "init", at = @At("RETURN"))
25
    private void initHook(CallbackInfo ci) {
26
        Button.Builder builder = Button.builder(Component.literal("⚡"), button -> mc.gui.setScreen(
27
                new WindowsScreen(
28
                        MacroWindow.get(ModuleManager.windows.macroPos.getValue().getX() * mc.getWindow().getGuiScaledWidth(), ModuleManager.windows.macroPos.getValue().getY() * mc.getWindow().getGuiScaledHeight(), ModuleManager.windows.macroPos),
29
                        ConfigWindow.get(ModuleManager.windows.configPos.getValue().getX() * mc.getWindow().getGuiScaledWidth(), ModuleManager.windows.configPos.getValue().getY() * mc.getWindow().getGuiScaledHeight(), ModuleManager.windows.configPos),
30
                        FriendsWindow.get(ModuleManager.windows.friendPos.getValue().getX() * mc.getWindow().getGuiScaledWidth(), ModuleManager.windows.friendPos.getValue().getY() * mc.getWindow().getGuiScaledHeight(), ModuleManager.windows.friendPos),
31
                        WaypointWindow.get(ModuleManager.windows.waypointPos.getValue().getX() * mc.getWindow().getGuiScaledWidth(), ModuleManager.windows.waypointPos.getValue().getY() * mc.getWindow().getGuiScaledHeight(), ModuleManager.windows.waypointPos),
32
                        ProxyWindow.get(ModuleManager.windows.proxyPos.getValue().getX() * mc.getWindow().getGuiScaledWidth(), ModuleManager.windows.proxyPos.getValue().getY() * mc.getWindow().getGuiScaledHeight(), ModuleManager.windows.proxyPos)
33
                ))).size(60, 20);
34
        if (!ModuleManager.unHook.isEnabled())
35
            addRenderableWidget(builder.pos(width - 65, height - 25).build());
36
    }
37
}
MixinOtherClientPlayerEntitysrc/main/java/thunder/hack/injection/MixinOtherClientPlayerEntity.javaJava · 74 lines · 2.6 KB
@Mixin(RemotePlayer.class)
ModifiesRemotePlayer
MixinOtherClientPlayerEntity.javaJava · 74 lines · 2.6 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.authlib.GameProfile;
4
import net.minecraft.client.multiplayer.ClientLevel;
5
import net.minecraft.client.player.AbstractClientPlayer;
6
import net.minecraft.client.player.RemotePlayer;
7
import net.minecraft.world.phys.Vec3;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.Unique;
10
import thunder.hack.core.manager.client.ModuleManager;
11
import thunder.hack.features.modules.combat.Aura;
12
import thunder.hack.features.modules.misc.FakePlayer;
13
import thunder.hack.utility.interfaces.IEntityLiving;
14
import thunder.hack.utility.interfaces.IOtherClientPlayerEntity;
15
16
import static thunder.hack.features.modules.Module.mc;
17
18
@Mixin(RemotePlayer.class)
19
public class MixinOtherClientPlayerEntity extends AbstractClientPlayer implements IOtherClientPlayerEntity {
20
    @Unique private double backUpX, backUpY, backUpZ;
21
22
    public MixinOtherClientPlayerEntity(ClientLevel world, GameProfile profile) {
23
        super(world, profile);
24
    }
25
26
    public void resolve(Aura.Resolver mode) {
27
        if ((Object) this == FakePlayer.fakePlayer) {
28
            backUpY = -999;
29
            return;
30
        }
31
32
        backUpX = getX();
33
        backUpY = getY();
34
        backUpZ = getZ();
35
36
        if(mode == Aura.Resolver.BackTrack) {
37
            double minDst = 999d;
38
            Aura.Position bestPos = null;
39
            for (Aura.Position p : ((IEntityLiving) this).getPositionHistory()) {
40
                double dst = mc.player.distanceToSqr(p.getX(), p.getY(), p.getZ());
41
                if (dst < minDst) {
42
                    minDst = dst;
43
                    bestPos = p;
44
                }
45
            }
46
            if(bestPos != null) {
47
                setPos(bestPos.getX(), bestPos.getY(), bestPos.getZ());
48
                if(Aura.target == this)
49
                    ModuleManager.aura.resolvedBox = getBoundingBox();
50
            }
51
            return;
52
        }
53
54
        Vec3 from = new Vec3(((IEntityLiving) this).getPrevServerX(), ((IEntityLiving) this).getPrevServerY(), ((IEntityLiving) this).getPrevServerZ());
55
        Vec3 to = new Vec3(getX(), getY(), getZ());
56
57
        if(mode == Aura.Resolver.Advantage) {
58
            if (mc.player.distanceToSqr(from) > mc.player.distanceToSqr(to)) setPos(to.x, to.y, to.z);
59
            else setPos(from.x, from.y, from.z);
60
        } else {
61
            setPos(to.x, to.y, to.z);
62
        }
63
        if(Aura.target == this)
64
            ModuleManager.aura.resolvedBox = getBoundingBox();
65
    }
66
67
    public void releaseResolver() {
68
        if (backUpY != -999) {
69
            setPos(backUpX, backUpY, backUpZ);
70
            backUpY = -999;
71
        }
72
    }
73
}
74
MixinParticleManagersrc/main/java/thunder/hack/injection/MixinParticleManager.javaJava · 38 lines · 1.3 KB
@Mixin(ParticleEngine.class)
MixinParticleManager.javaJava · 38 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.client.Camera;
4
import net.minecraft.client.particle.*;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9
import thunder.hack.core.manager.client.ModuleManager;
10
import thunder.hack.features.modules.render.NoRender;
11
12
@Mixin(ParticleEngine.class)
13
public class MixinParticleManager {
14
    @Inject(at = @At("HEAD"), method = "add(Lnet/minecraft/client/particle/Particle;)V", cancellable = true)
15
    public void addParticleHook(Particle p, CallbackInfo e) {
16
        NoRender nR = ModuleManager.noRender;
17
18
        if(!nR.isEnabled())
19
            return;
20
        
21
        if (nR.elderGuardian.getValue() && p instanceof ElderGuardianParticle)
22
            e.cancel();
23
24
        if (nR.explosions.getValue() && p instanceof HugeExplosionParticle)
25
            e.cancel();
26
27
        if (nR.campFire.getValue() && p instanceof CampfireSmokeParticle)
28
            e.cancel();
29
30
        if (nR.breakParticles.getValue() && p instanceof TerrainParticle)
31
            e.cancel();
32
33
        if (nR.fireworks.getValue() && (p instanceof FireworkParticles.Starter || p instanceof FireworkParticles.OverlayParticle))
34
            e.cancel();
35
    }
36
37
}
38
MixinPlayerEntitysrc/main/java/thunder/hack/injection/MixinPlayerEntity.javaJava · 122 lines · 5.1 KB
@Mixin(value = Player.class, priority = 800)priority 800
ModifiesPlayer
MixinPlayerEntity.javaJava · 122 lines · 5.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
8
import thunder.hack.ThunderHack;
9
import thunder.hack.core.manager.client.ModuleManager;
10
import thunder.hack.events.impl.EventAttack;
11
import thunder.hack.events.impl.EventPlayerTravel;
12
import thunder.hack.features.modules.client.Media;
13
import thunder.hack.features.modules.combat.Aura;
14
import thunder.hack.features.modules.movement.AutoSprint;
15
import thunder.hack.features.modules.movement.Speed;
16
17
import static thunder.hack.features.modules.Module.mc;
18
19
import net.minecraft.network.chat.Component;
20
import net.minecraft.world.entity.Entity;
21
import net.minecraft.world.entity.MoverType;
22
import net.minecraft.world.entity.player.Player;
23
import net.minecraft.world.phys.Vec3;
24
25
@Mixin(value = Player.class, priority = 800)
26
public class MixinPlayerEntity {
27
    @Inject(method = "getCurrentItemAttackStrengthDelay", at = @At("HEAD"), cancellable = true)
28
    public void getAttackCooldownProgressPerTickHook(CallbackInfoReturnable<Float> cir) {
29
        if (ModuleManager.aura.isEnabled() && ModuleManager.aura.switchMode.getValue() == Aura.Switch.Silent) {
30
            cir.setReturnValue(12.5f);
31
        }
32
    }
33
34
    @Inject(method = "getDisplayName", at = @At("HEAD"), cancellable = true)
35
    public void getDisplayNameHook(CallbackInfoReturnable<Component> cir) {
36
        if (ModuleManager.media.isEnabled() && Media.nickProtect.getValue()) {
37
            cir.setReturnValue(Component.nullToEmpty("Protected"));
38
        }
39
    }
40
41
    @Inject(method = "attack", at = @At("RETURN"))
42
    public void attackAHook(Entity target, CallbackInfo callbackInfo) {
43
        if (ModuleManager.autoSprint.isEnabled() && AutoSprint.sprint.getValue()) {
44
            final float multiplier = 0.6f + 0.4f * AutoSprint.motion.getValue();
45
            mc.player.setDeltaMovement(mc.player.getDeltaMovement().x / 0.6 * multiplier, mc.player.getDeltaMovement().y, mc.player.getDeltaMovement().z / 0.6 * multiplier);
46
            mc.player.setSprinting(true);
47
        }
48
    }
49
50
    @Inject(method = "getSpeed", at = @At("HEAD"), cancellable = true)
51
    public void getMovementSpeedHook(CallbackInfoReturnable<Float> cir) {
52
        if (ModuleManager.speed.isEnabled() && ModuleManager.speed.mode.is(Speed.Mode.Vanilla)) {
53
            cir.setReturnValue(ModuleManager.speed.boostFactor.getValue());
54
        }
55
    }
56
57
    @Inject(method = "attack", at = @At("HEAD"), cancellable = true)
58
    private void attackAHook2(Entity target, CallbackInfo ci) {
59
        final EventAttack event = new EventAttack(target, false);
60
        ThunderHack.EVENT_BUS.post(event);
61
        if (event.isCancelled()) {
62
            ci.cancel();
63
        }
64
    }
65
66
    @Inject(method = "travel", at = @At("HEAD"), cancellable = true)
67
    private void onTravelhookPre(Vec3 movementInput, CallbackInfo ci) {
68
        if (mc.player == null)
69
            return;
70
71
        final EventPlayerTravel event = new EventPlayerTravel(movementInput, true);
72
        ThunderHack.EVENT_BUS.post(event);
73
        if (event.isCancelled()) {
74
            mc.player.move(MoverType.SELF, mc.player.getDeltaMovement());
75
            ci.cancel();
76
        }
77
    }
78
79
80
    @Inject(method = "travel", at = @At("RETURN"), cancellable = true)
81
    private void onTravelhookPost(Vec3 movementInput, CallbackInfo ci) {
82
        if (mc.player == null)
83
            return;
84
        final EventPlayerTravel event = new EventPlayerTravel(movementInput, false);
85
        ThunderHack.EVENT_BUS.post(event);
86
        if (event.isCancelled()) {
87
            mc.player.move(MoverType.SELF, mc.player.getDeltaMovement());
88
            ci.cancel();
89
        }
90
    }
91
92
    @Inject(method = "wantsToStopRiding", at = @At("HEAD"), cancellable = true)
93
    protected void shouldDismountHook(CallbackInfoReturnable<Boolean> cir) {
94
        if (ModuleManager.boatFly.isEnabled() && ModuleManager.boatFly.allowShift.getValue())
95
            cir.setReturnValue(false);
96
    }
97
98
    @Inject(method = "blockInteractionRange", at = @At("HEAD"), cancellable = true)
99
    public void getBlockInteractionRangeHook(CallbackInfoReturnable<Double> cir) {
100
        if (ModuleManager.reach.isEnabled()) {
101
            if (ModuleManager.reach.Creative.getValue() && mc.player.isCreative()) {
102
                cir.setReturnValue((double) ModuleManager.reach.creativeBlocksRange.getValue());
103
            }
104
            else {
105
                cir.setReturnValue((double) ModuleManager.reach.blocksRange.getValue());
106
            }
107
        }
108
    }
109
110
    @Inject(method = "entityInteractionRange", at = @At("HEAD"), cancellable = true)
111
    public void getEntityInteractionRangeHook(CallbackInfoReturnable<Double> cir) {
112
        if (ModuleManager.reach.isEnabled()) {
113
            if (ModuleManager.reach.Creative.getValue() && mc.player.isCreative()) {
114
                cir.setReturnValue((double) ModuleManager.reach.creativeEntityRange.getValue());
115
            }
116
            else {
117
                cir.setReturnValue((double) ModuleManager.reach.entityRange.getValue());
118
            }
119
        }
120
    }
121
}
122
MixinPlayerListEntrysrc/main/java/thunder/hack/injection/MixinPlayerListEntry.javaJava · 85 lines · 3.3 KB
@Mixin(PlayerInfo.class)
ModifiesPlayerInfo
MixinPlayerListEntry.javaJava · 85 lines · 3.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.authlib.GameProfile;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.Unique;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
10
import thunder.hack.core.manager.client.ModuleManager;
11
import thunder.hack.utility.CapeHandler;
12
import thunder.hack.utility.ThunderUtility;
13
14
import java.io.BufferedReader;
15
import java.io.InputStreamReader;
16
import java.net.URI;
17
import java.net.URL;
18
import java.util.Objects;
19
import net.minecraft.client.multiplayer.PlayerInfo;
20
import net.minecraft.core.ClientAsset;
21
import net.minecraft.resources.Identifier;
22
import net.minecraft.util.Util;
23
import net.minecraft.world.entity.player.PlayerSkin;
24
25
@Mixin(PlayerInfo.class)
26
public class MixinPlayerListEntry {
27
28
    @Unique
29
    private boolean loadedCapeTexture;
30
31
    @Unique
32
    private Identifier customCapeTexture;
33
34
    @Inject(method = "<init>(Lcom/mojang/authlib/GameProfile;Z)V", at = @At("TAIL"))
35
    private void initHook(GameProfile profile, boolean secureChatEnforced, CallbackInfo ci) {
36
        getTexture(profile);
37
    }
38
39
    @Inject(method = "getSkin", at = @At("TAIL"), cancellable = true)
40
    private void getCapeTexture(CallbackInfoReturnable<PlayerSkin> cir) {
41
        if (customCapeTexture != null) {
42
            PlayerSkin prev = cir.getReturnValue();
43
            ClientAsset.Texture cape = new ClientAsset.ResourceTexture(customCapeTexture);
44
            PlayerSkin newTextures = new PlayerSkin(prev.body(), cape, cape, prev.model(), prev.secure());
45
            cir.setReturnValue(newTextures);
46
        }
47
    }
48
49
    @Unique
50
    private void getTexture(GameProfile profile) {
51
        if (loadedCapeTexture) return;
52
        loadedCapeTexture = true;
53
        Util.backgroundExecutor().execute(() -> {
54
55
            if (ModuleManager.capes.isEnabled())
56
                CapeHandler.loadPlayerCape(profile, id -> {
57
                    customCapeTexture = id;
58
                });
59
60
            if (!ModuleManager.capes.thCapes.getValue()) return;
61
62
            for (String str : ThunderUtility.starGazer) {
63
                if (profile.name().toLowerCase().equals(str.toLowerCase()))
64
                    customCapeTexture = Identifier.fromNamespaceAndPath("thunderhack", "textures/capes/starcape.png");
65
            }
66
67
            try {
68
                URL capesList = URI.create("https://raw.githubusercontent.com/ulybaka1337/THRecodeImprovedUtil/main/capes/capeBase.txt").toURL();
69
                BufferedReader in = new BufferedReader(new InputStreamReader(capesList.openStream()));
70
                String inputLine;
71
                while ((inputLine = in.readLine()) != null) {
72
                    String colune = inputLine.trim();
73
                    String name = colune.split(":")[0];
74
                    String cape = colune.split(":")[1];
75
                    if (Objects.equals(profile.name(), name)) {
76
                        customCapeTexture = Identifier.fromNamespaceAndPath("thunderhack", "textures/capes/" + cape + ".png");
77
                        return;
78
                    }
79
                }
80
            } catch (Exception ignored) {
81
            }
82
        });
83
    }
84
}
85
MixinPlayerListHudsrc/main/java/thunder/hack/injection/MixinPlayerListHud.javaJava · 40 lines · 1.8 KB
@Mixin(PlayerTabOverlay.class)
MixinPlayerListHud.javaJava · 40 lines · 1.8 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
7
import thunder.hack.ThunderHack;
8
import thunder.hack.core.manager.client.ModuleManager;
9
import thunder.hack.features.modules.client.ClientSettings;
10
11
import java.util.Comparator;
12
import java.util.List;
13
import net.minecraft.Optionull;
14
import net.minecraft.client.gui.components.PlayerTabOverlay;
15
import net.minecraft.client.multiplayer.PlayerInfo;
16
import net.minecraft.world.level.GameType;
17
import net.minecraft.world.scores.PlayerTeam;
18
19
import static thunder.hack.features.modules.Module.mc;
20
21
@Mixin(PlayerTabOverlay.class)
22
public class MixinPlayerListHud {
23
    private static final Comparator<Object> ENTRY_ORDERING = Comparator.comparingInt((entry) -> ((PlayerInfo) entry).getGameMode() == GameType.SPECTATOR ? 1 : 0)
24
            .thenComparing((entry) -> Optionull.mapOrDefault(((PlayerInfo) entry).getTeam(), PlayerTeam::getName, ""))
25
            .thenComparing((entry) -> ((PlayerInfo) entry).getProfile().name(), String::compareToIgnoreCase);
26
27
    @Inject(method = "getPlayerInfos", at = @At("HEAD"), cancellable = true)
28
    private void collectPlayerEntriesHook(CallbackInfoReturnable<List<PlayerInfo>> cir) {
29
        if (ClientSettings.futureCompatibility.getValue())
30
            return;
31
32
        if (ThunderHack.isFuturePresent())
33
            return;
34
35
        if (ModuleManager.extraTab.isEnabled())
36
            cir.setReturnValue(mc.player.connection.getListedOnlinePlayers().stream().sorted(ENTRY_ORDERING).limit(1000).toList());
37
        else
38
            cir.setReturnValue(mc.player.connection.getListedOnlinePlayers().stream().sorted(ENTRY_ORDERING).limit(80).toList());
39
    }
40
}
MixinScoreBoardsrc/main/java/thunder/hack/injection/MixinScoreBoard.javaJava · 30 lines · 1.2 KB
@Mixin(Scoreboard.class)
ModifiesScoreboard
MixinScoreBoard.javaJava · 30 lines · 1.2 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
4
import net.minecraft.world.scores.PlayerTeam;
5
import net.minecraft.world.scores.Scoreboard;
6
import org.spongepowered.asm.mixin.Final;
7
import org.spongepowered.asm.mixin.Mixin;
8
import org.spongepowered.asm.mixin.Shadow;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.Inject;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12
13
@Mixin(Scoreboard.class)
14
public abstract class MixinScoreBoard {
15
    @Final
16
    @Shadow
17
    private Object2ObjectMap<String, PlayerTeam> teamsByPlayer;
18
19
    @Inject(method = "removePlayerFromTeam(Ljava/lang/String;Lnet/minecraft/world/scores/PlayerTeam;)V", at = @At("HEAD"), cancellable = true)
20
    public void removeScoreHolderFromTeamHook(String scoreHolderName, PlayerTeam team, CallbackInfo ci) {
21
        ci.cancel();
22
        if (teamsByPlayer.get(scoreHolderName) != team) {
23
            //("Player is either on another team or not on any team. Cannot remove from team '" + team.getName() + "'.");
24
            return;
25
        }
26
        teamsByPlayer.remove(scoreHolderName);
27
        team.getPlayers().remove(scoreHolderName);
28
    }
29
}
30
MixinScoreboardPlayerScoresrc/main/java/thunder/hack/injection/MixinScoreboardPlayerScore.javaJava · 9 lines · 203 B
@Mixin(PlayerScoreEntry.class)
MixinScoreboardPlayerScore.javaJava · 9 lines · 203 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.world.scores.PlayerScoreEntry;
4
import org.spongepowered.asm.mixin.Mixin;
5
6
@Mixin(PlayerScoreEntry.class)
7
public class MixinScoreboardPlayerScore {
8
9
}
MixinScreensrc/main/java/thunder/hack/injection/MixinScreen.javaJava · 140 lines · 6.7 KB
@Mixin(Screen.class)
ModifiesScreen
MixinScreen.javaJava · 140 lines · 6.7 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.brigadier.exceptions.CommandSyntaxException;
4
import com.mojang.logging.LogUtils;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.Shadow;
7
import org.spongepowered.asm.mixin.injection.At;
8
import org.spongepowered.asm.mixin.injection.Inject;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
11
import thunder.hack.ThunderHack;
12
import thunder.hack.core.Managers;
13
import thunder.hack.core.manager.client.CommandManager;
14
import thunder.hack.core.manager.client.ModuleManager;
15
import thunder.hack.core.manager.client.ProxyManager;
16
import thunder.hack.events.impl.ClientClickEvent;
17
import thunder.hack.gui.misc.DialogScreen;
18
import thunder.hack.features.modules.client.ClientSettings;
19
import thunder.hack.utility.math.MathUtility;
20
import thunder.hack.utility.render.Render2DEngine;
21
import thunder.hack.utility.render.TextureStorage;
22
23
import java.io.BufferedReader;
24
import java.io.File;
25
import java.io.FileReader;
26
import java.nio.file.Path;
27
import java.util.List;
28
import java.util.Objects;
29
import net.minecraft.client.Minecraft;
30
import net.minecraft.client.gui.GuiGraphicsExtractor;
31
import net.minecraft.client.gui.screens.Screen;
32
import net.minecraft.network.chat.Style;
33
34
import static thunder.hack.features.modules.Module.mc;
35
import static thunder.hack.features.modules.client.ClientSettings.isRu;
36
37
@Mixin(Screen.class)
38
public abstract class MixinScreen {
39
    @Inject(method = "handleComponentClicked", at = @At("HEAD"), cancellable = true, require = 0)
40
    private void onRunCommand(Style style, CallbackInfoReturnable<Boolean> cir) {
41
        if (Objects.requireNonNull(style.getClickEvent()) instanceof ClientClickEvent clientClickEvent && clientClickEvent.getValue().startsWith(Managers.COMMAND.getPrefix()))
42
            try {
43
                CommandManager manager = Managers.COMMAND;
44
                manager.getDispatcher().execute(clientClickEvent.getValue().substring(Managers.COMMAND.getPrefix().length()), manager.getSource());
45
                cir.setReturnValue(true);
46
            } catch (CommandSyntaxException ignored) {
47
            }
48
    }
49
50
    @Inject(method = "onFilesDrop", at = @At("HEAD"))
51
    public void filesDragged(List<Path> paths, CallbackInfo ci) {
52
        String configPath = paths.get(0).toString();
53
        File cfgFile = new File(configPath);
54
        String fileName = cfgFile.getName();
55
56
        if (fileName.contains(".th")) {
57
            DialogScreen dialogScreen = new DialogScreen(
58
                    TextureStorage.questionPic,
59
                    isRu() ? "Обнаружен конфиг!" : "Config detected!",
60
                    isRu() ? "Ты действительно хочешь загрузить " + fileName + "?" : "Are you sure you want to load " + fileName + "?",
61
                    isRu() ? "Да" : "Yes", 
62
                    isRu() ? "Нет" : "No",
63
                    () -> {
64
                        Managers.MODULE.onUnload("none");
65
                        Managers.CONFIG.load(cfgFile);
66
                        Managers.MODULE.onLoad("none");
67
                        mc.gui.setScreen(null);
68
                    }, () -> mc.gui.setScreen(null));
69
            mc.gui.setScreen(dialogScreen);
70
71
        } else if (fileName.contains(".txt")){
72
            DialogScreen dialogScreen2 = new DialogScreen(
73
                    TextureStorage.questionPic,
74
                    isRu() ? "Обнаружен текстовый файл!" : "Text file detected!",
75
                    isRu() ? "Импортировать файл " + fileName + " как" : "Import file " + fileName + " as",
76
                    isRu() ? "Прокси" : "Proxies", 
77
                    isRu() ? "Забить" : "Cancel",
78
                    () -> {
79
                        try {
80
                            try (BufferedReader reader = new BufferedReader(new FileReader(cfgFile))) {
81
                                while (reader.ready()) {
82
                                    String[] line = reader.readLine().split(":");
83
84
                                    String ip = line[0];
85
                                    String port = line[1];
86
                                    String login = line[2];
87
                                    String password = line[3];
88
89
                                    int p = 80;
90
91
                                    try {
92
                                        p = Integer.parseInt(port);
93
                                    } catch (Exception e) {
94
                                        LogUtils.getLogger().warn(e.getMessage());
95
                                    }
96
97
                                    Managers.PROXY.addProxy(new ProxyManager.ThProxy("Proxy" + (int) MathUtility.random(0, 10000), ip, p, login, password));
98
                                }
99
                            }
100
                        } catch (Exception ignored) {
101
                        }
102
                        mc.gui.setScreen(null);
103
                    },
104
                    () -> {
105
                        mc.gui.setScreen(null);
106
                    });
107
            mc.gui.setScreen(dialogScreen2);
108
        }
109
    }
110
111
    @Inject(method = "extractPanorama", at = @At("HEAD"), cancellable = true)
112
    public void renderPanoramaBackgroundHook(GuiGraphicsExtractor context, float delta, CallbackInfo ci) {
113
        if (ClientSettings.customPanorama.getValue() && mc.level == null) {
114
            ci.cancel();
115
            Render2DEngine.drawMainMenuShader(context.pose(), 0, 0, mc.getWindow().getGuiScaledWidth(), mc.getWindow().getGuiScaledHeight());
116
        }
117
    }
118
119
    @Inject(method = "extractTransparentBackground", at = @At("HEAD"), cancellable = true)
120
    private void renderInGameBackground(GuiGraphicsExtractor context, CallbackInfo info) {
121
        Render2DEngine.resetScissorStack();
122
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.disableGuiBackGround.getValue()) {
123
            info.cancel();
124
        }
125
        // Custom GUIs render their own background — skip vanilla to avoid double dark gradient
126
        if (mc.gui.screen() instanceof thunder.hack.gui.clickui.ClickGUI
127
            || mc.gui.screen() instanceof thunder.hack.gui.thundergui.ThunderGui
128
            || mc.gui.screen() instanceof thunder.hack.gui.windows.WindowsScreen) {
129
            info.cancel();
130
        }
131
    }
132
133
    @Inject(method = "extractBackground(Lnet/minecraft/client/gui/GuiGraphicsExtractor;IIF)V", at = @At("HEAD"), cancellable = true)
134
    public void onRenderBackground(GuiGraphicsExtractor context, int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
135
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.disableGuiBackGround.getValue() && mc.level != null) {
136
            ci.cancel();
137
        }
138
    }
139
}
140
MixinShulkerBoxBlocksrc/main/java/thunder/hack/injection/MixinShulkerBoxBlock.javaJava · 25 lines · 1.0 KB
@Mixin(Item.class)
ModifiesItem
MixinShulkerBoxBlock.javaJava · 25 lines · 1.0 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.manager.client.ModuleManager;
4
import thunder.hack.features.modules.render.Tooltips;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
9
10
import java.util.function.Consumer;
11
import net.minecraft.network.chat.Component;
12
import net.minecraft.world.item.Item;
13
import net.minecraft.world.item.ItemStack;
14
import net.minecraft.world.item.TooltipFlag;
15
import net.minecraft.world.item.component.TooltipDisplay;
16
17
@Mixin(Item.class)
18
public class MixinShulkerBoxBlock {
19
    @Inject(method = "appendHoverText", at = @At("HEAD"), cancellable = true)
20
    private void onAppendTooltip(ItemStack stack, Item.TooltipContext context, TooltipDisplay displayComponent, Consumer<Component> textConsumer, TooltipFlag options, CallbackInfo ci) {
21
        if (ModuleManager.tooltips == null) return;
22
        if (Tooltips.storage.getValue()) ci.cancel();
23
    }
24
}
25
MixinSignBlockEntityRenderersrc/main/java/thunder/hack/injection/MixinSignBlockEntityRenderer.javaJava · 23 lines · 1.1 KB
@Mixin(AbstractSignRenderer.class)
MixinSignBlockEntityRenderer.javaJava · 23 lines · 1.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.blaze3d.vertex.PoseStack;
4
import net.minecraft.client.renderer.SubmitNodeCollector;
5
import net.minecraft.client.renderer.blockentity.AbstractSignRenderer;
6
import net.minecraft.client.renderer.blockentity.state.SignRenderState;
7
import net.minecraft.core.BlockPos;
8
import net.minecraft.world.level.block.entity.SignText;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.injection.At;
11
import org.spongepowered.asm.mixin.injection.Inject;
12
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13
import thunder.hack.core.manager.client.ModuleManager;
14
15
@Mixin(AbstractSignRenderer.class)
16
public class MixinSignBlockEntityRenderer {
17
    @Inject(method = "submitSignText", at = {@At("HEAD")}, cancellable = true)
18
    public final void renderTextHook(SignRenderState state, PoseStack matrices, SubmitNodeCollector vertexConsumers, SignText signText, CallbackInfo ci) {
19
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.signText.getValue())
20
            ci.cancel();
21
    }
22
}
23
MixinSkinTexturessrc/main/java/thunder/hack/injection/MixinSkinTextures.javaJava · 22 lines · 868 B
@Mixin(PlayerSkin.class)
ModifiesPlayerSkin
MixinSkinTextures.javaJava · 22 lines · 868 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.resources.Identifier;
4
import net.minecraft.world.entity.player.PlayerSkin;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.injection.At;
7
import org.spongepowered.asm.mixin.injection.Inject;
8
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
9
import thunder.hack.core.manager.client.ModuleManager;
10
import thunder.hack.features.modules.client.Media;
11
import thunder.hack.utility.render.TextureStorage;
12
13
@Mixin(PlayerSkin.class)
14
public class MixinSkinTextures {
15
    @Inject(method = "body", at = @At("HEAD"), cancellable = true)
16
    public void getSkinTextureHook(CallbackInfoReturnable<Identifier> cir) {
17
        if (ModuleManager.media.isEnabled() && Media.skinProtect.getValue()) {
18
            cir.setReturnValue(TextureStorage.sunRiseSkin);
19
        }
20
    }
21
}
22
MixinSlimeBlocksrc/main/java/thunder/hack/injection/MixinSlimeBlock.javaJava · 22 lines · 882 B
@Mixin(SlimeBlock.class)
ModifiesSlimeBlock
MixinSlimeBlock.javaJava · 22 lines · 882 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.world.entity.Entity;
5
import net.minecraft.world.level.Level;
6
import net.minecraft.world.level.block.SlimeBlock;
7
import net.minecraft.world.level.block.state.BlockState;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.injection.At;
10
import org.spongepowered.asm.mixin.injection.Inject;
11
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
12
import thunder.hack.core.manager.client.ModuleManager;
13
14
@Mixin(SlimeBlock.class)
15
public class MixinSlimeBlock {
16
    @Inject(method = "stepOn", at = @At("HEAD"), cancellable = true)
17
    public void onSteppedOnHook(Level world, BlockPos pos, BlockState state, Entity entity, CallbackInfo ci) {
18
        if(ModuleManager.noSlow.isEnabled() && ModuleManager.noSlow.slime.getValue())
19
            ci.cancel();
20
    }
21
}
22
MixinSodiumBlockOcclusionCachesrc/main/java/thunder/hack/injection/MixinSodiumBlockOcclusionCache.javaJava · 27 lines · 1.3 KB
@Mixin(targets = "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache", remap = false)remap=false
Modifiesme.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache external mod
MixinSodiumBlockOcclusionCache.javaJava · 27 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.Direction;
5
import net.minecraft.world.level.BlockGetter;
6
import net.minecraft.world.level.block.FireBlock;
7
import net.minecraft.world.level.block.state.BlockState;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.Pseudo;
10
import org.spongepowered.asm.mixin.injection.At;
11
import org.spongepowered.asm.mixin.injection.Inject;
12
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
13
import thunder.hack.core.manager.client.ModuleManager;
14
import thunder.hack.features.modules.render.XRay;
15
16
@SuppressWarnings("UnresolvedMixinReference")
17
@Pseudo
18
@Mixin(targets = "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache", remap = false)
19
public class MixinSodiumBlockOcclusionCache {
20
    @Inject(method = "shouldDrawSide", at = @At("RETURN"), cancellable = true)
21
    void shouldDrawSideHook(BlockState state, BlockGetter view, BlockPos pos, Direction facing, CallbackInfoReturnable<Boolean> cir) {
22
        if (ModuleManager.xray.isEnabled() && ModuleManager.xray.wallHack.getValue())
23
            cir.setReturnValue(XRay.isCheckableOre(state.getBlock()));
24
        if(ModuleManager.autoAnchor.isEnabled() && state.getBlock() instanceof FireBlock)
25
            cir.setReturnValue(false);
26
    }
27
}
MixinSplashOverlaysrc/main/java/thunder/hack/injection/MixinSplashOverlay.javaJava · 123 lines · 5.0 KB
@Mixin(LoadingOverlay.class)
MixinSplashOverlay.javaJava · 123 lines · 5.0 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.utility.render.compat.RenderSystem;
4
import org.spongepowered.asm.mixin.Final;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.Shadow;
7
import org.spongepowered.asm.mixin.injection.At;
8
import org.spongepowered.asm.mixin.injection.Inject;
9
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
10
import thunder.hack.core.manager.client.ModuleManager;
11
import thunder.hack.features.modules.client.ClientSettings;
12
import thunder.hack.utility.render.Render2DEngine;
13
import thunder.hack.utility.render.TextureStorage;
14
15
import java.awt.*;
16
import java.util.Optional;
17
import java.util.function.Consumer;
18
import net.minecraft.client.gui.GuiGraphicsExtractor;
19
import net.minecraft.client.gui.screens.LoadingOverlay;
20
import net.minecraft.server.packs.resources.ReloadInstance;
21
import net.minecraft.util.Mth;
22
import net.minecraft.util.Util;
23
24
import static thunder.hack.features.modules.Module.mc;
25
26
@Mixin(LoadingOverlay.class)
27
public abstract class MixinSplashOverlay {
28
    @Final @Shadow private boolean fadeIn;
29
    @Shadow private float currentProgress;
30
    @Shadow private long fadeOutStart = -1L;
31
    @Shadow private long fadeInStart = -1L;
32
    @Final @Shadow private ReloadInstance reload;
33
    @Final @Shadow private Consumer<Optional<Throwable>> onFinish;
34
35
    @Inject(method = "extractRenderState", at = @At("HEAD"), cancellable = true)
36
    public void render(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta, CallbackInfo ci) {
37
        if (ModuleManager.unHook.isEnabled() || !ClientSettings.customLoadingScreen.getValue())
38
            return;
39
        ci.cancel();
40
        renderCustom(context, mouseX, mouseY, delta);
41
    }
42
43
    public void renderCustom(GuiGraphicsExtractor context, int mouseX, int mouseY, float delta) {
44
        int i = mc.getWindow().getGuiScaledWidth();
45
        int j = mc.getWindow().getGuiScaledHeight();
46
        long l = Util.getMillis();
47
        if (fadeIn && fadeInStart == -1L) {
48
            fadeInStart = l;
49
        }
50
51
        float f = fadeOutStart > -1L ? (float) (l - fadeOutStart) / 1000.0F : -1.0F;
52
        float g = fadeInStart > -1L ? (float) (l - fadeInStart) / 500.0F : -1.0F;
53
        float h;
54
        int k;
55
        if (f >= 1.0F) {
56
            if (mc.gui.screen() != null)
57
                mc.gui.screen().extractRenderState(context, 0, 0, delta);
58
59
            k = Mth.ceil((1.0F - Mth.clamp(f - 1.0F, 0.0F, 1.0F)) * 255.0F);
60
            context.fill(0, 0, i, j, withAlpha(new Color(0x070015).getRGB(), k));
61
            h = 1.0F - Mth.clamp(f - 1.0F, 0.0F, 1.0F);
62
        } else if (fadeIn) {
63
            if (mc.gui.screen() != null && g < 1.0F)
64
                mc.gui.screen().extractRenderState(context, mouseX, mouseY, delta);
65
66
            k = Mth.ceil(Mth.clamp((double) g, 0.15, 1.0) * 255.0);
67
            context.fill(0, 0, i, j, withAlpha(new Color(0x070015).getRGB(), k));
68
            h = Mth.clamp(g, 0.0F, 1.0F);
69
        } else {
70
            k = new Color(0x070015).getRGB();
71
            float m = (float) (k >> 16 & 255) / 255.0F;
72
            float n = (float) (k >> 8 & 255) / 255.0F;
73
            float o = (float) (k & 255) / 255.0F;
74
            RenderSystem.clearColor(m, n, o, 1.0F);
75
            RenderSystem.clear(16384);
76
            h = 1.0F;
77
        }
78
79
        k = (int) ((double) context.guiWidth() * 0.5);
80
        int p = (int) ((double) context.guiHeight() * 0.5);
81
82
        RenderSystem.enableBlend();
83
        RenderSystem.blendFunc(770, 1);
84
85
        int logoAlpha = Mth.ceil(Mth.clamp(h, 0.0F, 1.0F) * 255.0F);
86
        context.blit(net.minecraft.client.renderer.RenderPipelines.GUI_TEXTURED, TextureStorage.thLogo, k - 150, p - 35, 0, 0, 300, 70, 300, 70,
87
                withAlpha(new Color(0x1A1A1A).getRGB(), logoAlpha));
88
        Render2DEngine.addWindow(context.pose(),k - 150, p - 35, k - 150 + (300 * currentProgress), p + 35, 1f);
89
        context.blit(net.minecraft.client.renderer.RenderPipelines.GUI_TEXTURED, TextureStorage.thLogo, k - 150, p - 35, 0, 0, 300, 70, 300, 70,
90
                withAlpha(Color.WHITE.getRGB(), logoAlpha));
91
        Render2DEngine.popWindow();
92
93
        float t = this.reload.getActualProgress();
94
        this.currentProgress = Mth.clamp(this.currentProgress * 0.95F + t * 0.050000012F, 0.0F, 1.0F);
95
96
        RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
97
        RenderSystem.defaultBlendFunc();
98
        RenderSystem.disableBlend();
99
100
        if (f >= 2.0F) {
101
            mc.gui.setOverlay(null);
102
        }
103
104
        if (fadeOutStart == -1L && reload.isDone() && (!fadeIn || g >= 2.0F)) {
105
            try {
106
                reload.checkExceptions();
107
                onFinish.accept(Optional.empty());
108
            } catch (Throwable var23) {
109
                onFinish.accept(Optional.of(var23));
110
            }
111
112
            fadeOutStart = Util.getMillis();
113
            if (mc.gui.screen() != null) {
114
                mc.gui.screen().init(mc.getWindow().getGuiScaledWidth(), mc.getWindow().getGuiScaledHeight());
115
            }
116
        }
117
    }
118
119
    private static int withAlpha(int color, int alpha) {
120
        return color & 16777215 | alpha << 24;
121
    }
122
}
123
MixinSweetBerryBushBlocksrc/main/java/thunder/hack/injection/MixinSweetBerryBushBlock.javaJava · 23 lines · 1.0 KB
@Mixin(SweetBerryBushBlock.class)
MixinSweetBerryBushBlock.javaJava · 23 lines · 1.0 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.world.entity.Entity;
5
import net.minecraft.world.entity.InsideBlockEffectApplier;
6
import net.minecraft.world.level.Level;
7
import net.minecraft.world.level.block.SweetBerryBushBlock;
8
import net.minecraft.world.level.block.state.BlockState;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.injection.At;
11
import org.spongepowered.asm.mixin.injection.Inject;
12
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
13
import thunder.hack.core.manager.client.ModuleManager;
14
15
@Mixin(SweetBerryBushBlock.class)
16
public class MixinSweetBerryBushBlock {
17
    @Inject(method = "entityInside", at = @At("HEAD"), cancellable = true)
18
    public void onEntityCollisionHook(BlockState state, Level world, BlockPos pos, Entity entity, InsideBlockEffectApplier handler, boolean isClient, CallbackInfo ci) {
19
        if(ModuleManager.noSlow.isEnabled() && ModuleManager.noSlow.sweetBerryBush.getValue())
20
            ci.cancel();
21
    }
22
}
23
MixinTextVisitFactorysrc/main/java/thunder/hack/injection/MixinTextVisitFactory.javaJava · 31 lines · 1.4 KB
@Mixin(value = {StringDecomposer.class})
MixinTextVisitFactory.javaJava · 31 lines · 1.4 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import thunder.hack.core.manager.player.FriendManager;
4
import thunder.hack.core.manager.client.ModuleManager;
5
import thunder.hack.features.modules.misc.NameProtect;
6
import org.spongepowered.asm.mixin.Mixin;
7
import org.spongepowered.asm.mixin.injection.At;
8
import org.spongepowered.asm.mixin.injection.ModifyArg;
9
10
import static thunder.hack.features.modules.Module.mc;
11
12
import net.minecraft.util.StringDecomposer;
13
14
@Mixin(value = {StringDecomposer.class})
15
public class MixinTextVisitFactory {
16
    @ModifyArg(at = @At(value = "INVOKE", target = "Lnet/minecraft/util/StringDecomposer;iterateFormatted(Ljava/lang/String;ILnet/minecraft/network/chat/Style;Lnet/minecraft/network/chat/Style;Lnet/minecraft/util/FormattedCharSink;)Z", ordinal = 0), method = {"iterateFormatted(Ljava/lang/String;ILnet/minecraft/network/chat/Style;Lnet/minecraft/util/FormattedCharSink;)Z" }, index = 0)
17
    private static String adjustText(String text) {
18
        return protect(text);
19
    }
20
21
    private static String protect(String string) {
22
        if (!ModuleManager.nameProtect.isEnabled() || mc.player == null)
23
            return string;
24
        String me = mc.getUser().getName();
25
        if (string.contains(me) || (FriendManager.friends.stream().anyMatch(i -> i.contains(string)) && NameProtect.hideFriends.getValue()))
26
            return string.replace(me, NameProtect.getCustomName());
27
28
        return string;
29
    }
30
}
31
MixinTitleScreensrc/main/java/thunder/hack/injection/MixinTitleScreen.javaJava · 83 lines · 3.9 KB
@Mixin(TitleScreen.class)
ModifiesTitleScreen
MixinTitleScreen.javaJava · 83 lines · 3.9 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.fabricmc.loader.api.FabricLoader;
4
import net.minecraft.ChatFormatting;
5
import net.minecraft.client.gui.screens.ConfirmScreen;
6
import net.minecraft.client.gui.screens.Screen;
7
import net.minecraft.client.gui.screens.TitleScreen;
8
import net.minecraft.network.chat.Component;
9
import net.minecraft.util.Util;
10
import org.spongepowered.asm.mixin.Mixin;
11
import org.spongepowered.asm.mixin.injection.At;
12
import org.spongepowered.asm.mixin.injection.Inject;
13
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
14
import thunder.hack.ThunderHack;
15
import thunder.hack.gui.misc.DialogScreen;
16
import thunder.hack.gui.mainmenu.MainMenuScreen;
17
import thunder.hack.utility.render.TextureStorage;
18
import thunder.hack.core.manager.client.ModuleManager;
19
import thunder.hack.features.modules.client.ClientSettings;
20
21
import java.net.URI;
22
23
import static thunder.hack.features.modules.Module.mc;
24
import static thunder.hack.features.modules.client.ClientSettings.isRu;
25
26
import com.mojang.blaze3d.platform.InputConstants;
27
28
@Mixin(TitleScreen.class)
29
public class MixinTitleScreen extends Screen {
30
    protected MixinTitleScreen(Component title) {
31
        super(title);
32
    }
33
34
    @Inject(method = "init", at = @At("RETURN"))
35
    public void postInitHook(CallbackInfo ci) {
36
        if (ClientSettings.customMainMenu.getValue() && !MainMenuScreen.getInstance().confirm && ModuleManager.clickGui.getBind().getKey() != -1) {
37
            mc.gui.setScreen(MainMenuScreen.getInstance());
38
        }
39
        if (ModuleManager.clickGui.getBind().getKey() == -1) {
40
            DialogScreen dialogScreen2 = new DialogScreen(
41
                    TextureStorage.cutie,
42
                    isRu() ? "Спасибо что скачали ThunderHack!" : "Thank you for downloading ThunderHack!",
43
                    isRu() ? "Меню с функциями клиента открывается на клавишу - P" : "Menu with client modules is opened with the key - P",
44
                    isRu() ? "Зайти в майн" : "Join on minecraft",
45
                    isRu() ? "Закрыть майн" : "Close minecraft",
46
                    () -> {
47
                        ModuleManager.clickGui.setBind(InputConstants.getKey("key.keyboard.p").getValue(), false, false);
48
                        mc.gui.setScreen(MainMenuScreen.getInstance());
49
                    },
50
                    () -> {
51
                        ModuleManager.clickGui.setBind(InputConstants.getKey("key.keyboard.p").getValue(), false, false);
52
                        mc.stop();
53
                    }
54
            );
55
            DialogScreen dialogScreen1 = new DialogScreen(
56
                    TextureStorage.questionPic,
57
                    "Hello!",
58
                    "What's your language?",
59
                    "Русский",
60
                    "English",
61
                    () -> {
62
                        ClientSettings.language.setValue(ClientSettings.Language.RU);
63
                        mc.gui.setScreen(dialogScreen2);
64
                    },
65
                    () -> {
66
                        ClientSettings.language.setValue(ClientSettings.Language.ENG);
67
                        mc.gui.setScreen(dialogScreen2);
68
                    }
69
            );
70
            mc.gui.setScreen(dialogScreen1);
71
        }
72
73
        if (ThunderHack.isOutdated && !FabricLoader.getInstance().isDevelopmentEnvironment()) {
74
            mc.gui.setScreen(new ConfirmScreen(
75
                    confirm -> {
76
                        if (confirm) Util.getPlatform().openUri(URI.create("https://github.com/Pan4ur/ThunderHack-Recode/releases/download/latest/thunderhack-1.7.jar/"));
77
                        else mc.stop();
78
                    },
79
                    Component.nullToEmpty(ChatFormatting.RED + "You are using an outdated version of ThunderHack Recode"), Component.nullToEmpty("Please update to the latest release"), Component.nullToEmpty("Download"), Component.nullToEmpty("Quit Game")));
80
        }
81
    }
82
}
83
MixinTridentItemsrc/main/java/thunder/hack/injection/MixinTridentItem.javaJava · 46 lines · 2.0 KB
@Mixin(TridentItem.class)
ModifiesTridentItem
MixinTridentItem.javaJava · 46 lines · 2.0 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
7
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
8
import thunder.hack.ThunderHack;
9
import thunder.hack.core.manager.client.ModuleManager;
10
import thunder.hack.events.impl.UseTridentEvent;
11
12
import static thunder.hack.ThunderHack.mc;
13
14
import net.minecraft.world.InteractionHand;
15
import net.minecraft.world.InteractionResult;
16
import net.minecraft.world.entity.LivingEntity;
17
import net.minecraft.world.entity.player.Player;
18
import net.minecraft.world.item.ItemStack;
19
import net.minecraft.world.item.TridentItem;
20
import net.minecraft.world.item.enchantment.EnchantmentHelper;
21
import net.minecraft.world.level.Level;
22
23
@Mixin(TridentItem.class)
24
public abstract class MixinTridentItem {
25
26
    @Inject(method = "releaseUsing", at = @At(value = "HEAD"), cancellable = true)
27
    public void onStoppedUsingHook(ItemStack stack, Level world, LivingEntity user, int remainingUseTicks, CallbackInfoReturnable<Boolean> cir) {
28
        if (user == mc.player && EnchantmentHelper.getTridentSpinAttackStrength(stack, mc.player) > 0) {
29
            UseTridentEvent e = new UseTridentEvent();
30
            ThunderHack.EVENT_BUS.post(e);
31
            if (e.isCancelled()) {
32
                cir.setReturnValue(false);
33
            }
34
        }
35
    }
36
37
    @Inject(method = "use", at = @At(value = "HEAD"), cancellable = true)
38
    public void useHook(Level world, Player user, InteractionHand hand, CallbackInfoReturnable<InteractionResult> cir) {
39
        ItemStack itemStack = user.getItemInHand(hand);
40
        if (EnchantmentHelper.getTridentSpinAttackStrength(itemStack, user) > 0 && !user.isInWaterOrRain() && ModuleManager.tridentBoost.isEnabled() && ModuleManager.tridentBoost.anyWeather.getValue()) {
41
            user.startUsingItem(hand);
42
            cir.setReturnValue(InteractionResult.CONSUME);
43
        }
44
    }
45
}
46
MixinWorldsrc/main/java/thunder/hack/injection/MixinWorld.javaJava · 34 lines · 1.4 KB
@Mixin(Level.class)
ModifiesLevel
MixinWorld.javaJava · 34 lines · 1.4 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import org.spongepowered.asm.mixin.Mixin;
4
import org.spongepowered.asm.mixin.injection.At;
5
import org.spongepowered.asm.mixin.injection.Inject;
6
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
7
import thunder.hack.utility.world.ExplosionUtility;
8
9
import static thunder.hack.features.modules.Module.mc;
10
11
import net.minecraft.core.BlockPos;
12
import net.minecraft.world.level.Level;
13
import net.minecraft.world.level.block.Blocks;
14
import net.minecraft.world.level.block.state.BlockState;
15
import net.minecraft.world.level.chunk.LevelChunk;
16
17
@Mixin(Level.class)
18
public abstract class MixinWorld {
19
    @Inject(method = "getBlockState", at = @At("HEAD"), cancellable = true)
20
    public void blockStateHook(BlockPos pos, CallbackInfoReturnable<BlockState> cir) {
21
        if (ExplosionUtility.terrainIgnore && mc.level != null && !mc.level.isInWorldBounds(pos)) {
22
            LevelChunk worldChunk = mc.level.getChunk(pos.getX() >> 4, pos.getZ() >> 4);
23
24
            BlockState tempState = worldChunk.getBlockState(pos);
25
26
            if (tempState.getBlock() == Blocks.OBSIDIAN
27
                    || tempState.getBlock() == Blocks.BEDROCK
28
                    || tempState.getBlock() == Blocks.ENDER_CHEST
29
                    || tempState.getBlock() == Blocks.RESPAWN_ANCHOR
30
            ) return;
31
            cir.setReturnValue(Blocks.AIR.defaultBlockState());
32
        }
33
    }
34
}
MixinWorldChunksrc/main/java/thunder/hack/injection/MixinWorldChunk.javaJava · 28 lines · 1.0 KB
@Mixin({LevelChunk.class})
ModifiesLevelChunk
MixinWorldChunk.javaJava · 28 lines · 1.0 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.world.level.Level;
5
import net.minecraft.world.level.block.state.BlockState;
6
import net.minecraft.world.level.chunk.LevelChunk;
7
import org.spongepowered.asm.mixin.Final;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.Shadow;
10
import org.spongepowered.asm.mixin.injection.At;
11
import org.spongepowered.asm.mixin.injection.Inject;
12
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
13
import thunder.hack.ThunderHack;
14
import thunder.hack.events.impl.EventSetBlockState;
15
16
@Mixin({LevelChunk.class})
17
public class MixinWorldChunk {
18
19
    @Shadow @Final Level level;
20
21
    @Inject(method = "setBlockState", at = @At("RETURN"))
22
    private void setBlockStateHook(BlockPos pos, BlockState state, int flags, CallbackInfoReturnable<BlockState> cir) {
23
        if (level.isClientSide()) {
24
            ThunderHack.EVENT_BUS.post(new EventSetBlockState(pos, cir.getReturnValue(), state));
25
        }
26
    }
27
}
28
MixinWorldRenderersrc/main/java/thunder/hack/injection/MixinWorldRenderer.javaJava · 38 lines · 1.8 KB
@Mixin(LevelRenderer.class)
MixinWorldRenderer.javaJava · 38 lines · 1.8 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection;
2
3
import com.mojang.blaze3d.buffers.GpuBufferSlice;
4
import com.mojang.blaze3d.framegraph.FrameGraphBuilder;
5
import net.minecraft.client.renderer.LevelRenderer;
6
import net.minecraft.client.renderer.PostChain;
7
import net.minecraft.world.phys.Vec3;
8
import org.spongepowered.asm.mixin.Mixin;
9
import org.spongepowered.asm.mixin.injection.*;
10
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
11
import thunder.hack.core.Managers;
12
import thunder.hack.core.manager.client.ModuleManager;
13
import thunder.hack.core.manager.client.ShaderManager;
14
15
import static thunder.hack.features.modules.Module.mc;
16
17
@Mixin(LevelRenderer.class)
18
public abstract class MixinWorldRenderer {
19
20
    @Redirect(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/PostChain;addToFrame(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;IILnet/minecraft/client/renderer/PostChain$TargetBundle;)V", ordinal = 0))
21
    private void replaceShaderHook(PostChain instance, FrameGraphBuilder frameGraphBuilder, int width, int height, PostChain.TargetBundle framebufferSet) {
22
        ShaderManager.Shader shaders = ModuleManager.shaders.mode.getValue();
23
        if (ModuleManager.shaders.isEnabled() && mc.level != null) {
24
            if (Managers.SHADER.fullNullCheck()) return;
25
            Managers.SHADER.setupShader(shaders, Managers.SHADER.getShaderOutline(shaders));
26
        } else {
27
            instance.addToFrame(frameGraphBuilder, width, height, framebufferSet);
28
        }
29
    }
30
31
    @Inject(method = "addWeatherPass", at = @At("HEAD"), cancellable = true)
32
    private void renderWeatherHook(FrameGraphBuilder frameGraphBuilder, GpuBufferSlice fog, CallbackInfo ci) {
33
        if (ModuleManager.noRender.isEnabled() && ModuleManager.noRender.noWeather.getValue()) {
34
            ci.cancel();
35
        }
36
    }
37
}
38
AccessiblePassesShaderEffectsrc/main/java/thunder/hack/injection/accesors/AccessiblePassesShaderEffect.javaJava · 32 lines · 1.1 KB
@Mixin(PostChain.class)
ModifiesPostChain
AccessiblePassesShaderEffect.javaJava · 32 lines · 1.1 KB · complete file, verbatimOriginal ↗
1
/*
2
 * Satin
3
 * Copyright (C) 2019-2024 Ladysnake
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU Lesser General Public
7
 * License as published by the Free Software Foundation; either
8
 * version 3 of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public License
16
 * along with this program; If not, see <https://www.gnu.org/licenses>.
17
 */
18
package thunder.hack.injection.accesors;
19
20
import org.spongepowered.asm.mixin.Mixin;
21
import org.spongepowered.asm.mixin.gen.Accessor;
22
23
import java.util.List;
24
import net.minecraft.client.renderer.PostChain;
25
import net.minecraft.client.renderer.PostPass;
26
27
@Mixin(PostChain.class)
28
public interface AccessiblePassesShaderEffect {
29
    @Accessor
30
    List<PostPass> getPasses();
31
}
32
IAreaEffectCloudEntitysrc/main/java/thunder/hack/injection/accesors/IAreaEffectCloudEntity.javaJava · 13 lines · 396 B
@Mixin(AreaEffectCloud.class)
IAreaEffectCloudEntity.javaJava · 13 lines · 396 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.world.entity.AreaEffectCloud;
4
import net.minecraft.world.item.alchemy.PotionContents;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.gen.Accessor;
7
8
@Mixin(AreaEffectCloud.class)
9
public interface IAreaEffectCloudEntity {
10
    @Accessor("potionContents")
11
    PotionContents getPotionContentsComponent();
12
}
13
IBeaconBlockEntitysrc/main/java/thunder/hack/injection/accesors/IBeaconBlockEntity.javaJava · 12 lines · 323 B
@Mixin(BeaconBlockEntity.class)
IBeaconBlockEntity.javaJava · 12 lines · 323 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.world.level.block.entity.BeaconBlockEntity;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.gen.Accessor;
6
7
@Mixin(BeaconBlockEntity.class)
8
public interface IBeaconBlockEntity {
9
    @Accessor(value = "levels")
10
    int getLevel();
11
}
12
IClientPlayerEntitysrc/main/java/thunder/hack/injection/accesors/IClientPlayerEntity.javaJava · 16 lines · 449 B
@Mixin(LocalPlayer.class)
ModifiesLocalPlayer
IClientPlayerEntity.javaJava · 16 lines · 449 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.player.LocalPlayer;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.gen.Accessor;
6
import org.spongepowered.asm.mixin.gen.Invoker;
7
8
@Mixin(LocalPlayer.class)
9
public interface IClientPlayerEntity {
10
    @Invoker(value = "sendPosition")
11
    void iSendMovementPackets();
12
13
    @Accessor(value = "jumpRidingScale")
14
    void setMountJumpStrength(float v);
15
}
16
IClientWorldMixinsrc/main/java/thunder/hack/injection/accesors/IClientWorldMixin.javaJava · 12 lines · 435 B
@Mixin(ClientLevel.class)
ModifiesClientLevel
IClientWorldMixin.javaJava · 12 lines · 435 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.multiplayer.ClientLevel;
4
import net.minecraft.client.multiplayer.prediction.BlockStatePredictionHandler;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.gen.Accessor;
7
8
@Mixin(ClientLevel.class)
9
public interface IClientWorldMixin {
10
    @Accessor("blockStatePredictionHandler")
11
    BlockStatePredictionHandler getPendingUpdateManager();
12
}
IEntitysrc/main/java/thunder/hack/injection/accesors/IEntity.javaJava · 32 lines · 744 B
@Mixin(Entity.class)
ModifiesEntity
IEntity.javaJava · 32 lines · 744 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.world.entity.Entity;
5
import net.minecraft.world.phys.Vec3;
6
import org.spongepowered.asm.mixin.Mixin;
7
import org.spongepowered.asm.mixin.Mutable;
8
import org.spongepowered.asm.mixin.gen.Accessor;
9
10
@Mixin(Entity.class)
11
public interface IEntity {
12
    @Mutable
13
    @Accessor("position")
14
    void thunderHack$setPosition(Vec3 pos);
15
16
    @Mutable
17
    @Accessor("blockPosition")
18
    void thunderHack$setBlockPosition(BlockPos blockPos);
19
20
    @Accessor("yRotO")
21
    float getLastYaw();
22
23
    @Accessor("yRotO")
24
    void setLastYaw(float yaw);
25
26
    @Accessor("xRotO")
27
    float getLastPitch();
28
29
    @Accessor("xRotO")
30
    void setLastPitch(float pitch);
31
}
32
IEntityRenderDispatchersrc/main/java/thunder/hack/injection/accesors/IEntityRenderDispatcher.javaJava · 13 lines · 437 B
@Mixin(EntityRenderDispatcher.class)
IEntityRenderDispatcher.javaJava · 13 lines · 437 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.renderer.entity.EntityRenderDispatcher;
4
import net.minecraft.client.resources.model.EquipmentAssetManager;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.gen.Accessor;
7
8
@Mixin(EntityRenderDispatcher.class)
9
public interface IEntityRenderDispatcher {
10
    @Accessor("equipmentAssets")
11
    EquipmentAssetManager getEquipmentModelLoader();
12
}
13
IExplosionS2CPacketsrc/main/java/thunder/hack/injection/accesors/IExplosionS2CPacket.javaJava · 19 lines · 574 B
@Mixin(ClientboundExplodePacket.class)
IExplosionS2CPacket.javaJava · 19 lines · 574 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import java.util.Optional;
4
import net.minecraft.network.protocol.game.ClientboundExplodePacket;
5
import net.minecraft.world.phys.Vec3;
6
import org.spongepowered.asm.mixin.Mixin;
7
import org.spongepowered.asm.mixin.Mutable;
8
import org.spongepowered.asm.mixin.gen.Accessor;
9
10
@Mixin(ClientboundExplodePacket.class)
11
public interface IExplosionS2CPacket {
12
    @Mutable
13
    @Accessor("playerKnockback")
14
    void setPlayerKnockback(Optional<Vec3> playerKnockback);
15
16
    @Accessor("playerKnockback")
17
    Optional<Vec3> getPlayerKnockback();
18
}
19
IFrustumsrc/main/java/thunder/hack/injection/accesors/IFrustum.javaJava · 32 lines · 630 B
@Mixin(Frustum.class)
ModifiesFrustum
IFrustum.javaJava · 32 lines · 630 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.renderer.culling.Frustum;
4
import org.joml.FrustumIntersection;
5
import org.joml.Vector4f;
6
import org.spongepowered.asm.mixin.Mixin;
7
import org.spongepowered.asm.mixin.gen.Accessor;
8
9
@Mixin(Frustum.class)
10
public interface IFrustum {
11
    @Accessor
12
    FrustumIntersection getIntersection();
13
14
    @Accessor("camX")
15
    double getX();
16
17
    @Accessor("camX")
18
    void setX(double x);
19
20
    @Accessor("camY")
21
    double getY();
22
23
    @Accessor("camY")
24
    void setY(double y);
25
26
    @Accessor("camZ")
27
    double getZ();
28
29
    @Accessor("camZ")
30
    void setZ(double z);
31
}
32
IGameMessageS2CPacketsrc/main/java/thunder/hack/injection/accesors/IGameMessageS2CPacket.javaJava · 15 lines · 454 B
@Mixin(ClientboundSystemChatPacket.class)
IGameMessageS2CPacket.javaJava · 15 lines · 454 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.network.chat.Component;
4
import net.minecraft.network.protocol.game.ClientboundSystemChatPacket;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.Mutable;
7
import org.spongepowered.asm.mixin.gen.Accessor;
8
9
@Mixin(ClientboundSystemChatPacket.class)
10
public interface IGameMessageS2CPacket {
11
    @Mutable
12
    @Accessor("content")
13
    void setContent(Component val);
14
}
15
IGameRenderersrc/main/java/thunder/hack/injection/accesors/IGameRenderer.javaJava · 14 lines · 464 B
@Mixin(GameRenderer.class)
ModifiesGameRenderer
IGameRenderer.javaJava · 14 lines · 464 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.renderer.GameRenderer;
4
import net.minecraft.client.renderer.state.level.CameraRenderState;
5
import org.joml.Matrix4fc;
6
import org.spongepowered.asm.mixin.Mixin;
7
import org.spongepowered.asm.mixin.gen.Invoker;
8
9
@Mixin(GameRenderer.class)
10
public interface IGameRenderer {
11
    @Invoker("renderItemInHand")
12
    void irenderHand(CameraRenderState cameraState, float tickDelta, Matrix4fc matrix4f);
13
}
14
IGuiRenderersrc/main/java/thunder/hack/injection/accesors/IGuiRenderer.javaJava · 17 lines · 421 B
@Mixin(GuiRenderer.class)
ModifiesGuiRenderer
IGuiRenderer.javaJava · 17 lines · 421 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.gui.render.GuiRenderer;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.gen.Accessor;
6
7
import java.util.List;
8
9
@Mixin(GuiRenderer.class)
10
public interface IGuiRenderer {
11
    @Accessor("firstDrawIndexAfterBlur")
12
    int thunderhack$getFirstDrawIndexAfterBlur();
13
14
    @Accessor("draws")
15
    List<?> thunderhack$getDraws();
16
}
17
IHeldItemRenderersrc/main/java/thunder/hack/injection/accesors/IHeldItemRenderer.javaJava · 27 lines · 804 B
@Mixin(ItemInHandRenderer.class)
ModifiesItemInHandRenderer not in 26.3
IHeldItemRenderer.javaJava · 27 lines · 804 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.renderer.ItemInHandRenderer;
4
import net.minecraft.world.item.ItemStack;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.gen.Accessor;
7
8
@Mixin(ItemInHandRenderer.class)
9
public interface IHeldItemRenderer {
10
    @Accessor(value="mainHandHeight")
11
    void setEquippedProgressMainHand(float var1);
12
13
    @Accessor(value="offHandHeight")
14
    void setEquippedProgressOffHand(float var1);
15
16
    @Accessor(value="mainHandHeight")
17
    float getEquippedProgressMainHand();
18
19
    @Accessor(value="offHandHeight")
20
    float getEquippedProgressOffHand();
21
22
    @Accessor(value="mainHandItem")
23
    void setItemStackMainHand(ItemStack var1);
24
25
    @Accessor(value="offHandItem")
26
    void setItemStackOffHand(ItemStack var1);
27
}
IInputsrc/main/java/thunder/hack/injection/accesors/IInput.javaJava · 23 lines · 588 B
@Mixin(ClientInput.class)
ModifiesClientInput
IInput.javaJava · 23 lines · 588 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.player.ClientInput;
4
import net.minecraft.world.entity.player.Input;
5
import net.minecraft.world.phys.Vec2;
6
import org.spongepowered.asm.mixin.Mixin;
7
import org.spongepowered.asm.mixin.gen.Accessor;
8
9
@Mixin(ClientInput.class)
10
public interface IInput {
11
    @Accessor("moveVector")
12
    Vec2 getMovementVector();
13
14
    @Accessor("moveVector")
15
    void setMovementVector(Vec2 movementVector);
16
17
    @Accessor("keyPresses")
18
    Input getPlayerInput();
19
20
    @Accessor("keyPresses")
21
    void setPlayerInput(Input playerInput);
22
}
23
IInteractionManagersrc/main/java/thunder/hack/injection/accesors/IInteractionManager.javaJava · 18 lines · 543 B
@Mixin(MultiPlayerGameMode.class)
IInteractionManager.javaJava · 18 lines · 543 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.multiplayer.MultiPlayerGameMode;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.gen.Accessor;
6
import org.spongepowered.asm.mixin.gen.Invoker;
7
8
@Mixin(MultiPlayerGameMode.class)
9
public interface IInteractionManager {
10
    @Accessor(value = "destroyProgress")
11
    float getCurBlockDamageMP();
12
13
    @Accessor(value = "destroyProgress")
14
    void setCurBlockDamageMP(float a);
15
16
    @Invoker(value = "ensureHasSentCarriedItem")
17
    void syncSlot();
18
}
ILivingEntitysrc/main/java/thunder/hack/injection/accesors/ILivingEntity.javaJava · 30 lines · 692 B
@Mixin(LivingEntity.class)
ModifiesLivingEntity
ILivingEntity.javaJava · 30 lines · 692 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.world.entity.LivingEntity;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.gen.Accessor;
6
7
@Mixin(LivingEntity.class)
8
public interface ILivingEntity {
9
    @Accessor("attackStrengthTicker")
10
    int getLastAttackedTicks();
11
12
    @Accessor("yBodyRotO")
13
    float getLastBodyYaw();
14
15
    @Accessor("yBodyRotO")
16
    void setLastBodyYaw(float bodyYaw);
17
18
    @Accessor("yHeadRotO")
19
    float getLastHeadYaw();
20
21
    @Accessor("yHeadRotO")
22
    void setLastHeadYaw(float headYaw);
23
24
    @Accessor("noJumpDelay")
25
    int getLastJumpCooldown();
26
27
    @Accessor("noJumpDelay")
28
    void setLastJumpCooldown(int val);
29
}
30
IMinecraftClientsrc/main/java/thunder/hack/injection/accesors/IMinecraftClient.javaJava · 48 lines · 1.3 KB
@Mixin(Minecraft.class)
ModifiesMinecraft
IMinecraftClient.javaJava · 48 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import com.mojang.authlib.minecraft.UserApiService;
4
import net.minecraft.client.Minecraft;
5
import net.minecraft.client.User;
6
import net.minecraft.client.gui.screens.social.PlayerSocialManager;
7
import net.minecraft.client.multiplayer.ProfileKeyPairManager;
8
import net.minecraft.client.multiplayer.chat.report.ReportingContext;
9
import org.spongepowered.asm.mixin.Mixin;
10
import org.spongepowered.asm.mixin.Mutable;
11
import org.spongepowered.asm.mixin.gen.Accessor;
12
import org.spongepowered.asm.mixin.gen.Invoker;
13
14
@Mixin(Minecraft.class)
15
public interface IMinecraftClient {
16
17
    @Accessor("rightClickDelay")
18
    int getUseCooldown();
19
20
    @Accessor("rightClickDelay")
21
    void setUseCooldown(int val);
22
23
    @Invoker("startUseItem")
24
    void idoItemUse();
25
26
    @Invoker("startAttack")
27
    boolean idoAttack();
28
29
    @Mutable
30
    @Accessor("profileKeyPairManager")
31
    void setProfileKeys(ProfileKeyPairManager keys);
32
33
    @Mutable
34
    @Accessor("user")
35
    void setSessionT(User session);
36
37
    @Mutable
38
    @Accessor
39
    void setUserApiService(UserApiService apiService);
40
41
    @Mutable
42
    @Accessor("playerSocialManager")
43
    void setSocialInteractionsManagerT(PlayerSocialManager socialInteractionsManager);
44
45
    @Mutable
46
    @Accessor("reportingContext")
47
    void setAbuseReportContextT(ReportingContext abuseReportContext);
48
}
INativeImagesrc/main/java/thunder/hack/injection/accesors/INativeImage.javaJava · 11 lines · 288 B
@Mixin(NativeImage.class)
ModifiesNativeImage
INativeImage.javaJava · 11 lines · 288 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import com.mojang.blaze3d.platform.NativeImage;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.gen.Accessor;
6
7
@Mixin(NativeImage.class)
8
public interface INativeImage {
9
    @Accessor("pixels")
10
    long getPointer();
11
}
IPlayerInteractBlockC2SPacketsrc/main/java/thunder/hack/injection/accesors/IPlayerInteractBlockC2SPacket.javaJava · 15 lines · 460 B
@Mixin(ServerboundUseItemOnPacket.class)
IPlayerInteractBlockC2SPacket.javaJava · 15 lines · 460 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket;
4
import net.minecraft.world.InteractionHand;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.Mutable;
7
import org.spongepowered.asm.mixin.gen.Accessor;
8
9
@Mixin(ServerboundUseItemOnPacket.class)
10
public interface IPlayerInteractBlockC2SPacket {
11
    @Mutable
12
    @Accessor("hand")
13
    void setHand(InteractionHand hand);
14
}
15
IPlayerMoveC2SPacketsrc/main/java/thunder/hack/injection/accesors/IPlayerMoveC2SPacket.javaJava · 17 lines · 470 B
@Mixin(ServerboundMovePlayerPacket.class)
IPlayerMoveC2SPacket.javaJava · 17 lines · 470 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.Mutable;
6
import org.spongepowered.asm.mixin.gen.Accessor;
7
8
@Mixin(ServerboundMovePlayerPacket.class)
9
public interface IPlayerMoveC2SPacket {
10
    @Mutable
11
    @Accessor("onGround")
12
    void setOnGround(boolean onGround);
13
14
    @Mutable
15
    @Accessor("y")
16
    void setY(double y);
17
}
IPlayerPositionLookS2CPacketsrc/main/java/thunder/hack/injection/accesors/IPlayerPositionLookS2CPacket.javaJava · 15 lines · 492 B
@Mixin(ClientboundPlayerPositionPacket.class)
IPlayerPositionLookS2CPacket.javaJava · 15 lines · 492 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket;
4
import net.minecraft.world.entity.PositionMoveRotation;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.Mutable;
7
import org.spongepowered.asm.mixin.gen.Accessor;
8
9
@Mixin(ClientboundPlayerPositionPacket.class)
10
public interface IPlayerPositionLookS2CPacket {
11
    @Mutable
12
    @Accessor("change")
13
    void setChange(PositionMoveRotation change);
14
}
15
IPostEffectPasssrc/main/java/thunder/hack/injection/accesors/IPostEffectPass.javaJava · 15 lines · 389 B
@Mixin(PostPass.class)
ModifiesPostPass
IPostEffectPass.javaJava · 15 lines · 389 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import com.mojang.blaze3d.buffers.GpuBuffer;
4
import org.spongepowered.asm.mixin.Mixin;
5
import org.spongepowered.asm.mixin.gen.Accessor;
6
7
import java.util.Map;
8
import net.minecraft.client.renderer.PostPass;
9
10
@Mixin(PostPass.class)
11
public interface IPostEffectPass {
12
    @Accessor("customUniforms")
13
    Map<String, GpuBuffer> getUniformBuffers();
14
}
15
ISPacketEntityVelocitysrc/main/java/thunder/hack/injection/accesors/ISPacketEntityVelocity.javaJava · 34 lines · 1.1 KB
@Mixin(ClientboundSetEntityMotionPacket.class)
ISPacketEntityVelocity.javaJava · 34 lines · 1.1 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.network.protocol.game.ClientboundSetEntityMotionPacket;
4
import net.minecraft.world.phys.Vec3;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.Mutable;
7
import org.spongepowered.asm.mixin.gen.Accessor;
8
9
@Mixin(ClientboundSetEntityMotionPacket.class)
10
public abstract class ISPacketEntityVelocity {
11
    @Mutable
12
    @Accessor("movement")
13
    abstract void setMovement(Vec3 movement);
14
15
    private ClientboundSetEntityMotionPacket packet() {
16
        return (ClientboundSetEntityMotionPacket) (Object) this;
17
    }
18
19
    public void setMotionX(double velocityX) {
20
        Vec3 movement = packet().movement();
21
        setMovement(new Vec3(velocityX, movement.y, movement.z));
22
    }
23
24
    public void setMotionY(double velocityY) {
25
        Vec3 movement = packet().movement();
26
        setMovement(new Vec3(movement.x, velocityY, movement.z));
27
    }
28
29
    public void setMotionZ(double velocityZ) {
30
        Vec3 movement = packet().movement();
31
        setMovement(new Vec3(movement.x, movement.y, velocityZ));
32
    }
33
}
34
ISignEditScreensrc/main/java/thunder/hack/injection/accesors/ISignEditScreen.javaJava · 16 lines · 458 B
@Mixin(AbstractSignEditScreen.class)
ISignEditScreen.javaJava · 16 lines · 458 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.gui.screens.inventory.AbstractSignEditScreen;
4
import net.minecraft.world.level.block.entity.SignBlockEntity;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.gen.Accessor;
7
8
@Mixin(AbstractSignEditScreen.class)
9
public interface ISignEditScreen {
10
    @Accessor("sign")
11
    SignBlockEntity getBlockEntity();
12
13
    @Accessor("isFrontText")
14
    boolean isFront();
15
}
16
IWorldRenderersrc/main/java/thunder/hack/injection/accesors/IWorldRenderer.javaJava · 13 lines · 395 B
@Mixin(LevelRenderer.class)
IWorldRenderer.javaJava · 13 lines · 395 B · complete file, verbatimOriginal ↗
1
package thunder.hack.injection.accesors;
2
3
import net.minecraft.client.renderer.LevelRenderer;
4
import net.minecraft.client.renderer.state.level.LevelRenderState;
5
import org.spongepowered.asm.mixin.Mixin;
6
import org.spongepowered.asm.mixin.gen.Accessor;
7
8
@Mixin(LevelRenderer.class)
9
public interface IWorldRenderer {
10
    @Accessor("levelRenderState")
11
    LevelRenderState getLevelRenderState();
12
}
13