diff options
Diffstat (limited to 'src/server/serveractiveobject.h')
-rw-r--r-- | src/server/serveractiveobject.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/server/serveractiveobject.h b/src/server/serveractiveobject.h index 927009aef..2764d159e 100644 --- a/src/server/serveractiveobject.h +++ b/src/server/serveractiveobject.h @@ -125,6 +125,7 @@ public: assert(isStaticAllowed()); *result = ""; } + /* Return false in here to never save and instead remove object on unload. getStaticData() will not be called in that case. @@ -132,6 +133,14 @@ public: virtual bool isStaticAllowed() const {return true;} + /* + Return false here to never unload the object. + isStaticAllowed && shouldUnload -> unload when out of active block range + !isStaticAllowed && shouldUnload -> unload when block is unloaded + */ + virtual bool shouldUnload() const + { return true; } + // Returns tool wear virtual u16 punch(v3f dir, const ToolCapabilities *toolcap = nullptr, |