Skip to content

Commit 4ee99fd

Browse files
committed
some more fixes
1 parent dc0fc41 commit 4ee99fd

6 files changed

Lines changed: 39 additions & 16 deletions

File tree

src/main/java/com/justdoom/flappyanticheat/checks/combat/range/RangeA.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void onPacketPlayReceive(PacketPlayReceiveEvent event) {
5757
fail("d=" + (float) distance, data.player);
5858
}
5959
}else this.preVL *= 0.975;
60-
Bukkit.broadcastMessage("distance=" + distance);
60+
//Bukkit.broadcastMessage("distance=" + distance);
6161

6262

6363
}

src/main/java/com/justdoom/flappyanticheat/checks/movement/groundspoof/GroundSpoofA.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class GroundSpoofA extends Check {
3131

3232
private int buffer = 0;
3333

34-
private boolean justJoined = true;
34+
private int justJoined = 0;
3535

3636
public GroundSpoofA(){
3737
super("GroundSpoof", "A", false);
@@ -45,11 +45,11 @@ public void onPacketPlayReceive(PacketPlayReceiveEvent e) {
4545

4646
WrappedPacketInFlying packet = new WrappedPacketInFlying(e.getNMSPacket());
4747

48-
if(ServerUtil.lowTPS(("checks." + check + "." + checkType).toLowerCase()) || player.getLocation().getY() < 1)
48+
if(ServerUtil.lowTPS(("checks." + check + "." + checkType).toLowerCase()) || player.getLocation().getY() < 1 || player.isDead())
4949
return;
5050

51-
if(justJoined){
52-
justJoined = false;
51+
if(justJoined < 100){
52+
justJoined += 1;
5353
return;
5454
}
5555

@@ -61,6 +61,7 @@ public void onPacketPlayReceive(PacketPlayReceiveEvent e) {
6161

6262
boolean boat = false;
6363
boolean shulker = false;
64+
boolean pistonHead = false;
6465

6566
AtomicReference<List<Entity>> nearby = new AtomicReference<>();
6667
sync(() -> nearby.set(player.getNearbyEntities(1.5, 10, 1.5)));
@@ -83,9 +84,14 @@ public void onPacketPlayReceive(PacketPlayReceiveEvent e) {
8384
shulker = true;
8485
break;
8586
}
87+
88+
if (block.getType() == Material.PISTON_HEAD) {
89+
pistonHead = true;
90+
break;
91+
}
8692
}
8793

88-
if (!boat && !shulker) {
94+
if (!boat && !shulker && !pistonHead) {
8995
String suspectedHack;
9096
if(packet.getY() % groundY == 0.0){
9197
suspectedHack = "Criticals/Anti Hunger";

src/main/java/com/justdoom/flappyanticheat/checks/movement/speed/SpeedA.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import io.github.retrooper.packetevents.packetwrappers.play.in.flying.WrappedPacketInFlying;
1111
import org.bukkit.Bukkit;
1212
import org.bukkit.Location;
13+
import org.bukkit.Material;
1314
import org.bukkit.Tag;
1415
import org.bukkit.block.Block;
1516
import org.bukkit.entity.Entity;
@@ -62,7 +63,17 @@ public void onPacketPlayReceive(PlayerMoveEvent event) {
6263
double bufferOrDefault = this.buffer.getOrDefault(uuid, 0.0);
6364

6465
if (!PlayerUtil.isOnClimbable(player) && !onGround && !lastOnGround && !(player.getNearbyEntities(1.5, 10, 1.5).size() > 0) && this.buffer.put(uuid, ++bufferOrDefault) > 2) {
65-
if (equalness > 0.027) {
66+
67+
boolean pistonHead = false;
68+
69+
for (Block block : PlayerUtil.getNearbyBlocks(new Location(player.getWorld(), player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getZ()), 2)) {
70+
if (block.getType() == Material.PISTON_HEAD) {
71+
pistonHead = true;
72+
break;
73+
}
74+
}
75+
76+
if (equalness > 0.027 && !pistonHead) {
6677
Bukkit.getScheduler().runTaskAsynchronously(FlappyAnticheat.getInstance(), () -> fail("e=" + equalness, player));
6778
}
6879
} else if(this.buffer.getOrDefault(uuid, 0.0) > 0) {

src/main/java/com/justdoom/flappyanticheat/checks/player/badpackets/BadPacketsB.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
import io.github.retrooper.packetevents.PacketEvents;
99
import io.github.retrooper.packetevents.event.impl.PacketPlayReceiveEvent;
1010
import io.github.retrooper.packetevents.packettype.PacketType;
11+
import io.github.retrooper.packetevents.packetwrappers.play.in.useentity.WrappedPacketInUseEntity;
1112

1213
public class BadPacketsB extends Check {
1314

14-
private boolean wasLastArmAnimation = false;
15+
private boolean wasLastArmAnimation;
1516

1617
public BadPacketsB(){
1718
super("BadPackets", "B", false);
@@ -22,10 +23,12 @@ public void onPacketPlayReceive(PacketPlayReceiveEvent event) {
2223

2324
if (event.getPacketId() == PacketType.Play.Client.USE_ENTITY){
2425

26+
WrappedPacketInUseEntity packetInUseEntity = new WrappedPacketInUseEntity(event.getNMSPacket());
27+
2528
if(ServerUtil.lowTPS(("checks." + check + "." + checkType).toLowerCase()))
2629
return;
2730

28-
if(!wasLastArmAnimation){
31+
if(!wasLastArmAnimation && packetInUseEntity.getAction() == WrappedPacketInUseEntity.EntityUseAction.ATTACK){
2932
fail("&7ArmAnimation=&2false", event.getPlayer());
3033
}
3134
} else if (event.getPacketId() == PacketType.Play.Client.ARM_ANIMATION){

src/main/java/com/justdoom/flappyanticheat/checks/player/blockplace/BlockPlaceB.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void onBlockPlace(BlockPlaceEvent event) {
3030
if(ServerUtil.lowTPS(("checks." + check + "." + checkType).toLowerCase()))
3131
return;
3232

33-
if (block.getType() != hand.getType()) {
33+
if (block.getType() != hand.getType() && block.getType() != player.getInventory().getItemInOffHand().getType()) {
3434

3535
Bukkit.getScheduler().runTaskAsynchronously(FlappyAnticheat.getInstance(), () -> fail("hand=" + hand.getType() + " placed=" + block.getType(), player));
3636
}

update-log.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ Stopped violation resets from running with no players online and spamming the co
7979

8080
1.6.3 BETA
8181
Fixed Speed A false on climbables
82+
Fixed false with Speed A and Timer A when multiple people are moving/running (oops)
83+
Fixed piston false with GroundSpoof and Speed A (I think)
84+
Fixed groundspoof A false when dead body falls into void
85+
Fixed blockplace B false with placing blocks with offhand
86+
Fixed BlockPlace B false when right clicking entities
87+
Fixed false with GroundSpoof A on join
88+
8289

8390

8491
Todo
@@ -118,13 +125,9 @@ api todo
118125

119126

120127
false todo
121-
groundspoof/fly A piston elevator false (believe its when your glitched inside piston head)
122128
groundspoof A on join false
123-
fix badpackets B false with worldguard
124-
random badpackets b falses
129+
fix badpackets B false with worldguard?
125130
speed a false with slime launching
126131
speed a false (with eating?) and jumping up blocks
127132
speed a false when jumping side to side
128-
blockplace B false with placing blocks with offhand
129-
groundspoof A false when dead body falls into void
130-
speed A false when taking damage?
133+
speed A false when taking damage in the air?

0 commit comments

Comments
 (0)