Air teleportation fix

Makes it less likey that a player would die of fall damage when using
the eye of ender
This commit is contained in:
Sam 2016-08-24 19:50:38 +01:00
parent 2c37d17db3
commit 4088d2a311

View File

@ -17,7 +17,6 @@ import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
import mineplex.core.common.util.UtilParticle; import mineplex.core.common.util.UtilParticle;
@ -31,7 +30,7 @@ import nautilus.game.arcade.kit.Perk;
public class PerkVoidSaver extends Perk public class PerkVoidSaver extends Perk
{ {
private Map<UUID, Location> _safeLocations = new HashMap<>(); private Map<UUID, Location> _safeLocations = new HashMap<>();
private List<UUID> _used = new ArrayList<>(); private List<UUID> _used = new ArrayList<>();
@ -73,8 +72,8 @@ public class PerkVoidSaver extends Perk
return; return;
} }
player.teleport(_safeLocations.get(player.getUniqueId()).add(0, 2, 0));
player.setFallDistance(0); player.setFallDistance(0);
player.teleport(_safeLocations.get(player.getUniqueId()).add(0, 1, 0));
player.getInventory().remove(Material.EYE_OF_ENDER); player.getInventory().remove(Material.EYE_OF_ENDER);
player.sendMessage(F.main("Game", "You used your safe teleport.")); player.sendMessage(F.main("Game", "You used your safe teleport."));
player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1, 0); player.playSound(player.getLocation(), Sound.ENDERMAN_TELEPORT, 1, 0);