TF-ProjectKorra/src/com/projectkorra/projectkorra/firebending/passive/FirePassive.java
Alexander Meech 2cb73c71ec Alex's Awesome Update (#729)
* Fix chi abilities appearing to strike twice, implement catapult 2.0, and fix water sources being removed by breaking them

* Small changes for loony (visual and time)

* Completely rewrite catapult functions and repair water abilities allowing plant sources to be broken upon selection

* Increase length of moveEarth call in Catapult and add more configuration options

* Fix my dumb mistake of using a bitwise operator

* Allow tempblock usage for iceblast
2017-02-16 18:10:08 -08:00

35 lines
1.4 KiB
Java

package com.projectkorra.projectkorra.firebending.passive;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import com.projectkorra.projectkorra.BendingPlayer;
import com.projectkorra.projectkorra.Element;
import com.projectkorra.projectkorra.ability.CoreAbility;
import com.projectkorra.projectkorra.command.Commands;
import com.projectkorra.projectkorra.configuration.ConfigManager;
import com.projectkorra.projectkorra.earthbending.Tremorsense;
import com.projectkorra.projectkorra.firebending.Illumination;
public class FirePassive {
public static void handlePassive() {
if (Commands.isToggledForAll && ConfigManager.defaultConfig.get().getBoolean("Properties.TogglePassivesWithAllBending")) {
return;
}
for (Player player : Bukkit.getOnlinePlayers()) {
BendingPlayer bPlayer = BendingPlayer.getBendingPlayer(player);
if (bPlayer != null && bPlayer.canBendPassive(Element.FIRE) && bPlayer.canUsePassive(Element.FIRE)) {
if (player.getFireTicks() > 80) {
player.setFireTicks(80);
}
if (bPlayer != null && !CoreAbility.hasAbility(player, Illumination.class) && !CoreAbility.hasAbility(player, Tremorsense.class) && bPlayer.canBendIgnoreBinds(CoreAbility.getAbility("Illumination")) && ConfigManager.defaultConfig.get().getBoolean("Abilities.Fire.Illumination.Passive")) {
if (bPlayer.isIlluminating()) {
new Illumination(player);
}
}
}
}
}
}