diff options
author | Lane Kolbly <lane@rscheme.org> | 2017-09-07 14:41:16 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2017-09-07 14:41:16 +0200 |
commit | b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61 (patch) | |
tree | c7e2a8db5676c8599ce76b212491dd35fd883c1c /Server/Plugins/APIDump | |
parent | Lighting now generally consistent with vanilla (#3988) (diff) | |
download | cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.gz cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.bz2 cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.lz cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.xz cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.zst cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.zip |
Diffstat (limited to '')
-rw-r--r-- | Server/Plugins/APIDump/APIDesc.lua | 11 | ||||
-rw-r--r-- | Server/Plugins/APIDump/Classes/World.lua | 31 | ||||
-rw-r--r-- | Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua | 3 |
3 files changed, 43 insertions, 2 deletions
diff --git a/Server/Plugins/APIDump/APIDesc.lua b/Server/Plugins/APIDump/APIDesc.lua index dafe98619..334fed378 100644 --- a/Server/Plugins/APIDump/APIDesc.lua +++ b/Server/Plugins/APIDump/APIDesc.lua @@ -11501,6 +11501,17 @@ a_Player:OpenWindow(Window); { Notes = "Saves all the chunks in all the worlds. Note that the saving is queued on each world's tick thread and this functions returns before the chunks are actually saved.", }, + SetSavingEnabled = + { + Params = + { + { + Name = "SavingEnabled", + Type = "boolean", + }, + }, + Notes = "Sets whether saving chunk data is enabled for all worlds. If disabled, dirty chunks will stay in memory forever, which can cause performance and stability issues.", + }, }, AdditionalInfo = { diff --git a/Server/Plugins/APIDump/Classes/World.lua b/Server/Plugins/APIDump/Classes/World.lua index ac837dea3..82f31febe 100644 --- a/Server/Plugins/APIDump/Classes/World.lua +++ b/Server/Plugins/APIDump/Classes/World.lua @@ -1450,6 +1450,16 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i }, Notes = "Returns the block type and metadata for the block at the specified coords. The first value specifies if the block is in a valid loaded chunk, the other values are valid only if BlockValid is true.", }, + GetDataPath = + { + Returns = + { + { + Type = "boolean", + }, + }, + Notes = "Returns the path to the root of the world data.", + }, GetDefaultWeatherInterval = { Params = @@ -2117,6 +2127,16 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i }, Notes = "Returns whether PVP is enabled in the world settings.", }, + IsSavingEnabled = + { + Returns = + { + { + Type = "boolean", + }, + }, + Notes = "Returns whether or not saving chunk data is enabled. If disabled, the world will keep dirty chunks in memory forever, and will simply regenerate non-dirty chunks that are unloaded.", + }, IsTrapdoorOpen = { Params = @@ -2726,6 +2746,17 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i }, Notes = "Sets the blockticking to start at the specified block in the next tick.", }, + SetSavingEnabled = + { + Params = + { + { + Name = "SavingEnabled", + Type = "boolean", + }, + }, + Notes = "Sets whether saving chunk data is enabled. If disabled, dirty chunks will stay in memory forever, which may cause performance and stability issues.", + }, SetShouldUseChatPrefixes = { Params = diff --git a/Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua b/Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua index 98e0a71fd..7317db215 100644 --- a/Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua +++ b/Server/Plugins/APIDump/Hooks/OnChunkUnloading.lua @@ -8,8 +8,7 @@ return Cuberite calls this function when a chunk is about to be unloaded from the memory. A plugin may force Cuberite to keep the chunk in memory by returning true.</p> <p> - FIXME: The return value should be used only for event propagation stopping, not for the actual - decision whether to unload. + CAUTION: Preventing the server from unloading chunks can cause the server to use too much RAM, which will adversely affect both performance and stability (i.e. your computer will get slow and crash). Return true sparingly. ]], Params = { |