summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump/Hooks/OnBlockSpread.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Server/Plugins/APIDump/Hooks/OnBlockSpread.lua')
-rw-r--r--Server/Plugins/APIDump/Hooks/OnBlockSpread.lua24
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
}
-
-
-
-