Class PlayerSpawnFinder

java.lang.Object
net.minecraft.server.level.PlayerSpawnFinder

public class PlayerSpawnFinder extends Object
  • Field Details

    • PLAYER_DIMENSIONS

      private static final EntityDimensions PLAYER_DIMENSIONS
    • ABSOLUTE_MAX_ATTEMPTS

      private static final int ABSOLUTE_MAX_ATTEMPTS
      See Also:
    • level

      private final ServerLevel level
    • spawnSuggestion

      private final BlockPos spawnSuggestion
    • radius

      private final int radius
    • candidateCount

      private final int candidateCount
    • coprime

      private final int coprime
    • offset

      private final int offset
    • nextCandidateIndex

      private int nextCandidateIndex
    • finishedFuture

      private final CompletableFuture<Vec3> finishedFuture
  • Constructor Details

    • PlayerSpawnFinder

      private PlayerSpawnFinder(ServerLevel level, BlockPos spawnSuggestion, int radius)
  • Method Details

    • findSpawn

      public static CompletableFuture<Vec3> findSpawn(ServerLevel level, BlockPos spawnSuggestion)
    • scheduleNext

      private void scheduleNext()
    • fixupSpawnHeight

      private static Vec3 fixupSpawnHeight(CollisionGetter level, BlockPos spawnPos)
    • noCollisionNoLiquid

      private static boolean noCollisionNoLiquid(CollisionGetter level, BlockPos pos)
    • getCoprime

      private static int getCoprime(int possibleOrigins)
    • scheduleCandidate

      private void scheduleCandidate(int candidateX, int candidateZ, int candidateIndex, Supplier<Optional<Vec3>> candidateChecker)
    • getOverworldRespawnPos

      protected static @Nullable BlockPos getOverworldRespawnPos(ServerLevel level, int x, int z)
    • getSpawnPosInChunk

      public static @Nullable BlockPos getSpawnPosInChunk(ServerLevel level, ChunkPos chunkPos)