summaryrefslogtreecommitdiffstats
path: root/MCServer
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-04-02 15:37:24 +0200
committerTycho <work.tycho+git@gmail.com>2014-04-02 15:37:24 +0200
commit741a64c250a1085108f24f351e9d9dacd085cc82 (patch)
treea69b5aba676473e5f75822a02e14e2acc542b263 /MCServer
parentFixed All signedness warnings in HTTPServer.cpp (diff)
parentMerge branch 'master' into globals (diff)
downloadcuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar
cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.gz
cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.bz2
cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.lz
cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.xz
cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.tar.zst
cuberite-741a64c250a1085108f24f351e9d9dacd085cc82.zip
Diffstat (limited to 'MCServer')
-rw-r--r--MCServer/Plugins/APIDump/APIDesc.lua41
-rw-r--r--MCServer/Plugins/Debuggers/Debuggers.lua27
2 files changed, 60 insertions, 8 deletions
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index 28e7744ed..451b7364a 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -200,6 +200,8 @@ g_APIDesc =
msFillAir = { Notes = "Dst is overwritten by Src only where Src has air blocks" },
msImprint = { Notes = "Src overwrites Dst anywhere where Dst has non-air blocks" },
msLake = { Notes = "Special mode for merging lake images" },
+ msSpongePrint = { Notes = "Similar to msImprint, sponge block doesn't overwrite anything, all other blocks overwrite everything"},
+ msMask = { Notes = "The blocks that are exactly the same are kept in Dst, all differing blocks are replaced by air"},
},
ConstantGroups =
{
@@ -247,6 +249,9 @@ g_APIDesc =
<tr>
<td> A </td><td> B </td><td> B </td><td> A </td><td> B </td>
</tr>
+ <tr>
+ <td> A </td><td> A </td><td> A </td><td> A </td><td> A </td>
+ </td>
</tbody></table>
<p>
@@ -260,7 +265,20 @@ g_APIDesc =
<h3>Special strategies</h3>
<p>For each strategy, evaluate the table rows from top downwards, the first match wins.</p>
-
+
+ <p>
+ <strong>msDifference</strong> - changes all the blocks which are the same to air. Otherwise the source block gets placed.
+ </p>
+ <table><tbody<tr>
+ <th colspan="2"> area block </th><th> </th><th> Notes </th>
+ </tr><tr>
+ <td> * </td><td> B </td><td> B </td><td> The blocks are different so we use block B </td>
+ </tr><tr>
+ <td> B </td><td> B </td><td> Air </td><td> The blocks are the same so we get air. </td>
+ </tr>
+ </tbody></table>
+
+
<p>
<strong>msLake</strong> - used for merging areas with lava and water lakes, in the appropriate generator.
</p>
@@ -293,7 +311,6 @@ g_APIDesc =
</tr>
</tbody></table>
-
<p>
<strong>msSpongePrint</strong> - used for most prefab-generators to merge the prefabs. Similar to
msImprint, but uses the sponge block as the NOP block instead, so that the prefabs may carve out air
@@ -306,10 +323,26 @@ g_APIDesc =
</tr><tr>
<td> A </td><td> sponge </td><td> A </td><td> Sponge is the NOP block </td>
</tr><tr>
- <td> * </td><td> B </td><td> B </td><td> Everything else overwrites anything </td>
+ <td> * </td><td> B </td><td> B </td><td> Everything else overwrites anything </td>
</tr>
</tbody></table>
- ]],
+
+ <p>
+ <strong>msMask</strong> - the blocks that are the same in the other area are kept, all the
+ differing blocks are replaced with air. Meta is used in the comparison, too, two blocks of the
+ same type but different meta are considered different and thus replaced with air.
+ </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> A </td><td> A </td><td> Same blocks are kept </td>
+ </tr><tr>
+ <td> A </td><td> non-A </td><td> air </td><td> Differing blocks are replaced with air </td>
+ </tr>
+ </tbody></table>
+]],
}, -- Merge strategies
}, -- AdditionalInfo
}, -- cBlockArea
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 2619bd6c4..064d5d772 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -69,12 +69,13 @@ function Initialize(Plugin)
LOG("Initialized " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
- -- TestBlockAreas();
- -- TestSQLiteBindings();
- -- TestExpatBindings();
- -- TestPluginCalls();
+ -- TestBlockAreas()
+ -- TestSQLiteBindings()
+ -- TestExpatBindings()
+ -- TestPluginCalls()
TestBlockAreasString()
+ TestStringBase64()
--[[
-- Test cCompositeChat usage in console-logging:
@@ -252,6 +253,24 @@ end
+function TestStringBase64()
+ -- Create a binary string:
+ local s = ""
+ for i = 0, 255 do
+ s = s .. string.char(i)
+ end
+
+ -- Roundtrip through Base64:
+ local Base64 = Base64Encode(s)
+ local UnBase64 = Base64Decode(Base64)
+
+ assert(UnBase64 == s)
+end
+
+
+
+
+
function TestSQLiteBindings()
LOG("Testing SQLite bindings...");