(add) Hook for Citizens 2 .

This commit is contained in:
asofold 2012-08-08 03:42:10 +02:00
parent e4b5db2e02
commit c96430fdc9
3 changed files with 39 additions and 0 deletions

View File

@ -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).

View File

@ -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());

View File

@ -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);
}
}