I like to set a Block at the Location where the Player is “looking at”, just like if as an end-user you right clicked. How do you correctly do this, given Entity’s Location getLocation() + Vector3d getRotation() ?
BlockRay is the correct thing to use.
It looks like you’re using BlockRay.ONLY_AIR_FILTER, but I think (not certain) your need the inverse. Try Predicates.not(BlockRay.ONLY_AIR_FILTER) instead.
java.util.NoSuchElementException: Filter limit reached
at org.spongepowered.api.util.blockray.BlockRay.advance(BlockRay.java:300) ~[BlockRay.class:?]
at org.spongepowered.api.util.blockray.BlockRay.end(BlockRay.java:338) ~[BlockRay.class:?]
at org.spongepowered.api.util.blockray.BlockRay$BlockRayBuilder.end(BlockRay.java:623) ~[BlockRay$BlockRayBuilder.class:?]
at ch.vorburger.minecraft.logo.Turtle.getStartingLocation(Turtle.java:44)
PS: I’m on API 74446aa with SpongeVanilla 453c4a9, both from 6 weeks ago… any particular reason to think that this may have been broken then, and work better on current HEAD? (I’ll upgrade when I’m somewhere with a faster Internet.)