1
0

Added additional examples to the documentation for HOOK_BLOCK_SPREAD. (#3277)

Fixes issue #3274
This commit is contained in:
Alexander Harkness 2016-07-29 14:44:39 +01:00 committed by GitHub
parent 28da6ed640
commit 56a0c48580

View File

@ -32,9 +32,25 @@ return
Cuberite will process the spread. If the function
returns true, no other callback is called for this event and the spread will not occur.
]],
Examples =
{
{
Title = "Stop fire spreading",
Desc = "Stops fire from spreading, but does not remove any player-placed fire.",
Code = [[
function OnBlockSpread(World, BlockX, Blocky, BlockZ, source)
if (source == ssFireSpread) then
-- Return true to block the fire spreading.
return true
end
-- We don't care about any other events, let them continue.
return false
end
-- Add the callback.
cPluginManager:AddHook(cPluginManager.HOOK_BLOCK_SPREAD, OnBlockSpread);
]],
},
},
}, -- HOOK_BLOCK_SPREAD
}