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