mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-02 04:25:26 +02:00
@@ -51,6 +51,9 @@ public abstract class AcrobaticsEventHandler {
|
||||
* @return true if the damage is fatal, false otherwise
|
||||
*/
|
||||
protected boolean isFatal(int damage) {
|
||||
if(player == null)
|
||||
return true;
|
||||
|
||||
if (player.getHealth() - damage < 1) {
|
||||
return true;
|
||||
}
|
||||
|
@@ -26,6 +26,9 @@ public class AcrobaticsManager {
|
||||
* @param event The event to check
|
||||
*/
|
||||
public void rollCheck(EntityDamageEvent event) {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if (!permissionInstance.roll(player)) {
|
||||
return;
|
||||
}
|
||||
@@ -54,6 +57,9 @@ public class AcrobaticsManager {
|
||||
* @param event The event to check
|
||||
*/
|
||||
public void dodgeCheck(EntityDamageEvent event) {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if (!permissionInstance.dodge(player)) {
|
||||
return;
|
||||
}
|
||||
|
@@ -39,11 +39,17 @@ public class DodgeEventHandler extends AcrobaticsEventHandler {
|
||||
|
||||
@Override
|
||||
protected void sendAbilityMessage() {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Combat.Proc"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processXPGain(int xp) {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
PlayerProfile profile = manager.getProfile();
|
||||
|
||||
if (System.currentTimeMillis() >= profile.getRespawnATS() + 5) {
|
||||
|
@@ -56,6 +56,9 @@ public class RollEventHandler extends AcrobaticsEventHandler {
|
||||
|
||||
@Override
|
||||
protected void sendAbilityMessage() {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if (isGraceful) {
|
||||
player.sendMessage(LocaleLoader.getString("Acrobatics.Ability.Proc"));
|
||||
}
|
||||
@@ -67,6 +70,9 @@ public class RollEventHandler extends AcrobaticsEventHandler {
|
||||
|
||||
@Override
|
||||
protected void processXPGain(int xpGain) {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
Skills.xpProcessing(player, manager.getProfile(), SkillType.ACROBATICS, xpGain);
|
||||
}
|
||||
|
||||
@@ -74,6 +80,9 @@ public class RollEventHandler extends AcrobaticsEventHandler {
|
||||
* Check if this is a graceful roll.
|
||||
*/
|
||||
private void isGracefulRoll() {
|
||||
if(player == null)
|
||||
return;
|
||||
|
||||
if (Permissions.getInstance().gracefulRoll(player)) {
|
||||
this.isGraceful = player.isSneaking();
|
||||
}
|
||||
|
Reference in New Issue
Block a user