summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2017-04-04 07:53:14 +0200
committerMattes D <github@xoft.cz>2017-04-04 07:53:14 +0200
commitfb205174350792c5840897b63d7457b3536e0c27 (patch)
treeff5a7e38c3f56793a382a59287c352ec0769bc35
parentAdded a nullptr check to cEntity::IsA (#3659) (diff)
downloadcuberite-fb205174350792c5840897b63d7457b3536e0c27.tar
cuberite-fb205174350792c5840897b63d7457b3536e0c27.tar.gz
cuberite-fb205174350792c5840897b63d7457b3536e0c27.tar.bz2
cuberite-fb205174350792c5840897b63d7457b3536e0c27.tar.lz
cuberite-fb205174350792c5840897b63d7457b3536e0c27.tar.xz
cuberite-fb205174350792c5840897b63d7457b3536e0c27.tar.zst
cuberite-fb205174350792c5840897b63d7457b3536e0c27.zip
-rw-r--r--Server/Plugins/APIDump/APIDesc.lua157
-rw-r--r--Server/Plugins/APIDump/Classes/Projectiles.lua2
-rw-r--r--Server/Plugins/APIDump/Classes/RankManager.lua16
-rw-r--r--Server/Plugins/APIDump/Classes/World.lua17
-rw-r--r--src/Entities/Player.h12
5 files changed, 195 insertions, 9 deletions
diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua
index 4ffaaee8d..c2c75628c 100644
--- a/Server/Plugins/APIDump/APIDesc.lua
+++ b/Server/Plugins/APIDump/APIDesc.lua
@@ -2277,6 +2277,11 @@ return
},
Variables =
{
+ m_BlockHeight =
+ {
+ Type = "number",
+ Notes = "The height of the block, a value between 0.0 and 1.0",
+ },
m_CanBeTerraformed =
{
Type = "bool",
@@ -2287,6 +2292,11 @@ return
Type = "bool",
Notes = "Does this block fully occupy its voxel - is it a 'full' block?",
},
+ m_Hardness =
+ {
+ Type = "number",
+ Notes = "The greater the value the longer the player needs to break the block.",
+ },
m_IsSnowable =
{
Type = "bool",
@@ -11411,7 +11421,7 @@ a_Player:OpenWindow(Window);
},
Notes = "Returns the name that is used in the playerlist.",
},
- GetResolvedPermissions =
+ GetRestrictions =
{
Returns =
{
@@ -11419,7 +11429,7 @@ a_Player:OpenWindow(Window);
Type = "table",
},
},
- Notes = "Returns all the player's permissions, as an array-table of strings.",
+ Notes = "Returns an array-table of all the restrictions that the player has assigned to them.",
},
GetSprintingMaxSpeed =
{
@@ -13988,6 +13998,51 @@ end
},
Notes = "Returns the coords of a block adjacent to the specified block through the specified {{Globals#BlockFaces|face}}",
},
+ Base64Decode =
+ {
+ Params =
+ {
+ {
+ Name = "Input",
+ Type = "string",
+ },
+ },
+ Returns =
+ {
+ { Type = "string" },
+ },
+ Notes = "Decodes a Base64-encoded string into the raw data.",
+ },
+ Base64Encode =
+ {
+ Params =
+ {
+ {
+ Name = "Input",
+ Type = "string",
+ },
+ },
+ Returns =
+ {
+ { Type = "string" },
+ },
+ Notes = "Encodes a string into Base64.",
+ },
+ BiomeToString =
+ {
+ Params =
+ {
+ {
+ Name = "Biome",
+ Type = "EMCSBiome",
+ },
+ },
+ Returns =
+ {
+ { Type = "string" },
+ },
+ Notes = "Translates biome enum into biome string. Returns empty string on failure (unknown biome).",
+ },
BlockFaceToString =
{
Params =
@@ -14082,6 +14137,23 @@ end
},
Notes = "Converts the {{Globals#eDamageType|DamageType}} to a string representation ",
},
+ DimensionToString =
+ {
+ Params =
+ {
+ {
+ Name = "Dimension",
+ Type = "eDimension",
+ },
+ },
+ Returns =
+ {
+ {
+ Type = "string",
+ },
+ },
+ Notes = "Converts an {{Globals#eDimension|eDimension}} to a string value. Returns Overworld on failure.",
+ },
EscapeString =
{
Params =
@@ -14149,6 +14221,21 @@ end
},
Notes = "Returns the item that has been read from the specified INI file value. If the value is not present in the INI file, the DefaultValue is stored in the file and parsed as the result. Returns empty item if the value cannot be parsed. ",
},
+ GetSnowStartHeight =
+ {
+ Params =
+ {
+ {
+ Name = "Biome",
+ Type = "EMCSBiome",
+ },
+ },
+ Returns =
+ {
+ { Type = "number" },
+ },
+ Notes = "Returns the height at which snow will start falling in the {{Globals#EMCSBiome|Biome}}. Check functions IsBiomeCold and IsBiomeVeryCold for more informations.",
+ },
GetTime =
{
Returns =
@@ -14159,6 +14246,21 @@ end
},
Notes = "Returns the current OS time, as a unix time stamp (number of seconds since Jan 1, 1970)",
},
+ IsBiomeCold =
+ {
+ Params =
+ {
+ {
+ Name = "Biome",
+ Type = "EMCSBiome",
+ },
+ },
+ Returns =
+ {
+ { Type = "boolean" },
+ },
+ Notes = "Returns true if the biome is cold (has snow and snowfall at higher elevations but not at regular heights). Doesn't report Very Cold biomes, use IsBiomeVeryCold() for those.",
+ },
IsBiomeNoDownfall =
{
Params =
@@ -14176,6 +14278,40 @@ end
},
Notes = "Returns true if the biome is 'dry', that is, there is no precipitation during rains and storms.",
},
+ IsBiomeOcean =
+ {
+ Params =
+ {
+ {
+ Name = "Biome",
+ Type = "EMCSBiome",
+ },
+ },
+ Returns =
+ {
+ {
+ Type = "boolean",
+ },
+ },
+ Notes = "Returns true if the biome is an ocean biome.",
+ },
+ IsBiomeVeryCold =
+ {
+ Params =
+ {
+ {
+ Name = "Biome",
+ Type = "EMCSBiome",
+ },
+ },
+ Returns =
+ {
+ {
+ Type = "boolean",
+ },
+ },
+ Notes = "Returns true if the biome is very cold (has snow on ground everywhere, turns top water to ice, has snowfall instead of rain everywhere). Doesn't report mildly cold biomes (where it snows above certain elevation), use IsBiomeCold() for those.",
+ },
IsValidBlock =
{
Params =
@@ -14474,6 +14610,23 @@ end
},
Notes = "Replaces *each* occurence of to-be-replaced-string in full-string with to-replace-string",
},
+ ReverseBlockFace =
+ {
+ Params =
+ {
+ {
+ Name = "BlockFace",
+ Type = "eBlockFace",
+ },
+ },
+ Returns =
+ {
+ {
+ Type = "eBlockFace",
+ },
+ },
+ Notes = "Returns the reversed {{Globals#eBlockFace|eBlockFace}}.",
+ },
RotateBlockFaceCCW =
{
Params =
diff --git a/Server/Plugins/APIDump/Classes/Projectiles.lua b/Server/Plugins/APIDump/Classes/Projectiles.lua
index b92f6d2a8..a62779960 100644
--- a/Server/Plugins/APIDump/Classes/Projectiles.lua
+++ b/Server/Plugins/APIDump/Classes/Projectiles.lua
@@ -26,7 +26,7 @@ return
},
GetBlockHit =
{
- Desc = "Gets the block arrow is in",
+ Notes = "Returns the coords of the block into which the arrow is stuck. Undefined if the arrow is still moving.",
Returns =
{
{
diff --git a/Server/Plugins/APIDump/Classes/RankManager.lua b/Server/Plugins/APIDump/Classes/RankManager.lua
index 9695117a6..be2969298 100644
--- a/Server/Plugins/APIDump/Classes/RankManager.lua
+++ b/Server/Plugins/APIDump/Classes/RankManager.lua
@@ -626,6 +626,22 @@ return
},
Notes = "Removes the specified rank. If ReplacementRankName is given, the players that have RankName will get their rank set to ReplacementRankName. If it isn't given, or is an invalid rank, the players will be removed from the manager, their ranks will be unset completely. Logs an info message and does nothing if the rank is not found.",
},
+ RemoveRestrictionFromGroup =
+ {
+ IsStatic = true,
+ Params =
+ {
+ {
+ Name = "Restriction",
+ Type = "string",
+ },
+ {
+ Name = "GroupName",
+ Type = "string",
+ },
+ },
+ Notes = "Removes the specified restriction from the specified group.",
+ },
RenameGroup =
{
IsStatic = true,
diff --git a/Server/Plugins/APIDump/Classes/World.lua b/Server/Plugins/APIDump/Classes/World.lua
index 91741377f..2733410e4 100644
--- a/Server/Plugins/APIDump/Classes/World.lua
+++ b/Server/Plugins/APIDump/Classes/World.lua
@@ -1112,6 +1112,23 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
},
Notes = "Calls the specified callback for each furnace in the chunk. Returns true if all furnaces in the chunk have been processed (including when there are zero furnaces), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cFurnaceEntity|FurnaceEntity}})</pre> The callback should return false or no value to continue with the next furnace, or true to abort the enumeration.",
},
+ ForEachLoadedChunk =
+ {
+ Params =
+ {
+ {
+ Name = "CallbackFunction",
+ Type = "function",
+ },
+ },
+ Returns =
+ {
+ {
+ Type = "boolean",
+ },
+ },
+ Notes = "Calls the specified callback for each loaded chunk in the world. Returns true if all chunks have been processed, or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback(ChunkX, ChunkZ)</pre> The callback should return false or no value to continue with the next chunk, or true to abort the enumeration.",
+ },
ForEachPlayer =
{
Params =
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index b592913bd..058ece26e 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -139,6 +139,12 @@ public:
virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) override;
+ // Sets the current gamemode, doesn't check validity, doesn't send update packets to client
+ void LoginSetGameMode(eGameMode a_GameMode);
+
+ // Updates player's capabilities - flying, visibility, etc. from their gamemode.
+ void SetCapabilities();
+
// tolua_begin
/** Prevent the player from moving and lock him into a_Location. */
@@ -174,12 +180,6 @@ public:
*/
void SetGameMode(eGameMode a_GameMode);
- // Sets the current gamemode, doesn't check validity, doesn't send update packets to client
- void LoginSetGameMode(eGameMode a_GameMode);
-
- // Updates player's capabilities - flying, visibility, etc. from their gamemode.
- void SetCapabilities();
-
/** Returns true if the player is in Creative mode, either explicitly, or by inheriting from current world */
bool IsGameModeCreative(void) const;