From dc5904c56b05f7c5251ec707dbdbc1e013c06208 Mon Sep 17 00:00:00 2001 From: MrFishCakes Date: Tue, 29 Aug 2023 23:23:27 +0100 Subject: [PATCH] Quick Location Maker --- patches/api/0005-Quick-Location-Maker.patch | 45 +++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 patches/api/0005-Quick-Location-Maker.patch diff --git a/patches/api/0005-Quick-Location-Maker.patch b/patches/api/0005-Quick-Location-Maker.patch new file mode 100644 index 0000000..6dcb734 --- /dev/null +++ b/patches/api/0005-Quick-Location-Maker.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: MrFishCakes +Date: Tue, 29 Aug 2023 23:21:19 +0100 +Subject: [PATCH] Quick Location Maker + +Adds a static accessor to create a location + +diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java +index 1bfe465b9aaeea7d3c871140145b7de1b8f1d93d..7cbe6129de9ca043e3fef1a075d4606e1a910b23 100644 +--- a/src/main/java/org/bukkit/Location.java ++++ b/src/main/java/org/bukkit/Location.java +@@ -1200,4 +1200,33 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm + return new Location(world, this.x(), this.y(), this.z(), this.getYaw(), this.getPitch()); + } + // Paper end ++ // Graphite start - Quick Location Maker ++ /** ++ * Create a new instance of a {@link Location} via static accessor. ++ * ++ * @param world The world in which this location resides ++ * @param x The x-coordinate of this new location ++ * @param y The y-coordinate of this new location ++ * @param z The z-coordinate of this new location ++ * @param yaw The absolute rotation on the x-plane, in degrees ++ * @param pitch The absolute rotation on the y-plane, in degrees ++ * @return A new location ++ */ ++ public static @NotNull Location of(@NotNull final World world, final double x, final double y, final double z, final float yaw, final float pitch) { ++ return new Location(world, x, y, z, yaw, pitch); ++ } ++ ++ /** ++ * Create a new instance of a {@link Location} via static accessor. ++ * ++ * @param world The world in which this location resides ++ * @param x The x-coordinate of this new location ++ * @param y The y-coordinate of this new location ++ * @param z The z-coordinate of this new location ++ * @return A new location ++ */ ++ public static @NotNull Location of(@NotNull final World world, final double x, final double y, final double z) { ++ return of(world, x, y, z, 0F, 0F); ++ } ++ // Graphite end - Quick Location Maker + }