sTick: Updated the plugin to work with current code
git-svn-id: http://mc-server.googlecode.com/svn/trunk@920 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
0130e73316
commit
9fa165488b
@ -6,15 +6,15 @@ PLUGIN = {} -- Reference to own plugin object
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function Initialize( Plugin )
|
function Initialize(Plugin)
|
||||||
PLUGIN = Plugin
|
PLUGIN = Plugin
|
||||||
|
|
||||||
Plugin:SetName( "sTick" )
|
Plugin:SetName("sTick")
|
||||||
Plugin:SetVersion( 8 )
|
Plugin:SetVersion(2)
|
||||||
|
|
||||||
PluginManager = cRoot:Get():GetPluginManager()
|
PluginManager = cRoot:Get():GetPluginManager()
|
||||||
PluginManager:AddHook( Plugin, cPluginManager.E_PLUGIN_BLOCK_PLACE )
|
PluginManager:AddHook(Plugin, cPluginManager.E_PLUGIN_BLOCK_PLACE)
|
||||||
|
|
||||||
LOG( "Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion() )
|
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
|
||||||
return true
|
return true
|
||||||
end
|
end
|
@ -1,17 +1,18 @@
|
|||||||
function OnBlockPlace( Block, Player )
|
function OnBlockPlace(Player, BlockX, BlockY, BlockZ, BlockFace, HeldItem)
|
||||||
|
|
||||||
-- dont check if the direction is in the air
|
-- dont check if the direction is in the air
|
||||||
if Block.m_Direction == -1 then
|
if BlockFace == BLOCK_FACE_NONE then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
if (Block.m_ItemType ~= 280) then -- not a Stick of Ticking
|
if (HeldItem.m_ItemType ~= 280) then
|
||||||
|
-- not a Stick of Ticking
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
LOG("Setting next block tick to {" .. Block.m_PosX .. ", " .. Block.m_PosY .. ", " .. Block.m_PosZ .. "}")
|
LOG("Setting next block tick to {" .. BlockX .. ", " .. BlockY .. ", " .. BlockZ .. "}")
|
||||||
|
|
||||||
Player:GetWorld():SetNextBlockTick(Block.m_PosX, Block.m_PosY, Block.m_PosZ);
|
Player:GetWorld():SetNextBlockTick(BlockX, BlockY, BlockZ);
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user