Paper/patches/api/0054-Expose-WorldBorder-isInBounds-Location-check.patch
Jake Potrebic 96d5e6ca48
Code Generation for TypedKeys (#9233)
Currently includes generated key holder classes for types
used in the Registry Modification API
2023-11-22 20:56:28 -08:00

30 lines
1.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Sat, 21 Jan 2017 17:03:10 -0600
Subject: [PATCH] Expose WorldBorder#isInBounds(Location) check
diff --git a/src/main/java/org/bukkit/WorldBorder.java b/src/main/java/org/bukkit/WorldBorder.java
index b1c08a7fc5856bcc29ee64d0a87b95a8ac940ddc..3ab5700b0b13fbfbf7c5b0b2c4a90bcc1e0a2d9c 100644
--- a/src/main/java/org/bukkit/WorldBorder.java
+++ b/src/main/java/org/bukkit/WorldBorder.java
@@ -162,4 +162,18 @@ public interface WorldBorder {
* @return The absolute maximum center coordinate of the WorldBorder
*/
public double getMaxCenterCoordinate();
+
+ // Paper start
+ /**
+ * Checks if the location is within the boundaries of this border.
+ *
+ * @param location specific location to check
+ * @return true if the location is within the bounds of this border, false otherwise.
+ * @deprecated use {@link #isInside(Location)} for an upstream compatible replacement
+ */
+ @Deprecated(forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.21")
+ public default boolean isInBounds(@NotNull Location location) {
+ return this.isInside(location);
+ }
+ // Paper end
}