mirror of
https://github.com/asofold/CompatNoCheatPlus.git
synced 2024-11-27 12:45:18 +01:00
(remove) Direct hooking of Citizens.
This commit is contained in:
parent
ffb9c1ad75
commit
b293b29314
@ -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.
|
||||
|
||||
|
@ -4,5 +4,4 @@ version: 0.3.0 beta
|
||||
depend:
|
||||
- NoCheatPlus
|
||||
softdepend:
|
||||
- mcMMO
|
||||
- Citizens
|
||||
- mcMMO
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user