From 85c4a1ebcacbf8647d106ab541a6484620a34d24 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 14 Sep 2013 17:28:22 +0200 Subject: APIDump: Added support for additional info exported with each class. --- MCServer/Plugins/APIDump/APIDesc.lua | 78 +++++++++++++++++++++++++++++++++++- MCServer/Plugins/APIDump/main.lua | 14 +++++++ 2 files changed, 91 insertions(+), 1 deletion(-) (limited to 'MCServer') diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua index 7d1ea4cce..7ff169bbc 100644 --- a/MCServer/Plugins/APIDump/APIDesc.lua +++ b/MCServer/Plugins/APIDump/APIDesc.lua @@ -110,7 +110,83 @@ g_APIDesc = msImprint = { Notes = "Src overwrites Dst anywhere where Dst has non-air blocks" }, msLake = { Notes = "Special mode for merging lake images" }, }, - }, + + AdditionalInfo = { + { + Header = "Merge strategies", + Contents = + [[ +

The strategy parameter specifies how individual blocks are combined together, using the table below. +

+ + + + + + + + + + + + + + + + + + + +
area blockresult
this Src msOverwrite msFillAir msImprint
air air air air air
A air air A A
air B B B B
A B B A B
+ +

+ So to sum up: +

    +
  1. msOverwrite completely overwrites all blocks with the Src's blocks
  2. +
  3. msFillAir overwrites only those blocks that were air
  4. +
  5. msImprint overwrites with only those blocks that are non-air
  6. +
+

+ +

+ Special strategies: +

+ +

+ msLake (evaluate top-down, first match wins): +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
area block Notes
this Src result
A sponge A Sponge is the NOP block
* air air Air always gets hollowed out, even under the oceans
water * water Water is never overwritten
lava * lava Lava is never overwritten
* water water Water always overwrites anything
* lava lava Lava always overwrites anything
dirt stone stone Stone overwrites dirt
grass stone stone ... and grass
mycelium stone stone ... and mycelium
A stone A ... but nothing else
A * A Everything else is left as it is
+ ]], + }, -- Merge strategies + }, -- AdditionalInfo + }, -- cBlockArea cBlockEntity = { diff --git a/MCServer/Plugins/APIDump/main.lua b/MCServer/Plugins/APIDump/main.lua index e1aa39dd2..758df8341 100644 --- a/MCServer/Plugins/APIDump/main.lua +++ b/MCServer/Plugins/APIDump/main.lua @@ -259,6 +259,7 @@ function ReadDescriptions(a_API) local APIDesc = g_APIDesc.Classes[cls.Name]; if (APIDesc ~= nil) then cls.Desc = APIDesc.Desc; + cls.AdditionalInfo = APIDesc.AdditionalInfo; -- Process inheritance: if (APIDesc.Inherits ~= nil) then @@ -444,6 +445,11 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) end cf:write("
  • Constants
  • \n"); cf:write("
  • Functions
  • \n"); + if (a_ClassAPI.AdditionalInfo ~= nil) then + for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do + cf:write("
  • " .. additional.Header .. "
  • \n"); + end + end cf:write(""); -- Write the class description: @@ -488,6 +494,14 @@ function WriteHtmlClass(a_ClassAPI, a_AllAPI) WriteFunctions(cls.Functions, cls.Name); end + -- Write the additional infos: + if (a_ClassAPI.AdditionalInfo ~= nil) then + for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do + cf:write("

    " .. additional.Header .. "

    \n"); + cf:write(additional.Contents); + end + end + cf:write(""); cf:close(); end -- cgit v1.2.3