From afdbb1d71bb69cf20cd7458e192be0c9308515ba Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 6 Feb 2013 22:29:29 +0000 Subject: cBlockArea can now be loaded from a .schematic file. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1195 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- MCServer/Plugins/Debuggers/Debuggers.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'MCServer/Plugins/Debuggers/Debuggers.lua') diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua index 6776fa480..ba410dd49 100644 --- a/MCServer/Plugins/Debuggers/Debuggers.lua +++ b/MCServer/Plugins/Debuggers/Debuggers.lua @@ -69,6 +69,7 @@ function OnPlayerUsingItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, C local HeldItem = Player:GetEquippedItem(); + if (HeldItem.m_ItemType == E_ITEM_STICK) then -- Magic sTick of ticking: set the pointed block for ticking at the next tick Player:SendMessage(cChatColor.LightGray .. "Setting next block tick to {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}") @@ -76,6 +77,7 @@ function OnPlayerUsingItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, C return true end + if (HeldItem.m_ItemType == E_ITEM_BLAZE_ROD) then -- Magic rod of query: show block types and metas for both neighbors of the pointed face local Type = 0; @@ -104,6 +106,7 @@ function OnPlayerUsingItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, C end end + -- Rclk with a diamond to read a block area, dump it, crop it, dump it again, crop it again... if (Player:GetEquippedItem().m_ItemType == E_ITEM_DIAMOND) then local Area = cBlockArea(); @@ -132,6 +135,20 @@ function OnPlayerUsingItem(Player, BlockX, BlockY, BlockZ, BlockFace, CursorX, C return false; end + + -- Rclk with an eye of ender places a predefined schematic at the cursor + if (Player:GetEquippedItem().m_ItemType == E_ITEM_EYE_OF_ENDER) then + local Area = cBlockArea(); + if not(Area:LoadFromSchematicFile("schematics/test.schematic")) then + LOG("Loading failed"); + return false; + end + LOG("Schematic loaded, placing now."); + Area:Write(Player:GetWorld(), BlockX, BlockY, BlockZ); + LOG("Done."); + return false; + end + end -- cgit v1.2.3