Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
❤️ BedNuker, NoItemRelease, NoRotate, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tryflle committed Nov 25, 2023
1 parent 3eb2783 commit f024d2c
Show file tree
Hide file tree
Showing 7 changed files with 137 additions and 13 deletions.
1 change: 1 addition & 0 deletions src/main/java/dev/stormy/client/module/ModuleManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public ModuleManager() {
addModule(new ClickGuiModule());
addModule(new ClosetSpeed());
addModule(new Blink());
addModule(new NoRotate());
addModule(new Bhop());
addModule(new Killaura());
addModule(new AntiVoid());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.weavemc.loader.api.event.*;
import org.lwjgl.input.Mouse;

import java.util.Objects;
import java.util.Optional;

@SuppressWarnings("unused")
Expand All @@ -33,7 +34,7 @@ public Killaura() {
this.registerSetting(new DescriptionSetting("Probably doesn't bypass much."));
this.registerSetting(range = new SliderSetting("Range", 3, 3, 6, 0.1));
this.registerSetting(frequency = new SliderSetting("CPS", 10, 1, 20, 0.5));
this.registerSetting(hurtTimeAmt = new SliderSetting("Ignore before hurt time", 0, 0, 20, 1));
this.registerSetting(hurtTimeAmt = new SliderSetting("Ignore before hurt time", 1, 1, 20, 1));
this.registerSetting(rotRand = new SliderSetting("Rotation Randomization", 2, 0, 3, .01));
this.registerSetting(rots = new TickSetting("Rotations (for bypassing)", false));
this.registerSetting(whenLooking = new TickSetting("Only when looking at player", false));
Expand All @@ -56,7 +57,7 @@ public boolean aBooleanCheck() {
if (!whenLooking.isToggled()) return false;
MovingObjectPosition result = mc.objectMouseOver;
if (result != null && result.typeOfHit == MovingObjectPosition.MovingObjectType.ENTITY && result.entityHit instanceof EntityPlayer targetPlayer) {
return whenLooking.isToggled() && PlayerUtils.lookingAtPlayer(mc.thePlayer, targetPlayer, range.getInput());
return whenLooking.isToggled() && PlayerUtils.lookingAtPlayer(mc.thePlayer, targetPlayer, range.getInput() + 1);
}
else return false;
}
Expand All @@ -70,6 +71,7 @@ public void experiMental(UpdateEvent.Pre e) {
if (target.isPresent()) {
if (mc.thePlayer.isBlocking() || mc.thePlayer.isEating()) return;
if (whenLooking.isToggled() && !aBooleanCheck()) return;
if (target.get().deathTime > 0) return;
mc.thePlayer.swingItem();
mc.playerController.attackEntity(mc.thePlayer, target.get());
timer.reset();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
package dev.stormy.client.module.modules.movement;

import dev.stormy.client.module.Module;
import dev.stormy.client.module.setting.impl.ComboSetting;
import dev.stormy.client.module.setting.impl.DescriptionSetting;
import dev.stormy.client.module.setting.impl.SliderSetting;
import dev.stormy.client.module.setting.impl.TickSetting;
import dev.stormy.client.utils.math.MathUtils;
import dev.stormy.client.utils.player.MoveUtils;
import dev.stormy.client.utils.player.PlayerUtils;
import net.weavemc.loader.api.event.SubscribeEvent;
import net.weavemc.loader.api.event.TickEvent;
import dev.stormy.client.module.Module;
import dev.stormy.client.module.setting.impl.DescriptionSetting;


@SuppressWarnings("unused")
public class Flight extends Module {
public ComboSetting<modeee> flightMode;
private int counter, ticks;
private boolean started;
public final SliderSetting airspeed;
public final TickSetting gs, ascend, descend;
Expand All @@ -34,26 +35,46 @@ public void onDisable() {
}
}


@SubscribeEvent
public void airTrafficControl(TickEvent e) {
if (!PlayerUtils.isPlayerInGame()) return;
if (gs.isToggled()) mc.thePlayer.onGround = true;
switch (flightMode.getMode()) {
case AirWalk: {
case AirWalk -> {
mc.thePlayer.motionY = 0.0F;
mc.thePlayer.speedInAir = (float) airspeed.getInput() * 2 / 100;
if (ascend.isToggled() && mc.gameSettings.keyBindJump.isKeyDown()) {
mc.thePlayer.onGround = true;
mc.thePlayer.jumpTicks = 0;
}
}
if (descend.isToggled() && mc.gameSettings.keyBindSneak.isKeyDown()) {
mc.thePlayer.motionY = -0.5F;
}
}
case VerusGlide -> {
mc.timer.timerSpeed = 1.0F;
if (mc.thePlayer.fallDistance > 0.5F) {
mc.thePlayer.motionY = -0.09800000190735147;
MoveUtils.strafe();
if (mc.thePlayer.fallDistance < 3.0F) {
MoveUtils.motionMult(1.03F);
}
if (mc.thePlayer.fallDistance > 3.0F) {
MoveUtils.motionMult(1.0105F);
};
mc.thePlayer.speedInAir = (float) (MathUtils.randomInt(1, 1.4) * 2) / 100;
if (ascend.isToggled() && mc.gameSettings.keyBindJump.isKeyDown()) {
mc.thePlayer.motionY += 1;
}
if (descend.isToggled() && mc.gameSettings.keyBindSneak.isKeyDown()) {
mc.thePlayer.motionY -= 0.5F;
}
}
}
}
}

public enum modeee {
AirWalk
AirWalk, VerusGlide
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.stormy.client.module.modules.movement;

import dev.stormy.client.module.setting.impl.ComboSetting;
import dev.stormy.client.module.setting.impl.DescriptionSetting;
import dev.stormy.client.module.setting.impl.SliderSetting;
import dev.stormy.client.module.setting.impl.TickSetting;
Expand All @@ -10,13 +11,16 @@
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemPotion;
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.weavemc.loader.api.event.PacketEvent;
import net.weavemc.loader.api.event.SubscribeEvent;
import dev.stormy.client.module.Module;
import net.weavemc.loader.api.event.TickEvent;

public class NoSlow extends Module {
public static SliderSetting speed;
public static TickSetting autosprint, noweapons, noconsumables;
public static ComboSetting<modes> mode;
public TimerUtils timer = new TimerUtils();
int rmb = mc.gameSettings.keyBindUseItem.getKeyCode();
int sprint = mc.gameSettings.keyBindSprint.getKeyCode();
Expand All @@ -29,11 +33,12 @@ public NoSlow() {
this.registerSetting(autosprint = new TickSetting("Allow Sprint", false));
this.registerSetting(noweapons = new TickSetting("Blacklist Weapons", false));
this.registerSetting(noconsumables = new TickSetting("Blacklist Consumables", false));
this.registerSetting(mode = new ComboSetting<>("Mode", modes.Regular));
}

@SubscribeEvent
public void onSlowdown(SlowdownEvent e) {
if (!PlayerUtils.isPlayerInGame()) return;
if (!PlayerUtils.isPlayerInGame() || mode.getMode() != modes.Regular) return;
if (noweapons.isToggled() && PlayerUtils.isPlayerHoldingWeapon()) return;
if (noconsumables.isToggled() && consumableCheck()) return;
e.setCancelled(true);
Expand All @@ -52,16 +57,30 @@ public void onSlowdown(SlowdownEvent e) {
}
@SubscribeEvent
public void reBlock(TickEvent e) {
if (shouldFinishBlock && timer.hasReached(100 + Utils.Java.randomInt(-10, 10))) {
if (mode.getMode() != modes.Regular && shouldFinishBlock && timer.hasReached(100 + Utils.Java.randomInt(-10, 10))) {
shouldFinishBlock = false;
KeyBinding.setKeyBindState(rmb, true);
KeyBinding.onTick(rmb);
timer.reset();
}
}

public static boolean consumableCheck() {
if (mc.thePlayer.getHeldItem() != null) {
return noconsumables.isToggled() && (mc.thePlayer.getHeldItem().getItem() instanceof ItemFood || mc.thePlayer.getHeldItem().getItem() instanceof ItemPotion);
} else return false;
}

@SubscribeEvent
public void onPacket(PacketEvent.Send e) {
if (!PlayerUtils.isPlayerInGame() || mode.getMode() != modes.NoItemRelease) return;
if (noweapons.isToggled() && PlayerUtils.isPlayerHoldingWeapon()) return;
if (noconsumables.isToggled() && consumableCheck()) return;
if (e.getPacket() instanceof C07PacketPlayerDigging && ((C07PacketPlayerDigging) e.getPacket()).getStatus() == C07PacketPlayerDigging.Action.RELEASE_USE_ITEM) {
e.setCancelled(true);
}
}
public enum modes {
Regular, NoItemRelease
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,32 @@

import dev.stormy.client.module.Module;
import dev.stormy.client.module.setting.impl.DescriptionSetting;
import dev.stormy.client.utils.world.WorldUtils;
import me.tryfle.stormy.events.UpdateEvent;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.weavemc.loader.api.event.SubscribeEvent;

public class BedNuker extends Module {

public BedNuker() {
super("BedNuker", ModuleCategory.Player, 0);
this.registerSetting(new DescriptionSetting("No logic YET"));
this.registerSetting(new DescriptionSetting("Breaks beds."));
}

}
@SubscribeEvent
public void onUpdate(UpdateEvent e) {
if (mc.thePlayer != null) {
breakBlock(WorldUtils.findNearestBedPos(mc.theWorld, mc.thePlayer.getPosition(), 6));
}
}

private void breakBlock(BlockPos pos) {
if (mc.thePlayer != null) {
try {
mc.playerController.onPlayerDamageBlock(pos, EnumFacing.NORTH);
mc.thePlayer.swingItem();
} catch (Exception ignored) {}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package dev.stormy.client.module.modules.player;

import dev.stormy.client.module.Module;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.weavemc.loader.api.event.PacketEvent;
import net.weavemc.loader.api.event.SubscribeEvent;

public class NoRotate extends Module {
public NoRotate() {
super("NoRotate", ModuleCategory.Player, 0);
}
@SubscribeEvent
public void onPacket(PacketEvent.Receive event) {
final Packet<?> packet = event.getPacket();
if (packet instanceof S08PacketPlayerPosLook s08) {
s08.yaw = mc.thePlayer.rotationYaw;
s08.pitch = mc.thePlayer.rotationPitch;
}
}
}
40 changes: 40 additions & 0 deletions src/main/java/dev/stormy/client/utils/world/WorldUtils.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package dev.stormy.client.utils.world;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.BlockPos;
import net.minecraft.world.World;

public class WorldUtils {
public static BlockPos findNearestBedPos(World world, BlockPos playerPos, int searchRadius) {
BlockPos nearestBedPos = null;
double nearestDistanceSq = Double.MAX_VALUE;

int minX = playerPos.getX() - searchRadius;
int minY = Math.max(0, playerPos.getY() - searchRadius);
int minZ = playerPos.getZ() - searchRadius;
int maxX = playerPos.getX() + searchRadius;
int maxY = Math.min(world.getHeight(), playerPos.getY() + searchRadius);
int maxZ = playerPos.getZ() + searchRadius;

for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
for (int z = minZ; z <= maxZ; z++) {
BlockPos currentPos = new BlockPos(x, y, z);
IBlockState blockState = world.getBlockState(currentPos);
Block block = blockState.getBlock();
if (block == Blocks.bed) {
double distanceSq = playerPos.distanceSq(currentPos);
if (distanceSq < nearestDistanceSq) {
nearestBedPos = currentPos;
nearestDistanceSq = distanceSq;
}
}
}
}
}

return nearestBedPos;
}
}

0 comments on commit f024d2c

Please sign in to comment.