summaryrefslogtreecommitdiffstats
path: root/Server
diff options
context:
space:
mode:
Diffstat (limited to 'Server')
-rw-r--r--Server/Plugins/APIDump/APIDesc.lua15
-rw-r--r--Server/Plugins/APIDump/Hooks/OnExploded.lua17
-rw-r--r--Server/Plugins/APIDump/Hooks/OnExploding.lua23
-rw-r--r--Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html7
-rw-r--r--Server/Plugins/APIDump/main_APIDump.lua2
-rw-r--r--Server/hg.supp8
-rw-r--r--Server/webadmin/login_template.html4
-rw-r--r--Server/webadmin/template.lua26
8 files changed, 45 insertions, 57 deletions
diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua
index 67689a2a5..be9f60662 100644
--- a/Server/Plugins/APIDump/APIDesc.lua
+++ b/Server/Plugins/APIDump/APIDesc.lua
@@ -2858,6 +2858,18 @@ end
TrimString = {Params = "string", Return = "string", Notes = "Trims whitespace at both ends of the string"},
md5 = {Params = "string", Return = "string", Notes = "<b>OBSOLETE</b>, use the {{cCryptoHash}} functions instead.<br>Converts a string to a raw binary md5 hash."},
},
+ Constants =
+ {
+ esBed = { Notes = "A bed explosion. The SourceData param is the {{Vector3i|position}} of the bed." },
+ esEnderCrystal = { Notes = "An ender crystal entity explosion. The SourceData param is the {{cEntity|ender crystal entity}} object." },
+ esGhastFireball = { Notes = "A ghast fireball explosion. The SourceData param is the {{cGhastFireballEntity|ghast fireball entity}} object." },
+ esMonster = { Notes = "A monster explosion (creeper). The SourceData param is the {{cMonster|monster entity}} object." },
+ esOther = { Notes = "Any other explosion. The SourceData param is unused." },
+ esPlugin = { Notes = "An explosion started by a plugin, without any further information. The SourceData param is unused. "},
+ esPrimedTNT = { Notes = "A TNT explosion. The SourceData param is the {{cTNTEntity|TNT entity}} object."},
+ esWitherBirth = { Notes = "An explosion at a wither's birth. The SourceData param is the {{cMonster|wither entity}} object." },
+ esWitherSkull = { Notes = "A wither skull explosion. The SourceData param is the {{cWitherSkullEntity|wither skull entity}} object." },
+ },
ConstantGroups =
{
BlockTypes =
@@ -2961,7 +2973,7 @@ end
These constants are used to differentiate the various sources of explosions. They are used in
the {{OnExploded|HOOK_EXPLODED}} hook, {{OnExploding|HOOK_EXPLODING}} hook and in the
{{cWorld}}:DoExplosionAt() function. These constants also dictate the type of the additional
- data provided with the explosions, such as the exploding {{cCreeper|creeper}} entity or the
+ data provided with the explosions, such as the exploding creeper {{cEntity|entity}} or the
{{Vector3i|coords}} of the exploding bed.
]],
},
@@ -3037,6 +3049,7 @@ end
"cHopperEntity.__cBlockEntityWindowOwner__",
"cLuaWindow.__cItemGrid__cListener__",
"Globals._CuberiteInternal_.*", -- Ignore all internal Cuberite constants
+ "Globals.esMax",
},
IgnoreVariables =
diff --git a/Server/Plugins/APIDump/Hooks/OnExploded.lua b/Server/Plugins/APIDump/Hooks/OnExploded.lua
index 6a01542ab..daca31237 100644
--- a/Server/Plugins/APIDump/Hooks/OnExploded.lua
+++ b/Server/Plugins/APIDump/Hooks/OnExploded.lua
@@ -11,20 +11,7 @@ return
<p>
The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT,
etc. It also carries the identification of the actual source. The exact type of the identification
- depends on the source kind:
- <table>
- <tr><th>Source</th><th>SourceData Type</th><th>Notes</th></tr>
- <tr><td>esPrimedTNT</td><td>{{cTNTEntity}}</td><td>An exploding primed TNT entity</td></tr>
- <tr><td>esCreeper</td><td>{{cCreeper}}</td><td>An exploding creeper or charged creeper</td></tr>
- <tr><td>esBed</td><td>{{Vector3i}}</td><td>A bed exploding in the Nether or in the End. The bed coords are given.</td></tr>
- <tr><td>esEnderCrystal</td><td>{{Vector3i}}</td><td>An ender crystal exploding upon hit. The block coords are given.</td></tr>
- <tr><td>esGhastFireball</td><td>{{cGhastFireballEntity}}</td><td>A ghast fireball hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherSkullBlack</td><td><i>TBD</i></td><td>A black wither skull hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherSkullBlue</td><td><i>TBD</i></td><td>A blue wither skull hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherBirth</td><td><i>TBD</i></td><td>A wither boss being created</td></tr>
- <tr><td>esOther</td><td><i>TBD</i></td><td>Any other previously unspecified type.</td></tr>
- <tr><td>esPlugin</td><td>object</td><td>An explosion created by a plugin. The plugin may specify any kind of data.</td></tr>
- </table></p>
+ depends on the source kind, see the {{Globals#ExplosionSource|esXXX}} constants' descriptions for details.
]],
Params =
{
@@ -35,7 +22,7 @@ return
{ Name = "Y", Type = "number", Notes = "Y-coord of the explosion center" },
{ Name = "Z", Type = "number", Notes = "Z-coord of the explosion center" },
{ Name = "Source", Type = "eExplosionSource", Notes = "Source of the explosion. See the table above." },
- { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the table above." },
+ { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the {{Globals#ExplosionSource|esXXX}} constants' descriptions." },
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called. If the function
diff --git a/Server/Plugins/APIDump/Hooks/OnExploding.lua b/Server/Plugins/APIDump/Hooks/OnExploding.lua
index e21b41be0..873202dc3 100644
--- a/Server/Plugins/APIDump/Hooks/OnExploding.lua
+++ b/Server/Plugins/APIDump/Hooks/OnExploding.lua
@@ -11,20 +11,7 @@ return
<p>
The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT,
etc. It also carries the identification of the actual source. The exact type of the identification
- depends on the source kind:
- <table>
- <tr><th>Source</th><th>SourceData Type</th><th>Notes</th></tr>
- <tr><td>esPrimedTNT</td><td>{{cTNTEntity}}</td><td>An exploding primed TNT entity</td></tr>
- <tr><td>esCreeper</td><td>{{cCreeper}}</td><td>An exploding creeper or charged creeper</td></tr>
- <tr><td>esBed</td><td>{{Vector3i}}</td><td>A bed exploding in the Nether or in the End. The bed coords are given.</td></tr>
- <tr><td>esEnderCrystal</td><td>{{Vector3i}}</td><td>An ender crystal exploding upon hit. The block coords are given.</td></tr>
- <tr><td>esGhastFireball</td><td>{{cGhastFireballEntity}}</td><td>A ghast fireball hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherSkullBlack</td><td><i>TBD</i></td><td>A black wither skull hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherSkullBlue</td><td><i>TBD</i></td><td>A blue wither skull hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherBirth</td><td><i>TBD</i></td><td>A wither boss being created</td></tr>
- <tr><td>esOther</td><td><i>TBD</i></td><td>Any other previously unspecified type.</td></tr>
- <tr><td>esPlugin</td><td>object</td><td>An explosion created by a plugin. The plugin may specify any kind of data.</td></tr>
- </table></p>
+ depends on the source kind, see the {{Globals#ExplosionSource|esXXX}} constants' descriptions for details
]],
Params =
{
@@ -35,12 +22,16 @@ return
{ Name = "Y", Type = "number", Notes = "Y-coord of the explosion center" },
{ Name = "Z", Type = "number", Notes = "Z-coord of the explosion center" },
{ Name = "Source", Type = "eExplosionSource", Notes = "Source of the explosion. See the table above." },
- { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the table above." },
+ { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the {{Globals#ExplosionSource|esXXX}} constants' description." },
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called, and finally
Cuberite will process the explosion - destroy blocks and push + hurt entities. If the function
- returns true, no other callback is called for this event and the explosion will not occur.
+ returns true, no other callback is called for this event and the explosion will not occur.</p>
+ <p>
+ The hook handler may return up to two more values after the initial bool. The second returned value
+ overrides the CanCauseFire parameter for subsequent hook calls and the final explosion, the third
+ returned value overrides the ExplosionSize parameter for subsequent hook calls and the final explosion.
]],
}, -- HOOK_EXPLODING
}
diff --git a/Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html b/Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html
index 2b6af0d82..a75a925b3 100644
--- a/Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html
+++ b/Server/Plugins/APIDump/Writing-a-Cuberite-plugin.html
@@ -209,10 +209,11 @@ function Explode(Split, Player)
-- Create a callback ExplodePlayer with parameter Explodee, which Cuberite calls for every player on the server
local HasExploded = false
local ExplodePlayer = function(Explodee)
- -- If the player we are currently at is the one we specified as the parameter
+ -- If the player name matches exactly
if (Explodee:GetName() == Split[2]) then
- -- Create an explosion at the same position as they are; see <a href="cWorld.html">API docs</a> for further details of this function
- Player:GetWorld():DoExplosionAt(Explodee:GetPosX(), Explodee:GetPosY(), Explodee:GetPosZ(), false, esPlugin)
+ -- Create an explosion of force level 2 at the same position as they are
+ -- see <a href="cWorld.html">API docs</a> for further details of this function
+ Player:GetWorld():DoExplosionAt(2, Explodee:GetPosX(), Explodee:GetPosY(), Explodee:GetPosZ(), false, esPlugin)
Player:SendMessageSuccess(Split[2] .. " was successfully exploded")
HasExploded = true;
return true -- Signalize to Cuberite that we do not need to call this callback for any more players
diff --git a/Server/Plugins/APIDump/main_APIDump.lua b/Server/Plugins/APIDump/main_APIDump.lua
index 68c843016..872fa60f4 100644
--- a/Server/Plugins/APIDump/main_APIDump.lua
+++ b/Server/Plugins/APIDump/main_APIDump.lua
@@ -786,7 +786,7 @@ local function WriteHtmlClass(a_ClassAPI, a_ClassMenu)
cf:write("<a name='", group.Name, "'><p>");
cf:write(LinkifyString(group.TextBefore or "", Source));
WriteConstantTable(group.Constants, a_InheritedName or a_ClassAPI.Name);
- cf:write(LinkifyString(group.TextAfter or "", Source), "</a></p>");
+ cf:write(LinkifyString(group.TextAfter or "", Source), "</a></p><hr/>");
end
end
end
diff --git a/Server/hg.supp b/Server/hg.supp
index 27eb8c27a..bea6ecf3c 100644
--- a/Server/hg.supp
+++ b/Server/hg.supp
@@ -6,9 +6,9 @@
-# This covers GCC bug 40518, http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40518
+# This covers GCC bug 40518, https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40518
# "Erasing an empty string causes a global value write / race condition warning in helgrind"
-# Original suppression authored by Jonathan Wakely: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40518#c20
+# Original suppression authored by Jonathan Wakely: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40518#c20
# Modified by Mattes to match the mangled function name used on Ubuntu
{
@@ -16,7 +16,3 @@
Helgrind:Race
fun:_ZNSs9_M_mutateEjjj
}
-
-
-
-
diff --git a/Server/webadmin/login_template.html b/Server/webadmin/login_template.html
index fb6f21b52..d0ab9b566 100644
--- a/Server/webadmin/login_template.html
+++ b/Server/webadmin/login_template.html
@@ -53,9 +53,9 @@
<ul class="menu bottom_links">
<li><a href="http://cuberite.org" target="_blank">Cuberite</a></li>
<li><a href="http://forum.mc-server.org" target="_blank">Forums</a></li>
- <li><a href="http://builds.cuberite.org" target="_blank">Buildserver</a></li>
+ <li><a href="https://builds.cuberite.org" target="_blank">Buildserver</a></li>
<li><a href="http://api-docs.cuberite.org" target="_blank">API Documentation</a></li>
- <li><a href="http://book.cuberite.org/" target="_blank">User's Manual</a></li>
+ <li><a href="https://book.cuberite.org/" target="_blank">User's Manual</a></li>
</ul>
</div>
</div>
diff --git a/Server/webadmin/template.lua b/Server/webadmin/template.lua
index 5b3ecf152..00b2523b7 100644
--- a/Server/webadmin/template.lua
+++ b/Server/webadmin/template.lua
@@ -25,7 +25,7 @@ function GetDefaultPage()
local SubTitle = "Current Game"
local Content = ""
-
+
Content = Content .. "<h4>Plugins:</h4><ul>"
PM:ForEachPlugin(
function (a_CBPlugin)
@@ -34,16 +34,16 @@ function GetDefaultPage()
end
end
)
-
+
Content = Content .. "</ul>"
Content = Content .. "<h4>Players:</h4><ul>"
-
+
cRoot:Get():ForEachPlayer(
function(a_CBPlayer)
Content = Content .. "<li>" .. a_CBPlayer:GetName() .. "</li>"
end
)
-
+
Content = Content .. "</ul><br>";
return Content, SubTitle
@@ -69,17 +69,17 @@ function ShowPage(WebAdmin, TemplateRequest)
if (PageContent == "") then
PageContent, SubTitle = GetDefaultPage()
end
-
+
local reqParamsClass = ""
-
+
for key,value in pairs(TemplateRequest.Request.Params) do
reqParamsClass = reqParamsClass .. " param-" .. string.lower(string.gsub(key, "[^a-zA-Z0-9]+", "-") .. "-" .. string.gsub(value, "[^a-zA-Z0-9]+", "-"))
end
-
+
if (string.gsub(reqParamsClass, "%s", "") == "") then
reqParamsClass = " no-param"
end
-
+
Output([[
<!-- Copyright Justin S and MCServer Team, licensed under CC-BY-SA 3.0 -->
<html>
@@ -140,7 +140,7 @@ function ShowPage(WebAdmin, TemplateRequest)
local TabNames = value:GetTabNames()
if (GetTableSize(TabNames) > 0) then
Output("<div><a class='usercp_nav_item usercp_nav_pmfolder' style='text-decoration:none;'><b>"..PluginWebTitle.."</b></a></div>\n");
-
+
for webname,prettyname in pairs(TabNames) do
Output("<div><a href='" .. BaseURL .. PluginWebTitle .. "/" .. webname .. "' class='usercp_nav_item usercp_nav_sub_pmfolder'>" .. prettyname .. "</a></div>\n")
end
@@ -149,7 +149,7 @@ function ShowPage(WebAdmin, TemplateRequest)
end
end
-
+
Output([[
</td>
</tr>
@@ -179,9 +179,9 @@ function ShowPage(WebAdmin, TemplateRequest)
<ul class="menu bottom_links">
<li><a href="http://cuberite.org" target="_blank">Cuberite</a></li>
<li><a href="http://forum.mc-server.org" target="_blank">Forums</a></li>
- <li><a href="http://builds.cuberite.org" target="_blank">Buildserver</a></li>
+ <li><a href="https://builds.cuberite.org" target="_blank">Buildserver</a></li>
<li><a href="http://api-docs.cuberite.org" target="_blank">API Documentation</a></li>
- <li><a href="http://book.cuberite.org/" target="_blank">User's Manual</a></li>
+ <li><a href="https://book.cuberite.org/" target="_blank">User's Manual</a></li>
</ul>
</div>
</div>
@@ -195,6 +195,6 @@ function ShowPage(WebAdmin, TemplateRequest)
</body>
</html>
]])
-
+
return table.concat(SiteContent)
end