Attempting to fix issues #272 , #266 , #261 , and #255 .

This commit is contained in:
U-YUE\Sean
2012-10-30 11:46:52 -07:00
parent 8dfa8c20f3
commit ab7a83b37e
18 changed files with 161 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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) {

View File

@@ -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();
}