Added additional examples to the documentation for HOOK_BLOCK_SPREAD. (#3277)
Fixes issue #3274
This commit is contained in:
parent
28da6ed640
commit
56a0c48580
@ -32,9 +32,25 @@ return
|
|||||||
Cuberite will process the spread. If the function
|
Cuberite will process the spread. If the function
|
||||||
returns true, no other callback is called for this event and the spread will not occur.
|
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
|
}, -- HOOK_BLOCK_SPREAD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user