This commit is contained in:
jackh 2025-02-06 00:37:57 -07:00
parent c4aea22d11
commit 72c8a216d9
3 changed files with 203 additions and 74 deletions

View File

@ -67,7 +67,7 @@ public class NoFall extends Module {
}
if (isFalling && mode.getInput() == 2) {
if (distanceFallen >= dynamic) {
Utils.getTimer().timerSpeed = (0.7399789F + (float) Utils.randomizeDouble(-0.012, 0.012));
Utils.getTimer().timerSpeed = 0.7199789F;
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
initialY = mc.thePlayer.posY;
}
@ -75,10 +75,10 @@ public class NoFall extends Module {
//Utils.print("" + dynamic);
if (isFalling && mode.getInput() == 3) {
if (mc.thePlayer.ticksExisted % 2 == 0) {
Utils.getTimer().timerSpeed = (float) Utils.randomizeDouble(0.5, 0.50201);
Utils.getTimer().timerSpeed = 0.5F;
}
else {
Utils.getTimer().timerSpeed = (float) 1;
Utils.getTimer().timerSpeed = 1F;
}
if (distanceFallen >= 3) {
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
@ -86,9 +86,9 @@ public class NoFall extends Module {
}
}
if (isFalling && mode.getInput() == 4) {
Utils.getTimer().timerSpeed = (float) 1;
Utils.getTimer().timerSpeed = 1F;
if (distanceFallen >= 8) {
Utils.getTimer().timerSpeed = (float) Utils.randomizeDouble(0.7, 0.70201);
Utils.getTimer().timerSpeed = 0.7F;
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
initialY = mc.thePlayer.posY;
}

View File

@ -14,32 +14,36 @@ import net.minecraftforge.fml.common.gameevent.TickEvent;
import org.lwjgl.input.Keyboard;
public class Safewalk extends Module {
private SliderSetting shiftDelay;
private SliderSetting sneakDelay;
private SliderSetting motion;
public static ButtonSetting shift, blocksOnly, pitchCheck, disableOnForward;
private ButtonSetting sneak;
public static ButtonSetting blocksOnly, pitchCheck, disableOnForward;
private int unsneakDelayTicks = 0;
private boolean isSneaking;
private long lastShift = 0L;
public Safewalk() {
super("Safewalk", Module.category.player, 0);
this.registerSetting(shift = new ButtonSetting("Shift", false));
this.registerSetting(shiftDelay = new SliderSetting("Delay until next shift", 0.0, 0.0, 800.0, 10.0));
this.registerSetting(motion = new SliderSetting("Motion", 1.0, 0.5, 1.2, 0.01));
this.registerSetting(sneakDelay = new SliderSetting("Sneak delay", " tick", 0, 0, 20, 1));
this.registerSetting(motion = new SliderSetting("Motion", "x", 1.0, 0.5, 1.2, 0.01));
this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true));
this.registerSetting(disableOnForward = new ButtonSetting("Disable on forward", false));
this.registerSetting(pitchCheck = new ButtonSetting("Pitch check", false));
this.registerSetting(sneak = new ButtonSetting("Sneak", false));
}
@Override
public void onDisable() {
if (shift.isToggled() && Utils.isEdgeOfBlock()) {
if (sneak.isToggled() && Utils.isEdgeOfBlock()) {
this.setSneakState(false);
}
isSneaking = false;
lastShift = 0L;
unsneakDelayTicks = 0;
}
@Override
public void onUpdate() {
if (motion.getInput() != 1.0 && mc.thePlayer.onGround && Utils.isMoving() && (!pitchCheck.isToggled() || mc.thePlayer.rotationPitch >= 70.0f)) {
if (motion.getInput() != 1.0 && mc.thePlayer.onGround && Utils.isMoving() && settingsMet()) {
mc.thePlayer.motionX *= motion.getInput();
mc.thePlayer.motionZ *= motion.getInput();
}
@ -50,66 +54,59 @@ public class Safewalk extends Module {
if (e.phase != TickEvent.Phase.END) {
return;
}
if (!shift.isToggled() || !Utils.nullCheck()) {
if (!sneak.isToggled() || !Utils.nullCheck()) {
return;
}
if (mc.thePlayer.onGround && Utils.isEdgeOfBlock()) {
if (blocksOnly.isToggled()) {
final ItemStack getHeldItem = mc.thePlayer.getHeldItem();
if (getHeldItem == null || !(getHeldItem.getItem() instanceof ItemBlock)) {
boolean edge = mc.thePlayer.onGround && Utils.isEdgeOfBlock();
if (edge) {
if (!settingsMet()) {
this.setSneakState(false);
return;
}
if (!this.isSneaking) {
this.setSneakState(true);
unsneakDelayTicks = (int) sneakDelay.getInput();
}
}
else {
if (this.isSneaking) {
if (!settingsMet()) {
this.setSneakState(false);
return;
}
}
if (disableOnForward.isToggled() && Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())) {
if (unsneakDelayTicks > 0) {
unsneakDelayTicks--;
return;
}
this.setSneakState(false);
return;
}
if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70.0f) {
this.setSneakState(false);
return;
}
this.setSneakState(true);
} else if (this.isSneaking) {
this.setSneakState(false);
}
if (this.isSneaking && mc.thePlayer.capabilities.isFlying) {
if (this.isSneaking && (mc.thePlayer.capabilities.isFlying || !settingsMet())) {
this.setSneakState(false);
}
}
@SubscribeEvent
public void onGuiOpen(final GuiOpenEvent guiOpenEvent) {
if (shift.isToggled() && guiOpenEvent.gui == null) {
public void onGuiOpen(GuiOpenEvent e) {
if (sneak.isToggled() && e.gui == null) {
this.isSneaking = mc.thePlayer.isSneaking();
}
}
private void setSneakState(boolean shift) {
if (this.isSneaking) {
if (shift) {
return;
}
private void setSneakState(boolean sneakState) {
if (!sneakState) {
unsneakDelayTicks = 0;
}
else if (!shift) {
if (this.isSneaking == sneakState) {
return;
}
if (shift) {
final long targetShiftDelay = (long) shiftDelay.getInput();
if (targetShiftDelay > 0L) {
if (Utils.timeBetween(this.lastShift, System.currentTimeMillis()) < targetShiftDelay) {
return;
}
this.lastShift = System.currentTimeMillis();
}
if (!sneakState && Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) {
return;
}
else {
if (Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) {
return;
}
this.lastShift = System.currentTimeMillis();
}
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), this.isSneaking = shift);
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), sneakState);
this.isSneaking = sneakState;
}
public static boolean canSafeWalk() {
@ -120,14 +117,30 @@ public class Safewalk extends Module {
if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70) {
return false;
}
if (blocksOnly.isToggled() && (mc.thePlayer.getHeldItem() == null || !(mc.thePlayer.getHeldItem().getItem() instanceof ItemBlock))) {
return false;
}
if (ModuleManager.scaffold.moduleEnabled) {
return false;
if (blocksOnly.isToggled()) {
ItemStack held = mc.thePlayer.getHeldItem();
if (held == null || !(held.getItem() instanceof ItemBlock)) {
return false;
}
}
return true;
}
return false;
}
}
private boolean settingsMet() {
if (blocksOnly.isToggled()) {
ItemStack held = mc.thePlayer.getHeldItem();
if (held == null || !(held.getItem() instanceof ItemBlock)) {
return false;
}
}
if (disableOnForward.isToggled() && Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())) {
return false;
}
if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70.0f) {
return false;
}
return true;
}
}

View File

@ -12,6 +12,7 @@ import keystrokesmod.module.setting.impl.ButtonSetting;
import keystrokesmod.module.setting.impl.SliderSetting;
import keystrokesmod.utility.*;
import keystrokesmod.utility.Timer;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.block.BlockTNT;
import net.minecraft.client.settings.KeyBinding;
@ -45,6 +46,7 @@ public class Scaffold extends Module {
public ButtonSetting safeWalk;
public ButtonSetting showBlockCount;
private ButtonSetting silentSwing;
private ButtonSetting limitMotionWhileKeepY;
private String[] rotationModes = new String[] { "None", "Simple", "Offset", "Precise" };
private String[] sprintModes = new String[] { "None", "Vanilla", "Float" };
@ -102,6 +104,11 @@ public class Scaffold extends Module {
private long firstStroke, strokeDelay = 575;
private float lastEdge, lastEdge2, yawAngle;
private int speedEdge;
private EnumFacing[] facings = { EnumFacing.EAST, EnumFacing.WEST, EnumFacing.NORTH, EnumFacing.SOUTH, EnumFacing.UP };
private BlockPos[] offsets = { new BlockPos(-1, 0, 0), new BlockPos(1, 0, 0), new BlockPos(0, 0, 1), new BlockPos(0, 0, -1), new BlockPos(0, -1, 0) };
public Scaffold() {
super("Scaffold", category.player);
this.registerSetting(motion = new SliderSetting("Motion", "x", 1.0, 0.5, 1.2, 0.01));
@ -117,6 +124,7 @@ public class Scaffold extends Module {
this.registerSetting(safeWalk = new ButtonSetting("Safewalk", true));
this.registerSetting(showBlockCount = new ButtonSetting("Show block count", true));
this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false));
this.registerSetting(limitMotionWhileKeepY = new ButtonSetting("Limit motion while Keep Y", false));
this.alwaysOn = true;
}
@ -173,6 +181,7 @@ public class Scaffold extends Module {
rotateForward();
mc.thePlayer.jump();
Utils.setSpeed(getSpeed(getSpeedLevel()) - Utils.randomizeDouble(0.0003, 0.0001));
speedEdge++;
if (fastScaffold.getInput() == 5 || fastScaffold.getInput() == 2 && firstKeepYPlace) {
lowhop = true;
}
@ -187,7 +196,7 @@ public class Scaffold extends Module {
else if (fastScaffoldKeepY) {
fastScaffoldKeepY = firstKeepYPlace = false;
startYPos = -1;
keepYTicks = 0;
keepYTicks = speedEdge = 0;
}
if (lowhop) {
switch (simpleY) {
@ -212,7 +221,7 @@ public class Scaffold extends Module {
floatKeepY = true;
startYPos = e.posY;
mc.thePlayer.jump();
Utils.setSpeed(Utils.getHorizontalSpeed() - 0.1);
Utils.setSpeed(Utils.getHorizontalSpeed() - Utils.randomizeDouble(0.0001, 0.001));
floatJumped = true;
} else if (onGroundTicks <= 8 && mc.thePlayer.onGround) {
floatStarted = true;
@ -237,6 +246,17 @@ public class Scaffold extends Module {
floatStarted = floatJumped = floatKeepY = floatWasEnabled = false;
}
if (limitMotionWhileKeepY.isToggled()) {
if (startYPos != -1) {
if (hasPlaced && !mc.thePlayer.onGround) {
if (ModuleUtils.inAirTicks > 4) {
mc.thePlayer.motionX *= 0.965;
mc.thePlayer.motionZ *= 0.965;
}
}
}
}
if (targetBlock != null) {
Vec3 lookAt = new Vec3(targetBlock.xCoord - lookVec.xCoord, targetBlock.yCoord - lookVec.yCoord, targetBlock.zCoord - lookVec.zCoord);
@ -262,13 +282,13 @@ public class Scaffold extends Module {
float minPitch = 78.650f;
float firstStraight = 123.50f;
float secondStraight = 125.50f;
float thirdStraight = 127.50f;
float firstDiag = 128.50f;
float secondDiag = 130.50f;
float thirdDiag = 132.50f;
float fourthDiag = 138f;
float firstStraight = 128.50f;
float secondStraight = 129.50f;
float thirdStraight = 130.50f;
float firstDiag = 130.50f;
float secondDiag = 131.50f;
float thirdDiag = 134.50f;
float fourthDiag = 139f;
float firstOffset = 16;
float secondOffset = 14;
@ -344,8 +364,8 @@ public class Scaffold extends Module {
blockYaw = blockRotations[0];
pitch = blockRotations[1];
yawOffset = blockYawOffset;
if (pitch < minPitch && Utils.getHorizontalSpeed() < 0.6) {
//pitch = minPitch;
if (Utils.getHorizontalSpeed() < 0.6) {
//pitch = 80F;
}
if (firstStroke == 0) {
strokeDelay = 300;
@ -473,7 +493,7 @@ public class Scaffold extends Module {
//get yaw - player yaw offset
float yv = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw();
if (Raven.debug) {
Utils.sendModuleMessage(this, "" + MathHelper.wrapAngleTo180_float(yv - e.getYaw()) + " " + minOffset);
Utils.sendModuleMessage(this, "" + MathHelper.wrapAngleTo180_float(yv - e.getYaw()) + " " + e.getPitch() + " " + minOffset);
}
//Utils.print("" + mc.thePlayer.rotationYaw + " " + mc.thePlayer.rotationPitch);
@ -488,9 +508,9 @@ public class Scaffold extends Module {
rotationDelay = 2;
rotatingForward = true;
}
float forwardYaw = (mc.thePlayer.rotationYaw - hardcodedYaw() - 180 - (float) Utils.randomizeInt(-5, 5));
float forwardYaw = (mc.thePlayer.rotationYaw - hardcodedYaw() - 180);
e.setYaw(forwardYaw);
e.setPitch(10 - (float) Utils.randomizeDouble(1, 5));
e.setPitch(10);
}
}
else {
@ -617,7 +637,7 @@ public class Scaffold extends Module {
blockRotations = null;
fastScaffoldKeepY = firstKeepYPlace = rotateForward = rotatingForward = lowhop = floatStarted = floatJumped = floatWasEnabled = towerEdge =
was451 = was452 = false;
rotationDelay = keepYTicks = scaffoldTicks = 0;
rotationDelay = keepYTicks = scaffoldTicks = speedEdge = 0;
firstStroke = 0;
startYPos = -1;
lookVec = null;
@ -827,6 +847,97 @@ public class Scaffold extends Module {
return 0;
}
/*private List<PlaceData> findBlocks(int yOffset, int xOffset) {
List<PlaceData> possibleBlocks = new ArrayList<>();
int x = (int) Math.floor(mc.thePlayer.posX + xOffset);
int y = (int) Math.floor(((startYPos != -1) ? startYPos : (mc.thePlayer.posY)) + yOffset);
int z = (int) Math.floor(mc.thePlayer.posZ);
BlockPos pos = new BlockPos(x, y - 1, z);
for (int lastCheck = 0; lastCheck < 2; lastCheck++) {
for (int i = 0; i < offsets.length; i++) {
BlockPos newPos = pos.add(offsets[i]);
Block block = BlockUtils.getBlock(newPos);
if (lastCheck == 0) {
continue;
}
if (!block.getMaterial().isReplaceable() && !BlockUtils.isInteractable(block)) {
possibleBlocks.add(new PlaceData(facings[i], newPos));
}
}
}
BlockPos[] additionalOffsets = { // adjust these for perfect placement
pos.add(-1, 0, 0),
pos.add(1, 0, 0),
pos.add(0, 0, 1),
pos.add(0, 0, -1),
pos.add(0, -1, 0),
pos.add(-2, 0, 0),
pos.add(2, 0, 0),
pos.add(0, 0, 2),
pos.add(0, 0, -2),
pos.add(0, -2, 0),
pos.add(-3, 0, 0),
pos.add(3, 0, 0),
pos.add(0, 0, 3),
pos.add(0, 0, -3),
pos.add(0, -3, 0),
};
for (int lastCheck = 0; lastCheck < 2; lastCheck++) {
for (BlockPos additionalPos : additionalOffsets) {
for (int i = 0; i < offsets.length; i++) {
BlockPos newPos = additionalPos.add(offsets[i]);
Block block = BlockUtils.getBlock(newPos);
if (lastCheck == 0) {
continue;
}
if (!block.getMaterial().isReplaceable() && !BlockUtils.isInteractable(block)) {
possibleBlocks.add(new PlaceData(facings[i], newPos));
}
}
}
}
BlockPos[] additionalOffsets2 = { // adjust these for perfect placement
new BlockPos(-1, 0, 0),
new BlockPos(1, 0, 0),
new BlockPos(0, 0, 1),
new BlockPos(0, 0, -1),
new BlockPos(0, -1, 0),
new BlockPos(-2, 0, 0),
new BlockPos(2, 0, 0),
new BlockPos(0, 0, 2),
new BlockPos(0, 0, -2),
new BlockPos(0, -2, 0),
new BlockPos(-3, 0, 0),
new BlockPos(3, 0, 0),
new BlockPos(0, 0, 3),
new BlockPos(0, 0, -3),
new BlockPos(0, -3, 0),
};
for (int lastCheck = 0; lastCheck < 2; lastCheck++) {
for (BlockPos additionalPos2 : additionalOffsets2) {
for (BlockPos additionalPos : additionalOffsets) {
for (int i = 0; i < offsets.length; i++) {
BlockPos newPos = additionalPos2.add(additionalPos.add(offsets[i]));
Block block = BlockUtils.getBlock(newPos);
if (lastCheck == 0) {
continue;
}
if (!block.getMaterial().isReplaceable() && !BlockUtils.isInteractable(block)) {
possibleBlocks.add(new PlaceData(facings[i], newPos));
}
}
}
}
}
return possibleBlocks.isEmpty() ? null : possibleBlocks;
}*/
private List<PlaceData> findBlocks(int yOffset, int xOffset) {
List<PlaceData> possibleBlocks = new ArrayList<>();
int x = (int) Math.floor(mc.thePlayer.posX + xOffset);
@ -1078,5 +1189,10 @@ public class Scaffold extends Module {
this.enumFacing = enumFacing;
this.blockPos = blockPos;
}
public PlaceData(EnumFacing enumFacing, BlockPos blockPos) {
this.enumFacing = enumFacing;
this.blockPos = blockPos;
}
}
}