1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

Add min_y and max_y checks for Active Block Modifiers (ABM) (#11333)

This check can be used by ABM to reduce CPU usage.
This commit is contained in:
sfence
2021-06-20 17:21:35 +02:00
committed by GitHub
parent 1805775f3d
commit b10091be9b
6 changed files with 41 additions and 3 deletions

View File

@@ -67,6 +67,10 @@ public:
virtual u32 getTriggerChance() = 0;
// Whether to modify chance to simulate time lost by an unnattended block
virtual bool getSimpleCatchUp() = 0;
// get min Y for apply abm
virtual s16 getMinY() = 0;
// get max Y for apply abm
virtual s16 getMaxY() = 0;
// This is called usually at interval for 1/chance of the nodes
virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n){};
virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n,