From fe7e07d69d3227d6e5cfbeefd88b47b3f5961184 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 7 Feb 2013 10:45:30 +0000 Subject: Added cBlockArea:CopyTo() and :CopyFrom(), so now block areas can be duplicated easily. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1199 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Debuggers/Debuggers.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'MCServer/Plugins/Debuggers/Debuggers.lua') diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index c80957511..04f7af3c9 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -150,7 +150,7 @@ function OnPlayerUsingItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, C end - -- Rclk with an ender pearl saves a predefined area around the cursor into a .schematic file + -- Rclk with an ender pearl saves a predefined area around the cursor into a .schematic file. Also tests area copying if (Player:GetEquippedItem().m_ItemType == E_ITEM_ENDER_PEARL) then local Area = cBlockArea(); if not(Area:Read(Player:GetWorld(), @@ -159,8 +159,11 @@ function OnPlayerUsingItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, C LOG("LUA: Area couldn't be read"); return false; end - LOG("LUA: Area read, saving now."); - if not(Area:SaveToSchematicFile("schematics/out.schematic")) then + LOG("LUA: Area read, copying now."); + local Area2 = cBlockArea(); + Area2:CopyFrom(Area); + LOG("LUA: Copied, now saving."); + if not(Area2:SaveToSchematicFile("schematics/test.schematic")) then LOG("LUA: Cannot save schematic file."); return false; end -- cgit v1.2.3