mirror of
https://github.com/asofold/CompatNoCheatPlus.git
synced 2024-11-18 11:16:23 +01:00
(add) Hook for Citizens 2 .
This commit is contained in:
parent
e4b5db2e02
commit
c96430fdc9
@ -26,6 +26,9 @@ STACK
|
||||
VERSION HISTORY
|
||||
---------------------------
|
||||
|
||||
(5.1.0)
|
||||
- (add) Hook for Citizens 2 .
|
||||
|
||||
(5.0.0)
|
||||
- (BIG CHANGE) Finally adapt to the new API fo NoCheatPlus (moved over there).
|
||||
|
||||
|
@ -122,6 +122,10 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
|
||||
* Add standard hooks if available.
|
||||
*/
|
||||
private void addAvailableHooks() {
|
||||
try{
|
||||
addHook(new me.asofold.bpl.cncp.hooks.citizens2.HookCitizens2());
|
||||
}
|
||||
catch (Throwable t){}
|
||||
addHook(hookPlayerClass);
|
||||
try{
|
||||
addHook(new me.asofold.bpl.cncp.hooks.mcmmo.HookmcMMO());
|
||||
|
@ -0,0 +1,32 @@
|
||||
package me.asofold.bpl.cncp.hooks.citizens2;
|
||||
|
||||
import me.asofold.bpl.cncp.hooks.AbstractHook;
|
||||
import net.citizensnpcs.api.CitizensAPI;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
|
||||
public class HookCitizens2 extends AbstractHook {
|
||||
|
||||
public HookCitizens2(){
|
||||
assertPluginPresent("Citizens");
|
||||
CitizensAPI.getNPCRegistry(); // to let it fail for old versions.
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookName() {
|
||||
return "Citizens2(default)";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHookVersion() {
|
||||
return "1.0.0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCheckFailure(CheckType checkType, Player player) {
|
||||
return CitizensAPI.getNPCRegistry().isNPC(player);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user