summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-03-01 12:45:43 +0100
committerMattes D <github@xoft.cz>2016-03-01 12:45:43 +0100
commit48532d86cf3a4d549e9f7e6697d821946d7fa341 (patch)
tree86f5f2b17c79957dd1f8dc6fd458802f7b956775
parentMerge pull request #3040 from Woazboat/master (diff)
parentMobs no longer spawn at the top of the nether. (diff)
downloadcuberite-48532d86cf3a4d549e9f7e6697d821946d7fa341.tar
cuberite-48532d86cf3a4d549e9f7e6697d821946d7fa341.tar.gz
cuberite-48532d86cf3a4d549e9f7e6697d821946d7fa341.tar.bz2
cuberite-48532d86cf3a4d549e9f7e6697d821946d7fa341.tar.lz
cuberite-48532d86cf3a4d549e9f7e6697d821946d7fa341.tar.xz
cuberite-48532d86cf3a4d549e9f7e6697d821946d7fa341.tar.zst
cuberite-48532d86cf3a4d549e9f7e6697d821946d7fa341.zip
Diffstat (limited to '')
-rw-r--r--src/MobSpawner.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/MobSpawner.cpp b/src/MobSpawner.cpp
index 8db6b8edd..60f7cfb43 100644
--- a/src/MobSpawner.cpp
+++ b/src/MobSpawner.cpp
@@ -134,6 +134,11 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R
return false;
}
+ if (cChunkDef::IsValidHeight(a_RelY - 1) && (a_Chunk->GetBlock(a_RelX, a_RelY - 1, a_RelZ) == E_BLOCK_BEDROCK))
+ {
+ return false; // Make sure mobs do not spawn on bedrock.
+ }
+
cFastRandom Random;
BLOCKTYPE TargetBlock = a_Chunk->GetBlock(a_RelX, a_RelY, a_RelZ);