This commit is contained in:
parent
c4aea22d11
commit
72c8a216d9
|
|
@ -67,7 +67,7 @@ public class NoFall extends Module {
|
||||||
}
|
}
|
||||||
if (isFalling && mode.getInput() == 2) {
|
if (isFalling && mode.getInput() == 2) {
|
||||||
if (distanceFallen >= dynamic) {
|
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));
|
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
|
||||||
initialY = mc.thePlayer.posY;
|
initialY = mc.thePlayer.posY;
|
||||||
}
|
}
|
||||||
|
|
@ -75,10 +75,10 @@ public class NoFall extends Module {
|
||||||
//Utils.print("" + dynamic);
|
//Utils.print("" + dynamic);
|
||||||
if (isFalling && mode.getInput() == 3) {
|
if (isFalling && mode.getInput() == 3) {
|
||||||
if (mc.thePlayer.ticksExisted % 2 == 0) {
|
if (mc.thePlayer.ticksExisted % 2 == 0) {
|
||||||
Utils.getTimer().timerSpeed = (float) Utils.randomizeDouble(0.5, 0.50201);
|
Utils.getTimer().timerSpeed = 0.5F;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Utils.getTimer().timerSpeed = (float) 1;
|
Utils.getTimer().timerSpeed = 1F;
|
||||||
}
|
}
|
||||||
if (distanceFallen >= 3) {
|
if (distanceFallen >= 3) {
|
||||||
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
|
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
|
||||||
|
|
@ -86,9 +86,9 @@ public class NoFall extends Module {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isFalling && mode.getInput() == 4) {
|
if (isFalling && mode.getInput() == 4) {
|
||||||
Utils.getTimer().timerSpeed = (float) 1;
|
Utils.getTimer().timerSpeed = 1F;
|
||||||
if (distanceFallen >= 8) {
|
if (distanceFallen >= 8) {
|
||||||
Utils.getTimer().timerSpeed = (float) Utils.randomizeDouble(0.7, 0.70201);
|
Utils.getTimer().timerSpeed = 0.7F;
|
||||||
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
|
mc.getNetHandler().addToSendQueue(new C03PacketPlayer(true));
|
||||||
initialY = mc.thePlayer.posY;
|
initialY = mc.thePlayer.posY;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,32 +14,36 @@ import net.minecraftforge.fml.common.gameevent.TickEvent;
|
||||||
import org.lwjgl.input.Keyboard;
|
import org.lwjgl.input.Keyboard;
|
||||||
|
|
||||||
public class Safewalk extends Module {
|
public class Safewalk extends Module {
|
||||||
private SliderSetting shiftDelay;
|
private SliderSetting sneakDelay;
|
||||||
private SliderSetting motion;
|
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 boolean isSneaking;
|
||||||
private long lastShift = 0L;
|
|
||||||
|
|
||||||
public Safewalk() {
|
public Safewalk() {
|
||||||
super("Safewalk", Module.category.player, 0);
|
super("Safewalk", Module.category.player, 0);
|
||||||
this.registerSetting(shift = new ButtonSetting("Shift", false));
|
this.registerSetting(sneakDelay = new SliderSetting("Sneak delay", " tick", 0, 0, 20, 1));
|
||||||
this.registerSetting(shiftDelay = new SliderSetting("Delay until next shift", 0.0, 0.0, 800.0, 10.0));
|
this.registerSetting(motion = new SliderSetting("Motion", "x", 1.0, 0.5, 1.2, 0.01));
|
||||||
this.registerSetting(motion = new SliderSetting("Motion", 1.0, 0.5, 1.2, 0.01));
|
|
||||||
this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true));
|
this.registerSetting(blocksOnly = new ButtonSetting("Blocks only", true));
|
||||||
this.registerSetting(disableOnForward = new ButtonSetting("Disable on forward", false));
|
this.registerSetting(disableOnForward = new ButtonSetting("Disable on forward", false));
|
||||||
this.registerSetting(pitchCheck = new ButtonSetting("Pitch check", false));
|
this.registerSetting(pitchCheck = new ButtonSetting("Pitch check", false));
|
||||||
|
this.registerSetting(sneak = new ButtonSetting("Sneak", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (shift.isToggled() && Utils.isEdgeOfBlock()) {
|
if (sneak.isToggled() && Utils.isEdgeOfBlock()) {
|
||||||
this.setSneakState(false);
|
this.setSneakState(false);
|
||||||
}
|
}
|
||||||
isSneaking = false;
|
isSneaking = false;
|
||||||
lastShift = 0L;
|
unsneakDelayTicks = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onUpdate() {
|
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.motionX *= motion.getInput();
|
||||||
mc.thePlayer.motionZ *= motion.getInput();
|
mc.thePlayer.motionZ *= motion.getInput();
|
||||||
}
|
}
|
||||||
|
|
@ -50,66 +54,59 @@ public class Safewalk extends Module {
|
||||||
if (e.phase != TickEvent.Phase.END) {
|
if (e.phase != TickEvent.Phase.END) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!shift.isToggled() || !Utils.nullCheck()) {
|
if (!sneak.isToggled() || !Utils.nullCheck()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (mc.thePlayer.onGround && Utils.isEdgeOfBlock()) {
|
boolean edge = mc.thePlayer.onGround && Utils.isEdgeOfBlock();
|
||||||
if (blocksOnly.isToggled()) {
|
if (edge) {
|
||||||
final ItemStack getHeldItem = mc.thePlayer.getHeldItem();
|
if (!settingsMet()) {
|
||||||
if (getHeldItem == null || !(getHeldItem.getItem() instanceof ItemBlock)) {
|
this.setSneakState(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!this.isSneaking) {
|
||||||
|
this.setSneakState(true);
|
||||||
|
unsneakDelayTicks = (int) sneakDelay.getInput();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (this.isSneaking) {
|
||||||
|
if (!settingsMet()) {
|
||||||
this.setSneakState(false);
|
this.setSneakState(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
if (unsneakDelayTicks > 0) {
|
||||||
if (disableOnForward.isToggled() && Keyboard.isKeyDown(mc.gameSettings.keyBindForward.getKeyCode())) {
|
unsneakDelayTicks--;
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.setSneakState(false);
|
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);
|
this.setSneakState(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
public void onGuiOpen(final GuiOpenEvent guiOpenEvent) {
|
public void onGuiOpen(GuiOpenEvent e) {
|
||||||
if (shift.isToggled() && guiOpenEvent.gui == null) {
|
if (sneak.isToggled() && e.gui == null) {
|
||||||
this.isSneaking = mc.thePlayer.isSneaking();
|
this.isSneaking = mc.thePlayer.isSneaking();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setSneakState(boolean shift) {
|
private void setSneakState(boolean sneakState) {
|
||||||
if (this.isSneaking) {
|
if (!sneakState) {
|
||||||
if (shift) {
|
unsneakDelayTicks = 0;
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (!shift) {
|
if (this.isSneaking == sneakState) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (shift) {
|
|
||||||
final long targetShiftDelay = (long) shiftDelay.getInput();
|
if (!sneakState && Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) {
|
||||||
if (targetShiftDelay > 0L) {
|
return;
|
||||||
if (Utils.timeBetween(this.lastShift, System.currentTimeMillis()) < targetShiftDelay) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.lastShift = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) {
|
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), sneakState);
|
||||||
return;
|
this.isSneaking = sneakState;
|
||||||
}
|
|
||||||
this.lastShift = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), this.isSneaking = shift);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean canSafeWalk() {
|
public static boolean canSafeWalk() {
|
||||||
|
|
@ -120,14 +117,30 @@ public class Safewalk extends Module {
|
||||||
if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70) {
|
if (pitchCheck.isToggled() && mc.thePlayer.rotationPitch < 70) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (blocksOnly.isToggled() && (mc.thePlayer.getHeldItem() == null || !(mc.thePlayer.getHeldItem().getItem() instanceof ItemBlock))) {
|
if (blocksOnly.isToggled()) {
|
||||||
return false;
|
ItemStack held = mc.thePlayer.getHeldItem();
|
||||||
}
|
if (held == null || !(held.getItem() instanceof ItemBlock)) {
|
||||||
if (ModuleManager.scaffold.moduleEnabled) {
|
return false;
|
||||||
return false;
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -12,6 +12,7 @@ import keystrokesmod.module.setting.impl.ButtonSetting;
|
||||||
import keystrokesmod.module.setting.impl.SliderSetting;
|
import keystrokesmod.module.setting.impl.SliderSetting;
|
||||||
import keystrokesmod.utility.*;
|
import keystrokesmod.utility.*;
|
||||||
import keystrokesmod.utility.Timer;
|
import keystrokesmod.utility.Timer;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockAir;
|
import net.minecraft.block.BlockAir;
|
||||||
import net.minecraft.block.BlockTNT;
|
import net.minecraft.block.BlockTNT;
|
||||||
import net.minecraft.client.settings.KeyBinding;
|
import net.minecraft.client.settings.KeyBinding;
|
||||||
|
|
@ -45,6 +46,7 @@ public class Scaffold extends Module {
|
||||||
public ButtonSetting safeWalk;
|
public ButtonSetting safeWalk;
|
||||||
public ButtonSetting showBlockCount;
|
public ButtonSetting showBlockCount;
|
||||||
private ButtonSetting silentSwing;
|
private ButtonSetting silentSwing;
|
||||||
|
private ButtonSetting limitMotionWhileKeepY;
|
||||||
|
|
||||||
private String[] rotationModes = new String[] { "None", "Simple", "Offset", "Precise" };
|
private String[] rotationModes = new String[] { "None", "Simple", "Offset", "Precise" };
|
||||||
private String[] sprintModes = new String[] { "None", "Vanilla", "Float" };
|
private String[] sprintModes = new String[] { "None", "Vanilla", "Float" };
|
||||||
|
|
@ -102,6 +104,11 @@ public class Scaffold extends Module {
|
||||||
private long firstStroke, strokeDelay = 575;
|
private long firstStroke, strokeDelay = 575;
|
||||||
private float lastEdge, lastEdge2, yawAngle;
|
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() {
|
public Scaffold() {
|
||||||
super("Scaffold", category.player);
|
super("Scaffold", category.player);
|
||||||
this.registerSetting(motion = new SliderSetting("Motion", "x", 1.0, 0.5, 1.2, 0.01));
|
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(safeWalk = new ButtonSetting("Safewalk", true));
|
||||||
this.registerSetting(showBlockCount = new ButtonSetting("Show block count", true));
|
this.registerSetting(showBlockCount = new ButtonSetting("Show block count", true));
|
||||||
this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false));
|
this.registerSetting(silentSwing = new ButtonSetting("Silent swing", false));
|
||||||
|
this.registerSetting(limitMotionWhileKeepY = new ButtonSetting("Limit motion while Keep Y", false));
|
||||||
|
|
||||||
this.alwaysOn = true;
|
this.alwaysOn = true;
|
||||||
}
|
}
|
||||||
|
|
@ -173,6 +181,7 @@ public class Scaffold extends Module {
|
||||||
rotateForward();
|
rotateForward();
|
||||||
mc.thePlayer.jump();
|
mc.thePlayer.jump();
|
||||||
Utils.setSpeed(getSpeed(getSpeedLevel()) - Utils.randomizeDouble(0.0003, 0.0001));
|
Utils.setSpeed(getSpeed(getSpeedLevel()) - Utils.randomizeDouble(0.0003, 0.0001));
|
||||||
|
speedEdge++;
|
||||||
if (fastScaffold.getInput() == 5 || fastScaffold.getInput() == 2 && firstKeepYPlace) {
|
if (fastScaffold.getInput() == 5 || fastScaffold.getInput() == 2 && firstKeepYPlace) {
|
||||||
lowhop = true;
|
lowhop = true;
|
||||||
}
|
}
|
||||||
|
|
@ -187,7 +196,7 @@ public class Scaffold extends Module {
|
||||||
else if (fastScaffoldKeepY) {
|
else if (fastScaffoldKeepY) {
|
||||||
fastScaffoldKeepY = firstKeepYPlace = false;
|
fastScaffoldKeepY = firstKeepYPlace = false;
|
||||||
startYPos = -1;
|
startYPos = -1;
|
||||||
keepYTicks = 0;
|
keepYTicks = speedEdge = 0;
|
||||||
}
|
}
|
||||||
if (lowhop) {
|
if (lowhop) {
|
||||||
switch (simpleY) {
|
switch (simpleY) {
|
||||||
|
|
@ -212,7 +221,7 @@ public class Scaffold extends Module {
|
||||||
floatKeepY = true;
|
floatKeepY = true;
|
||||||
startYPos = e.posY;
|
startYPos = e.posY;
|
||||||
mc.thePlayer.jump();
|
mc.thePlayer.jump();
|
||||||
Utils.setSpeed(Utils.getHorizontalSpeed() - 0.1);
|
Utils.setSpeed(Utils.getHorizontalSpeed() - Utils.randomizeDouble(0.0001, 0.001));
|
||||||
floatJumped = true;
|
floatJumped = true;
|
||||||
} else if (onGroundTicks <= 8 && mc.thePlayer.onGround) {
|
} else if (onGroundTicks <= 8 && mc.thePlayer.onGround) {
|
||||||
floatStarted = true;
|
floatStarted = true;
|
||||||
|
|
@ -237,6 +246,17 @@ public class Scaffold extends Module {
|
||||||
floatStarted = floatJumped = floatKeepY = floatWasEnabled = false;
|
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) {
|
if (targetBlock != null) {
|
||||||
Vec3 lookAt = new Vec3(targetBlock.xCoord - lookVec.xCoord, targetBlock.yCoord - lookVec.yCoord, targetBlock.zCoord - lookVec.zCoord);
|
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 minPitch = 78.650f;
|
||||||
|
|
||||||
float firstStraight = 123.50f;
|
float firstStraight = 128.50f;
|
||||||
float secondStraight = 125.50f;
|
float secondStraight = 129.50f;
|
||||||
float thirdStraight = 127.50f;
|
float thirdStraight = 130.50f;
|
||||||
float firstDiag = 128.50f;
|
float firstDiag = 130.50f;
|
||||||
float secondDiag = 130.50f;
|
float secondDiag = 131.50f;
|
||||||
float thirdDiag = 132.50f;
|
float thirdDiag = 134.50f;
|
||||||
float fourthDiag = 138f;
|
float fourthDiag = 139f;
|
||||||
|
|
||||||
float firstOffset = 16;
|
float firstOffset = 16;
|
||||||
float secondOffset = 14;
|
float secondOffset = 14;
|
||||||
|
|
@ -344,8 +364,8 @@ public class Scaffold extends Module {
|
||||||
blockYaw = blockRotations[0];
|
blockYaw = blockRotations[0];
|
||||||
pitch = blockRotations[1];
|
pitch = blockRotations[1];
|
||||||
yawOffset = blockYawOffset;
|
yawOffset = blockYawOffset;
|
||||||
if (pitch < minPitch && Utils.getHorizontalSpeed() < 0.6) {
|
if (Utils.getHorizontalSpeed() < 0.6) {
|
||||||
//pitch = minPitch;
|
//pitch = 80F;
|
||||||
}
|
}
|
||||||
if (firstStroke == 0) {
|
if (firstStroke == 0) {
|
||||||
strokeDelay = 300;
|
strokeDelay = 300;
|
||||||
|
|
@ -473,7 +493,7 @@ public class Scaffold extends Module {
|
||||||
//get yaw - player yaw offset
|
//get yaw - player yaw offset
|
||||||
float yv = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw();
|
float yv = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw) - hardcodedYaw();
|
||||||
if (Raven.debug) {
|
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);
|
//Utils.print("" + mc.thePlayer.rotationYaw + " " + mc.thePlayer.rotationPitch);
|
||||||
|
|
@ -488,9 +508,9 @@ public class Scaffold extends Module {
|
||||||
rotationDelay = 2;
|
rotationDelay = 2;
|
||||||
rotatingForward = true;
|
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.setYaw(forwardYaw);
|
||||||
e.setPitch(10 - (float) Utils.randomizeDouble(1, 5));
|
e.setPitch(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
@ -617,7 +637,7 @@ public class Scaffold extends Module {
|
||||||
blockRotations = null;
|
blockRotations = null;
|
||||||
fastScaffoldKeepY = firstKeepYPlace = rotateForward = rotatingForward = lowhop = floatStarted = floatJumped = floatWasEnabled = towerEdge =
|
fastScaffoldKeepY = firstKeepYPlace = rotateForward = rotatingForward = lowhop = floatStarted = floatJumped = floatWasEnabled = towerEdge =
|
||||||
was451 = was452 = false;
|
was451 = was452 = false;
|
||||||
rotationDelay = keepYTicks = scaffoldTicks = 0;
|
rotationDelay = keepYTicks = scaffoldTicks = speedEdge = 0;
|
||||||
firstStroke = 0;
|
firstStroke = 0;
|
||||||
startYPos = -1;
|
startYPos = -1;
|
||||||
lookVec = null;
|
lookVec = null;
|
||||||
|
|
@ -827,6 +847,97 @@ public class Scaffold extends Module {
|
||||||
return 0;
|
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) {
|
private List<PlaceData> findBlocks(int yOffset, int xOffset) {
|
||||||
List<PlaceData> possibleBlocks = new ArrayList<>();
|
List<PlaceData> possibleBlocks = new ArrayList<>();
|
||||||
int x = (int) Math.floor(mc.thePlayer.posX + xOffset);
|
int x = (int) Math.floor(mc.thePlayer.posX + xOffset);
|
||||||
|
|
@ -1078,5 +1189,10 @@ public class Scaffold extends Module {
|
||||||
this.enumFacing = enumFacing;
|
this.enumFacing = enumFacing;
|
||||||
this.blockPos = blockPos;
|
this.blockPos = blockPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PlaceData(EnumFacing enumFacing, BlockPos blockPos) {
|
||||||
|
this.enumFacing = enumFacing;
|
||||||
|
this.blockPos = blockPos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue