mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-01-19 08:55:26 +01:00
Because it's not just Citizens that uses NPCs.
This commit is contained in:
parent
ec6b9d4387
commit
bcfec56300
@ -53,7 +53,7 @@ public abstract class AcrobaticsEventHandler {
|
||||
* @return true if the damage is fatal, false otherwise
|
||||
*/
|
||||
protected boolean isFatal(int damage) {
|
||||
if (Misc.isCitizensNPC(player) || player.getHealth() - damage < 1) {
|
||||
if (Misc.isNPC(player) || player.getHealth() - damage < 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class AcrobaticsManager extends SkillManager {
|
||||
* @param event The event to check
|
||||
*/
|
||||
public void rollCheck(EntityDamageEvent event) {
|
||||
if (Misc.isCitizensNPC(player) || !Permissions.roll(player)) {
|
||||
if (Misc.isNPC(player) || !Permissions.roll(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class AcrobaticsManager extends SkillManager {
|
||||
* @param event The event to check
|
||||
*/
|
||||
public void dodgeCheck(EntityDamageEvent event) {
|
||||
if (Misc.isCitizensNPC(player) || !Permissions.dodge(player)) {
|
||||
if (Misc.isNPC(player) || !Permissions.dodge(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@ public class ArcheryManager extends SkillManager {
|
||||
* @param livingEntity Entity damaged by the arrow
|
||||
*/
|
||||
public void trackArrows(LivingEntity livingEntity) {
|
||||
if (Misc.isCitizensNPC(player) || !Permissions.trackArrows(player)) {
|
||||
if (Misc.isNPC(player) || !Permissions.trackArrows(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ public class ArcheryManager extends SkillManager {
|
||||
* @param event The event to modify
|
||||
*/
|
||||
public void dazeCheck(Player defender, EntityDamageEvent event) {
|
||||
if (Misc.isCitizensNPC(player) || !Permissions.daze(player)) {
|
||||
if (Misc.isNPC(player) || !Permissions.daze(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ public class ArcheryManager extends SkillManager {
|
||||
* @param event The event to modify.
|
||||
*/
|
||||
public void bonusDamage(EntityDamageEvent event) {
|
||||
if (Misc.isCitizensNPC(player) || !Permissions.archeryBonus(player)) {
|
||||
if (Misc.isNPC(player) || !Permissions.archeryBonus(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public class MiningManager extends SkillManager{
|
||||
* @param plugin mcMMO plugin instance
|
||||
*/
|
||||
public void detonate(PlayerInteractEvent event) {
|
||||
if (Misc.isCitizensNPC(player)) {
|
||||
if (Misc.isNPC(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ public class MiningManager extends SkillManager{
|
||||
* @param event Event whose explosion is being processed
|
||||
*/
|
||||
public void blastMiningDropProcessing(EntityExplodeEvent event) {
|
||||
if (Misc.isCitizensNPC(player)) {
|
||||
if (Misc.isNPC(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ public class MiningManager extends SkillManager{
|
||||
* @param event Event whose explosion damage is being reduced
|
||||
*/
|
||||
public void demolitionsExpertise(EntityDamageEvent event) {
|
||||
if (Misc.isCitizensNPC(player)) {
|
||||
if (Misc.isNPC(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ public class MiningManager extends SkillManager{
|
||||
* @param event Event whose explosion radius is being changed
|
||||
*/
|
||||
public void biggerBombs(ExplosionPrimeEvent event) {
|
||||
if (Misc.isCitizensNPC(player)) {
|
||||
if (Misc.isNPC(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ public class Combat {
|
||||
|
||||
for (Entity entity : target.getNearbyEntities(2.5, 2.5, 2.5)) {
|
||||
if (entity instanceof Player) {
|
||||
if (Misc.isCitizensNPC((Player) entity)) {
|
||||
if (Misc.isNPC((Player) entity)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ public class Misc {
|
||||
public static final int TIME_CONVERSION_FACTOR = 1000;
|
||||
public static final double SKILL_MESSAGE_MAX_SENDING_DISTANCE = 10.0;
|
||||
|
||||
public static boolean isCitizensNPC(Player player) {
|
||||
public static boolean isNPC(Player player) {
|
||||
if (player == null || Users.getProfile(player) == null || player.hasMetadata("NPC")) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user