Awesome growing trees!
#2
To change the default Server behaviour of dropping leaf block you can try this:
PHP Code:
function TreePlugin:OnBlockDigPacketDataPlayer )
  
local World cRoot:Get():GetWorld()
  
local X PacketData.m_PosX
  local Y 
PacketData.m_PosY
  local Z 
PacketData.m_PosZ

  
-- status 0 started diggingblock broken
  
if(PacketData.m_Status == 2then
    
if(World:GetBlock(X,Y,Z) == E_BLOCK_LEAVESthen
      
-- override default MCServer behaviour20Chance of dropping saplings
      local Amount 
math.random(1,10)
      if(
Amount <= 2then Amount 1
      
else Amount 0 end
      World
:DigBlock(XYZcItem(E_BLOCK_SAPLINGAmount))
      return 
true
    end
  end

  
-- false allowedtrue disallowed
  
return false
end 
greets,
Tybor
Reply
Thanks given by:


Messages In This Thread
Awesome growing trees! - by codename_B - 02-28-2011, 02:42 AM
RE: Awesome growing trees! - by Tybor - 02-28-2011, 03:41 AM
RE: Awesome growing trees! - by codename_B - 02-28-2011, 03:48 AM
RE: Awesome growing trees! - by Tybor - 02-28-2011, 03:52 AM
RE: Awesome growing trees! - by NiLSPACE - 07-09-2012, 08:19 PM



Users browsing this thread: 1 Guest(s)