summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Debuggers/Debuggers.lua
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-07-13 00:54:11 +0200
committerHowaner <franzi.moos@googlemail.com>2014-07-13 00:54:11 +0200
commit4b093972ea139d057dd523b583352be69bae7edb (patch)
tree1bc8edf1594f4c81bbdd6a68cf7d22f5a2b21341 /MCServer/Plugins/Debuggers/Debuggers.lua
parentAdd doxy-comments. (diff)
parentMerge pull request #1154 from mc-server/trappedchests (diff)
downloadcuberite-4b093972ea139d057dd523b583352be69bae7edb.tar
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.gz
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.bz2
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.lz
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.xz
cuberite-4b093972ea139d057dd523b583352be69bae7edb.tar.zst
cuberite-4b093972ea139d057dd523b583352be69bae7edb.zip
Diffstat (limited to 'MCServer/Plugins/Debuggers/Debuggers.lua')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index deb6a720b..918204deb 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -31,6 +31,8 @@ function Initialize(Plugin)
PM:AddHook(cPluginManager.HOOK_PLUGIN_MESSAGE, OnPluginMessage);
PM:AddHook(cPluginManager.HOOK_PLAYER_JOINED, OnPlayerJoined);
PM:AddHook(cPluginManager.HOOK_PROJECTILE_HIT_BLOCK, OnProjectileHitBlock);
+ PM:AddHook(cPluginManager.HOOK_CHUNK_UNLOADING, OnChunkUnloading);
+ PM:AddHook(cPluginManager.HOOK_WORLD_STARTED, OnWorldStarted);
-- _X: Disabled so that the normal operation doesn't interfere with anything
-- PM:AddHook(cPluginManager.HOOK_CHUNK_GENERATED, OnChunkGenerated);
@@ -1382,6 +1384,7 @@ end
function OnProjectileHitBlock(a_Projectile, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_BlockHitPos)
+ -- Test projectile hooks by setting the blocks they hit on fire:
local BlockX, BlockY, BlockZ = AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, a_BlockFace)
local World = a_Projectile:GetWorld()
@@ -1391,3 +1394,28 @@ end
+
+function OnChunkUnloading(a_World, a_ChunkX, a_ChunkZ)
+ -- Do not let chunk [0, 0] unload, so that it continues ticking [cWorld:SetChunkAlwaysTicked() test]
+ if ((a_ChunkX == 0) and (a_ChunkZ == 0)) then
+ return true
+ end
+end
+
+
+
+
+
+function OnWorldStarted(a_World)
+ -- Make the chunk [0, 0] in every world keep ticking [cWorld:SetChunkAlwaysTicked() test]
+ a_World:ChunkStay({{0, 0}}, nil,
+ function()
+ -- The chunk is loaded, make it always tick:
+ a_World:SetChunkAlwaysTicked(0, 0, true)
+ end
+ )
+end
+
+
+
+