Search in sources :

Example 1 with BlockLocation

use of com.bergerkiller.bukkit.common.BlockLocation in project BKCommonLib by bergerhealer.

the class CommonHumanEntity method getSpawnPoint.

/**
     * Gets the block location of the respawn point for the human entity.
     * If none is available, null is returned instead.
     * 
     * @return spawn point coordinates, or null if none are available
     */
public BlockLocation getSpawnPoint() {
    Object handle = getHandle();
    String world = NMSEntityHuman.spawnWorld.get(handle);
    IntVector3 coords = NMSEntityHuman.spawnCoord.get(handle);
    if (world != null && coords != null && !world.isEmpty()) {
        return new BlockLocation(world, coords);
    } else {
        return null;
    }
}
Also used : BlockLocation(com.bergerkiller.bukkit.common.BlockLocation) IntVector3(com.bergerkiller.bukkit.common.bases.IntVector3)

Aggregations

BlockLocation (com.bergerkiller.bukkit.common.BlockLocation)1 IntVector3 (com.bergerkiller.bukkit.common.bases.IntVector3)1