mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 19:50:37 +00:00
Merge pull request #40 from Alex-The-Coder/master
Fixed IceBlast and Lightning bugs
This commit is contained in:
commit
f25a0668a2
2 changed files with 11 additions and 5 deletions
|
@ -10,6 +10,8 @@ import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LightningStrike;
|
import org.bukkit.entity.LightningStrike;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
|
|
||||||
import com.projectkorra.ProjectKorra.Methods;
|
import com.projectkorra.ProjectKorra.Methods;
|
||||||
import com.projectkorra.ProjectKorra.ProjectKorra;
|
import com.projectkorra.ProjectKorra.ProjectKorra;
|
||||||
|
@ -148,12 +150,14 @@ public class Lightning {
|
||||||
|
|
||||||
double damage = maxdamage - (distance / strikeradius) * .5;
|
double damage = maxdamage - (distance / strikeradius) * .5;
|
||||||
|
|
||||||
if (Methods.isWater(strike.getLocation().getBlock())) {
|
if ((getTargetLocation().getBlock().getType() == Material.WATER) || (getTargetLocation().getBlock().getType() == Material.STATIONARY_WATER)) {
|
||||||
for (Entity en: Methods.getEntitiesAroundPoint(strike.getLocation(), WaterAreaOfEffect)) {
|
for (Entity en: Methods.getEntitiesAroundPoint(getTargetLocation().getBlock().getLocation(), WaterAreaOfEffect)) {
|
||||||
if (en instanceof LivingEntity) {
|
if (en instanceof LivingEntity) {
|
||||||
if (Methods.isWater(en.getLocation().getBlock())) {
|
LivingEntity le = (LivingEntity) en;
|
||||||
Methods.damageEntity(player, entity, (int) damage);
|
if ((le.getLocation().getBlock().getType() == Material.WATER) || (le.getLocation().getBlock().getType() == Material.STATIONARY_WATER)) {
|
||||||
Methods.breakBreathbendingHold(entity);
|
le.damage((int) damage);
|
||||||
|
le.setLastDamageCause(new EntityDamageEvent(player, DamageCause.ENTITY_ATTACK, damage));
|
||||||
|
Methods.breakBreathbendingHold(le);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,8 @@ public class IceBlast {
|
||||||
|
|
||||||
if (sourceblock == null) {
|
if (sourceblock == null) {
|
||||||
return;
|
return;
|
||||||
|
}else if (TempBlock.isTempBlock(sourceblock)) {
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
prepare(sourceblock);
|
prepare(sourceblock);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue