crwdns141927:0crwdne141927:0

Warning

crwdns141929:0crwdne141929:0

crwdns141931:0:javadoc:crwdnd141931:0:javadoc:crwdne141931:0

crwdns141933:0:javadoc:crwdnd141933:0:javadoc:crwdnd141933:0:javadoc:crwdnd141933:0:javadoc:crwdne141933:0

Tip

crwdns141935:0crwdne141935:0

crwdns141937:0:javadoc:crwdnd141937:0:javadoc:crwdnd141937:0:javadoc:crwdne141937:0

Note

crwdns141939:0crwdne141939:0

crwdns141941:0crwdne141941:0

crwdns141943:0crwdne141943:0

  • crwdns141945:0crwdne141945:0

  • crwdns141947:0crwdne141947:0

  • crwdns141949:0:javadoc:crwdne141949:0

  • crwdns141951:0crwdne141951:0

crwdns141953:0crwdne141953:0

crwdns141955:0:javadoc:crwdne141955:0

import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.util.blockray.BlockRay;
import org.spongepowered.api.world.World;

Player player;
BlockRay<World> blockRay = BlockRay.from(player)
    .skipFilter(BlockRay.onlyAirFilter()).stopFilter(BlockRay.onlyAirFilter()).build();

crwdns141957:0crwdne141957:0

BlockRay<World> blockRay = BlockRay.from(player)
    .skipFilter(BlockRay.onlyAirFilter()).stopFilter(BlockRay.allFilter()).build();

crwdns141959:0crwdne141959:0

crwdns141961:0:javadoc:crwdnd141961:0:javadoc:crwdnd141961:0:javadoc:crwdne141961:0

crwdns141963:0crwdne141963:0

crwdns141965:0crwdne141965:0

import org.spongepowered.api.util.blockray.BlockRayHit;
import java.util.Optional;

BlockRay<World> blockRay = ...;
Optional<BlockRayHit<World>> hitOpt = blockRay.end();
if (hitOpt.isPresent()) {
    BlockRayHit<World> hit = hitOpt.get();
    System.out.println("Found " + hit.getLocation().getBlockType() + " block at "
        + hit.getLocation() + " with intersection at " + hit.getPosition());
}