From 628eebefd313f4e206e00a9f80b3578aef948415 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 21 Oct 2013 21:40:14 +0200 Subject: Ignoring a few generated files. --- MCServer/.gitignore | 1 + 1 file changed, 1 insertion(+) (limited to 'MCServer') diff --git a/MCServer/.gitignore b/MCServer/.gitignore index d9d869986..c03bcbe99 100644 --- a/MCServer/.gitignore +++ b/MCServer/.gitignore @@ -19,3 +19,4 @@ helgrind.log valgrind.log motd.txt *.deuser +*.dmp -- cgit v1.2.3 From ec94104a3ce4f88ed1490fd4283ed5a429bf675c Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 22 Oct 2013 21:53:35 +0200 Subject: APIDump: Inheritance is tested properly. This fixes #195 's second iteration. --- MCServer/Plugins/APIDump/main.lua | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua index b608ce256..eb0555d67 100644 --- a/MCServer/Plugins/APIDump/main.lua +++ b/MCServer/Plugins/APIDump/main.lua @@ -818,12 +818,10 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) local HasConstants = (#a_ClassAPI.Constants > 0); local HasFunctions = (#a_ClassAPI.Functions > 0); local HasVariables = (#a_ClassAPI.Variables > 0); - if (a_ClassAPI.Inherits ~= nil) then - for idx, cls in ipairs(a_ClassAPI.Inherits) do - HasConstants = HasConstants or (#cls.Constants > 0); - HasFunctions = HasFunctions or (#cls.Functions > 0); - HasVariables = HasVariables or (#cls.Variables > 0); - end + for idx, cls in ipairs(InheritanceChain) do + HasConstants = HasConstants or (#cls.Constants > 0); + HasFunctions = HasFunctions or (#cls.Functions > 0); + HasVariables = HasVariables or (#cls.Variables > 0); end -- Write the table of contents: -- cgit v1.2.3 From 34de5210d60d0a026a83ad051ae580c60db0dc4d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 22 Oct 2013 22:07:39 +0200 Subject: APIDump: member variables without a setter are considered constants. This fixes cChatColor constants being reported erroneously as member variables. --- MCServer/Plugins/APIDump/main.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua index eb0555d67..2db8b4b1b 100644 --- a/MCServer/Plugins/APIDump/main.lua +++ b/MCServer/Plugins/APIDump/main.lua @@ -158,9 +158,16 @@ function CreateAPITables() end -- Member variables: + local SetField = a_ClassObj[".set"] or {}; if ((a_ClassObj[".get"] ~= nil) and (type(a_ClassObj[".get"]) == "table")) then for k, v in pairs(a_ClassObj[".get"]) do - table.insert(res.Variables, { Name = k }); + if (SetField[k] == nil) then + -- It is a read-only variable, add it as a constant: + table.insert(res.Constants, {Name = k, Value = ""}); + else + -- It is a read-write variable, add it as a variable: + table.insert(res.Variables, { Name = k }); + end end end return res; -- cgit v1.2.3 From a91b422594ef75c500694adb0cb7968a5d336632 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 23 Oct 2013 12:09:34 +0200 Subject: APIDump: Linkified cEntity returns. --- MCServer/Plugins/APIDump/APIDesc.lua | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 1a7072f04..63928e64c 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -755,12 +755,12 @@ World:ForEachChestInChunk(Player:GetChunkX(), Player:GetChunkZ(), GetHealth = { Params = "", Return = "number", Notes = "Returns the current health of the entity." }, GetHeight = { Params = "", Return = "number", Notes = "Returns the height (Y size) of the entity" }, GetKnockbackAmountAgainst = { Params = "ReceiverEntity", Return = "number", Notes = "Returns the amount of knockback that the currently equipped items would cause when attacking the ReceiverEntity." }, - GetLookVector = { Params = "", Return = "Vector3f", Notes = "Returns the vector that defines the direction in which the entity is looking" }, + GetLookVector = { Params = "", Return = "{{Vector3f}}", Notes = "Returns the vector that defines the direction in which the entity is looking" }, GetMass = { Params = "", Return = "number", Notes = "Returns the mass of the entity. Currently unused." }, GetMaxHealth = { Params = "", Return = "number", Notes = "Returns the maximum number of hitpoints this entity is allowed to have." }, GetParentClass = { Params = "", Return = "string", Notes = "Returns the name of the direct parent class for this entity" }, GetPitch = { Params = "", Return = "number", Notes = "Returns the pitch (nose-down rotation) of the entity" }, - GetPosition = { Params = "", Return = "Vector3d", Notes = "Returns the entity's pivot position as a 3D vector" }, + GetPosition = { Params = "", Return = "{{Vector3d}}", Notes = "Returns the entity's pivot position as a 3D vector" }, GetPosX = { Params = "", Return = "number", Notes = "Returns the X-coord of the entity's pivot" }, GetPosY = { Params = "", Return = "number", Notes = "Returns the Y-coord of the entity's pivot" }, GetPosZ = { Params = "", Return = "number", Notes = "Returns the Z-coord of the entity's pivot" }, @@ -768,23 +768,26 @@ World:ForEachChestInChunk(Player:GetChunkX(), Player:GetChunkZ(), GetRoll = { Params = "", Return = "number", Notes = "Returns the roll (sideways rotation) of the entity. Currently unused." }, GetRot = { Params = "", Return = "{{Vector3f}}", Notes = "Returns the entire rotation vector (Yaw, Pitch, Roll)" }, GetRotation = { Params = "", Return = "number", Notes = "Returns the yaw (direction) of the entity. FIXME: Rename to GetYaw()." }, - GetSpeed = { Params = "", Return = "Vector3d", Notes = "Returns the complete speed vector of the entity" }, + GetSpeed = { Params = "", Return = "{{Vector3d}}", Notes = "Returns the complete speed vector of the entity" }, GetSpeedX = { Params = "", Return = "number", Notes = "Returns the X-part of the speed vector" }, GetSpeedY = { Params = "", Return = "number", Notes = "Returns the Y-part of the speed vector" }, GetSpeedZ = { Params = "", Return = "number", Notes = "Returns the Z-part of the speed vector" }, GetUniqueID = { Params = "", Return = "number", Notes = "Returns the ID that uniquely identifies the entity within the running server. Note that this ID is not persisted to the data files." }, GetWidth = { Params = "", Return = "number", Notes = "Returns the width (X and Z size) of the entity." }, - GetWorld = { Params = "", Return = "{{cWorld|cWorld}}", Notes = "Returns the world where the entity resides" }, + GetWorld = { Params = "", Return = "{{cWorld}}", Notes = "Returns the world where the entity resides" }, Heal = { Params = "Hitpoints", Return = "", Notes = "Heals the specified number of hitpoints. Hitpoints is expected to be a positive number." }, IsA = { Params = "ClassName", Return = "bool", Notes = "Returns true if the entity class is a descendant of the specified class name, or the specified class itself" }, IsBoat = { Params = "", Return = "bool", Notes = "Returns true if the entity is a {{cBoat|boat}}." }, IsCrouched = { Params = "", Return = "bool", Notes = "Returns true if the entity is crouched. Always false for entities that don't support crouching." }, IsDestroyed = { Params = "", Return = "bool", Notes = "Returns true if the entity has been destroyed and is awaiting removal from the internal structures." }, + IsFallingBlock = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cFallingBlock}} entity." }, + IsInvisible = { Params = "", Return = "bool", Notes = "Returns true if the entity is invisible" }, IsMinecart = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cMinecart|minecart}}" }, IsMob = { Params = "", Return = "bool", Notes = "Returns true if the entity represents any {{cMonster|mob}}." }, IsOnFire = { Params = "", Return = "bool", Notes = "Returns true if the entity is on fire" }, IsPickup = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cPickup|pickup}}." }, IsPlayer = { Params = "", Return = "bool", Notes = "Returns true if the entity represents a {{cPlayer|player}}" }, + IsProjectile = { Params = "", Return = "bool", Notes = "Returns true if the entity is a {{cProjectileEntity}} descendant." }, IsRclking = { Params = "", Return = "bool", Notes = "Currently unimplemented" }, IsRiding = { Params = "", Return = "bool", Notes = "Returns true if the entity is attached to (riding) another entity." }, IsSprinting = { Params = "", Return = "bool", Notes = "Returns true if the entity is sprinting. Entities that cannot sprint return always false" }, -- cgit v1.2.3 From 60abe99d5e993408c5de3ab25dc91bbb9900d785 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 23 Oct 2013 12:19:43 +0200 Subject: APIDump: Documented the cHopperEntity class. --- MCServer/Plugins/APIDump/APIDesc.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 63928e64c..3fcb68919 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -938,6 +938,28 @@ cFile:Delete("/usr/bin/virus.exe"); }, }, + cHopperEntity = + { + Desc = [[ + This class represents a hopper block entity in the world.

