1
0

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
This commit is contained in:
madmaxoft@gmail.com
2013-02-06 22:29:29 +00:00
parent a091413125
commit afdbb1d71b
5 changed files with 187 additions and 3 deletions

View File

@@ -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