summaryrefslogtreecommitdiffstats
path: root/MCServer/Plugins/Debuggers
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-08 21:57:42 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-08 21:57:42 +0100
commitb55afc940b4a95ac0191cc24a40c5c3824ab2f0f (patch)
tree83fe5517c9685d43986b87a28a4dfdcb141d381d /MCServer/Plugins/Debuggers
parentPrepared cChunkDesc for further API extension; used it as the sole container for generated chunk data, including entities / block entities. (diff)
downloadcuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.gz
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.bz2
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.lz
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.xz
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.tar.zst
cuberite-b55afc940b4a95ac0191cc24a40c5c3824ab2f0f.zip
Diffstat (limited to 'MCServer/Plugins/Debuggers')
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua20
1 files changed, 18 insertions, 2 deletions
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 04f7af3c9..ae639f6a6 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -14,8 +14,9 @@ function Initialize(Plugin)
Plugin:SetVersion(1)
PluginManager = cRoot:Get():GetPluginManager()
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USING_ITEM)
- PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE)
+ PluginManager:AddHook(Plugin, cPluginManager.HOOK_PLAYER_USING_ITEM);
+ PluginManager:AddHook(Plugin, cPluginManager.HOOK_TAKE_DAMAGE);
+ PluginManager:AddHook(Plugin, cPluginManager.HOOK_CHUNK_GENERATED);
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
@@ -186,3 +187,18 @@ end
+
+
+function OnChunkGenerated(World, ChunkX, ChunkZ, ChunkDesc)
+ -- Test ChunkDesc / BlockArea interaction
+ local BlockArea = cBlockArea();
+ ChunkDesc:ReadBlockArea(BlockArea, 0, 15, 50, 70, 0, 15);
+ BlockArea:SaveToSchematicFile("ChunkBlocks_" .. ChunkX .. "_" .. ChunkZ .. ".schematic");
+
+ ChunkDesc:WriteBlockArea(BlockArea, 5, 115, 5);
+ return false;
+end
+
+
+
+