Skip to content

Commit a894866

Browse files
committed
allow configuring RotationPlace flagBuffer
1 parent 9599b1c commit a894866

File tree

10 files changed

+52
-7
lines changed

10 files changed

+52
-7
lines changed

src/main/java/ac/grim/grimac/checks/impl/scaffolding/RotationPlace.java

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package ac.grim.grimac.checks.impl.scaffolding;
22

3+
import ac.grim.grimac.api.config.ConfigManager;
34
import ac.grim.grimac.checks.CheckData;
45
import ac.grim.grimac.checks.type.BlockPlaceCheck;
56
import ac.grim.grimac.player.GrimPlayer;
@@ -24,8 +25,12 @@
2425

2526
@CheckData(name = "RotationPlace")
2627
public class RotationPlace extends BlockPlaceCheck {
27-
double flagBuffer = 0; // If the player flags once, force them to play legit, or we will cancel the tick before.
28-
boolean ignorePost = false;
28+
private double flagBufferMax = 1;
29+
private double flagBufferIncrement = 1;
30+
private double flagBufferDecay = 0.1;
31+
32+
private double flagBuffer = 0; // If the player flags once, force them to play legit, or we will cancel the tick before.
33+
private boolean ignorePost = false;
2934

3035
public RotationPlace(GrimPlayer player) {
3136
super(player);
@@ -60,10 +65,10 @@ public void onPostFlyingBlockPlace(BlockPlace place) {
6065
boolean hit = didRayTraceHit(place);
6166
// This can false with rapidly moving yaw in 1.8+ clients
6267
if (!hit) {
63-
flagBuffer = 1;
68+
flagBuffer = Math.min(flagBuffer + flagBufferIncrement, flagBufferMax);
6469
flagAndAlert("post-flying");
6570
} else {
66-
flagBuffer = Math.max(0, flagBuffer - 0.1);
71+
flagBuffer = Math.max(0, flagBuffer - flagBufferDecay);
6772
}
6873
}
6974

@@ -113,4 +118,17 @@ private boolean didRayTraceHit(BlockPlace place) {
113118

114119
return false;
115120
}
121+
122+
@Override
123+
public void onReload(ConfigManager config) {
124+
super.onReload(config);
125+
126+
flagBufferMax = config.getDoubleElse(getConfigName() + ".flag-buffer-max", 1);
127+
flagBufferIncrement = config.getDoubleElse(getConfigName() + ".flag-buffer-increment", 1);
128+
flagBufferDecay = config.getDoubleElse(getConfigName() + ".flag-buffer-decay", 0.1);
129+
130+
if (flagBufferMax == -1) {
131+
flagBufferMax = Double.MAX_VALUE;
132+
}
133+
}
116134
}

src/main/resources/config/de.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ PositionPlace:
8383

8484
RotationPlace:
8585
cancelvl: 5
86+
flag-buffer-max: 1 # set to -1 to disable
87+
flag-buffer-increment: 1
88+
flag-buffer-decay: 0.1
8689

8790
# Prediction-based no slow check
8891
# Grim ist verantwortlich für den fehlerhaften Netcode hier... schwer zu falsen, selbst wenn man Rechtsklick und Offhand-Taste spammt.

src/main/resources/config/en.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ PositionPlace:
8383

8484
RotationPlace:
8585
cancelvl: 5
86+
flag-buffer-max: 1 # set to -1 to disable
87+
flag-buffer-increment: 1
88+
flag-buffer-decay: 0.1
8689

8790
# Prediction-based no slow check
8891
# Grim accounts for buggy netcode here... hard to false even when spamming right click and offhand button

src/main/resources/config/es.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ PositionPlace:
8484

8585
RotationPlace:
8686
cancelvl: 5
87+
flag-buffer-max: 1 # set to -1 to disable
88+
flag-buffer-increment: 1
89+
flag-buffer-decay: 0.1
8790

8891
# Comprobación de NoSlow basado en predicciones
8992
# Grim compensa por código de red con errores aquí... difícil de sacar un falso positivo incluso haciendo spam del

src/main/resources/config/fr.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ Simulation:
5353
# Nous prenons en compte Optifine en changeant les tables trigonométriques, mais en réduisant cela à 0.001, cela réduira les signalements de l'anticheat
5454
# sur FastMath si cette compensation ne fonctionne pas...
5555
threshold: 0.001
56-
# Quelle est la distance maximale d'une violation par tick avant que le joueur ne soit immédiatement renvoyé en arrière ?
56+
# Quelle est la distance maximale d'une violation par tick avant que le joueur ne soit immédiatement renvoyé en arrière ?
5757
# -1 pour désactiver
5858
immediate-setback-threshold: 0.1
59-
# Quelle est la distance maximale d'une violation sur tout les ticks avant que l'anti-cheat commence à renvoyer en arrière ?
59+
# Quelle est la distance maximale d'une violation sur tout les ticks avant que l'anti-cheat commence à renvoyer en arrière ?
6060
# -1 pour désactiver
6161
max-advantage: 1
6262
# Après 50 secondes avec la configuration par défaut, le joueur passera de 4 blocs -> 1 bloc d'avantage
@@ -83,6 +83,9 @@ PositionPlace:
8383

8484
RotationPlace:
8585
cancelvl: 5
86+
flag-buffer-max: 1 # set to -1 to disable
87+
flag-buffer-increment: 1
88+
flag-buffer-decay: 0.1
8689

8790
# Vérification de no-slow basée sur la prédiction.
8891
# Grim tient compte des problèmes de netcode ici... difficile à tromper même en spamant le clic droit et le bouton de la main secondaire.
@@ -141,7 +144,7 @@ EntityControl:
141144

142145
Reach:
143146
# De combien devrions-nous agrandir les hitboxes ? Une augmentation de 0,0005 devrait détecter une portée de 3,0005 ou plus.
144-
#
147+
#
145148
# Il y a un agrandissement forcé de 0,03 avec les versions 1.9 à 1.18.1 (pas 1.18.2) ou certaines combinaisons client/serveur en raison
146149
# des changements et limitations du protocole. Cette vérification est particulièrement puissante avec les clients 1.7/1.8 sur les serveurs 1.8.
147150
threshold: 0.0005

src/main/resources/config/it.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ PositionPlace:
8181
RotationPlace:
8282
# Livello di violazione per il piazzamento con rotazione specifica
8383
cancelvl: 5
84+
flag-buffer-max: 1 # set to -1 to disable
85+
flag-buffer-increment: 1
86+
flag-buffer-decay: 0.1
8487

8588
NoSlowA:
8689
# Limite per rilevare l'uso scorretto dell'oggetto

src/main/resources/config/nl.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ PositionPlace:
8383

8484
RotationPlace:
8585
cancelvl: 5
86+
flag-buffer-max: 1 # set to -1 to disable
87+
flag-buffer-increment: 1
88+
flag-buffer-decay: 0.1
8689

8790
# Op voorspelling gebaseerde NoSlow-controle
8891
# Grim is verantwoordelijk voor buggy netcode hier... moeilijk om vals te spelen, zelfs als je met rechts klikt en de offhand-knop spamt

src/main/resources/config/pt.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ PositionPlace:
8484

8585
RotationPlace:
8686
cancelvl: 5
87+
flag-buffer-max: 1 # set to -1 to disable
88+
flag-buffer-increment: 1
89+
flag-buffer-decay: 0.1
8790

8891
# Verificação de NoSlow por simulação.
8992
# Grim considera erros no netcode. Difícil de gerar falsos positivos, até mesmo spamando o blotão direito e a offhand.

src/main/resources/config/ru.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ PositionPlace:
8383

8484
RotationPlace:
8585
cancelvl: 5
86+
flag-buffer-max: 1 # set to -1 to disable
87+
flag-buffer-increment: 1
88+
flag-buffer-decay: 0.1
8689

8790
# Основанная на предсказаниях проверка на отсутствие замедления
8891
# Grim учитывает баги неткода здесь... трудно ошибиться, даже если спамить правым кликом и кнопкой оффхенд.

src/main/resources/config/zh.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ PositionPlace:
8484

8585
RotationPlace:
8686
cancelvl: 5
87+
flag-buffer-max: 1 # set to -1 to disable
88+
flag-buffer-increment: 1
89+
flag-buffer-decay: 0.1
8790

8891
# 使用模拟移动进行的NoSlow(使用物品时不会减速)检查
8992
# 在这里解释错误的服务器代码......即使在发送垃圾数据包时右键单击和副手按钮也很分辨

0 commit comments

Comments
 (0)