added some velocity debug

This commit is contained in:
Cheese 2015-07-17 13:27:55 +10:00
parent cfb4911c25
commit 44102842c9
2 changed files with 14 additions and 5 deletions

View File

@ -1,7 +1,9 @@
package mineplex.core.common.util;
import org.bukkit.Material;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
public class UtilAction
@ -38,5 +40,11 @@ public class UtilAction
//Velocity
ent.setFallDistance(0);
ent.setVelocity(vec);
//Debug
if (ent instanceof Player && UtilGear.isMat(((Player)ent).getItemInHand(), Material.SUGAR))
{
UtilPlayer.message(ent, F.main("Debug", "Velocity Sent: " + vec.length()));
}
}
}

View File

@ -391,10 +391,11 @@ public class DamageManager extends MiniPlugin
trajectory.setY(Math.abs(trajectory.getY()));
//Apply
UtilAction.velocity(event.GetDamageeEntity(),
trajectory, 0.2 + trajectory.length() * 0.8, false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true);
}
double vel = 0.2 + trajectory.length() * 0.8;
UtilAction.velocity(event.GetDamageeEntity(), trajectory, vel,
false, 0, Math.abs(0.2 * knockback), 0.4 + (0.04 * knockback), true);
}
}
catch (IllegalAccessException e)
{
@ -414,7 +415,7 @@ public class DamageManager extends MiniPlugin
{
for (Player player : UtilServer.getPlayers())
{
if (!UtilGear.isMat(player.getItemInHand(), Material.BOOK))
if (!UtilGear.isMat(player.getItemInHand(), Material.COMMAND))
continue;
UtilPlayer.message(player, " ");