map parser fixes

This commit is contained in:
Mini-Chiss 2015-08-09 00:09:26 +02:00
parent cbb0cb96c8
commit b974fcf838
2 changed files with 16 additions and 1 deletions

View File

@ -30,6 +30,7 @@ public enum GameType
Halloween("Halloween Horror"),
HideSeek("Block Hunt"),
Horse("Horseback"),
Lobbers("Bomb Lobbers"),
SurvivalGames("Survival Games"),
SurvivalGamesTeams("Survival Games Teams"),
Micro("Micro Battle"),

View File

@ -38,6 +38,7 @@ import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.util.Vector;
import mineplex.core.common.util.C;
import mineplex.core.common.util.Callback;
@ -720,6 +721,7 @@ public class MapParser extends JavaPlugin implements Listener
return blocks;
}
long lastUse = 0;
@EventHandler(priority = EventPriority.LOWEST)
public void leaptest(PlayerInteractEvent event)
{
@ -730,6 +732,18 @@ public class MapParser extends JavaPlugin implements Listener
if (event.getPlayer().getItemInHand().getType() != Material.FEATHER)
return;
event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().multiply(1.2));
if (System.currentTimeMillis() - lastUse < 800)
{
Bukkit.broadcastMessage("Cooldown");
return;
}
lastUse = System.currentTimeMillis();
Vector vel = event.getPlayer().getLocation().getDirection().multiply(1.2);
vel.add(new Vector(0,0.6,0));
event.getPlayer().setVelocity(vel);
}
}