Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
время уборки
Browse files Browse the repository at this point in the history
  • Loading branch information
antihack3r committed Oct 1, 2023
1 parent 73a6b84 commit 3c91dc2
Showing 1 changed file with 23 additions and 32 deletions.
55 changes: 23 additions & 32 deletions src/main/java/com/mrzak34/thunderhack/modules/movement/Step.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,38 +26,24 @@ public class Step extends Module {
private final Setting<Mode> mode = this.register(new Setting<>("Mode", Mode.NORMAL));
private boolean timer;
private Entity entityRiding;
/**
* @author Doogie13, linustouchtips, aesthetical
* @since 12/27/2021
*/

public Step() {
super("Step", "ходить по блокам 1 или 2 блока", Category.MOVEMENT);
super("Step", "Ходить выше, чем дозволено", Category.MOVEMENT);
}

@Override
public void onDisable() {
super.onDisable();
mc.player.stepHeight = 0.6F;
if (entityRiding != null) {
if (entityRiding instanceof EntityHorse || entityRiding instanceof EntityLlama || entityRiding instanceof EntityMule || entityRiding instanceof EntityPig && entityRiding.isBeingRidden() && ((EntityPig) entityRiding).canBeSteered()) {
entityRiding.stepHeight = 1;
} else {
entityRiding.stepHeight = 0.5F;
}
}
resetEntityStepHeight();
}

@Override
public void onUpdate() {
if (mc.player.capabilities.isFlying || Thunderhack.moduleManager.getModuleByClass(FreeCam.class).isOn()) {
mc.player.stepHeight = 0.6F;
return;
}
if (Jesus.isInLiquid()) {
if (mc.player.capabilities.isFlying || Thunderhack.moduleManager.getModuleByClass(FreeCam.class).isOn() || Jesus.isInLiquid()) {
mc.player.stepHeight = 0.6F;
return;
}

if (timer && mc.player.onGround) {
Thunderhack.TICK_TIMER = 1f;
timer = false;
Expand All @@ -66,22 +52,14 @@ public void onUpdate() {
if (mc.player.onGround && stepTimer.passedMs(stepDelay.getValue())) {
if (mc.player.isRiding() && mc.player.getRidingEntity() != null) {
entityRiding = mc.player.getRidingEntity();
if (entityStep.getValue()) {
if (entityStep.getValue())
mc.player.getRidingEntity().stepHeight = height.getValue().floatValue();
}
} else {
mc.player.stepHeight = height.getValue().floatValue();
}
} else {
if (mc.player.isRiding() && mc.player.getRidingEntity() != null) {
entityRiding = mc.player.getRidingEntity();
if (entityRiding != null) {
if (entityRiding instanceof EntityHorse || entityRiding instanceof EntityLlama || entityRiding instanceof EntityMule || entityRiding instanceof EntityPig && entityRiding.isBeingRidden() && ((EntityPig) entityRiding).canBeSteered()) {
entityRiding.stepHeight = 1;
} else {
entityRiding.stepHeight = 0.5F;
}
}
resetEntityStepHeight();
} else {
mc.player.stepHeight = 0.6F;
}
Expand All @@ -92,23 +70,36 @@ public void onUpdate() {
public void onStep(StepEvent event) {
if (mode.getValue().equals(Mode.NORMAL)) {
double stepHeight = event.getAxisAlignedBB().minY - mc.player.posY;
if (stepHeight <= 0 || stepHeight > height.getValue()) {

if (stepHeight <= 0 || stepHeight > height.getValue())
return;
}

double[] offsets = getOffset(stepHeight);
if (offsets != null && offsets.length > 1) {
if (useTimer.getValue()) {
Thunderhack.TICK_TIMER = 1F / offsets.length;
timer = true;
}
for (double offset : offsets) {

for (double offset: offsets)
mc.player.connection.sendPacket(new CPacketPlayer.Position(mc.player.posX, mc.player.posY + offset, mc.player.posZ, false));
}
}

stepTimer.reset();
}
}

private void resetEntityStepHeight() {
entityRiding = mc.player.getRidingEntity();
if (entityRiding != null) {
if (entityRiding instanceof EntityHorse || entityRiding instanceof EntityLlama || entityRiding instanceof EntityMule || entityRiding instanceof EntityPig && entityRiding.isBeingRidden() && ((EntityPig) entityRiding).canBeSteered()) {
entityRiding.stepHeight = 1;
} else {
entityRiding.stepHeight = 0.5F;
}
}
}

public double[] getOffset(double height) {
if (height == 0.75) {
if (strict.getValue()) {
Expand Down

0 comments on commit 3c91dc2

Please sign in to comment.