From 11aab4198be1a0f1104a433896e908e4c86de0c9 Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Tue, 29 Mar 2022 12:06:44 -0400 Subject: Optimize swapping nodes with equivalent lighting --- src/nodedef.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/nodedef.h') diff --git a/src/nodedef.h b/src/nodedef.h index ea50d4281..f90caff8a 100644 --- a/src/nodedef.h +++ b/src/nodedef.h @@ -478,6 +478,12 @@ struct ContentFeatures return (liquid_alternative_flowing_id == f.liquid_alternative_flowing_id); } + bool lightingEquivalent(const ContentFeatures &other) const { + return light_propagates == other.light_propagates + && sunlight_propagates == other.sunlight_propagates + && light_source == other.light_source; + } + int getGroup(const std::string &group) const { return itemgroup_get(groups, group); -- cgit v1.2.3