mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-10-26 14:00:14 +00:00
implement BlockSetMatchPatternTemplate
This commit is contained in:
1 parent
abfd050acb
commit
63667f256b
1 file changed
+21
+21
@@ -0,0 +1,21 @@
|
|||||||
|
package com.dfsek.terra.addons.feature.locator.config.pattern;
|
||||||
|
|
||||||
|
import com.dfsek.tectonic.annotations.Value;
|
||||||
|
import com.dfsek.tectonic.loading.object.ObjectTemplate;
|
||||||
|
import com.dfsek.terra.addons.feature.locator.patterns.Pattern;
|
||||||
|
import com.dfsek.terra.addons.feature.locator.patterns.match.MatchPattern;
|
||||||
|
import com.dfsek.terra.api.util.Range;
|
||||||
|
import com.dfsek.terra.api.util.collection.MaterialSet;
|
||||||
|
|
||||||
|
public class BlockSetMatchPatternTemplate implements ObjectTemplate<Pattern> {
|
||||||
|
@Value("blocks")
|
||||||
|
private MaterialSet blocks;
|
||||||
|
|
||||||
|
@Value("offset")
|
||||||
|
private Range offset;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Pattern get() {
|
||||||
|
return new MatchPattern(offset, blockState -> blocks.contains(blockState.getBlockType()));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user