Skip to content

Instantly share code, notes, and snippets.

@Ivorforce
Created September 18, 2016 18:12
Show Gist options
  • Save Ivorforce/b1d65df91ae753aee91746818969a383 to your computer and use it in GitHub Desktop.
Save Ivorforce/b1d65df91ae753aee91746818969a383 to your computer and use it in GitHub Desktop.
public static GenericYSelector surfaceYSelector()
{
return new GenericYSelector(Arrays.asList(
// Keep above caves
new FactorLimit(1, Arrays.asList(
new FactorLimit.RayDynamicPosition(null, FactorLimit.RayDynamicPosition.Type.WORLD_HEIGHT),
new FactorLimit.RayMatcher(1f, false, .5f, new PositionedBlockMatcher(RecurrentComplex.specialRegistry, "!(is.air | is.foliage | is.replaceable)")),
new FactorLimit.RayMove(1f, -5))),
// Spawn in air
new FactorMatch(1, "!(reccomplex:generic_space | reccomplex:generic_solid)", "is.air", 0.5f),
// Spawn on top of solids
new FactorMatch(1, "reccomplex:generic_solid & #0", "!(is.air | is.foliage | is.replaceable)", 0.5f),
// Spawn in non-solids
new FactorMatch(.5f, "!(reccomplex:generic_space | reccomplex:generic_solid)", "is.air | is.foliage | is.replaceable", 0.5f)
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment