1
0

Added new hooks: UPDATING_SIGN and UPDATED_SIGN. The first one is capable of changing the sign text by returning the new four lines along with the bool value

git-svn-id: http://mc-server.googlecode.com/svn/trunk@622 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-06-16 15:06:14 +00:00
parent 4d6433ac30
commit 18a99085f4
8 changed files with 451 additions and 8 deletions

View File

@@ -747,9 +747,9 @@ void cWorld::TickSpawnMobs(float a_Dt)
if (m_WorldTime >= 12000 + 1000)
{
if (GetBiomeAt(SpawnPos.x, SpawnPos.z) == biHell) // Spawn nether mobs
if (GetBiomeAt((int)SpawnPos.x, (int)SpawnPos.z) == biHell) // Spawn nether mobs
{
if (nightRand == 1 && GetBiomeAt(SpawnPos.x, SpawnPos.z) == biHell)
if (nightRand == 1)
Monster = new cZombie();
else if (nightRand == 5)
Monster = new cGhast();
@@ -1753,9 +1753,18 @@ void cWorld::ChunkLoadFailed(int a_ChunkX, int a_ChunkY, int a_ChunkZ)
void cWorld::UpdateSign(int a_X, int a_Y, int a_Z, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4)
void cWorld::UpdateSign(int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4)
{
m_ChunkMap->UpdateSign(a_X, a_Y, a_Z, a_Line1, a_Line2, a_Line3, a_Line4);
AString Line1(a_Line1);
AString Line2(a_Line2);
AString Line3(a_Line3);
AString Line4(a_Line4);
if (cRoot::Get()->GetPluginManager()->CallHookUpdatingSign(this, a_BlockX, a_BlockY, a_BlockZ, Line1, Line2, Line3, Line4))
{
return;
}
m_ChunkMap->UpdateSign(a_BlockX, a_BlockY, a_BlockZ, Line1, Line2, Line3, Line4);
cRoot::Get()->GetPluginManager()->CallHookUpdatedSign(this, a_BlockX, a_BlockY, a_BlockZ, Line1, Line2, Line3, Line4);
}