More rules
This commit is contained in:
parent
17ded1bbcc
commit
1a0cb36739
1 changed files with 34 additions and 0 deletions
|
@ -89,6 +89,40 @@ public class SurfaceRuleBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set biome ceiling with specified {@link BlockState}. Example - block of sandstone in the Overworld desert in air pockets.
|
||||||
|
* @param state {@link BlockState} for the ground cover.
|
||||||
|
* @return same {@link SurfaceRuleBuilder} instance.
|
||||||
|
*/
|
||||||
|
public SurfaceRuleBuilder ceil(BlockState state) {
|
||||||
|
entryInstance = getFromCache("ceil_" + state.toString(), () -> {
|
||||||
|
RuleSource rule = SurfaceRules.state(state);
|
||||||
|
return new SurfaceRuleEntry(1, SurfaceRules.ifTrue(SurfaceRules.ON_CEILING, rule));
|
||||||
|
});
|
||||||
|
rules.add(entryInstance);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows to add custom rule.
|
||||||
|
* @param priority rule priority, lower values = higher priority (rule will be applied before others).
|
||||||
|
* @param rule custom {@link SurfaceRules.RuleSource}.
|
||||||
|
* @return same {@link SurfaceRuleBuilder} instance.
|
||||||
|
*/
|
||||||
|
public SurfaceRuleBuilder rule(int priority, SurfaceRules.RuleSource rule) {
|
||||||
|
rules.add(new SurfaceRuleEntry(priority, rule));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows to add custom rule.
|
||||||
|
* @param rule
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public SurfaceRuleBuilder rule(SurfaceRules.RuleSource rule) {
|
||||||
|
return rule(7, rule);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finalise rule building process.
|
* Finalise rule building process.
|
||||||
* @return {@link SurfaceRules.RuleSource}.
|
* @return {@link SurfaceRules.RuleSource}.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue