(remove) Direct hooking of Citizens.

This commit is contained in:
asofold 2012-07-24 07:41:53 +02:00
parent ffb9c1ad75
commit b293b29314
4 changed files with 7 additions and 42 deletions

View File

@ -17,11 +17,17 @@ STACK
? another sequence number (for standard events)
*** 0.3.0
!(add) Option to prevent adding hooks by name.
!(add) Refactor citizens hook into a general hook using reflection (PlayerClassHook).
VERSION HISTORY
---------------------------
(0.3.0)
- (remove) Direct hooking of Citizens.
(0.2.2)
- (bugfix) Add noswing treatment for mcMMO.

View File

@ -4,5 +4,4 @@ version: 0.3.0 beta
depend:
- NoCheatPlus
softdepend:
- mcMMO
- Citizens
- mcMMO

View File

@ -148,10 +148,6 @@ public class CompatNoCheatPlus extends JavaPlugin implements Listener {
addHook(new me.asofold.bukkit.cncp.hooks.mcmmo.HookmcMMO());
}
catch (Throwable t){}
try{
addHook(new me.asofold.bukkit.cncp.hooks.citizens.HookCitizens());
}
catch (Throwable t){}
}
@Override

View File

@ -1,36 +0,0 @@
package me.asofold.bukkit.cncp.hooks.citizens;
import me.asofold.bukkit.cncp.hooks.AbstractHook;
import net.citizensnpcs.resources.npclib.PathNPC;
import org.bukkit.craftbukkit.entity.CraftPlayer;
import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.checks.CheckEvent;
public final class HookCitizens extends AbstractHook {
public HookCitizens(){
assertPluginPresent("Citizens");
}
@Override
public String getHookName() {
return "Citizens(default)";
}
@Override
public String getHookVersion() {
return "0.0";
}
@Override
public final void processEvent(final String group, final String check, final CheckEvent event) {
final Player player = event.getPlayer().getBukkitPlayer();
if (player instanceof CraftPlayer){
final CraftPlayer cp = (CraftPlayer) player;
if (cp.getHandle() instanceof PathNPC) event.setCancelled(true);
}
}
}