Skip to content

Commit

Permalink
reach and couple other things
Browse files Browse the repository at this point in the history
  • Loading branch information
BuildTools committed Jul 5, 2021
1 parent f2bdf0d commit d55c61f
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 23 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.justdoom</groupId>
<artifactId>FlappyAnticheat</artifactId>
<version>1.6.3-BETA</version>
<version>1.6.4-BETA</version>
<packaging>jar</packaging>

<name>FlappyAnticheat</name>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/justdoom/flappyanticheat/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ public class Config {
public Config(){

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public void punish(Player player, String path){
String finalCommand = command;
Bukkit.getScheduler().runTask(FlappyAnticheat.getInstance(), () -> Bukkit.dispatchCommand(Bukkit.getConsoleSender(), finalCommand));
}

if(FlappyAnticheat.getInstance().getConfig().getBoolean(path + ".broadcast-punishment")) {
for (Player p : Bukkit.getOnlinePlayers()) {
p.sendMessage(Color.translate(FlappyAnticheat.getInstance().getConfig().getString("messages.punish")).replace("{player}", player.getName()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

import com.justdoom.flappyanticheat.FlappyAnticheat;
import com.justdoom.flappyanticheat.checks.combat.forcefield.ForcefieldA;
import com.justdoom.flappyanticheat.checks.combat.range.RangeA;
import com.justdoom.flappyanticheat.checks.movement.fly.FlyA;
import com.justdoom.flappyanticheat.checks.combat.reach.ReachA;
import com.justdoom.flappyanticheat.checks.movement.groundspoof.GroundSpoofA;
import com.justdoom.flappyanticheat.checks.movement.noslow.NoSlowA;
import com.justdoom.flappyanticheat.checks.movement.speed.SpeedA;
import com.justdoom.flappyanticheat.checks.player.anticactus.AntiCactusA;
import com.justdoom.flappyanticheat.checks.player.badpackets.BadPacketsB;
import com.justdoom.flappyanticheat.checks.player.blockplace.BlockPlaceA;
import com.justdoom.flappyanticheat.checks.player.badpackets.BadPacketsA;
import com.justdoom.flappyanticheat.checks.player.badpackets.BadPacketsB;
import com.justdoom.flappyanticheat.checks.player.blockplace.BlockPlaceB;
import com.justdoom.flappyanticheat.checks.player.inventory.InventoryA;
import com.justdoom.flappyanticheat.checks.player.skinblinker.SkinBlinkerA;
import com.justdoom.flappyanticheat.checks.player.timer.TimerA;
import io.github.retrooper.packetevents.PacketEvents;
Expand All @@ -36,7 +33,7 @@ public void loadChecks(){
PacketEvents.get().registerListener(new AntiCactusA());
PacketEvents.get().registerListener(new TimerA());
PacketEvents.get().registerListener(new ForcefieldA());
//PacketEvents.get().registerListener(new RangeA());
PacketEvents.get().registerListener(new ReachA());

Bukkit.getPluginManager().registerEvents(new BlockPlaceA(), plugin);
Bukkit.getPluginManager().registerEvents(new BlockPlaceB(), plugin);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.justdoom.flappyanticheat.checks.combat.range;
package com.justdoom.flappyanticheat.checks.combat.reach;

import com.justdoom.flappyanticheat.FlappyAnticheat;
import com.justdoom.flappyanticheat.checks.Check;
Expand All @@ -8,15 +8,14 @@
import io.github.retrooper.packetevents.event.impl.PacketPlaySendEvent;
import io.github.retrooper.packetevents.packettype.PacketType;
import io.github.retrooper.packetevents.packetwrappers.play.in.useentity.WrappedPacketInUseEntity;
import org.bukkit.Bukkit;
import org.bukkit.entity.LivingEntity;
import org.bukkit.util.BoundingBox;
import org.bukkit.util.Vector;

import java.util.ArrayList;
import java.util.List;

public class RangeA extends Check {
public class ReachA extends Check {

private long lastKP;
private int preVL;
Expand All @@ -35,8 +34,8 @@ private List<BoundingBox> rayBB(PlayerData data, int ticks) {

}

public RangeA() {
super("Range", "A", false);
public ReachA() {
super("Reach", "A", false);
}

@Override
Expand All @@ -56,7 +55,7 @@ public void onPacketPlayReceive(PacketPlayReceiveEvent event) {
if(this.preVL++ > 4) {
fail("d=" + (float) distance, data.player);
}
}else this.preVL *= 0.975;
} else this.preVL *= 0.975;
//Bukkit.broadcastMessage("distance=" + distance);


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package com.justdoom.flappyanticheat.customevents;

import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;

import java.util.Collection;
import java.util.List;

public class ViolationResetEvent extends Event implements Cancellable {

private static final HandlerList HANDLERS = new HandlerList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ public void getVersion(Consumer<String> consumer) {
}
});
}
}
}
13 changes: 12 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ checks:
- "kick {player} FlappyAC > Suspicious Activity"
vl: 10
b:
enabled: true
#this check currently falses a fair bit so disabled by default
enabled: false
min-tps: 17.0
punishable: true
broadcast-punishment: true
Expand Down Expand Up @@ -109,6 +110,16 @@ checks:
- "kick {player} FlappyAC > Suspicious Activity"
vl: 10
forcefield:
a:
enabled: true
min-tps: 17.0
punishable: true
broadcast-punishment: true
punish-vl: 200
punish-commands:
- "kick {player} FlappyAC > Suspicious Activity"
vl: 10
reach:
a:
enabled: true
min-tps: 17.0
Expand Down
15 changes: 8 additions & 7 deletions update-log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ Fixed blockplace B false with placing blocks with offhand
Fixed BlockPlace B false when right clicking entities
Fixed false with GroundSpoof A on join

1.6.4 BETA
Disabled BadPackets B by default because too many falses when attacking entities legit
Added a Reach check


Todo
- add speed and forcefield to config

- better fly check

Todo
- change flag to output config option to output to console or something

- More checks
Expand All @@ -112,9 +112,10 @@ Todo
- Maybe create a website that lets you edit the config easily (change from kick punishments to ban punishments quickly)
- Better way to get values from config
- 1.17 support
- disable op bypass?
- disable op bypass option?
- worldguard support because has to many issues (groundspoof breaking below block and badpackets (a or b?) when attacking)

- fix alerts toggle not working (works again????)
- make flag output to console in compacted messages (Player flagged Speed A 1000 times)


api todo
Expand All @@ -129,5 +130,5 @@ groundspoof A on join false
fix badpackets B false with worldguard?
speed a false with slime launching
speed a false (with eating?) and jumping up blocks
speed a false when jumping side to side
speed a false when jumping side to side?
speed A false when taking damage in the air?

0 comments on commit d55c61f

Please sign in to comment.