Commits

coll1234567 authored and md_5 committed c278419d351
#854: Move getHighestBlockYAt methods from World to RegionAccessor
No tags

src/main/java/org/bukkit/RegionAccessor.java

Modified
341 341 * {@link org.bukkit.entity.Mob} interface provide
342 342 * randomisation logic for their spawn.
343 343 * This parameter is hence useless for any other type
344 344 * of entity.
345 345 * @param function the function to be run before the entity is spawned.
346 346 * @return the spawned entity instance.
347 347 * @throws IllegalArgumentException if either the world or clazz parameter are null.
348 348 */
349 349 @NotNull
350 350 public <T extends Entity> T spawn(@NotNull Location location, @NotNull Class<T> clazz, boolean randomizeData, @Nullable Consumer<T> function) throws IllegalArgumentException;
351 +
352 + /**
353 + * Gets the highest non-empty (impassable) coordinate at the given
354 + * coordinates.
355 + *
356 + * @param x X-coordinate of the blocks
357 + * @param z Z-coordinate of the blocks
358 + * @return Y-coordinate of the highest non-empty block
359 + */
360 + public int getHighestBlockYAt(int x, int z);
361 +
362 + /**
363 + * Gets the highest non-empty (impassable) coordinate at the given
364 + * {@link Location}.
365 + *
366 + * @param location Location of the blocks
367 + * @return Y-coordinate of the highest non-empty block
368 + */
369 + public int getHighestBlockYAt(@NotNull Location location);
370 +
371 + /**
372 + * Gets the highest coordinate corresponding to the {@link HeightMap} at the
373 + * given coordinates.
374 + *
375 + * @param x X-coordinate of the blocks
376 + * @param z Z-coordinate of the blocks
377 + * @param heightMap the heightMap that is used to determine the highest
378 + * point
379 + *
380 + * @return Y-coordinate of the highest block corresponding to the
381 + * {@link HeightMap}
382 + */
383 + public int getHighestBlockYAt(int x, int z, @NotNull HeightMap heightMap);
384 +
385 + /**
386 + * Gets the highest coordinate corresponding to the {@link HeightMap} at the
387 + * given {@link Location}.
388 + *
389 + * @param location Location of the blocks
390 + * @param heightMap the heightMap that is used to determine the highest
391 + * point
392 + * @return Y-coordinate of the highest block corresponding to the
393 + * {@link HeightMap}
394 + */
395 + public int getHighestBlockYAt(@NotNull Location location, @NotNull HeightMap heightMap);
351 396 }

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut