mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
Trying to clean up duplicate checks & whatnot in our listeners.
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
package com.gmail.nossr50.skills.swords;
|
||||
|
||||
import com.gmail.nossr50.config.AdvancedConfig;
|
||||
import com.gmail.nossr50.config.Config;
|
||||
|
||||
public class Swords {
|
||||
public static double bleedMaxChance = AdvancedConfig.getInstance().getBleedChanceMax();
|
||||
@ -14,4 +15,8 @@ public class Swords {
|
||||
|
||||
public static int serratedStrikesModifier = AdvancedConfig.getInstance().getSerratedStrikesModifier();
|
||||
public static int serratedStrikesBleedTicks = AdvancedConfig.getInstance().getSerratedStrikesTicks();
|
||||
|
||||
public static boolean pvpEnabled = Config.getInstance().getSwordsPVP();
|
||||
public static boolean pveEnabled = Config.getInstance().getSwordsPVE();
|
||||
}
|
||||
|
||||
|
@ -21,9 +21,6 @@ public class SwordsManager extends SkillManager {
|
||||
* @param defender The defending entity
|
||||
*/
|
||||
public void bleedCheck(LivingEntity defender) {
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (!Permissions.swordsBleed(player)) {
|
||||
return;
|
||||
}
|
||||
@ -42,9 +39,6 @@ public class SwordsManager extends SkillManager {
|
||||
}
|
||||
|
||||
public void counterAttackChecks(LivingEntity attacker, int damage) {
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
if (!Permissions.counterAttack(player)) {
|
||||
return;
|
||||
}
|
||||
@ -65,7 +59,7 @@ public class SwordsManager extends SkillManager {
|
||||
}
|
||||
|
||||
public void serratedStrikes(LivingEntity target, int damage) {
|
||||
if (Misc.isNPCPlayer(player) || !Permissions.serratedStrikes(player) || !profile.getAbilityMode(AbilityType.SERRATED_STRIKES)) {
|
||||
if (!profile.getAbilityMode(AbilityType.SERRATED_STRIKES) || !Permissions.serratedStrikes(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user