Paper/patches/api/0291-More-World-API.patch
Nassim Jahnke 789bc79280
Updated Upstream (Bukkit/CraftBukkit/Spigot) (#6457)
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:
c9a46ebf #653: Add World#spawn with randomizeData parameter
e49c2e3a Damageable should extend ItemMeta
01ff04f4 SPIGOT-5880, SPIGOT-5567: New ChunkGenerator API
ca5b4b1a SPIGOT-6697: Deprecate generateTree with BlockChangeDelegate as it does not handle tiles

CraftBukkit Changes:
7c8bbcbe SPIGOT-6716: Preserve the order of stored enchantments of enchanted books.
18027d02 #914: Add World#spawn with randomizeData parameter
3cad0316 SPIGOT-6714: Don't fire PlayerBucketEvent when empty
8c6d60cf Fix server crash with BlockPopulator when entities are at a negative chunk border
4f6bcc84 SPIGOT-5880, SPIGOT-5567: New ChunkGenerator API
78d5b35b SPIGOT-6697: Restore generateTree with BlockChangeDelegate behaviour
15792f0d Rebuild patch
c949675e SPIGOT-6713: Cancelling EntityTransformEvent Causes Deceased Slimes To Not Despawn
a955f15c Fix issues with new ChunkGenerator API
a0a37f41 SPIGOT-6630: Replacing an enchantment on an item creates a conflict error

Spigot Changes:
b166a49b Rebuild patches
3c1fc60a SPIGOT-6693: Composters only take in one item at custom hopper speeds
2021-08-25 09:59:26 +02:00

126 lines
3.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jake Potrebic <jake.m.potrebic@gmail.com>
Date: Tue, 7 Jul 2020 10:53:22 -0700
Subject: [PATCH] More World API
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 00fc240c2da96d937ade789a1110190d6cd79254..59f11b9f36a7fdf7240daf93ea3f2af99d7ec255 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -3434,6 +3434,114 @@ public interface World extends RegionAccessor, WorldInfo, PluginMessageRecipient
@Nullable
public Location locateNearestStructure(@NotNull Location origin, @NotNull StructureType structureType, int radius, boolean findUnexplored);
+ // Paper start
+ /**
+ * Locates the nearest biome based on an origin, biome type, and radius to search.
+ * Step defaults to {@code 8}.
+ *
+ * @param origin Origin location
+ * @param biome Biome to find
+ * @param radius radius to search
+ * @return Location of biome or null if not found in specified radius
+ */
+ @Nullable
+ Location locateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius);
+
+ /**
+ * Locates the nearest biome based on an origin, biome type, and radius to search
+ * and step
+ *
+ * @param origin Origin location
+ * @param biome Biome to find
+ * @param radius radius to search
+ * @param step Search step 1 would mean checking every block, 8 would be every 8th block
+ * @return Location of biome or null if not found in specified radius
+ */
+ @Nullable
+ Location locateNearestBiome(@NotNull Location origin, @NotNull Biome biome, int radius, int step);
+
+ /**
+ * Checks if the world:
+ * <ul>
+ * <li>evaporates water</li>
+ * <li>dries sponges</li>
+ * <li>has lava spread faster and further</li>
+ * </ul>
+ *
+ * @return true if ultrawarm, false if not
+ * @deprecated use {@link #isUltraWarm()}
+ */
+ @Deprecated
+ boolean isUltrawarm();
+
+ /**
+ * Gets the coordinate scaling of this world.
+ *
+ * @return the coordinate scale
+ */
+ double getCoordinateScale();
+
+ /**
+ * Checks if the world has skylight access
+ *
+ * @return whether there is skylight
+ * @deprecated use {@link #hasSkyLight()}
+ */
+ @Deprecated
+ boolean hasSkylight();
+
+ /**
+ * Checks if the world has a bedrock ceiling
+ *
+ * @return whether the world has a bedrock ceiling
+ * @deprecated use {@link #hasCeiling()}
+ */
+ @Deprecated
+ boolean hasBedrockCeiling();
+
+ /**
+ * Checks if beds work
+ *
+ * @return whether beds work
+ * @deprecated use {@link #isBedWorks()}
+ */
+ @Deprecated
+ boolean doesBedWork();
+
+ /**
+ * Checks if respawn anchors work
+ *
+ * @return whether respawn anchors work
+ * @deprecated use {@link #isRespawnAnchorWorks()}
+ */
+ @Deprecated
+ boolean doesRespawnAnchorWork();
+
+ /**
+ * Checks if this world has a fixed time
+ *
+ * @return whether this world has fixed time
+ */
+ boolean isFixedTime();
+
+ /**
+ * Gets the collection of materials that burn infinitely in this world.
+ *
+ * @return the materials that will forever stay lit by fire
+ */
+ @NotNull
+ Collection<Material> getInfiniburn();
+
+ /**
+ * Posts a specified game event at a location
+ *
+ * @param sourceEntity optional source entity
+ * @param gameEvent the game event to post
+ * @param position the position in the world where to post the event to listeners
+ */
+ void sendGameEvent(@Nullable Entity sourceEntity, @NotNull GameEvent gameEvent, @NotNull Vector position);
+ // Paper end
+
// Spigot start
/**
* Returns the view distance used for this world.