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;
@ -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);