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 pLevel, BlockPos pSpawnSuggestion, int pRadius)
  • Method Details

    • findSpawn

      public static CompletableFuture<Vec3> findSpawn(ServerLevel pLevel, BlockPos pPos)
    • scheduleNext

      private void scheduleNext()
    • fixupSpawnHeight

      private static Vec3 fixupSpawnHeight(CollisionGetter pCollisionGetter, BlockPos pPos)
    • noCollisionNoLiquid

      private static boolean noCollisionNoLiquid(CollisionGetter pCollisionGetter, BlockPos pPos)
    • getCoprime

      private static int getCoprime(int pCandidateCount)
    • scheduleCandidate

      private void scheduleCandidate(int pX, int pZ, int pIndex, Supplier<Optional<Vec3>> pCalculator)
    • getOverworldRespawnPos

      @Nullable protected static BlockPos getOverworldRespawnPos(ServerLevel pLevel, int pX, int pZ)
    • getSpawnPosInChunk

      @Nullable public static BlockPos getSpawnPosInChunk(ServerLevel pLevel, ChunkPos pChunkPos)