From 19ea5d5423a04e91576f8f5772aebedbff6292cb Mon Sep 17 00:00:00 2001 From: samoatesgames Date: Fri, 13 Nov 2015 15:08:16 +0000 Subject: Improved spawn location calculations. - Supports Overworld and Nether spawns. - Supports spawning under objects, but still above ground (e.g. under the leaves of a tree). - Protects against spawning in oceans. - Protects against spawning in water. - Uses a radial search about the origin, rather than a linear. - Correctly calculates Nether spawn on spawn world generation (fixes: cuberite#2548) - Fixes a bug in CheckPlayerSpawnPoint() where the X offset was used in both the X and Z coords (BLOCKTYPE BlockType = GetBlock(a_PosX + Coords[i].x, a_PosY, a_PosZ + Coords[i].x);) --- src/Entities/Entity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Entities/Entity.cpp') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index ee806c4b3..f44dbe27c 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1343,7 +1343,7 @@ bool cEntity::DetectPortal() TargetPos.x *= 8.0; TargetPos.z *= 8.0; - cWorld * TargetWorld = cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedOverworldName(), dimNether, GetWorld()->GetName(), false); + cWorld * TargetWorld = cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedOverworldName(), dimNether, GetWorld()->GetName(), true); LOGD("Jumping nether -> overworld"); new cNetherPortalScanner(this, TargetWorld, TargetPos, 256); return true; @@ -1367,7 +1367,7 @@ bool cEntity::DetectPortal() TargetPos.x /= 8.0; TargetPos.z /= 8.0; - cWorld * TargetWorld = cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedNetherWorldName(), dimNether, GetWorld()->GetName(), false); + cWorld * TargetWorld = cRoot::Get()->CreateAndInitializeWorld(GetWorld()->GetLinkedNetherWorldName(), dimNether, GetWorld()->GetName(), true); LOGD("Jumping overworld -> nether"); new cNetherPortalScanner(this, TargetWorld, TargetPos, 128); return true; -- cgit v1.2.3