Skip to content

Commit

Permalink
Fixed configs
Browse files Browse the repository at this point in the history
  • Loading branch information
XIII-MC committed Aug 29, 2024
1 parent 5a8cd3a commit 9af3b47
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/gteam/wave/checks/CheckHolder.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import net.gteam.wave.checks.annotations.Disabled;
import net.gteam.wave.checks.impl.fly.Fly10A;
import net.gteam.wave.checks.impl.jump.Jump5A;
import net.gteam.wave.checks.impl.motion.Speed5A;
import net.gteam.wave.checks.impl.motion.Speed10A;
import net.gteam.wave.checks.types.Check;
import net.gteam.wave.managers.profile.Profile;
import net.gteam.wave.processors.ClientPlayPacket;
Expand Down Expand Up @@ -36,7 +36,7 @@ public void registerAll() {

new Fly10A(this.profile),
new Jump5A(this.profile),
new Speed5A(this.profile)
new Speed10A(this.profile)

);

Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/gteam/wave/checks/impl/fly/Fly10A.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import net.gteam.wave.processors.ClientPlayPacket;
import net.gteam.wave.processors.ServerPlayPacket;

@Development
public class Fly10A extends Check {

public Fly10A(final Profile profile) {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/net/gteam/wave/checks/impl/jump/Jump5A.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.gteam.wave.utils.custom.CustomEffect;
import net.gteam.wave.utils.custom.EffectType;

@Development
public class Jump5A extends Check {

public Jump5A(final Profile profile) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import net.gteam.wave.processors.ClientPlayPacket;
import net.gteam.wave.processors.ServerPlayPacket;

public class Speed5A extends Check {
public class Speed10A extends Check {

public Speed5A(final Profile profile) {
super(profile, CheckType.SPEED, "SP5A", "Impossible XZ speed");
public Speed10A(final Profile profile) {
super(profile, CheckType.SPEED, "SP10A", "Impossible XZ speed");
}

@Override
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/gteam/wave/checks/types/AbstractCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public abstract class AbstractCheck {
private final boolean development, disabled, experimental;
private final CheckCategory checkCategory;
private final CheckType check;
private int vl;
private int vl = 1;
private final int maxVl;
private float buffer;
private String verbose = "";
Expand All @@ -57,13 +57,13 @@ public AbstractCheck(final Profile profile, final CheckType check, final String

this.enabled = type.isEmpty()
? config.getBoolean(codeName + ".enabled")
: config.getBoolean(codeName + "." + checkType + ".enabled", config.getBoolean(codeName + "." + checkType));
: config.getBoolean(codeName + "." + checkType + ".enabled", config.getBoolean(codeName + "." + checkType + ".enabled"));

this.maxVl = config.getInt(codeName + ".max_vl");
this.maxVl = config.getInt(codeName + "." + checkType + ".max_vl");

if (profile != null) {
this.commands.addAll(
BetterStream.applyAndGet(config.getStringList(codeName + ".commands"),
BetterStream.applyAndGet(config.getStringList(codeName + "." + checkType + ".commands"),
command -> command.replace("%player%", profile.getPlayer().getName())
)
);
Expand Down
32 changes: 18 additions & 14 deletions src/main/java/net/gteam/wave/files/Checks.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,24 @@ public void shutdown() {
}

public enum Setting {
FLY("fly", "", "Fly Check"),
FLY_FL10A("fly.fl10a", true, "Should we enable this module?"),
FLY_MAX_VL("fly.max_vl", 10, "The maximum violation amount a player needs to reach in order to get punished"),
FLY_COMMANDS("fly.commands", Collections.singletonList("kick %player% Unfair Advantage"), "The commands that will get executed once a player reaches the maximum violation amount"),

JUMP("jump", "", "Jump Check"),
JUMP_JU5A("jump.ju5a", true, "Should we enable this module?"),
JUMP_MAX_VL("jump.max_vl", 5, "The maximum violation amount a player needs to reach in order to get punished"),
JUMP_COMMANDS("jump.commands", Collections.singletonList("kick %player% Unfair Advantage"), "The commands that will get executed once a player reaches the maximum violation amount"),

SPEED("speed", "", "Speed Check"),
SPEED_SP10A("speed.sp10a", true, "Should we enable this module?"),
SPEED_MAX_VL("speed.max_vl", 10, "The maximum violation amount a player needs to reach in order to get punished"),
SPEED_COMMANDS("speed.commands", Collections.singletonList("kick %player% Unfair Advantage"), "The commands that will get executed once a player reaches the maximum violation amount");
FLY("fly", "", "Fly Checks"),
FLY_FL10A("fly.fl10a", true, "Should we enable this check ?"),
FLY_FL10A_MAX_VL("fly.fl10a.max_vl", 10, "The maximum violation amount a player needs to reach in order to get punished"),
FLY_FL10A_COMMANDS("fly.fl10a.commands", Collections.singletonList("kick %player% Unfair Advantage"), "The commands that will get executed once a player reaches the maximum violation amount"),

JUMP("jump", "", "Jump Checks"),
JUMP_JU5A("jump.ju5a", true, "Should we enable this check ?"),
JUMP_JU5A_MAX_VL("jump.ju5a.max_vl", 5, "The maximum violation amount a player needs to reach in order to get punished"),
JUMP_JU5A_COMMANDS("jump.ju5a.commands", Collections.singletonList("kick %player% Unfair Advantage"), "The commands that will get executed once a player reaches the maximum violation amount"),

SPEED("speed", "", "Jump Checks"),
SPEED_SP10A("speed.sp10a", true, "Should we enable this check ?"),
SPEED_SP10A_MAX_VL("speed.sp10a.max_vl", 10, "The maximum violation amount a player needs to reach in order to get punished"),
SPEED_SP10A_COMMANDS("speed.sp10a.commands", Collections.singletonList("kick %player% Unfair Advantage"), "The commands that will get executed once a player reaches the maximum violation amount"),

// Next check

;

private final String key;
private final Object defaultValue;
Expand Down

0 comments on commit 9af3b47

Please sign in to comment.