1
0

Added the OnHopperPullingItem and OnHopperPushingItem hooks.

Requested in FS 412, slightly modified the params.
This commit is contained in:
madmaxoft
2013-08-11 14:57:07 +02:00
parent d97b4463c6
commit dd60f55bcc
11 changed files with 230 additions and 61 deletions

View File

@@ -326,6 +326,30 @@ bool cPlugin_NewLua::OnHandshake(cClientHandle * a_Client, const AString & a_Use
bool cPlugin_NewLua::OnHopperPullingItem(cWorld & a_World, cHopperEntity & a_Hopper, int a_DstSlotNum, cBlockEntityWithItems & a_SrcEntity, int a_SrcSlotNum)
{
cCSLock Lock(m_CriticalSection);
bool res = false;
m_LuaState.Call(GetHookFnName(cPluginManager::HOOK_HOPPER_PULLING_ITEM), &a_World, &a_Hopper, a_DstSlotNum, &a_SrcEntity, a_SrcSlotNum, cLuaState::Return, res);
return res;
}
bool cPlugin_NewLua::OnHopperPushingItem(cWorld & a_World, cHopperEntity & a_Hopper, int a_SrcSlotNum, cBlockEntityWithItems & a_DstEntity, int a_DstSlotNum)
{
cCSLock Lock(m_CriticalSection);
bool res = false;
m_LuaState.Call(GetHookFnName(cPluginManager::HOOK_HOPPER_PUSHING_ITEM), &a_World, &a_Hopper, a_SrcSlotNum, &a_DstEntity, a_DstSlotNum, cLuaState::Return, res);
return res;
}
bool cPlugin_NewLua::OnKilling(cEntity & a_Victim, cEntity * a_Killer)
{
cCSLock Lock(m_CriticalSection);