summaryrefslogtreecommitdiffstats
path: root/src/Bindings/PluginLua.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2020-03-23 13:18:12 +0100
committerAlexander Harkness <me@bearbin.net>2020-03-23 13:18:12 +0100
commit0a68994f4800b063bf7a7e32663220ec4063402f (patch)
treec8875e6cff55a388f325571c96487f42747581f5 /src/Bindings/PluginLua.cpp
parentDon't attempt to give bucket with item count of 0 (diff)
downloadcuberite-0a68994f4800b063bf7a7e32663220ec4063402f.tar
cuberite-0a68994f4800b063bf7a7e32663220ec4063402f.tar.gz
cuberite-0a68994f4800b063bf7a7e32663220ec4063402f.tar.bz2
cuberite-0a68994f4800b063bf7a7e32663220ec4063402f.tar.lz
cuberite-0a68994f4800b063bf7a7e32663220ec4063402f.tar.xz
cuberite-0a68994f4800b063bf7a7e32663220ec4063402f.tar.zst
cuberite-0a68994f4800b063bf7a7e32663220ec4063402f.zip
Diffstat (limited to '')
-rw-r--r--src/Bindings/PluginLua.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp
index e2062117a..52695196b 100644
--- a/src/Bindings/PluginLua.cpp
+++ b/src/Bindings/PluginLua.cpp
@@ -665,9 +665,9 @@ bool cPluginLua::OnPlayerLeftClick(cPlayer & a_Player, int a_BlockX, int a_Block
-bool cPluginLua::OnPlayerMoving(cPlayer & a_Player, const Vector3d & a_OldPosition, const Vector3d & a_NewPosition)
+bool cPluginLua::OnPlayerMoving(cPlayer & a_Player, const Vector3d & a_OldPosition, const Vector3d & a_NewPosition, bool a_PreviousIsOnGround)
{
- return CallSimpleHooks(cPluginManager::HOOK_PLAYER_MOVING, &a_Player, a_OldPosition, a_NewPosition);
+ return CallSimpleHooks(cPluginManager::HOOK_PLAYER_MOVING, &a_Player, a_OldPosition, a_NewPosition, a_PreviousIsOnGround);
}
@@ -718,6 +718,16 @@ bool cPluginLua::OnPlayerPlacingBlock(cPlayer & a_Player, const sSetBlock & a_Bl
+bool cPluginLua::OnPlayerCrouched(cPlayer & a_Player)
+{
+ return CallSimpleHooks(cPluginManager::HOOK_PLAYER_CROUCHED,
+ &a_Player);
+}
+
+
+
+
+
bool cPluginLua::OnPlayerRightClick(cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ)
{
return CallSimpleHooks(cPluginManager::HOOK_PLAYER_RIGHT_CLICK, &a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ);
@@ -1093,6 +1103,7 @@ const char * cPluginLua::GetHookFnName(int a_HookType)
case cPluginManager::HOOK_PLAYER_OPENING_WINDOW: return "OnPlayerOpeningWindow";
case cPluginManager::HOOK_PLAYER_PLACED_BLOCK: return "OnPlayerPlacedBlock";
case cPluginManager::HOOK_PLAYER_PLACING_BLOCK: return "OnPlayerPlacingBlock";
+ case cPluginManager::HOOK_PLAYER_CROUCHED: return "OnPlayerCrouched";
case cPluginManager::HOOK_PLAYER_RIGHT_CLICK: return "OnPlayerRightClick";
case cPluginManager::HOOK_PLAYER_RIGHT_CLICKING_ENTITY: return "OnPlayerRightClickingEntity";
case cPluginManager::HOOK_PLAYER_SHOOTING: return "OnPlayerShooting";