From 4d53eb27110cce4a79a4ecce60a2bfad2879fa41 Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Wed, 29 Jan 2014 15:36:53 +0100 Subject: Documented cFloater. --- MCServer/Plugins/APIDump/APIDesc.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 07345d51e..cbdb7797b 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -813,6 +813,20 @@ cFile:Delete("/usr/bin/virus.exe"); }, }, -- cFile + cFloater = + { + Desc = [[ + When a player uses his/her fishing rod it creates a floater entity. This class manages it. + ]], + Functions = + { + CanPickup = { Params = "", Return = "bool", Notes = "Returns true if the floater gives an item when the player right clicks." }, + GetAttachedMobID = { Params = "", Return = "EntityID", Notes = "A floater can get attached to an mob. When it is and this functions gets called it returns the mob ID. If it isn't attached to a mob it returns -1" }, + GetOwnerID = { Params = "", Return = "EntityID", Notes = "Returns the EntityID of the player who owns the floater." }, + }, + Inherits = "cEntity", + }, + cGroup = { Desc = [[ -- cgit v1.2.3 From e0cb06dfae8fcb4b58d7b00db0bba9317d19ae95 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Thu, 30 Jan 2014 17:54:10 +0000 Subject: Update Core --- MCServer/Plugins/Core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core index 5fe3662a8..1a36a2922 160000 --- a/MCServer/Plugins/Core +++ b/MCServer/Plugins/Core @@ -1 +1 @@ -Subproject commit 5fe3662a8719f79cb2ca0a16150c716a3c5eb19c +Subproject commit 1a36a2922d97062230fd93dee3d4638d69feb7c6 -- cgit v1.2.3 From d3b8796c48f5c79cfa3b137af9699e698ab3c81a Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Thu, 30 Jan 2014 21:19:45 +0000 Subject: Fixed at least a little of the plugin guide. --- .../Plugins/APIDump/Writing-a-MCServer-plugin.html | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html b/MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html index 0e07cebdf..bdb80186f 100644 --- a/MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html +++ b/MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html @@ -25,7 +25,7 @@

Next, we must obtain a copy of CoreMessaging.lua. This can be found - here. + here. This is used to provide messaging support that is compliant with MCServer standards.

Creating the basic template

@@ -35,19 +35,14 @@ Format it like so:

-local PLUGIN
+PLUGIN = nil
 
 function Initialize(Plugin)
-	Plugin:SetName("DerpyPlugin")
+	Plugin:SetName("NewPlugin")
 	Plugin:SetVersion(1)
 	
 	PLUGIN = Plugin
 
-	-- Hooks
-
-	local PluginManager = cPluginManager:Get()
-	-- Command bindings
-
 	LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
 	return true
 end
@@ -84,7 +79,7 @@ end
 			To register a hook, insert the following code template into the "-- Hooks" area in the previous code example.
 			

-cPluginManager:AddHook(cPluginManager.HOOK_NAME_HERE, FunctionNameToBeCalled)
+cPluginManager.AddHook(cPluginManager.HOOK_NAME_HERE, FunctionNameToBeCalled)
 			

What does this code do? @@ -102,10 +97,7 @@ function Initialize(Plugin) Plugin:SetName("DerpyPlugin") Plugin:SetVersion(1) - cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_MOVING, OnPlayerMoving) - - local PluginManager = cPluginManager:Get() - -- Command bindings + cPluginManager.AddHook(cPluginManager.HOOK_PLAYER_MOVING, OnPlayerMoving) LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion()) return true @@ -127,10 +119,10 @@ end

 -- ADD THIS IF COMMAND DOES NOT REQUIRE A PARAMETER (/explode)
-PluginManager:BindCommand("/commandname", "permissionnode", FunctionToCall, " - Description of command")
+PluginManager.BindCommand("/commandname", "permissionnode", FunctionToCall, " - Description of command")
 
 -- ADD THIS IF COMMAND DOES REQUIRE A PARAMETER (/explode Notch)
-PluginManager:BindCommand("/commandname", "permissionnode", FunctionToCall, " ~ Description of command and parameter(s)")
+PluginManager.BindCommand("/commandname", "permissionnode", FunctionToCall, " ~ Description of command and parameter(s)")
 			

What does it do, and why are there two? -- cgit v1.2.3 From 79ef653cb79a47f2b4bcec47e13aff16f8ca1b43 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Fri, 31 Jan 2014 07:41:21 +0000 Subject: Fixed some more. --- MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'MCServer/Plugins') diff --git a/MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html b/MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html index bdb80186f..1eec4842a 100644 --- a/MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html +++ b/MCServer/Plugins/APIDump/Writing-a-MCServer-plugin.html @@ -119,10 +119,10 @@ end

 -- ADD THIS IF COMMAND DOES NOT REQUIRE A PARAMETER (/explode)
-PluginManager.BindCommand("/commandname", "permissionnode", FunctionToCall, " - Description of command")
+cPluginManager.BindCommand("/commandname", "permissionnode", FunctionToCall, " - Description of command")
 
 -- ADD THIS IF COMMAND DOES REQUIRE A PARAMETER (/explode Notch)
-PluginManager.BindCommand("/commandname", "permissionnode", FunctionToCall, " ~ Description of command and parameter(s)")
+cPluginManager.BindCommand("/commandname", "permissionnode", FunctionToCall, " ~ Description of command and parameter(s)")
 			

What does it do, and why are there two? @@ -189,8 +189,7 @@ function Initialize(Plugin) Plugin:SetName("DerpyPluginThatBlowsPeopleUp") Plugin:SetVersion(9001) - local PluginManager = cPluginManager:Get() - PluginManager:BindCommand("/explode", "derpyplugin.explode", Explode, " ~ Explode a player"); + cPluginManager.BindCommand("/explode", "derpyplugin.explode", Explode, " ~ Explode a player"); cPluginManager:AddHook(cPluginManager.HOOK_COLLECTING_PICKUP, OnCollectingPickup) -- cgit v1.2.3