mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
NoCheatPlus Support
The damage thing shouldn't be thrown when a player uses Bending to attack
This commit is contained in:
parent
a27de1f7be
commit
56b47f3816
2 changed files with 10 additions and 2 deletions
|
@ -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>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue