-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
114 additions
and
17 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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/justdoom/flappyanticheat/checks/player/badpackets/BadPacketsA.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.justdoom.flappyanticheat.checks.player.badpackets; | ||
|
||
import com.justdoom.flappyanticheat.checks.Check; | ||
import com.justdoom.flappyanticheat.checks.CheckData; | ||
import com.justdoom.flappyanticheat.data.PlayerData; | ||
import io.github.retrooper.packetevents.event.impl.PacketPlayReceiveEvent; | ||
import io.github.retrooper.packetevents.packettype.PacketType; | ||
import io.github.retrooper.packetevents.packetwrappers.play.in.flying.WrappedPacketInFlying; | ||
|
||
@CheckData(name = "BadPackets", type = "A") | ||
public class BadPacketsA extends Check { | ||
|
||
public BadPacketsA(PlayerData data) { | ||
super(data); | ||
} | ||
|
||
@Override | ||
public void onPacketPlayReceive(PacketPlayReceiveEvent event) { | ||
if (event.getPacketId() == PacketType.Play.Client.POSITION || event.getPacketId() == PacketType.Play.Client.POSITION_LOOK) { | ||
WrappedPacketInFlying packet = new WrappedPacketInFlying(event.getNMSPacket()); | ||
if(Math.abs(packet.getPitch()) > 90.0){ | ||
fail("pitch=" + packet.getPitch(), event.getPlayer()); | ||
} | ||
} | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/justdoom/flappyanticheat/checks/player/badpackets/BadPacketsB.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.justdoom.flappyanticheat.checks.player.badpackets; | ||
|
||
import com.justdoom.flappyanticheat.checks.Check; | ||
import com.justdoom.flappyanticheat.checks.CheckData; | ||
import com.justdoom.flappyanticheat.data.PlayerData; | ||
import io.github.retrooper.packetevents.event.impl.PacketPlayReceiveEvent; | ||
import io.github.retrooper.packetevents.packettype.PacketType; | ||
import io.github.retrooper.packetevents.packetwrappers.play.in.flying.WrappedPacketInFlying; | ||
import io.github.retrooper.packetevents.packetwrappers.play.in.useentity.WrappedPacketInUseEntity; | ||
|
||
@CheckData(name = "BadPackets", type = "B") | ||
public class BadPacketsB extends Check { | ||
|
||
private boolean wasLastArmAnimation; | ||
|
||
public BadPacketsB(PlayerData data) { | ||
super(data); | ||
} | ||
|
||
@Override | ||
public void onPacketPlayReceive(PacketPlayReceiveEvent event) { | ||
if (event.getPacketId() == PacketType.Play.Client.USE_ENTITY){ | ||
if(!wasLastArmAnimation){ | ||
fail("ArmAnimation=false", event.getPlayer()); | ||
} | ||
} else if (event.getPacketId() == PacketType.Play.Client.ARM_ANIMATION){ | ||
wasLastArmAnimation = true; | ||
} else if (event.getPacketId() == PacketType.Play.Client.FLYING){ | ||
wasLastArmAnimation = false; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/justdoom/flappyanticheat/checks/player/inventory/InventoryA.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.justdoom.flappyanticheat.checks.player.inventory; | ||
|
||
import com.justdoom.flappyanticheat.checks.Check; | ||
import com.justdoom.flappyanticheat.checks.CheckData; | ||
import com.justdoom.flappyanticheat.data.PlayerData; | ||
import io.github.retrooper.packetevents.event.impl.PacketPlayReceiveEvent; | ||
import io.github.retrooper.packetevents.packettype.PacketType; | ||
import io.github.retrooper.packetevents.packetwrappers.play.in.flying.WrappedPacketInFlying; | ||
|
||
@CheckData(name = "Inventory", type = "A") | ||
public class InventoryA extends Check { | ||
|
||
public InventoryA(PlayerData data) { | ||
super(data); | ||
} | ||
|
||
@Override | ||
public void onPacketPlayReceive(PacketPlayReceiveEvent event) { | ||
if (event.getPacketId() == PacketType.Play.Client.POSITION || event.getPacketId() == PacketType.Play.Client.POSITION_LOOK) { | ||
//WrappedPacketIn packet = new WrappedPacketInFlying(e.getNMSPacket()); | ||
} | ||
} | ||
} |
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