1
0

Each time a portal block receives a tick it has a 1 in 500 chance of spawning a zombie pigman.

This commit is contained in:
STRWarrior 2014-05-10 16:43:06 +02:00
parent a38d8b6513
commit 3b1f11bd6a

View File

@ -2,6 +2,7 @@
#pragma once
#include "BlockHandler.h"
#include "../Mobs/Monster.h"
@ -38,6 +39,19 @@ public:
return; // No pickups
}
virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
{
cFastRandom Random;
if (Random.NextInt(500) != 0)
{
return;
}
int PosX = a_Chunk.GetPosX() * 16 + a_RelX;
int PosZ = a_Chunk.GetPosZ() * 16 + a_RelZ;
a_WorldInterface.SpawnMob(PosX, a_RelY, PosZ, cMonster::eType::mtZombiePigman);
}
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{