Skip to content

Commit

Permalink
feat: requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
overkidding committed Dec 2, 2024
1 parent fc881fa commit e14d5ed
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/java/ac/grim/grimac/checks/Check.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class Check implements AbstractCheck, ConfigReloadObserver {
private boolean isEnabled;
private boolean exempted;

private CheckType type = CheckType.OTHER;
private CheckType type;

@Override
public boolean isExperimental() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ac/grim/grimac/checks/CheckData.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@

boolean experimental() default false;

CheckType checkType();
CheckType checkType() default CheckType.OTHER;

}
6 changes: 2 additions & 4 deletions src/main/java/ac/grim/grimac/checks/CheckType.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,15 @@
import org.apache.commons.lang.StringUtils;

public enum CheckType {

MOVEMENT,
ROTATION,
COMBAT,
PACKETS,
WORLD,
OTHER;

public String displayName(){
String loweredEnumName = this.name().toLowerCase();
return StringUtils.capitalize(loweredEnumName);
public String displayName() {
return StringUtils.capitalize(this.name().toLowerCase());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.CheckData;
import ac.grim.grimac.checks.CheckType;
import ac.grim.grimac.checks.type.PostPredictionCheck;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.anticheat.update.PredictionComplete;
Expand All @@ -13,7 +14,7 @@

import java.util.ArrayList;

@CheckData(name = "MultiInteractA", experimental = true)
@CheckData(name = "MultiInteractA", experimental = true, checkType = CheckType.COMBAT)
public class MultiInteractA extends Check implements PostPredictionCheck {
public MultiInteractA(final GrimPlayer player) {
super(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.CheckData;
import ac.grim.grimac.checks.CheckType;
import ac.grim.grimac.checks.type.PostPredictionCheck;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.anticheat.MessageUtil;
Expand All @@ -15,7 +16,7 @@

import java.util.ArrayList;

@CheckData(name = "MultiInteractB", experimental = true)
@CheckData(name = "MultiInteractB", experimental = true, checkType = CheckType.COMBAT)
public class MultiInteractB extends Check implements PostPredictionCheck {
public MultiInteractB(final GrimPlayer player) {
super(player);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.CheckData;
import ac.grim.grimac.checks.CheckType;
import ac.grim.grimac.checks.type.PacketCheck;
import ac.grim.grimac.player.GrimPlayer;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientEditBook;

@CheckData(name = "ExploitC")
@CheckData(name = "ExploitC", checkType = CheckType.PACKETS)
public class ExploitC extends Check implements PacketCheck {
public ExploitC(GrimPlayer playerData) {
super(playerData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

// Catches NoFalls for LOOK and GROUND packets
// This check runs AFTER the predictions
@CheckData(name = "NoFall", configName = "nofall", setback = 10, checkType = CheckType.PACKETS)
@CheckData(name = "NoFall", configName = "nofall", setback = 10, checkType = CheckType.MOVEMENT)
public class NoFallA extends Check implements PacketCheck {

public boolean flipPlayerGroundStatus = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;

@CheckData(name = "Prediction (Debug)", checkType = CheckType.MOVEMENT)
@CheckData(name = "Prediction (Debug)", checkType = CheckType.OTHER)
public class DebugHandler extends Check implements PostPredictionCheck {

Set<Player> listeners = new CopyOnWriteArraySet<>(new HashSet<>());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ac.grim.grimac.utils.anticheat.update.BlockPlace;
import ac.grim.grimac.utils.anticheat.update.RotationUpdate;

@CheckData(name = "DuplicateRotPlace", experimental = true, checkType = CheckType.WORLD)
@CheckData(name = "DuplicateRotPlace", experimental = true, checkType = CheckType.ROTATION)
public class DuplicateRotPlace extends BlockPlaceCheck {

public DuplicateRotPlace(GrimPlayer player) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ac.grim.grimac.checks.impl.scaffolding;

import ac.grim.grimac.checks.CheckData;
import ac.grim.grimac.checks.CheckType;
import ac.grim.grimac.checks.type.BlockPlaceCheck;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.anticheat.MessageUtil;
Expand All @@ -16,7 +17,7 @@
import java.util.ArrayList;
import java.util.List;

@CheckData(name = "MultiPlace", experimental = true)
@CheckData(name = "MultiPlace", experimental = true, checkType = CheckType.WORLD)
public class MultiPlace extends BlockPlaceCheck {
public MultiPlace(GrimPlayer player) {
super(player);
Expand Down

0 comments on commit e14d5ed

Please sign in to comment.