+

+ Plugins may use this class during chunk generation ({{OnChunkGenerated|HOOK_CHUNK_GENERATED}} and + {{OnChunkGenerating|HOOK_CHUNK_GENERATING}}) to add hoppers to the generated chunk. + ]], + Functions = + { + constructor = { Params = "BlockX, BlockY, BlockZ", Return = "cHopperEntity", Notes = "Creates and returns a new hopper at the specified coords." }, + GetOutputBlockPos = { Params = "BlockMeta", Return = "bool, BlockX, BlockY, BlockZ", Notes = "Returns whether the hopper is attached, and if so, the block coords of the block receiving the output items, based on the given meta." }, + }, + Constants = + { + ContentsHeight = { Notes = "Height (Y) of the internal {{cItemGrid}} representing the hopper contents." }, + ContentsWidth = { Notes = "Width (X) of the internal {{cItemGrid}} representing the hopper contents." }, + TICKS_PER_TRANSFER = { Notes = "Number of ticks between when the hopper transfers items." }, + }, + Inherits = "cBlockEntityWithItems", + }, + cIniFile = { Desc = [[The cIniFile is a class that makes it simple to read from and write to INI files. MCServer uses mostly INI files for settings and options. -- cgit v1.2.3 From 2cf196a892fb6d13dcb5f38369150da921ad8eb1 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 23 Oct 2013 13:34:44 +0200 Subject: APIDump: Added cChatColor constants. They don't really need much documentation, so just ignoring them in the Undocumented output. --- MCServer/Plugins/APIDump/APIDesc.lua | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 3fcb68919..0940931cd 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -369,10 +369,30 @@ g_APIDesc = }, Constants = { - Color = { Notes = "The first character of the color-code-sequence, §" }, - Delimiter = { Notes = "The first character of the color-code-sequence, §" }, - Random = { Notes = "Random letters and symbols animate instead of the text" }, + Black = { Notes = "" }, + Blue = { Notes = "" }, + Bold = { Notes = "" }, + Color = { Notes = "The first character of the color-code-sequence, §" }, + DarkPurple = { Notes = "" }, + Delimiter = { Notes = "The first character of the color-code-sequence, §" }, + Gold = { Notes = "" }, + Gray = { Notes = "" }, + Green = { Notes = "" }, + Italic = { Notes = "" }, + LightBlue = { Notes = "" }, + LightGray = { Notes = "" }, + LightGreen = { Notes = "" }, + LightPurple = { Notes = "" }, + Navy = { Notes = "" }, Plain = { Notes = "Resets all formatting to normal" }, + Purple = { Notes = "" }, + Random = { Notes = "Random letters and symbols animate instead of the text" }, + Red = { Notes = "" }, + Rose = { Notes = "" }, + Strikethrough = { Notes = "" }, + Underlined = { Notes = "" }, + White = { Notes = "" }, + Yellow = { Notes = "" }, }, }, -- cgit v1.2.3