diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-22 11:33:16 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-07-22 11:33:16 +0200 |
commit | 0a15e1f420402e797397ea447b1df96f6ea2106f (patch) | |
tree | 6876df8170be4b8d164cb062957d06061fb9dfea | |
parent | Merge remote-tracking branch 'origin/master' into portals (diff) | |
download | cuberite-0a15e1f420402e797397ea447b1df96f6ea2106f.tar cuberite-0a15e1f420402e797397ea447b1df96f6ea2106f.tar.gz cuberite-0a15e1f420402e797397ea447b1df96f6ea2106f.tar.bz2 cuberite-0a15e1f420402e797397ea447b1df96f6ea2106f.tar.lz cuberite-0a15e1f420402e797397ea447b1df96f6ea2106f.tar.xz cuberite-0a15e1f420402e797397ea447b1df96f6ea2106f.tar.zst cuberite-0a15e1f420402e797397ea447b1df96f6ea2106f.zip |
-rw-r--r-- | src/Blocks/BlockPortal.h | 2 | ||||
-rw-r--r-- | src/World.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/Blocks/BlockPortal.h b/src/Blocks/BlockPortal.h index 6f41f96df..fc74e89d0 100644 --- a/src/Blocks/BlockPortal.h +++ b/src/Blocks/BlockPortal.h @@ -55,7 +55,7 @@ public: virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override { - if ((a_RelY == 0) || (a_RelY == cChunkDef::Height)) // Y can't be < 0 or > Height; (Fast)SetBlock won't allow it + if ((a_RelY - 1 < 0) || (a_RelY + 1 > cChunkDef::Height)) { return false; // In case someone places a portal with meta 1 or 2 at boundaries, and server tries to get invalid coords at Y - 1 or Y + 1 } diff --git a/src/World.cpp b/src/World.cpp index 9dc28afea..2736e77d3 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -579,6 +579,11 @@ void cWorld::Start(void) int Weather = IniFile.GetValueSetI("General", "Weather", (int)m_Weather); m_TimeOfDay = IniFile.GetValueSetI("General", "TimeInTicks", m_TimeOfDay); + if (GetDimension() == dimOverworld) + { + m_NetherWorldName = IniFile.GetValueSet("LinkedWorlds", "NetherWorldName", DEFAULT_NETHER_NAME); + m_EndWorldName = IniFile.GetValueSet("LinkedWorlds", "EndWorldName", DEFAULT_END_NAME); + } else { m_OverworldName = IniFile.GetValueSet("LinkedWorlds", "OverworldName", GetLinkedOverworldName()); |