Renamed animation function
Renamed BroadcastPlayerAnimation to BroadcastEntityAnimation. Not just players can have animations, you know.
This commit is contained in:
parent
a5dd0e2b88
commit
30ead79049
@ -1,6 +1,6 @@
|
||||
/*
|
||||
** Lua binding: AllToLua
|
||||
** Generated automatically by tolua++-1.0.92 on 11/30/13 15:42:56.
|
||||
** Generated automatically by tolua++-1.0.92 on 12/06/13 23:06:37.
|
||||
*/
|
||||
|
||||
#ifndef __cplusplus
|
||||
@ -11803,6 +11803,38 @@ static int tolua_AllToLua_cWorld_IsDeepSnowEnabled00(lua_State* tolua_S)
|
||||
}
|
||||
#endif //#ifndef TOLUA_DISABLE
|
||||
|
||||
/* method: ShouldLavaSpawnFire of class cWorld */
|
||||
#ifndef TOLUA_DISABLE_tolua_AllToLua_cWorld_ShouldLavaSpawnFire00
|
||||
static int tolua_AllToLua_cWorld_ShouldLavaSpawnFire00(lua_State* tolua_S)
|
||||
{
|
||||
#ifndef TOLUA_RELEASE
|
||||
tolua_Error tolua_err;
|
||||
if (
|
||||
!tolua_isusertype(tolua_S,1,"const cWorld",0,&tolua_err) ||
|
||||
!tolua_isnoobj(tolua_S,2,&tolua_err)
|
||||
)
|
||||
goto tolua_lerror;
|
||||
else
|
||||
#endif
|
||||
{
|
||||
const cWorld* self = (const cWorld*) tolua_tousertype(tolua_S,1,0);
|
||||
#ifndef TOLUA_RELEASE
|
||||
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'ShouldLavaSpawnFire'", NULL);
|
||||
#endif
|
||||
{
|
||||
bool tolua_ret = (bool) self->ShouldLavaSpawnFire();
|
||||
tolua_pushboolean(tolua_S,(bool)tolua_ret);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
#ifndef TOLUA_RELEASE
|
||||
tolua_lerror:
|
||||
tolua_error(tolua_S,"#ferror in function 'ShouldLavaSpawnFire'.",&tolua_err);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif //#ifndef TOLUA_DISABLE
|
||||
|
||||
/* method: GetDimension of class cWorld */
|
||||
#ifndef TOLUA_DISABLE_tolua_AllToLua_cWorld_GetDimension00
|
||||
static int tolua_AllToLua_cWorld_GetDimension00(lua_State* tolua_S)
|
||||
@ -12193,7 +12225,8 @@ static int tolua_AllToLua_cWorld_QueueSetBlock00(lua_State* tolua_S)
|
||||
!tolua_isnumber(tolua_S,5,0,&tolua_err) ||
|
||||
!tolua_isnumber(tolua_S,6,0,&tolua_err) ||
|
||||
!tolua_isnumber(tolua_S,7,0,&tolua_err) ||
|
||||
!tolua_isnoobj(tolua_S,8,&tolua_err)
|
||||
!tolua_isnumber(tolua_S,8,1,&tolua_err) ||
|
||||
!tolua_isnoobj(tolua_S,9,&tolua_err)
|
||||
)
|
||||
goto tolua_lerror;
|
||||
else
|
||||
@ -12206,11 +12239,12 @@ static int tolua_AllToLua_cWorld_QueueSetBlock00(lua_State* tolua_S)
|
||||
unsigned char a_BlockType = (( unsigned char) tolua_tonumber(tolua_S,5,0));
|
||||
unsigned char a_BlockMeta = (( unsigned char) tolua_tonumber(tolua_S,6,0));
|
||||
int a_TickDelay = ((int) tolua_tonumber(tolua_S,7,0));
|
||||
unsigned char a_PreviousBlockType = (( unsigned char) tolua_tonumber(tolua_S,8,E_BLOCK_AIR));
|
||||
#ifndef TOLUA_RELEASE
|
||||
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'QueueSetBlock'", NULL);
|
||||
#endif
|
||||
{
|
||||
self->QueueSetBlock(a_BlockX,a_BLockY,a_BlockZ,a_BlockType,a_BlockMeta,a_TickDelay);
|
||||
self->QueueSetBlock(a_BlockX,a_BLockY,a_BlockZ,a_BlockType,a_BlockMeta,a_TickDelay,a_PreviousBlockType);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -30765,6 +30799,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
|
||||
tolua_constant(tolua_S,"HOOK_COLLECTING_PICKUP",cPluginManager::HOOK_COLLECTING_PICKUP);
|
||||
tolua_constant(tolua_S,"HOOK_CRAFTING_NO_RECIPE",cPluginManager::HOOK_CRAFTING_NO_RECIPE);
|
||||
tolua_constant(tolua_S,"HOOK_DISCONNECT",cPluginManager::HOOK_DISCONNECT);
|
||||
tolua_constant(tolua_S,"HOOK_ENTITY_ANIMATION",cPluginManager::HOOK_ENTITY_ANIMATION);
|
||||
tolua_constant(tolua_S,"HOOK_EXECUTE_COMMAND",cPluginManager::HOOK_EXECUTE_COMMAND);
|
||||
tolua_constant(tolua_S,"HOOK_EXPLODED",cPluginManager::HOOK_EXPLODED);
|
||||
tolua_constant(tolua_S,"HOOK_EXPLODING",cPluginManager::HOOK_EXPLODING);
|
||||
@ -30773,7 +30808,6 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
|
||||
tolua_constant(tolua_S,"HOOK_HOPPER_PUSHING_ITEM",cPluginManager::HOOK_HOPPER_PUSHING_ITEM);
|
||||
tolua_constant(tolua_S,"HOOK_KILLING",cPluginManager::HOOK_KILLING);
|
||||
tolua_constant(tolua_S,"HOOK_LOGIN",cPluginManager::HOOK_LOGIN);
|
||||
tolua_constant(tolua_S,"HOOK_PLAYER_ANIMATION",cPluginManager::HOOK_PLAYER_ANIMATION);
|
||||
tolua_constant(tolua_S,"HOOK_PLAYER_BREAKING_BLOCK",cPluginManager::HOOK_PLAYER_BREAKING_BLOCK);
|
||||
tolua_constant(tolua_S,"HOOK_PLAYER_BROKEN_BLOCK",cPluginManager::HOOK_PLAYER_BROKEN_BLOCK);
|
||||
tolua_constant(tolua_S,"HOOK_PLAYER_EATING",cPluginManager::HOOK_PLAYER_EATING);
|
||||
@ -30855,6 +30889,7 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
|
||||
tolua_function(tolua_S,"IsGameModeAdventure",tolua_AllToLua_cWorld_IsGameModeAdventure00);
|
||||
tolua_function(tolua_S,"IsPVPEnabled",tolua_AllToLua_cWorld_IsPVPEnabled00);
|
||||
tolua_function(tolua_S,"IsDeepSnowEnabled",tolua_AllToLua_cWorld_IsDeepSnowEnabled00);
|
||||
tolua_function(tolua_S,"ShouldLavaSpawnFire",tolua_AllToLua_cWorld_ShouldLavaSpawnFire00);
|
||||
tolua_function(tolua_S,"GetDimension",tolua_AllToLua_cWorld_GetDimension00);
|
||||
tolua_function(tolua_S,"GetHeight",tolua_AllToLua_cWorld_GetHeight00);
|
||||
tolua_function(tolua_S,"BroadcastChat",tolua_AllToLua_cWorld_BroadcastChat00);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
** Lua binding: AllToLua
|
||||
** Generated automatically by tolua++-1.0.92 on 11/30/13 15:42:57.
|
||||
** Generated automatically by tolua++-1.0.92 on 12/06/13 23:06:38.
|
||||
*/
|
||||
|
||||
/* Exported function */
|
||||
|
@ -2668,7 +2668,7 @@ void cChunk::BroadcastEntityVelocity(const cEntity & a_Entity, const cClientHand
|
||||
|
||||
|
||||
|
||||
void cChunk::BroadcastPlayerAnimation(const cPlayer & a_Player, char a_Animation, const cClientHandle * a_Exclude)
|
||||
void cChunk::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude)
|
||||
{
|
||||
for (cClientHandleList::const_iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr )
|
||||
{
|
||||
@ -2676,7 +2676,7 @@ void cChunk::BroadcastPlayerAnimation(const cPlayer & a_Player, char a_Animation
|
||||
{
|
||||
continue;
|
||||
}
|
||||
(*itr)->SendPlayerAnimation(a_Player, a_Animation);
|
||||
(*itr)->SendEntityAnimation(a_Entity, a_Animation);
|
||||
} // for itr - LoadedByClient[]
|
||||
}
|
||||
|
||||
|
@ -271,7 +271,7 @@ public:
|
||||
void BroadcastEntityRelMoveLook (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityStatus (const cEntity & a_Entity, char a_Status, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityVelocity (const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastPlayerAnimation (const cPlayer & a_Player, char a_Animation, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityAnimation (const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude = NULL); // a_Src coords are Block * 8
|
||||
void BroadcastSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSpawnEntity (cEntity & a_Entity, const cClientHandle * a_Exclude = NULL);
|
||||
|
@ -573,16 +573,16 @@ void cChunkMap::BroadcastEntityVelocity(const cEntity & a_Entity, const cClientH
|
||||
|
||||
|
||||
|
||||
void cChunkMap::BroadcastPlayerAnimation(const cPlayer & a_Player, char a_Animation, const cClientHandle * a_Exclude)
|
||||
void cChunkMap::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude)
|
||||
{
|
||||
cCSLock Lock(m_CSLayers);
|
||||
cChunkPtr Chunk = GetChunkNoGen(a_Player.GetChunkX(), ZERO_CHUNK_Y, a_Player.GetChunkZ());
|
||||
cChunkPtr Chunk = GetChunkNoGen(a_Entity.GetChunkX(), ZERO_CHUNK_Y, a_Entity.GetChunkZ());
|
||||
if (Chunk == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// It's perfectly legal to broadcast packets even to invalid chunks!
|
||||
Chunk->BroadcastPlayerAnimation(a_Player, a_Animation, a_Exclude);
|
||||
Chunk->BroadcastEntityAnimation(a_Entity, a_Animation, a_Exclude);
|
||||
}
|
||||
|
||||
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
void BroadcastEntityRelMoveLook(const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityStatus(const cEntity & a_Entity, char a_Status, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityVelocity(const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastPlayerAnimation(const cPlayer & a_Player, char a_Animation, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude = NULL); // a_Src coords are Block * 8
|
||||
void BroadcastSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSpawnEntity(cEntity & a_Entity, const cClientHandle * a_Exclude = NULL);
|
||||
|
@ -1053,13 +1053,13 @@ void cClientHandle::HandlePlayerMoveLook(double a_PosX, double a_PosY, double a_
|
||||
|
||||
void cClientHandle::HandleAnimation(char a_Animation)
|
||||
{
|
||||
if (cPluginManager::Get()->CallHookPlayerAnimation(*m_Player, a_Animation))
|
||||
if (cPluginManager::Get()->CallHookEntityAnimation(*m_Player, a_Animation))
|
||||
{
|
||||
// Plugin disagrees, bail out
|
||||
return;
|
||||
}
|
||||
|
||||
m_Player->GetWorld()->BroadcastPlayerAnimation(*m_Player, a_Animation, this);
|
||||
m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, a_Animation, this);
|
||||
}
|
||||
|
||||
|
||||
@ -1264,19 +1264,19 @@ void cClientHandle::HandleEntityAction(int a_EntityID, char a_ActionID)
|
||||
|
||||
switch (a_ActionID)
|
||||
{
|
||||
case 1: // crouch
|
||||
case 1: // Crouch
|
||||
{
|
||||
m_Player->SetCrouch(true);
|
||||
break;
|
||||
}
|
||||
case 2: // uncrouch
|
||||
case 2: // Uncrouch
|
||||
{
|
||||
m_Player->SetCrouch(false);
|
||||
break;
|
||||
}
|
||||
case 3: // Leave bed
|
||||
{
|
||||
m_Player->GetWorld()->BroadcastPlayerAnimation(*m_Player, 2);
|
||||
m_Player->GetWorld()->BroadcastEntityAnimation(*m_Player, 2);
|
||||
break;
|
||||
}
|
||||
case 4: // Start sprinting
|
||||
@ -1813,9 +1813,9 @@ void cClientHandle::SendPickupSpawn(const cPickup & a_Pickup)
|
||||
|
||||
|
||||
|
||||
void cClientHandle::SendPlayerAnimation(const cPlayer & a_Player, char a_Animation)
|
||||
void cClientHandle::SendEntityAnimation(const cEntity & a_Entity, char a_Animation)
|
||||
{
|
||||
m_Protocol->SendPlayerAnimation(a_Player, a_Animation);
|
||||
m_Protocol->SendEntityAnimation(a_Entity, a_Animation);
|
||||
}
|
||||
|
||||
|
||||
|
@ -114,7 +114,7 @@ public:
|
||||
void SendHealth (void);
|
||||
void SendInventorySlot (char a_WindowID, short a_SlotNum, const cItem & a_Item);
|
||||
void SendPickupSpawn (const cPickup & a_Pickup);
|
||||
void SendPlayerAnimation (const cPlayer & a_Player, char a_Animation);
|
||||
void SendEntityAnimation (const cEntity & a_Entity, char a_Animation);
|
||||
void SendPlayerListItem (const cPlayer & a_Player, bool a_IsOnline);
|
||||
void SendPlayerMaxSpeed (void); ///< Informs the client of the maximum player speed (1.6.1+)
|
||||
void SendPlayerMoveLook (void);
|
||||
|
@ -572,7 +572,7 @@ void cPlayer::StartEating(void)
|
||||
m_EatingFinishTick = m_World->GetWorldAge() + EATING_TICKS;
|
||||
|
||||
// Send the packets:
|
||||
m_World->BroadcastPlayerAnimation(*this, 3);
|
||||
m_World->BroadcastEntityAnimation(*this, 3);
|
||||
m_World->BroadcastEntityMetadata(*this);
|
||||
}
|
||||
|
||||
@ -587,7 +587,7 @@ void cPlayer::FinishEating(void)
|
||||
|
||||
// Send the packets:
|
||||
m_ClientHandle->SendEntityStatus(*this, ENTITY_STATUS_EATING_ACCEPTED);
|
||||
m_World->BroadcastPlayerAnimation(*this, 0);
|
||||
m_World->BroadcastEntityAnimation(*this, 0);
|
||||
m_World->BroadcastEntityMetadata(*this);
|
||||
|
||||
// consume the item:
|
||||
@ -616,7 +616,7 @@ void cPlayer::FinishEating(void)
|
||||
void cPlayer::AbortEating(void)
|
||||
{
|
||||
m_EatingFinishTick = -1;
|
||||
m_World->BroadcastPlayerAnimation(*this, 0);
|
||||
m_World->BroadcastEntityAnimation(*this, 0);
|
||||
m_World->BroadcastEntityMetadata(*this);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
virtual bool OnHopperPushingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_SrcSlotNum, cBlockEntityWithItems & a_DstEntity, int a_DstSlotNum) = 0;
|
||||
virtual bool OnKilling (cEntity & a_Victim, cEntity * a_Killer) = 0;
|
||||
virtual bool OnLogin (cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username) = 0;
|
||||
virtual bool OnPlayerAnimation (cPlayer & a_Player, int a_Animation) = 0;
|
||||
virtual bool OnEntityAnimation (cEntity & a_Entity, int a_Animation) = 0;
|
||||
virtual bool OnPlayerBreakingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
|
||||
virtual bool OnPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
|
||||
virtual bool OnPlayerEating (cPlayer & a_Player) = 0;
|
||||
|
@ -550,14 +550,14 @@ bool cPluginLua::OnLogin(cClientHandle * a_Client, int a_ProtocolVersion, const
|
||||
|
||||
|
||||
|
||||
bool cPluginLua::OnPlayerAnimation(cPlayer & a_Player, int a_Animation)
|
||||
bool cPluginLua::OnEntityAnimation(cEntity & a_Entity, int a_Animation)
|
||||
{
|
||||
cCSLock Lock(m_CriticalSection);
|
||||
bool res = false;
|
||||
cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_PLAYER_ANIMATION];
|
||||
cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_ENTITY_ANIMATION];
|
||||
for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr)
|
||||
{
|
||||
m_LuaState.Call((int)(**itr), &a_Player, a_Animation, cLuaState::Return, res);
|
||||
m_LuaState.Call((int)(**itr), &a_Entity, a_Animation, cLuaState::Return, res);
|
||||
if (res)
|
||||
{
|
||||
return true;
|
||||
@ -1287,11 +1287,11 @@ const char * cPluginLua::GetHookFnName(int a_HookType)
|
||||
case cPluginManager::HOOK_COLLECTING_PICKUP: return "OnCollectingPickup";
|
||||
case cPluginManager::HOOK_CRAFTING_NO_RECIPE: return "OnCraftingNoRecipe";
|
||||
case cPluginManager::HOOK_DISCONNECT: return "OnDisconnect";
|
||||
case cPluginManager::HOOK_ENTITY_ANIMATION: return "OnEntityAnimation";
|
||||
case cPluginManager::HOOK_EXECUTE_COMMAND: return "OnExecuteCommand";
|
||||
case cPluginManager::HOOK_HANDSHAKE: return "OnHandshake";
|
||||
case cPluginManager::HOOK_KILLING: return "OnKilling";
|
||||
case cPluginManager::HOOK_LOGIN: return "OnLogin";
|
||||
case cPluginManager::HOOK_PLAYER_ANIMATION: return "OnPlayerAnimation";
|
||||
case cPluginManager::HOOK_PLAYER_BREAKING_BLOCK: return "OnPlayerBreakingBlock";
|
||||
case cPluginManager::HOOK_PLAYER_BROKEN_BLOCK: return "OnPlayerBrokenBlock";
|
||||
case cPluginManager::HOOK_PLAYER_EATING: return "OnPlayerEating";
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
virtual bool OnHopperPushingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_SrcSlotNum, cBlockEntityWithItems & a_DstEntity, int a_DstSlotNum) override;
|
||||
virtual bool OnKilling (cEntity & a_Victim, cEntity * a_Killer) override;
|
||||
virtual bool OnLogin (cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username) override;
|
||||
virtual bool OnPlayerAnimation (cPlayer & a_Player, int a_Animation) override;
|
||||
virtual bool OnEntityAnimation (cEntity & a_Entity, int a_Animation) override;
|
||||
virtual bool OnPlayerBreakingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override;
|
||||
virtual bool OnPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override;
|
||||
virtual bool OnPlayerEating (cPlayer & a_Player) override;
|
||||
|
@ -603,16 +603,16 @@ bool cPluginManager::CallHookLogin(cClientHandle * a_Client, int a_ProtocolVersi
|
||||
|
||||
|
||||
|
||||
bool cPluginManager::CallHookPlayerAnimation(cPlayer & a_Player, int a_Animation)
|
||||
bool cPluginManager::CallHookEntityAnimation(cEntity & a_Entity, int a_Animation)
|
||||
{
|
||||
HookMap::iterator Plugins = m_Hooks.find(HOOK_PLAYER_ANIMATION);
|
||||
HookMap::iterator Plugins = m_Hooks.find(HOOK_ENTITY_ANIMATION);
|
||||
if (Plugins == m_Hooks.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->OnPlayerAnimation(a_Player, a_Animation))
|
||||
if ((*itr)->OnEntityAnimation(a_Entity, a_Animation))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -68,6 +68,7 @@ public: // tolua_export
|
||||
HOOK_COLLECTING_PICKUP,
|
||||
HOOK_CRAFTING_NO_RECIPE,
|
||||
HOOK_DISCONNECT,
|
||||
HOOK_ENTITY_ANIMATION,
|
||||
HOOK_EXECUTE_COMMAND,
|
||||
HOOK_EXPLODED,
|
||||
HOOK_EXPLODING,
|
||||
@ -76,7 +77,6 @@ public: // tolua_export
|
||||
HOOK_HOPPER_PUSHING_ITEM,
|
||||
HOOK_KILLING,
|
||||
HOOK_LOGIN,
|
||||
HOOK_PLAYER_ANIMATION,
|
||||
HOOK_PLAYER_BREAKING_BLOCK,
|
||||
HOOK_PLAYER_BROKEN_BLOCK,
|
||||
HOOK_PLAYER_EATING,
|
||||
@ -162,7 +162,7 @@ public: // tolua_export
|
||||
bool CallHookHopperPushingItem (cWorld & a_World, cHopperEntity & a_Hopper, int a_SrcSlotNum, cBlockEntityWithItems & a_DstEntity, int a_DstSlotNum);
|
||||
bool CallHookKilling (cEntity & a_Victim, cEntity * a_Killer);
|
||||
bool CallHookLogin (cClientHandle * a_Client, int a_ProtocolVersion, const AString & a_Username);
|
||||
bool CallHookPlayerAnimation (cPlayer & a_Player, int a_Animation);
|
||||
bool CallHookEntityAnimation (cEntity & a_Entity, int a_Animation);
|
||||
bool CallHookPlayerBreakingBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
|
||||
bool CallHookPlayerBrokenBlock (cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
|
||||
bool CallHookPlayerEating (cPlayer & a_Player);
|
||||
|
@ -79,7 +79,7 @@ public:
|
||||
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) = 0;
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) = 0;
|
||||
virtual void SendPlayerAbilities (void) = 0;
|
||||
virtual void SendPlayerAnimation (const cPlayer & a_Player, char a_Animation) = 0;
|
||||
virtual void SendEntityAnimation (const cEntity & a_Entity, char a_Animation) = 0;
|
||||
virtual void SendPlayerListItem (const cPlayer & a_Player, bool a_IsOnline) = 0;
|
||||
virtual void SendPlayerMaxSpeed (void) = 0; ///< Informs the client of the maximum player speed (1.6.1+)
|
||||
virtual void SendPlayerMoveLook (void) = 0;
|
||||
|
@ -578,11 +578,11 @@ void cProtocol125::SendPickupSpawn(const cPickup & a_Pickup)
|
||||
|
||||
|
||||
|
||||
void cProtocol125::SendPlayerAnimation(const cPlayer & a_Player, char a_Animation)
|
||||
void cProtocol125::SendEntityAnimation(const cEntity & a_Entity, char a_Animation)
|
||||
{
|
||||
cCSLock Lock(m_CSPacket);
|
||||
WriteByte(PACKET_ANIMATION);
|
||||
WriteInt (a_Player.GetUniqueID());
|
||||
WriteInt (a_Entity.GetUniqueID());
|
||||
WriteByte(a_Animation);
|
||||
Flush();
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
|
||||
virtual void SendPlayerAbilities (void) override {} // This protocol doesn't support such message
|
||||
virtual void SendPlayerAnimation (const cPlayer & a_Player, char a_Animation) override;
|
||||
virtual void SendEntityAnimation (const cEntity & a_Entity, char a_Animation) override;
|
||||
virtual void SendPlayerListItem (const cPlayer & a_Player, bool a_IsOnline) override;
|
||||
virtual void SendPlayerMaxSpeed (void) override;
|
||||
virtual void SendPlayerMoveLook (void) override;
|
||||
|
@ -489,10 +489,10 @@ void cProtocol172::SendPlayerAbilities(void)
|
||||
|
||||
|
||||
|
||||
void cProtocol172::SendPlayerAnimation(const cPlayer & a_Player, char a_Animation)
|
||||
void cProtocol172::SendEntityAnimation(const cEntity & a_Entity, char a_Animation)
|
||||
{
|
||||
cPacketizer Pkt(*this, 0x0b); // Animation packet
|
||||
Pkt.WriteVarInt(a_Player.GetUniqueID());
|
||||
Pkt.WriteVarInt(a_Entity.GetUniqueID());
|
||||
Pkt.WriteChar(a_Animation);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ public:
|
||||
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
|
||||
virtual void SendPlayerAbilities (void) override;
|
||||
virtual void SendPlayerAnimation (const cPlayer & a_Player, char a_Animation) override;
|
||||
virtual void SendEntityAnimation (const cEntity & a_Entity, char a_Animation) override;
|
||||
virtual void SendPlayerListItem (const cPlayer & a_Player, bool a_IsOnline) override;
|
||||
virtual void SendPlayerMaxSpeed (void) override;
|
||||
virtual void SendPlayerMoveLook (void) override;
|
||||
|
@ -396,10 +396,10 @@ void cProtocolRecognizer::SendPlayerAbilities(void)
|
||||
|
||||
|
||||
|
||||
void cProtocolRecognizer::SendPlayerAnimation(const cPlayer & a_Player, char a_Animation)
|
||||
void cProtocolRecognizer::SendEntityAnimation(const cEntity & a_Entity, char a_Animation)
|
||||
{
|
||||
ASSERT(m_Protocol != NULL);
|
||||
m_Protocol->SendPlayerAnimation(a_Player, a_Animation);
|
||||
m_Protocol->SendEntityAnimation(a_Entity, a_Animation);
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,7 +90,7 @@ public:
|
||||
virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
|
||||
virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
|
||||
virtual void SendPlayerAbilities (void) override;
|
||||
virtual void SendPlayerAnimation (const cPlayer & a_Player, char a_Animation) override;
|
||||
virtual void SendEntityAnimation (const cEntity & a_Entity, char a_Animation) override;
|
||||
virtual void SendPlayerListItem (const cPlayer & a_Player, bool a_IsOnline) override;
|
||||
virtual void SendPlayerMaxSpeed (void) override;
|
||||
virtual void SendPlayerMoveLook (void) override;
|
||||
|
@ -1858,9 +1858,9 @@ void cWorld::BroadcastEntityVelocity(const cEntity & a_Entity, const cClientHand
|
||||
|
||||
|
||||
|
||||
void cWorld::BroadcastPlayerAnimation(const cPlayer & a_Player, char a_Animation, const cClientHandle * a_Exclude)
|
||||
void cWorld::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude)
|
||||
{
|
||||
m_ChunkMap->BroadcastPlayerAnimation(a_Player, a_Animation, a_Exclude);
|
||||
m_ChunkMap->BroadcastEntityAnimation(a_Entity, a_Animation, a_Exclude);
|
||||
}
|
||||
|
||||
|
||||
|
@ -159,7 +159,7 @@ public:
|
||||
void BroadcastEntityRelMoveLook (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityStatus (const cEntity & a_Entity, char a_Status, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityVelocity (const cEntity & a_Entity, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastPlayerAnimation (const cPlayer & a_Player, char a_Animation, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastEntityAnimation (const cEntity & a_Entity, char a_Animation, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastPlayerListItem (const cPlayer & a_Player, bool a_IsOnline, const cClientHandle * a_Exclude = NULL);
|
||||
void BroadcastSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude = NULL); // tolua_export a_Src coords are Block * 8
|
||||
void BroadcastSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data, const cClientHandle * a_Exclude = NULL); // tolua_export
|
||||
|
Loading…
Reference in New Issue
Block a user