Velocity Death Message Fix

Fixes Velocity DeathMessages
This commit is contained in:
OmniCypher 2015-11-14 17:17:20 -08:00
parent 12cf8daa60
commit db76fe8334
2 changed files with 4 additions and 3 deletions

View file

@ -622,9 +622,9 @@ public class PKListener implements Listener {
double damage = ((e.getDistanceTraveled() - minimumDistance) < 0 ? 0 : e.getDistanceTraveled() - minimumDistance) / (e.getDifference().length()); double damage = ((e.getDistanceTraveled() - minimumDistance) < 0 ? 0 : e.getDistanceTraveled() - minimumDistance) / (e.getDifference().length());
if (damage > 0) { if (damage > 0) {
if(damage <= maxDamage) { if(damage <= maxDamage) {
GeneralMethods.damageEntity(e.getInstigator(), e.getEntity(), damage, null); GeneralMethods.damageEntity(e.getInstigator(), e.getEntity(), damage, e.getAbility().toString());
} else { } else {
GeneralMethods.damageEntity(e.getInstigator(), e.getEntity(), maxDamage, null); GeneralMethods.damageEntity(e.getInstigator(), e.getEntity(), maxDamage, e.getAbility().toString());
} }
} }
} }

View file

@ -7,6 +7,7 @@ import com.projectkorra.projectkorra.earthbending.EarthMethods;
import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent; import com.projectkorra.projectkorra.event.HorizontalVelocityChangeEvent;
import com.projectkorra.projectkorra.waterbending.WaterMethods; import com.projectkorra.projectkorra.waterbending.WaterMethods;
import org.bukkit.Bukkit;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@ -76,8 +77,8 @@ public class HorizontalVelocityTracker {
for (Block b : blocks) { for (Block b : blocks) {
if (GeneralMethods.isSolid(b) && (entity.getLocation().getBlock().getRelative(BlockFace.EAST, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.NORTH, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.WEST, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.SOUTH, 1).equals(b))) { if (GeneralMethods.isSolid(b) && (entity.getLocation().getBlock().getRelative(BlockFace.EAST, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.NORTH, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.WEST, 1).equals(b) || entity.getLocation().getBlock().getRelative(BlockFace.SOUTH, 1).equals(b))) {
if (!EarthMethods.isTransparentToEarthbending(instigator, b)) { if (!EarthMethods.isTransparentToEarthbending(instigator, b)) {
ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity, instigator, lastVelocity, thisVelocity, diff, launchLocation, impactLocation, abil));
hasBeenDamaged = true; hasBeenDamaged = true;
ProjectKorra.plugin.getServer().getPluginManager().callEvent(new HorizontalVelocityChangeEvent(entity, instigator, lastVelocity, thisVelocity, diff, launchLocation, impactLocation, abil));
remove(); remove();
return; return;
} }