Add exception handler into Ability Managers

This commit is contained in:
Jack Lin 2015-05-27 14:57:27 +12:00
parent 85153cf895
commit 468232f812
5 changed files with 95 additions and 69 deletions

View file

@ -2,6 +2,7 @@ package com.projectkorra.ProjectKorra.airbending;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import com.projectkorra.ProjectKorra.GeneralMethods;
import com.projectkorra.ProjectKorra.ProjectKorra; import com.projectkorra.ProjectKorra.ProjectKorra;
public class AirbendingManager implements Runnable { public class AirbendingManager implements Runnable {
@ -14,19 +15,23 @@ public class AirbendingManager implements Runnable {
@Override @Override
public void run() { public void run() {
AirBlast.progressAll(); try {
AirPassive.handlePassive(Bukkit.getServer()); AirBlast.progressAll();
AirBurst.progressAll(); AirPassive.handlePassive(Bukkit.getServer());
AirScooter.progressAll(); AirBurst.progressAll();
Suffocate.progressAll(); AirScooter.progressAll();
AirSpout.spoutAll(); Suffocate.progressAll();
AirBubble.handleBubbles(Bukkit.getServer()); AirSpout.spoutAll();
AirSuction.progressAll(); AirBubble.handleBubbles(Bukkit.getServer());
AirSwipe.progressAll(); AirSuction.progressAll();
Tornado.progressAll(); AirSwipe.progressAll();
AirShield.progressAll(); Tornado.progressAll();
AirCombo.progressAll(); AirShield.progressAll();
FlightAbility.progressAll(); AirCombo.progressAll();
FlightAbility.progressAll();
} catch (Exception e) {
GeneralMethods.logError(e, false);
}
} }
} }

View file

@ -3,6 +3,7 @@ package com.projectkorra.ProjectKorra.chiblocking;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import com.projectkorra.ProjectKorra.GeneralMethods;
import com.projectkorra.ProjectKorra.ProjectKorra; import com.projectkorra.ProjectKorra.ProjectKorra;
public class ChiblockingManager implements Runnable { public class ChiblockingManager implements Runnable {
@ -15,11 +16,15 @@ public class ChiblockingManager implements Runnable {
@Override @Override
public void run() { public void run() {
ChiPassive.handlePassive(); try {
WarriorStance.progressAll(); ChiPassive.handlePassive();
AcrobatStance.progressAll(); WarriorStance.progressAll();
for(Player player : Bukkit.getOnlinePlayers()) { AcrobatStance.progressAll();
Smokescreen.removeFromHashMap(player); for(Player player : Bukkit.getOnlinePlayers()) {
Smokescreen.removeFromHashMap(player);
}
} catch (Exception e) {
GeneralMethods.logError(e, false);
} }
} }

View file

@ -2,6 +2,7 @@ package com.projectkorra.ProjectKorra.earthbending;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import com.projectkorra.ProjectKorra.GeneralMethods;
import com.projectkorra.ProjectKorra.ProjectKorra; import com.projectkorra.ProjectKorra.ProjectKorra;
import com.projectkorra.ProjectKorra.RevertChecker; import com.projectkorra.ProjectKorra.RevertChecker;
@ -14,20 +15,24 @@ public class EarthbendingManager implements Runnable {
} }
public void run() { public void run() {
EarthPassive.revertSands(); try {
EarthPassive.handleMetalPassives(); EarthPassive.revertSands();
RevertChecker.revertEarthBlocks(); EarthPassive.handleMetalPassives();
EarthTunnel.progressAll(); RevertChecker.revertEarthBlocks();
EarthArmor.moveArmorAll(); EarthTunnel.progressAll();
Tremorsense.manage(Bukkit.getServer()); EarthArmor.moveArmorAll();
Catapult.progressAll(); Tremorsense.manage(Bukkit.getServer());
EarthColumn.progressAll(); Catapult.progressAll();
CompactColumn.progressAll(); EarthColumn.progressAll();
Shockwave.progressAll(); CompactColumn.progressAll();
EarthBlast.progressAll(); Shockwave.progressAll();
MetalClips.progressAll(); EarthBlast.progressAll();
LavaSurge.progressAll(); MetalClips.progressAll();
LavaFlow.progressAll(); LavaSurge.progressAll();
EarthSmash.progressAll(); LavaFlow.progressAll();
EarthSmash.progressAll();
} catch (Exception e) {
GeneralMethods.logError(e, false);
}
} }
} }

View file

@ -4,6 +4,7 @@ import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import com.projectkorra.ProjectKorra.GeneralMethods;
import com.projectkorra.ProjectKorra.ProjectKorra; import com.projectkorra.ProjectKorra.ProjectKorra;
public class FirebendingManager implements Runnable { public class FirebendingManager implements Runnable {
@ -15,25 +16,30 @@ public class FirebendingManager implements Runnable {
} }
public void run() { public void run() {
FirePassive.handlePassive(); try {
FireJet.progressAll(); FirePassive.handlePassive();
Cook.progressAll(); FireJet.progressAll();
Illumination.manage(Bukkit.getServer()); Cook.progressAll();
FireBlast.progressAll(); Illumination.manage(Bukkit.getServer());
Fireball.progressAll(); FireBlast.progressAll();
FireBurst.progressAll(); Fireball.progressAll();
FireShield.progressAll(); FireBurst.progressAll();
Lightning.progressAll(); FireShield.progressAll();
WallOfFire.manage(); Lightning.progressAll();
Combustion.progressAll(); WallOfFire.manage();
for (Block block : FireStream.ignitedblocks.keySet()) { Combustion.progressAll();
if (block.getType() != Material.FIRE) { for (Block block : FireStream.ignitedblocks.keySet()) {
FireStream.ignitedblocks.remove(block); if (block.getType() != Material.FIRE) {
FireStream.ignitedblocks.remove(block);
}
} }
HeatControl.progressAll();
FireStream.dissipateAll();
FireStream.progressAll();
FireCombo.progressAll();
} catch (Exception e) {
GeneralMethods.logError(e, false);
} }
HeatControl.progressAll();
FireStream.dissipateAll();
FireStream.progressAll();
FireCombo.progressAll();
} }
} }

