aboutsummaryrefslogtreecommitdiff
path: root/azalea-block/src/range.rs
diff options
context:
space:
mode:
Diffstat (limited to 'azalea-block/src/range.rs')
-rw-r--r--azalea-block/src/range.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/azalea-block/src/range.rs b/azalea-block/src/range.rs
index 6ccf4152..9b520d49 100644
--- a/azalea-block/src/range.rs
+++ b/azalea-block/src/range.rs
@@ -1,4 +1,7 @@
-use std::{collections::HashSet, ops::RangeInclusive};
+use std::{
+ collections::HashSet,
+ ops::{Add, RangeInclusive},
+};
use crate::BlockState;
@@ -31,3 +34,13 @@ impl BlockStates {
self.set.contains(state)
}
}
+
+impl Add for BlockStates {
+ type Output = Self;
+
+ fn add(self, rhs: Self) -> Self::Output {
+ Self {
+ set: self.set.union(&rhs.set).copied().collect(),
+ }
+ }
+}