forked from Rilshrink/Minecraft-Disablers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColdNetworkDisabler.java
More file actions
56 lines (48 loc) · 1.82 KB
/
ColdNetworkDisabler.java
File metadata and controls
56 lines (48 loc) · 1.82 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
public class ColdNetworkDisabler extends Module {
public ColdNetworkDisabler() {
super("ColdNetworkDisabler", "Disables Cold Network's Anticheat", Catagory.MISC); // They use a weird config of verus
}
ArrayList<Packet> transactions = new ArrayList<Packet>();
int currentTransaction = 0;
public void onPacket(EventPacket event) {
if(!this.getState()) return;
Packet packet = event.getPacket();
if(packet instanceof C0FPacketConfirmTransaction) {
transactions.add(packet);
event.setCanceled(true);
}
if(packet instanceof C00PacketKeepAlive) {
((C00PacketKeepAlive)packet).key -= RandomUtils.random(1, 2147483647);
}
if(packet instanceof C03PacketPlayer) {
C03PacketPlayer c03 = (C03PacketPlayer)packet;
mc.thePlayer.sendQueue.addToSendQueueNoEvent(new C0CPacketInput());
if(mc.thePlayer.ticksExisted % 15 == 0) {
c03.y += RandomUtils.randDouble(100, 1000);
}
}
}
public void onEnable() {
mc.thePlayer.ticksExisted = 0;
}
public void onDisable() {
transactions.clear();
currentTransaction = 0;
}
public void onWorldChange() {
if(!this.getState()) return;
transactions.clear();
currentTransaction = 0;
}
public void onUpdate() {
if(!this.getState()) return;
mc.timer.timerSpeed = 0.6F;
if(mc.thePlayer.ticksExisted % 50 == 0 && (transactions.size()-1) > currentTransaction) {
mc.thePlayer.sendQueue.addToSendQueueNoEvent(transactions.get(++currentTransaction)));
}
if(mc.thePlayer.ticksExisted % 500 == 0) {
transactions.clear();
currentTransaction = 0;
}
}
}