Use ? super in Consumer/Predicate API (#9939)

This commit is contained in:
Jake Potrebic 2023-11-25 15:03:02 -08:00 committed by GitHub
parent f9938d3949
commit b37bbcfd98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 240 additions and 277 deletions

View file

@ -6,18 +6,20 @@ Subject: [PATCH] Expand Location Manipulation API
Adds set(x, y, z), add(base, x, y, z), subtract(base, x, y, z);
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde..aa6821aa33d3c579a139bd7c0378253c43b3754a 100644
index 14aa275b0fb89d361ee5ec690684053e5e8b4e11..189c2159941712a6f22bb5aaf1e8ca80b4eb54f6 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -546,6 +546,54 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
@@ -545,6 +545,59 @@ public class Location implements Cloneable, ConfigurationSerializable, io.paperm
public boolean isChunkLoaded() { return this.getWorld().isChunkLoaded(locToBlock(x) >> 4, locToBlock(z) >> 4); } // Paper
// Paper start
+ // Paper start - expand location manipulation API
+
+ /**
+ * Sets the position of this Location and returns itself
+ *
+ * <p>
+ * This mutates this object, clone first.
+ *
+ * @param x X coordinate
+ * @param y Y coordinate
+ * @param z Z coordinate
@ -33,8 +35,9 @@ index b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde..aa6821aa33d3c579a139bd7c0378253c
+
+ /**
+ * Takes the x/y/z from base and adds the specified x/y/z to it and returns self
+ *
+ * <p>
+ * This mutates this object, clone first.
+ *
+ * @param base The base coordinate to modify
+ * @param x X coordinate to add to base
+ * @param y Y coordinate to add to base
@ -48,8 +51,9 @@ index b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde..aa6821aa33d3c579a139bd7c0378253c
+
+ /**
+ * Takes the x/y/z from base and subtracts the specified x/y/z to it and returns self
+ *
+ * <p>
+ * This mutates this object, clone first.
+ *
+ * @param base The base coordinate to modify
+ * @param x X coordinate to subtract from base
+ * @param y Y coordinate to subtract from base
@ -60,7 +64,8 @@ index b7ff09ffdd3aecc1843d175bc76fe5fae1f48dde..aa6821aa33d3c579a139bd7c0378253c
+ public Location subtract(@NotNull Location base, double x, double y, double z) {
+ return this.set(base.x - x, base.y - y, base.z - z);
+ }
+ // Paper end - expand location manipulation API
+
// Paper start - expand Location API
/**
* @return A new location where X/Y/Z are on the Block location (integer value of X/Y/Z)
*/