diff options
author | HaoTNN <haotnn@gmail.com> | 2015-05-23 23:06:37 +0200 |
---|---|---|
committer | HaoTNN <haotnn@gmail.com> | 2015-05-23 23:06:37 +0200 |
commit | 2578afb2449ac27defb3ac9dcc3d140e980d0d1a (patch) | |
tree | 4f8e0f52f39c1eb3189680b0395134d4b72a2228 /src/Bindings | |
parent | Merge remote-tracking branch 'upstream/master' (diff) | |
parent | Merge pull request #2107 from mc-server/cow-waterspawn (diff) | |
download | cuberite-2578afb2449ac27defb3ac9dcc3d140e980d0d1a.tar cuberite-2578afb2449ac27defb3ac9dcc3d140e980d0d1a.tar.gz cuberite-2578afb2449ac27defb3ac9dcc3d140e980d0d1a.tar.bz2 cuberite-2578afb2449ac27defb3ac9dcc3d140e980d0d1a.tar.lz cuberite-2578afb2449ac27defb3ac9dcc3d140e980d0d1a.tar.xz cuberite-2578afb2449ac27defb3ac9dcc3d140e980d0d1a.tar.zst cuberite-2578afb2449ac27defb3ac9dcc3d140e980d0d1a.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Bindings/ManualBindings_World.cpp | 2 | ||||
-rw-r--r-- | src/Bindings/Plugin.h | 2 | ||||
-rw-r--r-- | src/Bindings/PluginLua.cpp | 6 | ||||
-rw-r--r-- | src/Bindings/PluginLua.h | 4 | ||||
-rw-r--r-- | src/Bindings/PluginManager.cpp | 6 | ||||
-rw-r--r-- | src/Bindings/PluginManager.h | 4 |
6 files changed, 12 insertions, 12 deletions
diff --git a/src/Bindings/ManualBindings_World.cpp b/src/Bindings/ManualBindings_World.cpp index 3ee5ca498..5becbba92 100644 --- a/src/Bindings/ManualBindings_World.cpp +++ b/src/Bindings/ManualBindings_World.cpp @@ -530,7 +530,7 @@ static int tolua_cWorld_TryGetHeight(lua_State * tolua_S) // Call the implementation: int Height = 0; bool res = self->TryGetHeight(BlockX, BlockZ, Height); - L.Push(res ? 1 : 0); + L.Push(res); if (res) { L.Push(Height); diff --git a/src/Bindings/Plugin.h b/src/Bindings/Plugin.h index b4bbfd802..1330bca0d 100644 --- a/src/Bindings/Plugin.h +++ b/src/Bindings/Plugin.h @@ -56,7 +56,7 @@ public: virtual bool OnDisconnect (cClientHandle & a_Client, const AString & a_Reason) = 0; virtual bool OnEntityAddEffect (cEntity & a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, double a_DistanceModifier) = 0; virtual bool OnEntityTeleport (cEntity & a_Entity, const Vector3d & a_OldPosition, const Vector3d & a_NewPosition) = 0; - virtual bool OnEntityChangeWorld (cEntity & a_Entity, cWorld & a_World) = 0; + virtual bool OnEntityChangingWorld (cEntity & a_Entity, cWorld & a_World) = 0; virtual bool OnEntityChangedWorld (cEntity & a_Entity, cWorld & a_World) = 0; virtual bool OnExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, cPluginManager::CommandResult & a_Result) = 0; virtual bool OnExploded (cWorld & a_World, double a_ExplosionSize, bool a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData) = 0; diff --git a/src/Bindings/PluginLua.cpp b/src/Bindings/PluginLua.cpp index a8be26f71..234bf579b 100644 --- a/src/Bindings/PluginLua.cpp +++ b/src/Bindings/PluginLua.cpp @@ -534,7 +534,7 @@ bool cPluginLua::OnEntityAddEffect(cEntity & a_Entity, int a_EffectType, int a_E -bool cPluginLua::OnEntityChangeWorld(cEntity & a_Entity, cWorld & a_World) +bool cPluginLua::OnEntityChangingWorld(cEntity & a_Entity, cWorld & a_World) { cCSLock Lock(m_CriticalSection); if (!m_LuaState.IsValid()) @@ -542,7 +542,7 @@ bool cPluginLua::OnEntityChangeWorld(cEntity & a_Entity, cWorld & a_World) return false; } bool res = false; - cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_ENTITY_CHANGE_WORLD]; + cLuaRefs & Refs = m_HookMap[cPluginManager::HOOK_ENTITY_CHANGING_WORLD]; for (cLuaRefs::iterator itr = Refs.begin(), end = Refs.end(); itr != end; ++itr) { m_LuaState.Call((int)(**itr), &a_Entity, &a_World, cLuaState::Return, res); @@ -1932,7 +1932,7 @@ const char * cPluginLua::GetHookFnName(int a_HookType) case cPluginManager::HOOK_DISCONNECT: return "OnDisconnect"; case cPluginManager::HOOK_PLAYER_ANIMATION: return "OnPlayerAnimation"; case cPluginManager::HOOK_ENTITY_ADD_EFFECT: return "OnEntityAddEffect"; - case cPluginManager::HOOK_ENTITY_CHANGE_WORLD: return "OnEntityChangeWorld"; + case cPluginManager::HOOK_ENTITY_CHANGING_WORLD: return "OnEntityChangingWorld"; case cPluginManager::HOOK_ENTITY_CHANGED_WORLD: return "OnEntityChangedWorld"; case cPluginManager::HOOK_ENTITY_TELEPORT: return "OnEntityTeleport"; case cPluginManager::HOOK_EXECUTE_COMMAND: return "OnExecuteCommand"; diff --git a/src/Bindings/PluginLua.h b/src/Bindings/PluginLua.h index 533dc0331..a763cdfdf 100644 --- a/src/Bindings/PluginLua.h +++ b/src/Bindings/PluginLua.h @@ -115,7 +115,7 @@ public: virtual bool OnCraftingNoRecipe (cPlayer & a_Player, cCraftingGrid & a_Grid, cCraftingRecipe & a_Recipe) override; virtual bool OnDisconnect (cClientHandle & a_Client, const AString & a_Reason) override; virtual bool OnEntityAddEffect (cEntity & a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, double a_DistanceModifier) override; - virtual bool OnEntityChangeWorld (cEntity & a_Entity, cWorld & a_World) override; + virtual bool OnEntityChangingWorld (cEntity & a_Entity, cWorld & a_World) override; virtual bool OnEntityChangedWorld (cEntity & a_Entity, cWorld & a_World) override; virtual bool OnExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, cPluginManager::CommandResult & a_Result) override; virtual bool OnExploded (cWorld & a_World, double a_ExplosionSize, bool a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData) override; @@ -179,7 +179,7 @@ public: bool CanAddOldStyleHook(int a_HookType); // cWebPlugin overrides - virtual const AString GetWebTitle(void) const {return GetName(); } + virtual const AString GetWebTitle(void) const override {return GetName(); } virtual AString HandleWebRequest(const HTTPRequest & a_Request) override; /** Adds a new web tab to webadmin. diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index 6fb6ef4fa..4dc3e20d3 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -525,14 +525,14 @@ bool cPluginManager::CallHookEntityTeleport(cEntity & a_Entity, const Vector3d & -bool cPluginManager::CallHookEntityChangeWorld(cEntity & a_Entity, cWorld & a_World) +bool cPluginManager::CallHookEntityChangingWorld(cEntity & a_Entity, cWorld & a_World) { - FIND_HOOK(HOOK_ENTITY_CHANGE_WORLD); + FIND_HOOK(HOOK_ENTITY_CHANGING_WORLD); VERIFY_HOOK; for (PluginList::iterator itr = Plugins->second.begin(); itr != Plugins->second.end(); ++itr) { - if ((*itr)->OnEntityChangeWorld(a_Entity, a_World)) + if ((*itr)->OnEntityChangingWorld(a_Entity, a_World)) { return true; } diff --git a/src/Bindings/PluginManager.h b/src/Bindings/PluginManager.h index e528c049f..6bcef87bf 100644 --- a/src/Bindings/PluginManager.h +++ b/src/Bindings/PluginManager.h @@ -86,7 +86,7 @@ public: HOOK_DISCONNECT, HOOK_PLAYER_ANIMATION, HOOK_ENTITY_ADD_EFFECT, - HOOK_ENTITY_CHANGE_WORLD, + HOOK_ENTITY_CHANGING_WORLD, HOOK_ENTITY_CHANGED_WORLD, HOOK_EXECUTE_COMMAND, HOOK_EXPLODED, @@ -203,7 +203,7 @@ public: bool CallHookDisconnect (cClientHandle & a_Client, const AString & a_Reason); bool CallHookEntityAddEffect (cEntity & a_Entity, int a_EffectType, int a_EffectDurationTicks, int a_EffectIntensity, double a_DistanceModifier); bool CallHookEntityTeleport (cEntity & a_Entity, const Vector3d & a_OldPosition, const Vector3d & a_NewPosition); - bool CallHookEntityChangeWorld (cEntity & a_Entity, cWorld & a_World); + bool CallHookEntityChangingWorld (cEntity & a_Entity, cWorld & a_World); bool CallHookEntityChangedWorld (cEntity & a_Entity, cWorld & a_World); bool CallHookExecuteCommand (cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, CommandResult & a_Result); // If a_Player == nullptr, it is a console cmd bool CallHookExploded (cWorld & a_World, double a_ExplosionSize, bool a_CanCauseFire, double a_X, double a_Y, double a_Z, eExplosionSource a_Source, void * a_SourceData); |