mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 19:50:37 +00:00
Merge remote-tracking branch 'refs/remotes/ProjectKorra/master'
This commit is contained in:
commit
d98d8c837c
40 changed files with 174 additions and 101 deletions
|
@ -60,6 +60,7 @@ import com.projectkorra.projectkorra.firebending.FireShield;
|
|||
import com.projectkorra.projectkorra.object.Preset;
|
||||
import com.projectkorra.projectkorra.storage.DBConnection;
|
||||
import com.projectkorra.projectkorra.util.BlockCacheElement;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.Flight;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
@ -359,41 +360,6 @@ public class GeneralMethods {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Damages an Entity by amount of damage specified. Starts a
|
||||
* {@link EntityDamageByEntityEvent}.
|
||||
*
|
||||
* @param ability The ability that is used to damage the entity
|
||||
* @param entity The entity that is receiving the damage
|
||||
* @param damage The amount of damage to deal
|
||||
*/
|
||||
public static void damageEntity(Ability ability, Entity entity, double damage) {
|
||||
if (ability==null)
|
||||
return;
|
||||
Player player = ability.getPlayer();
|
||||
AbilityDamageEntityEvent damageEvent = new AbilityDamageEntityEvent(entity, ability, damage);
|
||||
Bukkit.getServer().getPluginManager().callEvent(damageEvent);
|
||||
if (entity instanceof LivingEntity) {
|
||||
if (entity instanceof Player && Commands.invincible.contains(entity.getName())) {
|
||||
damageEvent.setCancelled(true);
|
||||
}
|
||||
if (!damageEvent.isCancelled()) {
|
||||
damage = damageEvent.getDamage();
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("NoCheatPlus")) {
|
||||
NCPExemptionManager.exemptPermanently(player, CheckType.FIGHT_REACH);
|
||||
}
|
||||
if (((LivingEntity) entity).getHealth() - damage <= 0 && !entity.isDead()) {
|
||||
EntityBendingDeathEvent deathEvent = new EntityBendingDeathEvent(entity, damage, ability);
|
||||
Bukkit.getServer().getPluginManager().callEvent(deathEvent);
|
||||
}
|
||||
((LivingEntity) entity).damage(damage, player);
|
||||
entity.setLastDamageCause(new EntityDamageByEntityEvent(player, entity, DamageCause.CUSTOM, damage));
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("NoCheatPlus")) {
|
||||
NCPExemptionManager.unexempt(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deserializes the configuration file "bendingPlayers.yml" of the old
|
||||
|
|
|
@ -78,6 +78,7 @@ import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
|
|||
import com.projectkorra.projectkorra.object.Preset;
|
||||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.Flight;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import com.projectkorra.projectkorra.waterbending.Bloodbending;
|
||||
|
@ -699,9 +700,9 @@ public class PKListener implements Listener {
|
|||
double damage = ((e.getDistanceTraveled() - minimumDistance) < 0 ? 0 : e.getDistanceTraveled() - minimumDistance) / (e.getDifference().length());
|
||||
if (damage > 0) {
|
||||
if(damage <= maxDamage) {
|
||||
GeneralMethods.damageEntity(e.getAbility(), e.getEntity(), damage);
|
||||
DamageHandler.damageEntity((LivingEntity) e.getEntity(), damage, e.getAbility());
|
||||
} else {
|
||||
GeneralMethods.damageEntity(e.getAbility(), e.getEntity(), maxDamage);
|
||||
DamageHandler.damageEntity((LivingEntity) e.getEntity(), maxDamage, e.getAbility());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -840,7 +841,6 @@ public class PKListener implements Listener {
|
|||
Player source = Flight.getLaunchedBy(player);
|
||||
if (source != null) {
|
||||
event.setCancelled(true);
|
||||
GeneralMethods.damageEntity(null, player, event.getDamage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -194,13 +194,11 @@ public abstract class WaterAbility extends ElementalAbility {
|
|||
return null;
|
||||
} else if (isWaterbendable(testBlock.getType())) {
|
||||
return testBlock;
|
||||
} else if (!isTransparent(player, testBlock)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (double i = 0; i <= range; i++) {
|
||||
Block block = location.clone().add(vector.clone().multiply(i)).getBlock();
|
||||
if (GeneralMethods.isRegionProtectedFromBuild(player, "WaterManipulation", location)) {
|
||||
if (!isTransparent(player, block) || GeneralMethods.isRegionProtectedFromBuild(player, "WaterManipulation", location)) {
|
||||
continue;
|
||||
} else if (isWaterbendable(player, null, block) && (!isPlant(block) || plantbending)) {
|
||||
if (TempBlock.isTempBlock(block)) {
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.projectkorra.projectkorra.ability.AirAbility;
|
|||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.command.Commands;
|
||||
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.Flight;
|
||||
|
||||
public class AirBlast extends AirAbility {
|
||||
|
@ -253,10 +254,10 @@ public class AirBlast extends AirAbility {
|
|||
breakBreathbendingHold(entity);
|
||||
|
||||
if (source != null && (this.damage > 0 && entity instanceof LivingEntity && !entity.equals(player) && !affectedEntities.contains(entity))) {
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity((LivingEntity) entity, damage, this);
|
||||
affectedEntities.add(entity);
|
||||
} else if (source == null && (damage > 0 && entity instanceof LivingEntity && !entity.equals(player) && !affectedEntities.contains(entity))) {
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity((LivingEntity) entity, damage, this);
|
||||
affectedEntities.add(entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.projectkorra.projectkorra.avatar.AvatarState;
|
|||
import com.projectkorra.projectkorra.command.Commands;
|
||||
import com.projectkorra.projectkorra.firebending.FireCombo;
|
||||
import com.projectkorra.projectkorra.firebending.FireCombo.FireComboStream;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.Flight;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
@ -331,9 +332,9 @@ public class AirCombo extends AirAbility implements ComboAbility {
|
|||
if (damage != 0) {
|
||||
if (entity instanceof LivingEntity) {
|
||||
if (fstream.getAbility().equalsIgnoreCase("AirSweep")) {
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
} else {
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ public class AirScooter extends AirAbility {
|
|||
private double speed;
|
||||
private double interval;
|
||||
private double radius;
|
||||
private long cooldown;
|
||||
private double maxHeightFromGround;
|
||||
private Block floorblock;
|
||||
private Random random;
|
||||
|
@ -30,18 +31,21 @@ public class AirScooter extends AirAbility {
|
|||
|
||||
public AirScooter(Player player) {
|
||||
super(player);
|
||||
if (check(player)) {
|
||||
|
||||
if (check(player))
|
||||
return;
|
||||
} else if (!player.isSprinting() || GeneralMethods.isSolid(player.getEyeLocation().getBlock())
|
||||
|| player.getEyeLocation().getBlock().isLiquid()) {
|
||||
else if (!player.isSprinting() || GeneralMethods.isSolid(player.getEyeLocation().getBlock())
|
||||
|| player.getEyeLocation().getBlock().isLiquid())
|
||||
return;
|
||||
} else if (GeneralMethods.isSolid(player.getLocation().add(0, -.5, 0).getBlock())) {
|
||||
else if (GeneralMethods.isSolid(player.getLocation().add(0, -.5, 0).getBlock()))
|
||||
return;
|
||||
else if (bPlayer.isOnCooldown(this))
|
||||
return;
|
||||
}
|
||||
|
||||
this.speed = getConfig().getDouble("Abilities.Air.AirScooter.Speed");
|
||||
this.interval = getConfig().getDouble("Abilities.Air.AirScooter.Interval");
|
||||
this.radius = getConfig().getDouble("Abilities.Air.AirScooter.Radius");
|
||||
this.cooldown = getConfig().getLong("Abilities.Air.AirScooter.Cooldown");
|
||||
this.maxHeightFromGround = getConfig().getDouble("Abilities.Air.AirScooter.MaxHeightFromGround");
|
||||
this.random = new Random();
|
||||
this.angles = new ArrayList<>();
|
||||
|
@ -138,6 +142,7 @@ public class AirScooter extends AirAbility {
|
|||
@Override
|
||||
public void remove() {
|
||||
super.remove();
|
||||
bPlayer.addCooldown(this);
|
||||
player.setAllowFlight(canFly);
|
||||
player.setFlying(hadFly);
|
||||
}
|
||||
|
@ -169,7 +174,7 @@ public class AirScooter extends AirAbility {
|
|||
|
||||
@Override
|
||||
public long getCooldown() {
|
||||
return 0;
|
||||
return cooldown;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -222,4 +227,8 @@ public class AirScooter extends AirAbility {
|
|||
public void setFloorblock(Block floorblock) {
|
||||
this.floorblock = floorblock;
|
||||
}
|
||||
|
||||
public void setCooldown(long cooldown) {
|
||||
this.cooldown = cooldown;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.projectkorra.projectkorra.earthbending.EarthBlast;
|
|||
import com.projectkorra.projectkorra.firebending.Combustion;
|
||||
import com.projectkorra.projectkorra.firebending.FireBlast;
|
||||
import com.projectkorra.projectkorra.firebending.Illumination;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.Flight;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
||||
|
||||
|
@ -196,7 +197,7 @@ public class AirSwipe extends AirAbility {
|
|||
}
|
||||
if (entity instanceof LivingEntity && !affectedEntities.contains(entity)) {
|
||||
if (damage != 0) {
|
||||
GeneralMethods.damageEntity(ability, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, ability);
|
||||
}
|
||||
affectedEntities.add(entity);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
|||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
|
||||
/**
|
||||
* Suffocate
|
||||
|
@ -196,7 +197,7 @@ public class Suffocate extends AirAbility {
|
|||
BukkitRunnable br1 = new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GeneralMethods.damageEntity(ability, target, damage);
|
||||
DamageHandler.damageEntity(target, damage, ability);
|
||||
}
|
||||
};
|
||||
BukkitRunnable br2 = new BukkitRunnable() {
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.projectkorra.projectkorra.chiblocking;
|
|||
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.ChiAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
@ -35,7 +36,7 @@ public class QuickStrike extends ChiAbility {
|
|||
return;
|
||||
}
|
||||
|
||||
GeneralMethods.damageEntity(this, target, damage);
|
||||
DamageHandler.damageEntity(target, damage, this);
|
||||
if (target instanceof Player && ChiPassive.willChiBlock(player, (Player) target)) {
|
||||
ChiPassive.blockChi((Player) target);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.chiblocking;
|
|||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.ChiAbility;
|
||||
import com.projectkorra.projectkorra.airbending.Suffocate;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
@ -39,7 +40,7 @@ public class RapidPunch extends ChiAbility {
|
|||
}
|
||||
|
||||
LivingEntity lt = (LivingEntity) target;
|
||||
GeneralMethods.damageEntity(this, target, damage);
|
||||
DamageHandler.damageEntity(target, damage, this);
|
||||
|
||||
if (target instanceof Player) {
|
||||
if (ChiPassive.willChiBlock(player, (Player) target)) {
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.projectkorra.projectkorra.chiblocking;
|
|||
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.ChiAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
|
@ -32,7 +33,7 @@ public class SwiftKick extends ChiAbility {
|
|||
remove();
|
||||
return;
|
||||
}
|
||||
GeneralMethods.damageEntity(this, target, damage);
|
||||
DamageHandler.damageEntity(target, damage, this);
|
||||
if (target instanceof Player && ChiPassive.willChiBlock(player, (Player) target)) {
|
||||
ChiPassive.blockChi((Player) target);
|
||||
}
|
||||
|
|
|
@ -284,6 +284,7 @@ public class ConfigManager {
|
|||
config.addDefault("Abilities.Air.AirScooter.Speed", 0.675);
|
||||
config.addDefault("Abilities.Air.AirScooter.Interval", 100);
|
||||
config.addDefault("Abilities.Air.AirScooter.Radius", 1);
|
||||
config.addDefault("Abilities.Air.AirScooter.Cooldown", 7000);
|
||||
config.addDefault("Abilities.Air.AirScooter.MaxHeightFromGround", 7);
|
||||
|
||||
config.addDefault("Abilities.Air.Tornado.Enabled", true);
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.projectkorra.projectkorra.firebending.Combustion;
|
|||
import com.projectkorra.projectkorra.firebending.FireBlast;
|
||||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
@ -270,7 +271,7 @@ public class EarthBlast extends EarthAbility {
|
|||
if (isMetal(sourceBlock) && bPlayer.canMetalbend()) {
|
||||
damage = getMetalAugment(damage);
|
||||
}
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
isProgressing = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.projectkorra.projectkorra.ability.EarthAbility;
|
|||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
|
@ -550,7 +551,7 @@ public class EarthSmash extends EarthAbility {
|
|||
if (entity instanceof LivingEntity && entity != player && !affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
double damage = currentBlocks.size() / 13.0 * this.damage;
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
Vector travelVec = GeneralMethods.getDirection(location, entity.getLocation());
|
||||
entity.setVelocity(travelVec.setY(knockup).normalize().multiply(knockback));
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
|||
import com.projectkorra.projectkorra.ability.LavaAbility;
|
||||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
|
@ -257,7 +258,7 @@ public class LavaSurge extends LavaAbility {
|
|||
for(Entity e : GeneralMethods.getEntitiesAroundPoint(fb.getLocation(), 2)) {
|
||||
if(e instanceof LivingEntity) {
|
||||
if(e.getEntityId() != player.getEntityId()) {
|
||||
GeneralMethods.damageEntity(this, e, impactDamage);
|
||||
DamageHandler.damageEntity(e, impactDamage, this);
|
||||
e.setFireTicks(100);
|
||||
GeneralMethods.setVelocity(e, direction.clone());
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.earthbending;
|
|||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.MetalAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
|
@ -381,7 +382,7 @@ public class MetalClips extends MetalAbility {
|
|||
|
||||
if (System.currentTimeMillis() > time + crushInterval) {
|
||||
time = System.currentTimeMillis();
|
||||
GeneralMethods.damageEntity(this, targetEntity, (crushDamage + (crushDamage * 1.2)));
|
||||
DamageHandler.damageEntity(targetEntity, (crushDamage + (crushDamage * 1.2)), this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -408,7 +409,7 @@ public class MetalClips extends MetalAbility {
|
|||
TARGET_TO_ABILITY.put(targetEntity, this);
|
||||
formArmor();
|
||||
} else {
|
||||
GeneralMethods.damageEntity(this, e, 5);
|
||||
DamageHandler.damageEntity(e, 5, this);
|
||||
ii.getWorld().dropItem(ii.getLocation(), ii.getItemStack());
|
||||
remove();
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
|||
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||
import com.projectkorra.projectkorra.ability.EarthAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
|
@ -265,7 +266,7 @@ public class Ripple extends EarthAbility {
|
|||
|
||||
private void affect(Entity entity) {
|
||||
if (entity instanceof LivingEntity) {
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
|
||||
Vector vector = direction.clone();
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.projectkorra.projectkorra.earthbending;
|
|||
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.SandAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.Flight;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
@ -157,7 +158,7 @@ public class SandSpout extends SandAbility {
|
|||
for (Player sPlayer : players) {
|
||||
if (!sPlayer.equals(player)) {
|
||||
sPlayer.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, blindnessTime * 20, 1));
|
||||
GeneralMethods.damageEntity(this, sPlayer, damage);
|
||||
DamageHandler.damageEntity(sPlayer, damage, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,10 +22,9 @@ public class EntityBendingDeathEvent extends Event {
|
|||
/**
|
||||
* Creates a new EntityBendingDeathEvent
|
||||
*
|
||||
* @param victim the player who died
|
||||
* @param attacker the player who killed the victim
|
||||
* @param entity the entity who died
|
||||
* @param damage the amount of damage done in the attack that killed the victim
|
||||
* @param ability the ability used to kill the victim
|
||||
* @param ability the ability used to kill the entity
|
||||
*/
|
||||
public EntityBendingDeathEvent(Entity entity, double damage, Ability ability) {
|
||||
this.entity = entity;
|
||||
|
|
|
@ -5,6 +5,7 @@ import com.projectkorra.projectkorra.ProjectKorra;
|
|||
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||
import com.projectkorra.projectkorra.ability.CombustionAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
@ -101,7 +102,7 @@ public class Combustion extends CombustionAbility {
|
|||
for (Entity entity : block.getWorld().getEntities()) {
|
||||
if (entity instanceof LivingEntity) {
|
||||
if (entity.getLocation().distanceSquared(block) < radius * radius) { // They are close enough to the explosion.
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity((LivingEntity) entity, damage, this);
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.projectkorra.projectkorra.ability.FireAbility;
|
|||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.earthbending.EarthBlast;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.waterbending.PlantRegrowth;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterManipulation;
|
||||
|
@ -125,7 +126,7 @@ public class FireBlast extends FireAbility {
|
|||
}
|
||||
if (entity instanceof LivingEntity) {
|
||||
entity.setFireTicks((int) (fireTicks * 20));
|
||||
GeneralMethods.damageEntity(this, entity, (int) getDayFactor(damage));
|
||||
DamageHandler.damageEntity(entity, (int) getDayFactor(damage), this);
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
new FireDamageTimer(entity, player);
|
||||
remove();
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
|||
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||
import com.projectkorra.projectkorra.ability.FireAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
|
||||
import org.bukkit.Effect;
|
||||
|
@ -134,13 +135,13 @@ public class FireBlastCharged extends FireAbility {
|
|||
if (distance > damageRadius) {
|
||||
return;
|
||||
} else if (distance < innerRadius) {
|
||||
GeneralMethods.damageEntity(this, entity, maxDamage);
|
||||
DamageHandler.damageEntity(entity, maxDamage, this);
|
||||
return;
|
||||
}
|
||||
|
||||
double slope = -(maxDamage * .5) / (damageRadius - innerRadius);
|
||||
double damage = slope * (distance - innerRadius) + maxDamage;
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
}
|
||||
|
||||
|
@ -173,7 +174,7 @@ public class FireBlastCharged extends FireAbility {
|
|||
if (entity instanceof LivingEntity) {
|
||||
double slope = -(maxDamage * .5) / (damageRadius - innerRadius);
|
||||
double damage = slope * (entity.getLocation().distance(location) - innerRadius) + maxDamage;
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
}
|
||||
location.getWorld().playSound(location, Sound.EXPLODE, 5, 1);
|
||||
|
|
|
@ -25,6 +25,7 @@ import com.projectkorra.projectkorra.ability.util.ComboManager.AbilityInformatio
|
|||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.command.Commands;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
|
||||
/*
|
||||
|
@ -179,7 +180,7 @@ public class FireCombo extends FireAbility implements ComboAbility {
|
|||
if (ability.equalsIgnoreCase("FireKick")) {
|
||||
if (!affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
fstream.remove();
|
||||
}
|
||||
} else if (ability.equalsIgnoreCase("FireSpin")) {
|
||||
|
@ -191,21 +192,21 @@ public class FireCombo extends FireAbility implements ComboAbility {
|
|||
if (!affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
double newKnockback = bPlayer.isAvatarState() ? knockback + 0.5 : knockback;
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
entity.setVelocity(direction.normalize().multiply(newKnockback));
|
||||
fstream.remove();
|
||||
}
|
||||
} else if (ability.equalsIgnoreCase("JetBlaze")) {
|
||||
if (!affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
entity.setFireTicks((int) (fireTicks * 20));
|
||||
new FireDamageTimer(entity, player);
|
||||
}
|
||||
} else if (ability.equalsIgnoreCase("FireWheel")) {
|
||||
if (!affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
entity.setFireTicks((int) (fireTicks * 20));
|
||||
new FireDamageTimer(entity, player);
|
||||
this.remove();
|
||||
|
|
|
@ -8,6 +8,7 @@ import org.bukkit.entity.Player;
|
|||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||
import com.projectkorra.projectkorra.event.EntityBendingDeathEvent;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
|
@ -54,12 +55,10 @@ public class FireDamageTimer {
|
|||
}
|
||||
LivingEntity Lentity = (LivingEntity) entity;
|
||||
Player source = INSTANCES.get(entity);
|
||||
if (Lentity.getHealth() - DAMAGE <= 0 && !entity.isDead()) {
|
||||
EntityBendingDeathEvent event = new EntityBendingDeathEvent(entity, DAMAGE, CoreAbility.getAbilitiesByElement(Element.FIRE).get(0));
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
Lentity.damage(DAMAGE, source);
|
||||
//damages the entity
|
||||
DamageHandler.damageEntity(Lentity, source, DAMAGE, CoreAbility.getAbilitiesByElement(Element.FIRE).get(0));
|
||||
|
||||
if (entity.getFireTicks() > MAX_TICKS) {
|
||||
entity.setFireTicks(MAX_TICKS);
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
|||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.LightningAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Sound;
|
||||
|
@ -123,7 +124,7 @@ public class Lightning extends LightningAbility {
|
|||
public void electrocute(LivingEntity lent) {
|
||||
lent.getWorld().playSound(lent.getLocation(), Sound.CREEPER_HISS, 1, 0);
|
||||
player.getWorld().playSound(player.getLocation(), Sound.CREEPER_HISS, 1, 0);
|
||||
GeneralMethods.damageEntity(this, lent, damage);
|
||||
DamageHandler.damageEntity(lent, damage, this);
|
||||
|
||||
if (Math.random() < stunChance) {
|
||||
final Location lentLoc = lent.getLocation();
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.firebending;
|
|||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||
import com.projectkorra.projectkorra.ability.FireAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
|
@ -93,7 +94,7 @@ public class WallOfFire extends FireAbility {
|
|||
if (TempBlock.isTempBlock(block) && isIce(block)) {
|
||||
return;
|
||||
}
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
}
|
||||
entity.setFireTicks((int) (fireTicks * 20));
|
||||
|
|
69
src/com/projectkorra/projectkorra/util/DamageHandler.java
Normal file
69
src/com/projectkorra/projectkorra/util/DamageHandler.java
Normal file
|
@ -0,0 +1,69 @@
|
|||
package com.projectkorra.projectkorra.util;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.ability.Ability;
|
||||
import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||
import com.projectkorra.projectkorra.command.Commands;
|
||||
import com.projectkorra.projectkorra.event.AbilityDamageEntityEvent;
|
||||
import com.projectkorra.projectkorra.event.EntityBendingDeathEvent;
|
||||
|
||||
import fr.neatmonster.nocheatplus.checks.CheckType;
|
||||
import fr.neatmonster.nocheatplus.hooks.NCPExemptionManager;
|
||||
|
||||
public class DamageHandler {
|
||||
|
||||
/**
|
||||
* Damages an Entity by amount of damage specified. Starts a
|
||||
* {@link EntityDamageByEntityEvent}.
|
||||
*
|
||||
* @param ability The ability that is used to damage the entity
|
||||
* @param entity The entity that is receiving the damage
|
||||
* @param damage The amount of damage to deal
|
||||
*/
|
||||
public static void damageEntity(Entity entity, Player source, double damage, Ability ability) {
|
||||
|
||||
if (ability == null)
|
||||
return;
|
||||
|
||||
Player player = ability.getPlayer();
|
||||
AbilityDamageEntityEvent damageEvent = new AbilityDamageEntityEvent(entity, ability, damage);
|
||||
Bukkit.getServer().getPluginManager().callEvent(damageEvent);
|
||||
if (entity instanceof LivingEntity) {
|
||||
if (entity instanceof Player && Commands.invincible.contains(entity.getName())) {
|
||||
damageEvent.setCancelled(true);
|
||||
}
|
||||
if (!damageEvent.isCancelled()) {
|
||||
damage = damageEvent.getDamage();
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("NoCheatPlus")) {
|
||||
NCPExemptionManager.exemptPermanently(player, CheckType.FIGHT_REACH);
|
||||
}
|
||||
|
||||
boolean wasDead = entity.isDead();
|
||||
|
||||
((LivingEntity) entity).damage(damage, source);
|
||||
entity.setLastDamageCause(new EntityDamageByEntityEvent(player, entity, DamageCause.CUSTOM, damage));
|
||||
|
||||
if(!wasDead && entity.isDead()) {
|
||||
EntityBendingDeathEvent event = new EntityBendingDeathEvent(entity, damage, ability);
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("NoCheatPlus")) {
|
||||
NCPExemptionManager.unexempt(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void damageEntity(Entity entity, double damage, Ability ability) {
|
||||
damageEntity(entity, ability.getPlayer(), damage, ability);
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@ import com.projectkorra.projectkorra.ability.AirAbility;
|
|||
import com.projectkorra.projectkorra.ability.BloodAbility;
|
||||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.object.HorizontalVelocityTracker;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||
|
||||
public class Bloodbending extends BloodAbility {
|
||||
|
@ -78,7 +79,7 @@ public class Bloodbending extends BloodAbility {
|
|||
continue;
|
||||
}
|
||||
}
|
||||
GeneralMethods.damageEntity(this, entity, 0);
|
||||
DamageHandler.damageEntity(entity, 0, this);
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
TARGETED_ENTITIES.put(entity, entity.getLocation().clone());
|
||||
}
|
||||
|
@ -118,7 +119,7 @@ public class Bloodbending extends BloodAbility {
|
|||
return;
|
||||
}
|
||||
|
||||
GeneralMethods.damageEntity(this, target, 0);
|
||||
DamageHandler.damageEntity(target, 0, this);
|
||||
HorizontalVelocityTracker.remove(target);
|
||||
AirAbility.breakBreathbendingHold(target);
|
||||
TARGETED_ENTITIES.put(target, target.getLocation().clone());
|
||||
|
@ -204,7 +205,7 @@ public class Bloodbending extends BloodAbility {
|
|||
|
||||
entities.add(entity);
|
||||
if (!TARGETED_ENTITIES.containsKey(entity) && entity instanceof LivingEntity) {
|
||||
GeneralMethods.damageEntity(this, entity, 0);
|
||||
DamageHandler.damageEntity(entity, 0, this);
|
||||
TARGETED_ENTITIES.put(entity, entity.getLocation().clone());
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.projectkorra.projectkorra.ability.AirAbility;
|
|||
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||
|
@ -151,12 +152,12 @@ public class IceBlast extends IceAbility {
|
|||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, 70, 2);
|
||||
new TempPotionEffect(entity, effect);
|
||||
bPlayer.slow(10);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
} else {
|
||||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, 70, 2);
|
||||
new TempPotionEffect(entity, effect);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.BendingPlayer;
|
|||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||
|
||||
|
@ -92,12 +93,12 @@ public class IceSpikeBlast extends IceAbility {
|
|||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, slowDuration, slowPower);
|
||||
new TempPotionEffect(entity, effect);
|
||||
targetBPlayer.slow(slowCooldown);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
} else {
|
||||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, slowDuration, slowPower);
|
||||
new TempPotionEffect(entity, effect);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.waterbending;
|
|||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.AirAbility;
|
||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
@ -220,7 +221,7 @@ public class IceSpikePillar extends IceAbility {
|
|||
|
||||
private void affect(LivingEntity entity) {
|
||||
entity.setVelocity(thrownForce);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
damaged.add(entity);
|
||||
|
||||
if (entity instanceof Player) {
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.projectkorra.projectkorra.ability.WaterAbility;
|
|||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
@ -171,7 +172,7 @@ public class OctopusForm extends WaterAbility {
|
|||
entity.setVelocity(GeneralMethods.getDirection(player.getLocation(), location).normalize().multiply(knock));
|
||||
|
||||
if (entity instanceof LivingEntity) {
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.projectkorra.projectkorra.ability.WaterAbility;
|
|||
import com.projectkorra.projectkorra.avatar.AvatarState;
|
||||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
|
@ -517,7 +518,7 @@ public class Torrent extends WaterAbility {
|
|||
entity.setFallDistance(0);
|
||||
if (entity instanceof LivingEntity) {
|
||||
double damageDealt = getNightFactor(deflectDamage);
|
||||
GeneralMethods.damageEntity(this, entity, damageDealt);
|
||||
DamageHandler.damageEntity(entity, damageDealt, this);
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
}
|
||||
}
|
||||
|
@ -534,7 +535,7 @@ public class Torrent extends WaterAbility {
|
|||
}
|
||||
if (entity instanceof LivingEntity && !hurtEntities.contains(entity)) {
|
||||
double damageDealt = getNightFactor(damage);
|
||||
GeneralMethods.damageEntity(this, entity, damageDealt);
|
||||
DamageHandler.damageEntity(entity, damageDealt, this);
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
hurtEntities.add(entity);
|
||||
((LivingEntity) entity).setNoDamageTicks(0);
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.projectkorra.projectkorra.ability.FireAbility;
|
|||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
|
||||
import com.projectkorra.projectkorra.firebending.Lightning;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterArmsWhip.Whip;
|
||||
|
@ -352,9 +353,9 @@ public class WaterArms extends WaterAbility {
|
|||
FireAbility.playLightningbendingParticle(l1);
|
||||
}
|
||||
if (lightningKill) {
|
||||
GeneralMethods.damageEntity(lightning, player, 60D);
|
||||
DamageHandler.damageEntity(player, 60D, lightning);
|
||||
} else {
|
||||
GeneralMethods.damageEntity(lightning, player, lightningDamage);
|
||||
DamageHandler.damageEntity(player, lightningDamage, lightning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.projectkorra.projectkorra.waterbending;
|
|||
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.IceAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import com.projectkorra.projectkorra.util.TempPotionEffect;
|
||||
|
@ -126,7 +127,7 @@ public class WaterArmsFreeze extends IceAbility {
|
|||
|
||||
for (Entity entity : GeneralMethods.getEntitiesAroundPoint(location, 2.5)) {
|
||||
if (entity instanceof LivingEntity && entity.getEntityId() != player.getEntityId() && !(entity instanceof ArmorStand)) {
|
||||
GeneralMethods.damageEntity(this, entity, iceDamage);
|
||||
DamageHandler.damageEntity(entity, iceDamage, this);
|
||||
PotionEffect effect = new PotionEffect(PotionEffectType.SLOW, 40, 2);
|
||||
new TempPotionEffect((LivingEntity) entity, effect);
|
||||
remove();
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.projectkorra.projectkorra.waterbending;
|
|||
|
||||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterArms.Arm;
|
||||
|
||||
|
@ -172,7 +173,7 @@ public class WaterArmsSpear extends WaterAbility {
|
|||
location = entity.getLocation();
|
||||
|
||||
if (spearDamageEnabled) {
|
||||
GeneralMethods.damageEntity(this, entity, spearDamage);
|
||||
DamageHandler.damageEntity(entity, spearDamage, this);
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.projectkorra.projectkorra.GeneralMethods;
|
|||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||
import com.projectkorra.projectkorra.ability.util.MultiAbilityManager;
|
||||
import com.projectkorra.projectkorra.command.Commands;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
import com.projectkorra.projectkorra.waterbending.WaterArms.Arm;
|
||||
|
||||
|
@ -304,7 +305,7 @@ public class WaterArmsWhip extends WaterAbility {
|
|||
if (entity instanceof LivingEntity) {
|
||||
if (entity.getEntityId() != player.getEntityId()) {
|
||||
hasDamaged = true;
|
||||
GeneralMethods.damageEntity(this, entity, punchDamage);
|
||||
DamageHandler.damageEntity(entity, punchDamage, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.projectkorra.projectkorra.firebending.FireCombo;
|
|||
import com.projectkorra.projectkorra.firebending.FireCombo.FireComboStream;
|
||||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
|
@ -184,7 +185,7 @@ public class WaterCombo extends WaterAbility implements ComboAbility {
|
|||
}
|
||||
if (damage != 0) {
|
||||
if (entity instanceof LivingEntity) {
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.projectkorra.projectkorra.firebending.Combustion;
|
|||
import com.projectkorra.projectkorra.firebending.FireBlast;
|
||||
import com.projectkorra.projectkorra.util.BlockSource;
|
||||
import com.projectkorra.projectkorra.util.ClickType;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.ParticleEffect;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
|
@ -281,7 +282,7 @@ public class WaterManipulation extends WaterAbility {
|
|||
damage = AvatarState.getValue(damage);
|
||||
}
|
||||
damage = getNightFactor(damage);
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
AirAbility.breakBreathbendingHold(entity);
|
||||
progressing = false;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.projectkorra.projectkorra.waterbending;
|
|||
import com.projectkorra.projectkorra.GeneralMethods;
|
||||
import com.projectkorra.projectkorra.ProjectKorra;
|
||||
import com.projectkorra.projectkorra.ability.WaterAbility;
|
||||
import com.projectkorra.projectkorra.util.DamageHandler;
|
||||
import com.projectkorra.projectkorra.util.TempBlock;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
@ -255,7 +256,7 @@ public class WaterSpoutWave extends WaterAbility {
|
|||
if (entity != this.player && entity instanceof LivingEntity && !affectedEntities.contains(entity)) {
|
||||
affectedEntities.add(entity);
|
||||
final double augment = getNightFactor(player.getWorld());
|
||||
GeneralMethods.damageEntity(this, entity, damage);
|
||||
DamageHandler.damageEntity(entity, damage, this);
|
||||
final Player fplayer = this.player;
|
||||
final Entity fent = entity;
|
||||
|
||||
|
|
Loading…
Reference in a new issue