-
Notifications
You must be signed in to change notification settings - Fork 324
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch full autoblock and desync noslows
- Loading branch information
1 parent
60f8812
commit 7b0ae9b
Showing
17 changed files
with
234 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,4 +35,4 @@ public void onPacketReceive(PacketReceiveEvent event) { | |
} | ||
} | ||
} | ||
} | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/ac/grim/grimac/checks/impl/movement/NoSlowMitigation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package ac.grim.grimac.checks.impl.movement; | ||
|
||
import ac.grim.grimac.GrimAPI; | ||
import ac.grim.grimac.api.config.ConfigManager; | ||
import ac.grim.grimac.checks.Check; | ||
import ac.grim.grimac.checks.type.PostPredictionCheck; | ||
import ac.grim.grimac.player.GrimPlayer; | ||
import ac.grim.grimac.utils.anticheat.update.PredictionComplete; | ||
|
||
public class NoSlowMitigation extends Check implements PostPredictionCheck { | ||
private double offsetToFlag; | ||
private double bestOffset = 1; | ||
private boolean flaggedLastTick; | ||
|
||
public NoSlowMitigation(GrimPlayer player) { | ||
super(player); | ||
} | ||
|
||
@Override | ||
public void onPredictionComplete(final PredictionComplete predictionComplete) { | ||
if (!predictionComplete.isChecked()) return; | ||
|
||
if (wouldFlag()) { | ||
if (flaggedLastTick) { | ||
player.resetBukkitItemUsage(); | ||
} | ||
flaggedLastTick = true; | ||
} else flaggedLastTick = false; | ||
|
||
bestOffset = 1; | ||
} | ||
|
||
public void handlePredictionAnalysis(double offset) { | ||
bestOffset = Math.min(bestOffset, offset); | ||
} | ||
|
||
public boolean wouldFlag() { | ||
return player.isMitigateNoSlow() | ||
&& !player.packetStateData.isSlowedByUsingItem() | ||
&& bestOffset > offsetToFlag | ||
&& player.isUsingBukkitItem(); | ||
} | ||
|
||
@Override | ||
public void onReload(ConfigManager config) { | ||
offsetToFlag = config.getDoubleElse("mitigate-noslow-threshold", 0.001); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.