forked from Hirohiko360/LiquidBounceScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCleanSprint.js
More file actions
81 lines (71 loc) · 2.45 KB
/
CleanSprint.js
File metadata and controls
81 lines (71 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
var scriptName = "CleanSprint";
var scriptVersion = 1.0;
var scriptAuthor = "yorik100";
var C0BPacketEntityAction = Java.type("net.minecraft.network.play.client.C0BPacketEntityAction");
function getMoveYaw() {
var moveYaw = mc.thePlayer.rotationYaw;
if (mc.thePlayer.moveForward != 0 && mc.thePlayer.moveStrafing == 0) {
moveYaw += mc.thePlayer.moveForward > 0 ? 0 : 180;
} else if (mc.thePlayer.moveForward != 0 && mc.thePlayer.moveStrafing != 0) {
if (mc.thePlayer.moveForward > 0)
moveYaw += mc.thePlayer.moveStrafing > 0 ? -45 : 45;
else
moveYaw -= mc.thePlayer.moveStrafing > 0 ? -45 : 45;
moveYaw += mc.thePlayer.moveForward > 0 ? 0 : 180;
} else if (mc.thePlayer.moveStrafing != 0 && mc.thePlayer.moveForward == 0) {
moveYaw += mc.thePlayer.moveStrafing > 0 ? -90 : 90;
}
return moveYaw;
}
var cleanSprint = new CleanSprint();
var client;
function CleanSprint() {
this.getName = function() {
return "MatrixSprint";
};
this.getDescription = function() {
return "OmniSprint bypass for Matrix";
};
this.getCategory = function() {
return "Movement";
};
var stopSprint = false;
var cancel = true;
this.onEnable = function() {
stopSprint = false;
cancel = true
}
this.onJump = function(event) {
if (cancel && mc.thePlayer.isSprinting()) {
event.cancelEvent()
cancel = false;
this.yaw = mc.thePlayer.rotationYaw;
mc.thePlayer.rotationYaw = getMoveYaw();
mc.thePlayer.jump();
mc.thePlayer.rotationYaw = this.yaw;
cancel = true;
}
}
this.onUpdate = function() {
if (mc.thePlayer.isSprinting()) {
if (mc.thePlayer.moveForward <= 0) {
mc.thePlayer.sendQueue.addToSendQueue(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
stopSprint = true;
} else if (stopSprint) {
mc.thePlayer.sendQueue.addToSendQueue(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.START_SPRINTING));
stopSprint = false;
}
} else {
stopSprint = false;
}
}
this.onPacket = function(event) {}
this.onDisable = function() {}
}
function onLoad() {}
function onEnable() {
client = moduleManager.registerModule(cleanSprint);
}
function onDisable() {
moduleManager.unregisterModule(client);
}