MCPcopy Create free account
hub / github.com/cuberite/cuberite / OnPlayerUsingBlock

Method OnPlayerUsingBlock

src/Bindings/PluginLua.cpp:998–1012  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

996
997
998bool cPluginLua::OnPlayerUsingBlock(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
999{
1000 cCSLock Lock(m_CriticalSection);
1001 bool res = false;
1002 cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_PLAYER_USING_BLOCK];
1003 for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr)
1004 {
1005 m_LuaState.Call((int)(**itr), &a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, a_BlockType, a_BlockMeta, cLuaState::Return, res);
1006 if (res)
1007 {
1008 return true;
1009 }
1010 }
1011 return false;
1012}
1013
1014
1015

Callers 1

Calls 3

beginMethod · 0.80
endMethod · 0.80
CallMethod · 0.45

Tested by

no test coverage detected