Skip to content

Commit

Permalink
finally use that util I added a while ago
Browse files Browse the repository at this point in the history
  • Loading branch information
ManInMyVan committed Jan 19, 2025
1 parent 924dcf9 commit 111cc7a
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public void onPacketReceive(PacketReceiveEvent event) {
}

if (interact.getAction() == WrapperPlayClientInteractEntity.InteractAction.ATTACK) {
if (player.isMitigateAutoblock()) {
player.resetBukkitItemUsage();
}

ItemStack heldItem = player.getInventory().getHeldItem();
PacketEntity entity = player.compensatedEntities.getEntity(interact.getEntityId());

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/ac/grim/grimac/player/GrimPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,7 @@ public void runNettyTaskInMs(Runnable runnable, int ms) {
@Getter @Setter private boolean experimentalChecks = false;
@Getter private boolean cancelDuplicatePacket = true;
@Getter @Setter private boolean exemptElytra = false;
@Getter private boolean mitigateAutoblock;

@Override
public void reload(ConfigManager config) {
Expand All @@ -840,6 +841,7 @@ public void reload(ConfigManager config) {
maxTransactionTime = GrimMath.clamp(config.getIntElse("max-transaction-time", 60), 1, 180);
ignoreDuplicatePacketRotation = config.getBooleanElse("ignore-duplicate-packet-rotation", false);
cancelDuplicatePacket = config.getBooleanElse("cancel-duplicate-packet", true);
mitigateAutoblock = config.getBooleanElse("mitigate-autoblock", false);
// reload all checks
for (AbstractCheck value : checkManager.allChecks.values()) value.reload();
// reload punishment manager
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ debug-pipeline-on-join: false
# Aktiviert experimentelle Prüfungen
experimental-checks: false

mitigate-autoblock: false

# Grim bricht manchmal illegale Pakete ab, z.B. mit Timer, nachdem X Pakete in einer Sekunde abgebrochen wurden, wann sollte
# wir den Spieler einfach kicken? Dies ist erforderlich, da einige Paketbegrenzer die von Grim abgebrochenen Pakete nicht zählen.
packet-spam-threshold: 100
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ debug-pipeline-on-join: false
# Enables experimental checks
experimental-checks: false

mitigate-autoblock: false

# Grim sometimes cancels illegal packets such as with timer, after X packets in a second cancelled, when should
# we simply kick the player? This is required as some packet limiters don't count packets cancelled by grim.
packet-spam-threshold: 100
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ debug-pipeline-on-join: false
# Habilitar comprobaciones experimentales
experimental-checks: false

mitigate-autoblock: false

# Grim a veces cancela paquetes ilegal como los de Timer. Después de X paquetes en un solo segundo cancelados,
# cuando deberíamos simplemente expulsar al jugador? Esto es obligatorio ya que algunos limitadores de paquetes
# no cuentan los paquetes cancelados por Grim.
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ debug-pipeline-on-join: false
# Active les vérifications expérimentales
experimental-checks: false

mitigate-autoblock: false

# Grim annule parfois des paquets illégaux, comme ceux liés au chronomètre, après avoir annulé X paquets en une seconde,
# à partir de combien de paquets annulés devrions-nous simplement expulser le joueur ?
# Cela est nécessaire car certains limiteurs de paquets ne comptent pas les paquets annulés par Grim.
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ debug-pipeline-on-join: false
# Enables experimental checks
experimental-checks: false

mitigate-autoblock: false

# Grim sometimes cancels illegal packets such as with timer, after X packets in a second cancelled, when should
# we simply kick the player? This is required as some packet limiters don't count packets cancelled by grim.
packet-spam-threshold: 100
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ debug-pipeline-on-join: false
# 実験的なチェックを有効にします
experimental-checks: false

mitigate-autoblock: false

# Grimは "Timer" のような違反パケットをキャンセルすることがありますが、1秒間にキャンセルされたパケット数がXを超えた場合、
# プレイヤーを強制的にキックしますか?これは、いくつかのパケットリミッターがGrimによってキャンセルされたパケットをカウントしないためです。
packet-spam-threshold: 100
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ debug-pipeline-on-join: false
# Experimentele controles inschakelen
experimental-checks: false

mitigate-autoblock: false

# Grim annuleert soms illegale pakketten zoals met timer, na X pakketten in een seconde geannuleerd, wanneer moeten
# we de speler gewoon schoppen? Dit is nodig omdat sommige pakket-begrenzers pakketten die door grim worden geannuleerd niet tellen
packet-spam-threshold: 100
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ debug-pipeline-on-join: false
# Habilita verificações experimentais.
experimental-checks: false

mitigate-autoblock: false

# Grim às vezes cancela pacotes ilegais como com o timer, depois de X pacotes em um segundo que foram cancelados, quando
# deve-se simplesmente expulsar o jogador? Isso é requirido já que alguns limitadores de pacotes não contam pacotes
# cancelados pelo Grim.
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ debug-pipeline-on-join: false
# Включает экспериментальные проверки
experimental-checks: false

mitigate-autoblock: false

# Грим иногда отменяет незаконные пакеты, например, с таймером, после X пакетов в секунду отмененных, когда следует
# нам просто кикнуть игрока? Это необходимо, так как некоторые ограничители пакетов не учитывают пакеты, отмененные Гримом.
packet-spam-threshold: 100
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/tr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ debug-pipeline-on-join: false
# Deneysel kontrolleri etkinleştir
experimental-checks: false

mitigate-autoblock: false

# Grim bazen timer gibi yasa dışı paketleri iptal eder; bir saniyede X paket iptal edildikten sonra, ne zaman
# oyuncuyu basitçe atmalıyız? Bu, bazı paket sınırlayıcılarının Grim tarafından iptal edilen paketleri saymaması gerektiğindendir.
packet-spam-threshold: 100
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config/zh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ debug-pipeline-on-join: false
# 启用实验性检查
experimental-checks: false

mitigate-autoblock: false

# Grim有时会取消非法的数据包,比如用timer,在一秒钟内取消了数个数据包后,我们应该踢掉这个玩家?
# 我们认为是应该的,因为有些数据包限制器并不计算被Grim取消的数据包。
packet-spam-threshold: 100
Expand Down

0 comments on commit 111cc7a

Please sign in to comment.