Inform players of the ender pearl cooldown
This commit is contained in:
parent
d885f83159
commit
96263ebf5b
@ -29,10 +29,12 @@ import mineplex.core.updater.event.UpdateEvent;
|
||||
public class EnderPearlModule extends Module
|
||||
{
|
||||
|
||||
private static final int DEFAULT_COOLDOWN = 500;
|
||||
|
||||
private final Map<Player, Projectile> _pearls;
|
||||
|
||||
private int _maxTicks = Integer.MAX_VALUE;
|
||||
private long _cooldown = 500;
|
||||
private long _cooldown = DEFAULT_COOLDOWN;
|
||||
|
||||
public EnderPearlModule()
|
||||
{
|
||||
@ -62,7 +64,7 @@ public class EnderPearlModule extends Module
|
||||
Player player = event.getPlayer();
|
||||
ItemStack itemStack = player.getItemInHand();
|
||||
|
||||
if (itemStack != null && itemStack.getType() == Material.ENDER_PEARL && !Recharge.Instance.use(player, "Ender Pearl", _cooldown, false, false))
|
||||
if (itemStack != null && itemStack.getType() == Material.ENDER_PEARL && !Recharge.Instance.use(player, "Ender Pearl", _cooldown, _cooldown > DEFAULT_COOLDOWN, false))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user