mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 01:27:40 +01:00
[trunk] getSaveDestination: floor location and center the player on the block
Less chance to get stuck in walls git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1176 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
parent
3f2a7388b6
commit
8a30845b1d
@ -48,9 +48,9 @@ public class PlayerExtension extends PlayerWrapper
|
||||
public Location getSafeDestination(Location loc) throws Exception
|
||||
{
|
||||
World world = loc.getWorld();
|
||||
double x = Math.round(loc.getX())+0.5;
|
||||
double y = Math.round(loc.getY());
|
||||
double z = Math.round(loc.getZ())+0.5;
|
||||
double x = Math.floor(loc.getX())+0.5;
|
||||
double y = Math.floor(loc.getY());
|
||||
double z = Math.floor(loc.getZ())+0.5;
|
||||
|
||||
while (isBlockAboveAir(world, x, y, z))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user