From 18a99085f468dfcb4ec2d9f93361b23874364d82 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 16 Jun 2012 15:06:14 +0000 Subject: 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 --- source/cWorld.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'source/cWorld.cpp') diff --git a/source/cWorld.cpp b/source/cWorld.cpp index 0616fcf44..e5bff4c11 100644 --- a/source/cWorld.cpp +++ b/source/cWorld.cpp @@ -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); } -- cgit v1.2.3