mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 08:25:31 +00:00
create AirMatchPatternTemplate
This commit is contained in:
parent
649273db01
commit
ca02187b0c
@ -0,0 +1,25 @@
|
||||
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.TerraPlugin;
|
||||
import com.dfsek.terra.api.block.state.BlockState;
|
||||
import com.dfsek.terra.api.util.Range;
|
||||
|
||||
public class AirMatchPatternTemplate implements ObjectTemplate<Pattern> {
|
||||
@Value("offset")
|
||||
private Range offset;
|
||||
|
||||
private final BlockState air;
|
||||
|
||||
public AirMatchPatternTemplate(TerraPlugin main) {
|
||||
this.air = main.getWorldHandle().air();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pattern get() {
|
||||
return new MatchPattern(offset, air::matches);
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ public class MatchPattern implements Pattern {
|
||||
private final Range range;
|
||||
private final Predicate<BlockState> matches;
|
||||
|
||||
protected MatchPattern(Range range, Predicate<BlockState> matches) {
|
||||
public MatchPattern(Range range, Predicate<BlockState> matches) {
|
||||
this.range = range;
|
||||
this.matches = matches;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user