To change the default Server behaviour of dropping leaf block you can try this:
greets,
Tybor
PHP Code:
function TreePlugin:OnBlockDig( PacketData, Player )
local World = cRoot:Get():GetWorld()
local X = PacketData.m_PosX
local Y = PacketData.m_PosY
local Z = PacketData.m_PosZ
-- status 0 = started digging; 2 = block broken
if(PacketData.m_Status == 2) then
if(World:GetBlock(X,Y,Z) == E_BLOCK_LEAVES) then
-- override default MCServer behaviour; 20% Chance of dropping saplings
local Amount = math.random(1,10)
if(Amount <= 2) then Amount = 1
else Amount = 0 end
World:DigBlock(X, Y, Z, cItem(E_BLOCK_SAPLING, Amount))
return true
end
end
-- false = allowed; true = disallowed
return false
end
Tybor