Mineplex2018-withcommit/Plugins/Mineplex.Game.Clans/src/mineplex/game/clans/items/legendaries/WindBlade.java

41 lines
847 B
Java
Raw Normal View History

package mineplex.game.clans.items.legendaries;
import mineplex.game.clans.items.attributes.ItemAttribute;
import mineplex.game.clans.items.generation.ValueDistribution;
import org.bukkit.entity.Player;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
public class WindBlade extends LegendaryItem
{
public static final int MAX_FLIGHT_TIME = 80; // Max flight of 80 ticks
private long _flightTime; // Time (in ticks) since last touching ground and flying
public WindBlade()
{
_flightTime = 0;
}
@Override
public void update(Player wielder)
{
if (isHoldingRightClick() && canPropel())
{
propelPlayer(wielder);
}
}
private void propelPlayer(Player player)
{
_flightTime++;
// TODO: Propel player forward with ??? velocity
}
private boolean canPropel()
{
return _flightTime <= MAX_FLIGHT_TIME;
}
}