diff options
Diffstat (limited to 'MCServer/Plugins')
-rw-r--r-- | MCServer/Plugins/APIDump/APIDesc.lua | 8 | ||||
-rw-r--r-- | MCServer/Plugins/APIDump/Hooks/OnKilled.lua | 22 | ||||
-rw-r--r-- | MCServer/Plugins/APIDump/Hooks/OnKilling.lua | 6 | ||||
-rw-r--r-- | MCServer/Plugins/InfoDump.lua | 4 |
4 files changed, 33 insertions, 7 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 87edb226a..09479ee4e 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -2379,8 +2379,12 @@ local CompressedString = cStringCompression.CompressStringGZIP("DataToCompress") GetLinkedOverworldName = { Params = "", Return = "string", Notes = "Returns the name of the world this world is linked to." }, GetMapManager = { Params = "", Return = "{{cMapManager}}", Notes = "Returns the {{cMapManager|MapManager}} object used by this world." }, GetMaxCactusHeight = { Params = "", Return = "number", Notes = "Returns the configured maximum height to which cacti will grow naturally." }, + GetMaxNetherPortalHeight = { Params = "", Return = "number", Notes = "Returns the maximum height for a nether portal" }, + GetMaxNetherPortalWidth = { Params = "", Return = "number", Notes = "Returns the maximum width for a nether portal" }, GetMaxSugarcaneHeight = { Params = "", Return = "number", Notes = "Returns the configured maximum height to which sugarcane will grow naturally." }, GetMaxViewDistance = { Params = "", Return = "number", Notes = "Returns the maximum viewdistance that players can see in this world. The view distance is the amount of chunks around the player that the player can see." }, + GetMinNetherPortalHeight = { Params = "", Return = "number", Notes = "Returns the minimum height for a nether portal" }, + GetMinNetherPortalWidth = { Params = "", Return = "number", Notes = "Returns the minimum width for a nether portal" }, GetName = { Params = "", Return = "string", Notes = "Returns the name of the world, as specified in the settings.ini file." }, GetNumChunks = { Params = "", Return = "number", Notes = "Returns the number of chunks currently loaded." }, GetScoreBoard = { Params = "", Return = "{{cScoreBoard}}", Notes = "Returns the {{cScoreBoard|ScoreBoard}} object used by this world. " }, @@ -2448,6 +2452,10 @@ local CompressedString = cStringCompression.CompressStringGZIP("DataToCompress") SetLinkedNetherWorldName = { Params = "string", Return = "", Notes = "Sets the name of the world that the nether portal should link to." }, SetLinkedOverworldName = { Params = "string", Return = "", Notes = "Sets the name of the world that the nether portal should link to?" }, SetMaxViewDistance = { Params = "number", Return = "", Notes = "Sets the maximum viewdistance of the players in the world." }, + SetMaxNetherPortalHeight = { Params = "number", Return = "", Notes = "Sets the maximum height for a nether portal" }, + SetMaxNetherPortalWidth = { Params = "number", Return = "", Notes = "Sets the maximum width for a nether portal" }, + SetMinNetherPortalHeight = { Params = "number", Return = "", Notes = "Sets the minimum height for a nether portal" }, + SetMinNetherPortalWidth = { Params = "number", Return = "", Notes = "Sets the minimum width for a nether portal" }, SetShouldUseChatPrefixes = { Params = "", Return = "ShouldUse (bool)", Notes = "Sets whether coloured chat prefixes such as [INFO] is used with the SendMessageXXX() or BroadcastChatXXX(), or simply the entire message is coloured in the respective colour." }, SetSignLines = { Params = "X, Y, Z, Line1, Line2, Line3, Line4, [{{cPlayer|Player}}]", Return = "", Notes = "Sets the sign text at the specified coords. The sign-updating hooks are called for the change. The Player parameter is used to indicate the player from whom the change has come, it may be nil." }, SetTicksUntilWeatherChange = { Params = "NumTicks", Return = "", Notes = "Sets the number of ticks after which the weather will be changed." }, diff --git a/MCServer/Plugins/APIDump/Hooks/OnKilled.lua b/MCServer/Plugins/APIDump/Hooks/OnKilled.lua new file mode 100644 index 000000000..9289b8f35 --- /dev/null +++ b/MCServer/Plugins/APIDump/Hooks/OnKilled.lua @@ -0,0 +1,22 @@ +return +{ + HOOK_KILLED = + { + CalledWhen = "A player or a mob died.", + DefaultFnName = "OnKilled", + Desc = [[ + This hook is called whenever player or a mob dies. It can be used to change the death message. + ]], + Params = + { + { Name = "Victim", Type = "{{cEntity}}", Notes = "The player or mob that died" }, + { Name = "TDI", Type = "{{TakeDamageInfo}}", Notes = "Informations about the death" }, + { Name = "DeathMessage", Type = "string", Notes = "The default death message. An empty string if the victim is not a player" }, + }, + Returns = [[ + The function may return two values. The first value is a boolean specifying whether other plugins should be called. If it is true, the other plugins won't get notified of the death. If it is false, the other plugins will get notified.</p> + <p>The second value is a string containing the death message. If the victim is a player, this death message is broadcasted instead of the default death message. If it is empty, no death message is broadcasted. If it is nil, the message is left unchanged. If the victim is not a player, the death message is never broadcasted.</p> + <p>In either case, the victim is dead. + ]], + }, -- HOOK_KILLED +} diff --git a/MCServer/Plugins/APIDump/Hooks/OnKilling.lua b/MCServer/Plugins/APIDump/Hooks/OnKilling.lua index 5e84009db..d2339e60b 100644 --- a/MCServer/Plugins/APIDump/Hooks/OnKilling.lua +++ b/MCServer/Plugins/APIDump/Hooks/OnKilling.lua @@ -7,11 +7,7 @@ return Desc = [[ This hook is called whenever a {{cPawn|pawn}}'s (a player's or a mob's) health reaches zero. This means that the pawn is about to be killed, unless a plugin "revives" them by setting their health - back to a positive value.</p> - <p> - FIXME: There is no HOOK_KILLED notification hook yet; this is deliberate because HOOK_KILLED has - been recently renamed to HOOK_KILLING, and plugins need to be updated. Once updated, the HOOK_KILLED - notification will be implemented. + back to a positive value. ]], Params = { diff --git a/MCServer/Plugins/InfoDump.lua b/MCServer/Plugins/InfoDump.lua index a715c9a18..2c7fff163 100644 --- a/MCServer/Plugins/InfoDump.lua +++ b/MCServer/Plugins/InfoDump.lua @@ -136,7 +136,7 @@ local function BuildCategories(a_PluginInfo) -- For each command add a reference to it into all of its categories: local function AddCommands(a_CmdPrefix, a_Commands) - for cmd, info in pairs(a_Commands) do + for cmd, info in pairs(a_Commands or {}) do local NewCmd = { CommandString = a_CmdPrefix .. cmd, @@ -451,7 +451,7 @@ local function BuildPermissions(a_PluginInfo) -- Collect all used permissions from Commands, reference the commands that use the permission: local Permissions = a_PluginInfo.Permissions or {} local function CollectPermissions(a_CmdPrefix, a_Commands) - for cmd, info in pairs(a_Commands) do + for cmd, info in pairs(a_Commands or {}) do CommandString = a_CmdPrefix .. cmd if ((info.Permission ~= nil) and (info.Permission ~= "")) then -- Add the permission to the list of permissions: |