-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
41 additions
and
0 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
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
35 changes: 35 additions & 0 deletions
35
veinminer-bukkit/src/main/java/wtf/choco/veinminer/anticheat/AntiCheatHookNegativity.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,35 @@ | ||
package wtf.choco.veinminer.anticheat; | ||
|
||
import com.elikill58.negativity.universal.bypass.BypassManager; | ||
|
||
import java.util.HashSet; | ||
import java.util.Set; | ||
import java.util.UUID; | ||
|
||
import org.bukkit.entity.Player; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public final class AntiCheatHookNegativity implements AntiCheatHook { | ||
|
||
private final Set<UUID> exempt = new HashSet<>(); | ||
|
||
public AntiCheatHookNegativity() { | ||
BypassManager.addBypassChecker((player, cheat) -> exempt.contains(player.getUniqueId())); | ||
} | ||
|
||
@Override | ||
public void exempt(@NotNull Player player) { | ||
this.exempt.add(player.getUniqueId()); | ||
} | ||
|
||
@Override | ||
public void unexempt(@NotNull Player player) { | ||
this.exempt.remove(player.getUniqueId()); | ||
} | ||
|
||
@Override | ||
public boolean shouldUnexempt(@NotNull Player player) { | ||
return exempt.contains(player.getUniqueId()); | ||
} | ||
|
||
} |
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ softdepend: | |
- GrimAC | ||
- LightAntiCheat | ||
- Matrix | ||
- Negativity | ||
- NoCheatPlus | ||
- Spartan | ||
# others | ||
|