diff options
author | Alexander Harkness <me@bearbin.net> | 2016-07-29 15:44:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-29 15:44:39 +0200 |
commit | 56a0c48580f231aa73b0a4a577fe048afcbcafac (patch) | |
tree | b0fd6ab8b1eb6e0d19ee7e7871f98a6eea6ee33f | |
parent | Merge pull request #3284 from cuberite/revert-3226-redstone (diff) | |
download | cuberite-56a0c48580f231aa73b0a4a577fe048afcbcafac.tar cuberite-56a0c48580f231aa73b0a4a577fe048afcbcafac.tar.gz cuberite-56a0c48580f231aa73b0a4a577fe048afcbcafac.tar.bz2 cuberite-56a0c48580f231aa73b0a4a577fe048afcbcafac.tar.lz cuberite-56a0c48580f231aa73b0a4a577fe048afcbcafac.tar.xz cuberite-56a0c48580f231aa73b0a4a577fe048afcbcafac.tar.zst cuberite-56a0c48580f231aa73b0a4a577fe048afcbcafac.zip |
-rw-r--r-- | Server/Plugins/APIDump/Hooks/OnBlockSpread.lua | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/Server/Plugins/APIDump/Hooks/OnBlockSpread.lua b/Server/Plugins/APIDump/Hooks/OnBlockSpread.lua index 7da796d4d..4d6dac21a 100644 --- a/Server/Plugins/APIDump/Hooks/OnBlockSpread.lua +++ b/Server/Plugins/APIDump/Hooks/OnBlockSpread.lua @@ -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 } - - - - |