forked from Strangerrrs/Raven-bS
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 'swingSpeedWhileBlocking' to Animations
Improve HypixelGroundSpeed Try to fix scaffold sprint
- Loading branch information
Showing
7 changed files
with
69 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 32 additions & 7 deletions
39
src/main/java/keystrokesmod/module/impl/movement/speed/hypixel/HypixelGroundSpeed.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,48 @@ | ||
package keystrokesmod.module.impl.movement.speed.hypixel; | ||
|
||
import keystrokesmod.event.PrePlayerInputEvent; | ||
import keystrokesmod.event.PreMotionEvent; | ||
import keystrokesmod.event.SendPacketEvent; | ||
import keystrokesmod.module.impl.movement.speed.HypixelSpeed; | ||
import keystrokesmod.module.impl.player.blink.NormalBlink; | ||
import keystrokesmod.module.setting.impl.SubMode; | ||
import keystrokesmod.utility.MoveUtil; | ||
import keystrokesmod.utility.Utils; | ||
import net.minecraft.network.play.client.C0FPacketConfirmTransaction; | ||
import net.minecraftforge.fml.common.eventhandler.EventPriority; | ||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class HypixelGroundSpeed extends SubMode<HypixelSpeed> { | ||
private final NormalBlink blink = new NormalBlink("Blink", this) { | ||
@Override | ||
public void onSendPacket(@NotNull SendPacketEvent e) { | ||
if (e.getPacket() instanceof C0FPacketConfirmTransaction) | ||
return; | ||
super.onSendPacket(e); | ||
} | ||
}; | ||
|
||
public HypixelGroundSpeed(String name, @NotNull HypixelSpeed parent) { | ||
super(name, parent); | ||
} | ||
|
||
@SubscribeEvent | ||
public void onPrePlayerInput(PrePlayerInputEvent event) { | ||
if (!Utils.nullCheck() || parent.parent.noAction()) return; | ||
if (mc.thePlayer.onGround && MoveUtil.isMoving() && mc.currentScreen == null) { | ||
event.setSpeed(MoveUtil.getAllowedHorizontalDistance() - Math.random() / 100); | ||
public void onDisable() { | ||
blink.disable(); | ||
|
||
mc.thePlayer.motionX *= .8; | ||
mc.thePlayer.motionZ *= .8; | ||
} | ||
|
||
@SubscribeEvent(priority = EventPriority.HIGH) | ||
public void onPreUpdate(PreMotionEvent event) { | ||
if (mc.thePlayer.onGround) { | ||
mc.thePlayer.motionX *= 1.114 - MoveUtil.getSpeedEffect() * .01 - Math.random() * 1E-4; | ||
mc.thePlayer.motionZ *= 1.114 - MoveUtil.getSpeedEffect() * .01 - Math.random() * 1E-4; | ||
} | ||
|
||
if (mc.thePlayer.onGround && mc.thePlayer.ticksExisted % 2 == 0) { | ||
blink.enable(); | ||
} else { | ||
blink.disable(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters