forked from Rilshrink/Minecraft-Disablers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOnlyMCDisabler.java
More file actions
52 lines (44 loc) · 1.87 KB
/
OnlyMCDisabler.java
File metadata and controls
52 lines (44 loc) · 1.87 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
public class OnlyMCDisabler extends Module {
public OnlyMCDisabler() {
super("OnlyMCDisabler", "Disables OnlyMC's Anticheat", Catagory.MISC); // They use a old version 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) {
mc.thePlayer.sendQueue.addToSendQueueNoEvent(new C0CPacketInput());
}
}
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;
if(mc.thePlayer.ticksExisted % 50 == 0) {
double rand = RandomUtils.randDouble(1000, 2000);
mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C06PacketPlayerPosLook(mc.thePlayer.posX, mc.thePlayer.posY - rand, mc.thePlayer.posZ,
mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, mc.thePlayer.onGround));
}
if(mc.thePlayer.ticksExisted % 120 == 0 && (transactions.size()-1) > currentTransaction) {
mc.thePlayer.sendQueue.addToSendQueueNoEvent(transactions.get(++currentTransaction)));
}
}
}