From f1a35effb05e06c0ae5556f76234a41e3ae3704e Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Sun, 29 Jan 2012 06:36:43 -0500 Subject: Added useExactLoginLocation(). Closes BUKKIT-145 useExactLoginLocation() looks for settings.use-exact-login-location within bukkit.yml. If true, we will bypass Vanilla's behaviour of checking for collisions and moving the player if needed when they login. If false, we will continue to follow Vanilla's behaviour and move players that 'collide' with objects when they login. --- .../java/net/minecraft/server/ServerConfigurationManager.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main/java/net/minecraft/server/ServerConfigurationManager.java') diff --git a/src/main/java/net/minecraft/server/ServerConfigurationManager.java b/src/main/java/net/minecraft/server/ServerConfigurationManager.java index f6595e3e..62d37089 100644 --- a/src/main/java/net/minecraft/server/ServerConfigurationManager.java +++ b/src/main/java/net/minecraft/server/ServerConfigurationManager.java @@ -120,11 +120,15 @@ public class ServerConfigurationManager { worldserver.chunkProviderServer.getChunkAt((int) entityplayer.locX >> 4, (int) entityplayer.locZ >> 4); - while (worldserver.a(entityplayer, entityplayer.boundingBox).size() != 0) { - entityplayer.setPosition(entityplayer.locX, entityplayer.locY + 1.0D, entityplayer.locZ); + // CraftBukkit start + if (!cserver.useExactLoginLocation()) { + while (worldserver.a(entityplayer, entityplayer.boundingBox).size() != 0) { + entityplayer.setPosition(entityplayer.locX, entityplayer.locY + 1.0D, entityplayer.locZ); + } + } else { + entityplayer.setPosition(entityplayer.locX, entityplayer.locY + entityplayer.getBukkitEntity().getEyeHeight(), entityplayer.locZ); } - // CraftBukkit start PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(this.cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.name + " joined the game."); this.cserver.getPluginManager().callEvent(playerJoinEvent); -- cgit v1.2.3