NoCheatPlus Support

The damage thing shouldn't be thrown when a player uses Bending to
attack
This commit is contained in:
MistPhizzle 2014-09-01 16:49:10 -04:00
parent a27de1f7be
commit 56b47f3816
2 changed files with 10 additions and 2 deletions

View file

@ -12,5 +12,6 @@
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/LocalServer/BukkitForPlugins.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/Factions.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/LWC.jar"/>
<classpathentry kind="lib" path="C:/Users/Shawn/Documents/Bending Plugins/NoCheatPlus.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View file

@ -115,6 +115,9 @@ import com.projectkorra.ProjectKorra.waterbending.Wave;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import com.sk89q.worldguard.protection.flags.DefaultFlag;
import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager;
public class Methods {
static ProjectKorra plugin;
@ -241,8 +244,6 @@ public class Methods {
*/
public static boolean canBeBloodbent(Player player) {
if (AvatarState.isAvatarState(player))
return false;
if (Commands.invincible.contains(player.getName())) return false;
if (isChiBlocked(player.getName()))
return true;
if (canBend(player.getName(), "Bloodbending") && Methods.getBendingPlayer(player.getName()).isToggled)
@ -386,9 +387,15 @@ public class Methods {
if (entity instanceof Player) {
if (Commands.invincible.contains(((Player) entity).getName())) return;
}
if (Bukkit.getPluginManager().isPluginEnabled("NoCheatPlus")) {
NCPExemptionManager.exemptPermanently(player, CheckType.FIGHT_REACH);
}
((LivingEntity) entity).damage(damage, player);
((LivingEntity) entity).setLastDamageCause(
new EntityDamageByEntityEvent(player, entity, DamageCause.CUSTOM, damage));
if (Bukkit.getPluginManager().isPluginEnabled("NoCheatPlus")) {
NCPExemptionManager.unexempt(player);
}
}
}