MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / getHeight

Method getHeight

src/main/java/net/minecraft/world/World.java:679–700  ·  view source on GitHub ↗

Returns the position at this x, z coordinate in the chunk with y set to the value from the height map.

(BlockPos pos)

Source from the content-addressed store, hash-verified

677 * Returns the position at this x, z coordinate in the chunk with y set to the value from the height map.
678 */
679 public BlockPos getHeight(BlockPos pos)
680 {
681 int i;
682
683 if (pos.getX() >= -30000000 && pos.getZ() >= -30000000 && pos.getX() < 30000000 && pos.getZ() < 30000000)
684 {
685 if (this.isChunkLoaded(pos.getX() >> 4, pos.getZ() >> 4, true))
686 {
687 i = this.getChunkFromChunkCoords(pos.getX() >> 4, pos.getZ() >> 4).getHeightValue(pos.getX() & 15, pos.getZ() & 15);
688 }
689 else
690 {
691 i = 0;
692 }
693 }
694 else
695 {
696 i = this.func_181545_F() + 1;
697 }
698
699 return new BlockPos(pos.getX(), i, pos.getZ());
700 }
701
702 /**
703 * Gets the lowest height of the chunk where sunlight directly reaches

Callers 13

getSpawnPointMethod · 0.95
getLargestDisplayModeMethod · 0.45
getDisplayModesMethod · 0.45
getDisplayModeNamesMethod · 0.45
getDisplayModeMethod · 0.45
readIconImageMethod · 0.45
checkDisplayModeMethod · 0.45
canPushMethod · 0.45

Calls 6

isChunkLoadedMethod · 0.95
func_181545_FMethod · 0.95
getXMethod · 0.65
getZMethod · 0.65
getHeightValueMethod · 0.45

Tested by

no test coverage detected