View file

@ -2,6 +2,7 @@ package com.projectkorra.ProjectKorra.waterbending;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import com.projectkorra.ProjectKorra.GeneralMethods;
import com.projectkorra.ProjectKorra.ProjectKorra; import com.projectkorra.ProjectKorra.ProjectKorra;
public class WaterbendingManager implements Runnable { public class WaterbendingManager implements Runnable {
@ -14,24 +15,28 @@ public class WaterbendingManager implements Runnable {
@Override @Override
public void run() { public void run() {
WaterPassive.handlePassive(); try {
Plantbending.regrow(); WaterPassive.handlePassive();
Bloodbending.progressAll(); Plantbending.regrow();
WaterSpout.handleSpouts(Bukkit.getServer()); Bloodbending.progressAll();
FreezeMelt.handleFrozenBlocks(); WaterSpout.handleSpouts(Bukkit.getServer());
OctopusForm.progressAll(); FreezeMelt.handleFrozenBlocks();
Torrent.progressAll(); OctopusForm.progressAll();
TorrentBurst.progressAll(); Torrent.progressAll();
HealingWaters.heal(Bukkit.getServer()); TorrentBurst.progressAll();
WaterReturn.progressAll(); HealingWaters.heal(Bukkit.getServer());
WaterManipulation.progressAll(); WaterReturn.progressAll();
WaterWall.progressAll(); WaterManipulation.progressAll();
Wave.progressAll(); WaterWall.progressAll();
IceSpike.progressAll(); Wave.progressAll();
IceSpike2.progressAll(); IceSpike.progressAll();
IceBlast.progressAll(); IceSpike2.progressAll();
WaterWave.progressAll(); IceBlast.progressAll();
WaterCombo.progressAll(); WaterWave.progressAll();
WaterCombo.progressAll();
} catch (Exception e) {
GeneralMethods.logError(e, false);
}
} }
} }