Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/twilightforest/world/TFTeleporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ private static int getScanHeight(ServerLevel world, BlockPos pos) {

private static int getScanHeight(ServerLevel world, int x, int z) {
int worldHeight = world.getMaxY() - 1;
//FIXME find an alternative to getHighestSectionPosition, its marked for removal
@SuppressWarnings("removal")
int chunkHeight = world.getChunk(x >> 4, z >> 4).getHighestSectionPosition() + 15;
LevelChunk chunk = world.getChunk(x >> 4, z >> 4);
int chunkHeightIndex = chunk.getHighestFilledSectionIndex();
int chunkHeight = (chunkHeightIndex == -1 ? chunk.getMinY() : SectionPos.sectionToBlockCoord(chunk.getSectionIndexFromSectionY(chunkHeightIndex))) + 15;
return Math.min(worldHeight, chunkHeight);
}

Expand Down