summaryrefslogtreecommitdiffstats
path: root/src/MobSpawner.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-12-21 12:57:01 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-12-21 12:57:01 +0100
commit9755c5ba699493b3aa18ad4927f5a6a87e991e3b (patch)
treecc9a83ff0b5c87e4edd31f0785b14c902d577768 /src/MobSpawner.cpp
parentFix repeater unpowering (diff)
parentMerge pull request #1680 from Masy98/entities (diff)
downloadcuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar
cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.gz
cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.bz2
cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.lz
cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.xz
cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.tar.zst
cuberite-9755c5ba699493b3aa18ad4927f5a6a87e991e3b.zip
Diffstat (limited to 'src/MobSpawner.cpp')
-rw-r--r--src/MobSpawner.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/MobSpawner.cpp b/src/MobSpawner.cpp
index ee9e569a7..bd34d8fcd 100644
--- a/src/MobSpawner.cpp
+++ b/src/MobSpawner.cpp
@@ -83,6 +83,7 @@ eMonsterType cMobSpawner::ChooseMobType(EMCSBiome a_Biome)
addIfAllowed(mtSkeleton, allowedMobs);
addIfAllowed(mtCreeper, allowedMobs);
addIfAllowed(mtSquid, allowedMobs);
+ addIfAllowed(mtGuardian, allowedMobs);
if ((a_Biome != biDesert) && (a_Biome != biBeach) && (a_Biome != biOcean))
{
@@ -144,6 +145,11 @@ bool cMobSpawner::CanSpawnHere(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_R
switch (a_MobType)
{
+ case mtGuardian:
+ {
+ return IsBlockWater(TargetBlock) && (a_RelY >= 45) && (a_RelY <= 62);
+ }
+
case mtSquid:
{
return IsBlockWater(TargetBlock) && (a_RelY >= 45) && (a_RelY <= 62);