diff options
author | maxcom1 <[email protected]> | 2024-03-23 22:26:17 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-03-23 17:26:17 -0400 |
commit | b6001403e9703cadaa6e8c8558e732b91c3c6d6e (patch) | |
tree | a8c57bbc334a8ad48d4ad2b43db335667b142bee /patches/api/0350-Add-getComputedBiome-API.patch | |
parent | 9ec7dfcbc41c6e625de0050b6997160a75df9f44 (diff) | |
download | Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.tar.gz Paper-b6001403e9703cadaa6e8c8558e732b91c3c6d6e.zip |
Add methods to change entity physics (#10334)
Diffstat (limited to 'patches/api/0350-Add-getComputedBiome-API.patch')
-rw-r--r-- | patches/api/0350-Add-getComputedBiome-API.patch | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/patches/api/0350-Add-getComputedBiome-API.patch b/patches/api/0350-Add-getComputedBiome-API.patch new file mode 100644 index 0000000000..6d24c2c66a --- /dev/null +++ b/patches/api/0350-Add-getComputedBiome-API.patch @@ -0,0 +1,79 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jason Penilla <[email protected]> +Date: Mon, 14 Mar 2022 22:45:32 -0700 +Subject: [PATCH] Add getComputedBiome API + + +diff --git a/src/main/java/org/bukkit/RegionAccessor.java b/src/main/java/org/bukkit/RegionAccessor.java +index b68367f123f029c3ff47eab6bfabd7a894a99da4..44ee56a5956cc17194c767a0c1071a2abffe818a 100644 +--- a/src/main/java/org/bukkit/RegionAccessor.java ++++ b/src/main/java/org/bukkit/RegionAccessor.java +@@ -25,6 +25,7 @@ public interface RegionAccessor extends Keyed { // Paper + * + * @param location the location of the biome + * @return Biome at the given location ++ * @see #getComputedBiome(int, int, int) + */ + @NotNull + Biome getBiome(@NotNull Location location); +@@ -36,10 +37,33 @@ public interface RegionAccessor extends Keyed { // Paper + * @param y Y-coordinate of the block + * @param z Z-coordinate of the block + * @return Biome at the given coordinates ++ * @see #getComputedBiome(int, int, int) + */ + @NotNull + Biome getBiome(int x, int y, int z); + ++ // Paper start ++ /** ++ * Gets the computed {@link Biome} at the given coordinates. ++ * ++ * <p>The computed Biome is the Biome as seen by clients for rendering ++ * purposes and in the "F3" debug menu. This is computed by looking at the noise biome ++ * at this and surrounding quarts and applying complex math operations.</p> ++ * ++ * <p>Most other Biome-related methods named getBiome, setBiome, and similar ++ * operate on the "noise biome", which is stored per-quart, or in other words, ++ * 1 Biome per 4x4x4 block region. This is how Biomes are currently generated and ++ * stored on disk.</p> ++ * ++ * @param x X-coordinate of the block ++ * @param y Y-coordinate of the block ++ * @param z Z-coordinate of the block ++ * @return Biome at the given coordinates ++ */ ++ @NotNull ++ Biome getComputedBiome(int x, int y, int z); ++ // Paper end ++ + /** + * Sets the {@link Biome} at the given {@link Location}. + * +diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java +index 42cc4f2ee960c0abf9c6688aeee4150754612c32..cf9600c743e977312c0a15c455d602391797ef34 100644 +--- a/src/main/java/org/bukkit/block/Block.java ++++ b/src/main/java/org/bukkit/block/Block.java +@@ -371,10 +371,22 @@ public interface Block extends Metadatable, Translatable, net.kyori.adventure.tr + * Returns the biome that this block resides in + * + * @return Biome type containing this block ++ * @see #getComputedBiome() + */ + @NotNull + Biome getBiome(); + ++ // Paper start ++ /** ++ * Gets the computed biome at the location of this Block. ++ * ++ * @return computed biome at the location of this Block. ++ * @see org.bukkit.RegionAccessor#getComputedBiome(int, int, int) ++ */ ++ @NotNull ++ Biome getComputedBiome(); ++ // Paper end ++ + /** + * Sets the biome that this block resides in + * |