diff options
author | madmaxoft <github@xoft.cz> | 2013-09-14 17:28:22 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-09-14 17:28:22 +0200 |
commit | 85c4a1ebcacbf8647d106ab541a6484620a34d24 (patch) | |
tree | 9d95035c64475324857d6711d35f5ee7560a90e3 /MCServer/Plugins/APIDump | |
parent | APIDump: Added support for overloaded functions. (diff) | |
download | cuberite-85c4a1ebcacbf8647d106ab541a6484620a34d24.tar cuberite-85c4a1ebcacbf8647d106ab541a6484620a34d24.tar.gz cuberite-85c4a1ebcacbf8647d106ab541a6484620a34d24.tar.bz2 cuberite-85c4a1ebcacbf8647d106ab541a6484620a34d24.tar.lz cuberite-85c4a1ebcacbf8647d106ab541a6484620a34d24.tar.xz cuberite-85c4a1ebcacbf8647d106ab541a6484620a34d24.tar.zst cuberite-85c4a1ebcacbf8647d106ab541a6484620a34d24.zip |
Diffstat (limited to 'MCServer/Plugins/APIDump')
-rw-r--r-- | MCServer/Plugins/APIDump/APIDesc.lua | 78 | ||||
-rw-r--r-- | MCServer/Plugins/APIDump/main.lua | 14 |
2 files changed, 91 insertions, 1 deletions
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 = + [[ + <p>The strategy parameter specifies how individual blocks are combined together, using the table below. + </p> + <table class="inline"> + <tbody><tr> + <th colspan="2">area block</th><th colspan="3">result</th> + </tr> + <tr> + <th> this </th><th> Src </th><th> msOverwrite </th><th> msFillAir </th><th> msImprint </th> + </tr> + <tr> + <td> air </td><td> air </td><td> air </td><td> air </td><td> air </td> + </tr> + <tr> + <td> A </td><td> air </td><td> air </td><td> A </td><td> A </td> + </tr> + <tr> + <td> air </td><td> B </td><td> B </td><td> B </td><td> B </td> + </tr> + <tr> + <td> A </td><td> B </td><td> B </td><td> A </td><td> B </td> + </tr> + </tbody></table> + + <p> + So to sum up: + <ol> + <li class="level1">msOverwrite completely overwrites all blocks with the Src's blocks</li> + <li class="level1">msFillAir overwrites only those blocks that were air</li> + <li class="level1">msImprint overwrites with only those blocks that are non-air</li> + </ol> + </p> + + <p> + Special strategies: + </p> + + <p> + <strong>msLake</strong> (evaluate top-down, first match wins): + </p> + <table><tbody><tr> + <th colspan="2"> area block </th><th> </th><th> Notes </th> + </tr><tr> + <th> this </th><th> Src </th><th> result </th><th> </th> + </tr><tr> + <td> A </td><td> sponge </td><td> A </td><td> Sponge is the NOP block </td> + </tr><tr> + <td> * </td><td> air </td><td> air </td><td> Air always gets hollowed out, even under the oceans </td> + </tr><tr> + <td> water </td><td> * </td><td> water </td><td> Water is never overwritten </td> + </tr><tr> + <td> lava </td><td> * </td><td> lava </td><td> Lava is never overwritten </td> + </tr><tr> + <td> * </td><td> water </td><td> water </td><td> Water always overwrites anything </td> + </tr><tr> + <td> * </td><td> lava </td><td> lava </td><td> Lava always overwrites anything </td> + </tr><tr> + <td> dirt </td><td> stone </td><td> stone </td><td> Stone overwrites dirt </td> + </tr><tr> + <td> grass </td><td> stone </td><td> stone </td><td> ... and grass </td> + </tr><tr> + <td> mycelium </td><td> stone </td><td> stone </td><td> ... and mycelium </td> + </tr><tr> + <td> A </td><td> stone </td><td> A </td><td> ... but nothing else </td> + </tr><tr> + <td> A </td><td> * </td><td> A </td><td> Everything else is left as it is </td> + </tr> + </tbody></table> + ]], + }, -- 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("<li><a href=\"#constants\">Constants</a></li>\n"); cf:write("<li><a href=\"#functions\">Functions</a></li>\n"); + if (a_ClassAPI.AdditionalInfo ~= nil) then + for i, additional in ipairs(a_ClassAPI.AdditionalInfo) do + cf:write("<li><a href=\"#additionalinfo_" .. i .. "\">" .. additional.Header .. "</a></li>\n"); + end + end cf:write("</ul>"); -- 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("<a name=\"additionalinfo_" .. i .. "\"><h1>" .. additional.Header .. "</h1></a>\n"); + cf:write(additional.Contents); + end + end + cf:write("</body></html>"); cf:close(); end |