From 54d55b31ef9b17673212184ac523f6f2a964338d Mon Sep 17 00:00:00 2001
From: Howaner
Date: Sun, 16 Mar 2014 16:12:16 +0100
Subject: Add documentation for new Block spread
---
MCServer/Plugins/APIDump/APIDesc.lua | 9 ++++++
MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua | 40 ++++++++++++++++++++++++
2 files changed, 49 insertions(+)
create mode 100644 MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
(limited to 'MCServer/Plugins')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 74e7bf860..92b57865f 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -1826,6 +1826,7 @@ cPluginManager.AddHook(cPluginManager.HOOK_CHAT, OnChatMessage);
},
Constants =
{
+ HOOK_BLOCK_SPREAD = { Notes = "Called when a block spreads based on world conditions" },
HOOK_BLOCK_TO_PICKUPS = { Notes = "Called when a block has been dug and is being converted to pickups. The server has provided the default pickups and the plugins may modify them." },
HOOK_CHAT = { Notes = "Called when a client sends a chat message that is not a command. The plugin may modify the chat message" },
HOOK_CHUNK_AVAILABLE = { Notes = "Called when a chunk is loaded or generated and becomes available in the {{cWorld|world}}." },
@@ -2767,6 +2768,14 @@ end
data provided with the explosions, such as the exploding {{cCreeper|creeper}} entity or the
{{Vector3i|coords}} of the exploding bed.
]],
+ },
+ SpreadSource =
+ {
+ Include = "^es.*",
+ TextBefore = [[
+ These constants are used to differentiate the various sources of spreads. They are used in
+ the {{OnBlockSpread|HOOK_BLOCK_SPREAD}} hook.
+ ]],
}
},
}, -- Globals
diff --git a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
new file mode 100644
index 000000000..1dde55f36
--- /dev/null
+++ b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
@@ -0,0 +1,40 @@
+return
+{
+ HOOK_BLOCK_SPREAD =
+ {
+ CalledWhen = "Called when a block spreads based on world conditions",
+ DefaultFnName = "OnBlockSpread", -- also used as pagename
+ Desc = [[
+ This hook is called when a block spreads.
+
+ The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT,
+ etc. It also carries the identification of the actual source. The exact type of the identification
+ depends on the source kind:
+
+ Source | Notes |
+ esFireSpread | Fire spreading |
+ esGrassSpread | Grass spreading |
+ esMushroomSpread | Mushroom spreading |
+ esMycelSpread | Mycel spreading |
+ esVineSpread | Vine spreading |
+
+ ]],
+ Params =
+ {
+ { Name = "World", Type = "{{cWorld}}", Notes = "The world in which the block resides" },
+ { Name = "BlockX", Type = "number", Notes = "X-coord of the block" },
+ { Name = "BlockY", Type = "number", Notes = "Y-coord of the block" },
+ { Name = "BlockZ", Type = "number", Notes = "Z-coord of the block" },
+ { Name = "Source", Type = "eSpreadSource", Notes = "Source of the spread. See the table above." },
+ },
+ Returns = [[
+ If the function returns false or no value, the next plugin's callback is called, and finally
+ MCServer will process the spread. If the function
+ returns true, no other callback is called for this event and the spread will not occur.
+ ]],
+ }, -- HOOK_BLOCK_SPREAD
+}
+
+
+
+
--
cgit v1.2.3
From 9ac3e3405a92d458bf3d09d0ec0f60031d31823d Mon Sep 17 00:00:00 2001
From: Howaner
Date: Sun, 16 Mar 2014 22:28:53 +0100
Subject: Change SpreadSource documentation
---
MCServer/Plugins/APIDump/APIDesc.lua | 2 +-
MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua | 10 +++++-----
2 files changed, 6 insertions(+), 6 deletions(-)
(limited to 'MCServer/Plugins')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 92b57865f..f8ad74226 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2771,7 +2771,7 @@ end
},
SpreadSource =
{
- Include = "^es.*",
+ Include = "^ss.*",
TextBefore = [[
These constants are used to differentiate the various sources of spreads. They are used in
the {{OnBlockSpread|HOOK_BLOCK_SPREAD}} hook.
diff --git a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
index 1dde55f36..a2f7d7ef9 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
@@ -12,11 +12,11 @@ return
depends on the source kind:
Source | Notes |
- esFireSpread | Fire spreading |
- esGrassSpread | Grass spreading |
- esMushroomSpread | Mushroom spreading |
- esMycelSpread | Mycel spreading |
- esVineSpread | Vine spreading |
+ ssFireSpread | Fire spreading |
+ ssGrassSpread | Grass spreading |
+ ssMushroomSpread | Mushroom spreading |
+ ssMycelSpread | Mycel spreading |
+ ssVineSpread | Vine spreading |
]],
Params =
--
cgit v1.2.3
From 327b70e769bd3bb826320027a1b7d56f6e386a6b Mon Sep 17 00:00:00 2001
From: Howaner
Date: Mon, 24 Mar 2014 20:01:57 +0100
Subject: Change documentation text
---
MCServer/Plugins/APIDump/APIDesc.lua | 4 ++--
MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
(limited to 'MCServer/Plugins')
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index f8ad74226..01f000182 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2773,8 +2773,8 @@ end
{
Include = "^ss.*",
TextBefore = [[
- These constants are used to differentiate the various sources of spreads. They are used in
- the {{OnBlockSpread|HOOK_BLOCK_SPREAD}} hook.
+ These constants are used to differentiate the various sources of spreads, such as grass growing.
+ They are used in the {{OnBlockSpread|HOOK_BLOCK_SPREAD}} hook.
]],
}
},
diff --git a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
index a2f7d7ef9..ed0b5f46f 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnBlockSpread.lua
@@ -7,8 +7,8 @@ return
Desc = [[
This hook is called when a block spreads.
- The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT,
- etc. It also carries the identification of the actual source. The exact type of the identification
+ The spread carries with it the type of its source - whether it's a block spreads.
+ It also carries the identification of the actual source. The exact type of the identification
depends on the source kind:
Source | Notes |
--
cgit v1.2.3