mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
f9e1ad2c2d
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 37262de8 PR-812: Add Registry#match(String) d6b40162 SPIGOT-4569: Add more BlockData API f9691891 PR-809: Throw a more clear error for BlockIterators with zero direction, add Vector#isZero() 91e79e19 PR-804: Added methods to get translation keys for materials, itemstacks and more 426b00d3 PR-795: Add new BiomeParameterPoint passed to BiomeProvider#getBiome 0e91ea52 SPIGOT-7224: Add events for brewing stands and campfires starting their actions CraftBukkit Changes: a50301aa5 Fix issues with fluid tag conversion and fluid #isTagged 6aeb5e4c3 SPIGOT-4569: Implement more BlockData API 7dbf862c2 PR-1131: Added methods to get translation keys for materials, itemstacks and more 7167588b1 PR-1117: Add new BiomeParameterPoint passed to BiomeProvider#getBiome 7c44152eb SPIGOT-7224: Add events for brewing stands and campfires starting their actions
79 lines
3 KiB
Diff
79 lines
3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
|
|
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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/RegionAccessor.java
|
|
+++ b/src/main/java/org/bukkit/RegionAccessor.java
|
|
@@ -0,0 +0,0 @@ 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);
|
|
@@ -0,0 +0,0 @@ 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 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/block/Block.java
|
|
+++ b/src/main/java/org/bukkit/block/Block.java
|
|
@@ -0,0 +0,0 @@ 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
|
|
*
|