From 5a152435b3fa1452a842519e21ab0643020bc1ab Mon Sep 17 00:00:00 2001
From: Howaner
Date: Mon, 30 Jun 2014 15:22:48 +0200
Subject: Add documentation.
---
.../APIDump/Hooks/OnPlayerFoodLevelChange.lua | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
create mode 100644 MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
(limited to 'MCServer/Plugins/APIDump/Hooks')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
new file mode 100644
index 000000000..4838573e5
--- /dev/null
+++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
@@ -0,0 +1,22 @@
+return
+{
+ HOOK_PLAYER_FOOD_LEVEL_CHANGE =
+ {
+ CalledWhen = "Called before the player food level changed. Plugin may override / refuse.",
+ DefaultFnName = "OnPlayerFoodLevelChange", -- also used as pagename
+ Desc = [[
+ This hook is called just before the food level change.
+ The food level is not yet changed, plugins may choose to override the new food level or refuse the change.
+ ]],
+ Params =
+ {
+ { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who change the food level." },
+ { Name = "NewFoodLevel", Type = "number", Notes = "The new food level." },
+ },
+ Returns = [[
+ If the function returns false or no value, the next plugin's callback is called. Afterwards, the
+ server change the food level from the player. If the function returns true, no
+ other callback is called for this event and the player's food level doesn't change.
+ ]],
+ }, -- HOOK_PLAYER_FOOD_LEVEL_CHANGE
+};
--
cgit v1.2.3
From 5a888f0a51ffbab6a6bd8ef24ff53ddf40a66ceb Mon Sep 17 00:00:00 2001
From: Howaner
Date: Tue, 1 Jul 2014 20:30:13 +0200
Subject: Change documentation
---
.../Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
(limited to 'MCServer/Plugins/APIDump/Hooks')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
index 4838573e5..5a6fc862a 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
@@ -5,18 +5,23 @@ return
CalledWhen = "Called before the player food level changed. Plugin may override / refuse.",
DefaultFnName = "OnPlayerFoodLevelChange", -- also used as pagename
Desc = [[
- This hook is called just before the food level change.
- The food level is not yet changed, plugins may choose to override the new food level or refuse the change.
+ This hook is called before the food level changes.
+ The food level is not changed yet, plugins may choose
+ to override the new food level or refuse the change.
]],
Params =
{
- { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who change the food level." },
- { Name = "NewFoodLevel", Type = "number", Notes = "The new food level." },
+ { Name = "Player", Type = "{{cPlayer}}", Notes = "The player who changes the food level." },
+ { Name = "NewFoodLevel", Type = "number", Notes = "The new food level. You can override it." },
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called. Afterwards, the
- server change the food level from the player. If the function returns true, no
+ server changes the food level of the player. If the function returns true, no
other callback is called for this event and the player's food level doesn't change.
]],
}, -- HOOK_PLAYER_FOOD_LEVEL_CHANGE
};
+
+
+
+
--
cgit v1.2.3
From 835d00428c2af43050fa248ab988c431ec1be152 Mon Sep 17 00:00:00 2001
From: Howaner
Date: Wed, 2 Jul 2014 14:49:08 +0200
Subject: Update documentation
---
MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'MCServer/Plugins/APIDump/Hooks')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua b/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
index 5a6fc862a..53637d5f1 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnPlayerFoodLevelChange.lua
@@ -2,17 +2,17 @@ return
{
HOOK_PLAYER_FOOD_LEVEL_CHANGE =
{
- CalledWhen = "Called before the player food level changed. Plugin may override / refuse.",
+ CalledWhen = "Called before the player food level changed. Plugin may override",
DefaultFnName = "OnPlayerFoodLevelChange", -- also used as pagename
Desc = [[
This hook is called before the food level changes.
The food level is not changed yet, plugins may choose
- to override the new food level or refuse the change.
+ to refuse the change.
]],
Params =
{
{ Name = "Player", Type = "{{cPlayer}}", Notes = "The player who changes the food level." },
- { Name = "NewFoodLevel", Type = "number", Notes = "The new food level. You can override it." },
+ { Name = "NewFoodLevel", Type = "number", Notes = "The new food level." },
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called. Afterwards, the
--
cgit v1.2.3
From 20afd5d70ee61e969f4015f851c1d8f04cd02215 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Thu, 3 Jul 2014 17:53:57 +0200
Subject: APIDump: Updated OnWeatherChanging docs after latest code changes.
---
MCServer/Plugins/APIDump/Hooks/OnWeatherChanging.lua | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
(limited to 'MCServer/Plugins/APIDump/Hooks')
diff --git a/MCServer/Plugins/APIDump/Hooks/OnWeatherChanging.lua b/MCServer/Plugins/APIDump/Hooks/OnWeatherChanging.lua
index d36164e8e..bb809af11 100644
--- a/MCServer/Plugins/APIDump/Hooks/OnWeatherChanging.lua
+++ b/MCServer/Plugins/APIDump/Hooks/OnWeatherChanging.lua
@@ -6,7 +6,7 @@ return
DefaultFnName = "OnWeatherChanging", -- also used as pagename
Desc = [[
This hook is called when the current weather has expired and a new weather is selected. Plugins may
- override the new weather setting.
+ override the new weather being set.
The new weather setting is sent to the clients only after this hook has been processed.
@@ -19,9 +19,12 @@ return
{ Name = "Weather", Type = "number", Notes = "The newly selected weather. One of wSunny, wRain, wStorm" },
},
Returns = [[
- If the function returns false or no value, the server calls other plugins' callbacks and finally
- sets the weather. If the function returns true, the server takes the second returned value (wSunny
- by default) and sets it as the new weather. No other plugins' callbacks are called in this case.
+ The hook handler can return up to two values. If the first value is false or not present, the server
+ calls other plugins' callbacks and finally sets the weather. If it is true, the server doesn't call any
+ more callbacks for this hook. The second value returned is used as the new weather. If no value is
+ given, the weather from the parameters is used as the weather. Returning false as the first value and a
+ specific weather constant as the second value makes the server call the rest of the hook handlers with
+ the new weather value.
]],
}, -- HOOK_WEATHER_CHANGING
}
--
cgit v1.2.3