Ceiling rules
This commit is contained in:
parent
3a06c128ed
commit
9609db9f9b
2 changed files with 18 additions and 1 deletions
|
@ -63,7 +63,8 @@ public class BCLib implements ModInitializer {
|
||||||
.filler(Blocks.STONE.defaultBlockState())
|
.filler(Blocks.STONE.defaultBlockState())
|
||||||
.subsurface(Blocks.DIRT.defaultBlockState(), 3)
|
.subsurface(Blocks.DIRT.defaultBlockState(), 3)
|
||||||
.surface(Blocks.GRASS_BLOCK.defaultBlockState())
|
.surface(Blocks.GRASS_BLOCK.defaultBlockState())
|
||||||
.ceil(Blocks.DEEPSLATE.defaultBlockState())
|
.aboveCeil(Blocks.DEEPSLATE.defaultBlockState(), 4)
|
||||||
|
.ceil(Blocks.BASALT.defaultBlockState())
|
||||||
.build();
|
.build();
|
||||||
BiomeAPI.addSurfaceRule(Biomes.END_HIGHLANDS.location(), rule);
|
BiomeAPI.addSurfaceRule(Biomes.END_HIGHLANDS.location(), rule);
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,6 +104,22 @@ public class SurfaceRuleBuilder {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set biome ceiling material with specified {@link BlockState} and height. Example - sandstone in the Overworld deserts.
|
||||||
|
* @param state {@link BlockState} for the subterrain layer.
|
||||||
|
* @param height block layer height.
|
||||||
|
* @return same {@link SurfaceRuleBuilder} instance.
|
||||||
|
*/
|
||||||
|
public SurfaceRuleBuilder aboveCeil(BlockState state, int height) {
|
||||||
|
entryInstance = getFromCache("above_ceil_" + height + "_" + state.toString(), () -> {
|
||||||
|
RuleSource rule = SurfaceRules.state(state);
|
||||||
|
rule = SurfaceRules.ifTrue(SurfaceRules.stoneDepthCheck(height, false, false, CaveSurface.CEILING), rule);
|
||||||
|
return new SurfaceRuleEntry(2, rule);
|
||||||
|
});
|
||||||
|
rules.add(entryInstance);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows to add custom rule.
|
* Allows to add custom rule.
|
||||||
* @param priority rule priority, lower values = higher priority (rule will be applied before others).
|
* @param priority rule priority, lower values = higher priority (rule will be applied before others).
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue