summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-04 14:14:38 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-06-04 14:14:38 +0200
commit86e5273cd17be8b8f1ae8a9b0dc2d212cb9b2791 (patch)
tree1b5c702a9e9da9115e64c317bdad5aba3544d4a1 /MCServer
parentImplemented bed homes (diff)
parentMerge pull request #1059 from mc-server/coverity_fixes (diff)
downloadcuberite-86e5273cd17be8b8f1ae8a9b0dc2d212cb9b2791.tar
cuberite-86e5273cd17be8b8f1ae8a9b0dc2d212cb9b2791.tar.gz
cuberite-86e5273cd17be8b8f1ae8a9b0dc2d212cb9b2791.tar.bz2
cuberite-86e5273cd17be8b8f1ae8a9b0dc2d212cb9b2791.tar.lz
cuberite-86e5273cd17be8b8f1ae8a9b0dc2d212cb9b2791.tar.xz
cuberite-86e5273cd17be8b8f1ae8a9b0dc2d212cb9b2791.tar.zst
cuberite-86e5273cd17be8b8f1ae8a9b0dc2d212cb9b2791.zip
Diffstat (limited to 'MCServer')
-rw-r--r--MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua5
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua14
2 files changed, 18 insertions, 1 deletions
diff --git a/MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua b/MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua
index 1588d420c..72cf85821 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnProjectileHitBlock.lua
@@ -10,6 +10,11 @@ return
Params =
{
{ Name = "ProjectileEntity", Type = "{{cProjectileEntity}}", Notes = "The projectile that hit an entity." },
+ { Name = "BlockX", Type = "number", Notes = "The X-coord where the projectile hit." },
+ { Name = "BlockY", Type = "number", Notes = "The Y-coord where the projectile hit." },
+ { Name = "BlockZ", Type = "number", Notes = "The Z-coord where the projectile hit." },
+ { Name = "BlockFace", Type = "number", Notes = "The side of the block where the projectile hit." },
+ { Name = "BlockHitPos", Type = "Vector3d", Notes = "The exact position where the projectile hit." },
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called. If the function
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 064d5d772..534426d25 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -29,7 +29,8 @@ function Initialize(Plugin)
PM:AddHook(cPluginManager.HOOK_WORLD_TICK, OnWorldTick);
PM:AddHook(cPluginManager.HOOK_PLUGINS_LOADED, OnPluginsLoaded);
PM:AddHook(cPluginManager.HOOK_PLUGIN_MESSAGE, OnPluginMessage);
- PM:AddHook(cPluginManager.HOOK_PLAYER_JOINED, OnPlayerJoined)
+ PM:AddHook(cPluginManager.HOOK_PLAYER_JOINED, OnPlayerJoined);
+ PM:AddHook(cPluginManager.HOOK_PROJECTILE_HIT_BLOCK, OnProjectileHitBlock);
-- _X: Disabled so that the normal operation doesn't interfere with anything
-- PM:AddHook(cPluginManager.HOOK_CHUNK_GENERATED, OnChunkGenerated);
@@ -1379,3 +1380,14 @@ end
+
+function OnProjectileHitBlock(a_Projectile, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_BlockHitPos)
+ local BlockX, BlockY, BlockZ = AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace)
+ local World = a_Projectile:GetWorld()
+
+ World:SetBlock(BlockX, BlockY, BlockZ, E_BLOCK_FIRE, 0)
+end
+
+
+
+