Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this Also, restore a patch that was dropped in the last upstream Bukkit Changes: 279eeab3 Fix command description not being set 96e2bb18 Remove debug print from SyntheticEventTest CraftBukkit Changes: d3ed151 Fix dangerously threaded beacons 217a293 Don't relocate joptsimple to allow --help to work. 1be05a2 Prepare for imminent Java 12 release a49270b Mappings Update 5259d80 SPIGOT-4669: Fix PlayerTeleportEvent coordinates for relative teleports Spigot Changes: e6eb36f2 Rebuild patches
- Loading branch information
1 parent
0976d52
commit ea855e2
Showing
332 changed files
with
1,073 additions
and
843 deletions.
There are no files selected for viewing
276 changes: 276 additions & 0 deletions
276
Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,276 @@ | ||
From 3d1f2e17aa510ecd93069a5adc6ad19795c73797 Mon Sep 17 00:00:00 2001 | ||
From: BillyGalbreath <Blake.Galbreath@GMail.com> | ||
Date: Mon, 18 Jun 2018 00:41:46 -0500 | ||
Subject: [PATCH] Add "getNearbyXXX" methods to Location | ||
|
||
|
||
diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java | ||
index 3387fb477..768af6b15 100644 | ||
--- a/src/main/java/org/bukkit/Location.java | ||
+++ b/src/main/java/org/bukkit/Location.java | ||
@@ -10,6 +10,15 @@ import org.bukkit.util.Vector; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
+// Paper start | ||
+import java.util.Collection; | ||
+import java.util.Collections; | ||
+import java.util.function.Predicate; | ||
+import org.bukkit.entity.Entity; | ||
+import org.bukkit.entity.LivingEntity; | ||
+import org.bukkit.entity.Player; | ||
+// Paper end | ||
+ | ||
/** | ||
* Represents a 3-dimensional position in a world. | ||
* <br> | ||
@@ -531,6 +540,246 @@ public class Location implements Cloneable, ConfigurationSerializable { | ||
centerLoc.setZ(getBlockZ() + 0.5); | ||
return centerLoc; | ||
} | ||
+ | ||
+ /** | ||
+ * Returns a list of entities within a bounding box centered around a Location. | ||
+ * | ||
+ * Some implementations may impose artificial restrictions on the size of the search bounding box. | ||
+ * | ||
+ * @param x 1/2 the size of the box along x axis | ||
+ * @param y 1/2 the size of the box along y axis | ||
+ * @param z 1/2 the size of the box along z axis | ||
+ * @return the collection of entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<Entity> getNearbyEntities(double x, double y, double z) { | ||
+ if (world == null) { | ||
+ throw new IllegalArgumentException("Location has no world"); | ||
+ } | ||
+ return world.getNearbyEntities(this, x, y, z); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param radius X Radius | ||
+ * @return the collection of entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<LivingEntity> getNearbyLivingEntities(double radius) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param xzRadius X/Z Radius | ||
+ * @param yRadius Y Radius | ||
+ * @return the collection of living entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<LivingEntity> getNearbyLivingEntities(double xzRadius, double yRadius) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param xRadius X Radius | ||
+ * @param yRadius Y Radius | ||
+ * @param zRadius Z radius | ||
+ * @return the collection of living entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<LivingEntity> getNearbyLivingEntities(double xRadius, double yRadius, double zRadius) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param radius Radius | ||
+ * @param predicate a predicate used to filter results | ||
+ * @return the collection of living entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<LivingEntity> getNearbyLivingEntities(double radius, @Nullable Predicate<LivingEntity> predicate) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius, predicate); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param xzRadius X/Z Radius | ||
+ * @param yRadius Y Radius | ||
+ * @param predicate a predicate used to filter results | ||
+ * @return the collection of living entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<LivingEntity> getNearbyLivingEntities(double xzRadius, double yRadius, @Nullable Predicate<LivingEntity> predicate) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius, predicate); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param xRadius X Radius | ||
+ * @param yRadius Y Radius | ||
+ * @param zRadius Z radius | ||
+ * @param predicate a predicate used to filter results | ||
+ * @return the collection of living entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<LivingEntity> getNearbyLivingEntities(double xRadius, double yRadius, double zRadius, @Nullable Predicate<LivingEntity> predicate) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius, predicate); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param radius X/Y/Z Radius | ||
+ * @return the collection of players near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<Player> getNearbyPlayers(double radius) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param xzRadius X/Z Radius | ||
+ * @param yRadius Y Radius | ||
+ * @return the collection of players near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<Player> getNearbyPlayers(double xzRadius, double yRadius) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param xRadius X Radius | ||
+ * @param yRadius Y Radius | ||
+ * @param zRadius Z Radius | ||
+ * @return the collection of players near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<Player> getNearbyPlayers(double xRadius, double yRadius, double zRadius) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param radius X/Y/Z Radius | ||
+ * @param predicate a predicate used to filter results | ||
+ * @return the collection of players near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<Player> getNearbyPlayers(double radius, @Nullable Predicate<Player> predicate) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius, predicate); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param xzRadius X/Z Radius | ||
+ * @param yRadius Y Radius | ||
+ * @param predicate a predicate used to filter results | ||
+ * @return the collection of players near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<Player> getNearbyPlayers(double xzRadius, double yRadius, @Nullable Predicate<Player> predicate) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius, predicate); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets nearby players within the specified radius (bounding box) | ||
+ * @param xRadius X Radius | ||
+ * @param yRadius Y Radius | ||
+ * @param zRadius Z Radius | ||
+ * @param predicate a predicate used to filter results | ||
+ * @return the collection of players near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public Collection<Player> getNearbyPlayers(double xRadius, double yRadius, double zRadius, @Nullable Predicate<Player> predicate) { | ||
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius, predicate); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) | ||
+ * @param clazz Type to filter by | ||
+ * @param radius X/Y/Z radius to search within | ||
+ * @param <T> the entity type | ||
+ * @return the collection of entities of type clazz near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double radius) { | ||
+ return getNearbyEntitiesByType(clazz, radius, radius, radius, null); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box) | ||
+ * @param clazz Type to filter by | ||
+ * @param xzRadius X/Z radius to search within | ||
+ * @param yRadius Y radius to search within | ||
+ * @param <T> the entity type | ||
+ * @return the collection of entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double xzRadius, double yRadius) { | ||
+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, null); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) | ||
+ * @param clazz Type to filter by | ||
+ * @param xRadius X Radius | ||
+ * @param yRadius Y Radius | ||
+ * @param zRadius Z Radius | ||
+ * @param <T> the entity type | ||
+ * @return the collection of entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double xRadius, double yRadius, double zRadius) { | ||
+ return getNearbyEntitiesByType(clazz, xRadius, yRadius, zRadius, null); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) | ||
+ * @param clazz Type to filter by | ||
+ * @param radius X/Y/Z radius to search within | ||
+ * @param predicate a predicate used to filter results | ||
+ * @param <T> the entity type | ||
+ * @return the collection of entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double radius, @Nullable Predicate<T> predicate) { | ||
+ return getNearbyEntitiesByType(clazz, radius, radius, radius, predicate); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets all nearby entities of the specified type, within the specified radius, with x and x radius matching (bounding box) | ||
+ * @param clazz Type to filter by | ||
+ * @param xzRadius X/Z radius to search within | ||
+ * @param yRadius Y radius to search within | ||
+ * @param predicate a predicate used to filter results | ||
+ * @param <T> the entity type | ||
+ * @return the collection of entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends T> clazz, double xzRadius, double yRadius, @Nullable Predicate<T> predicate) { | ||
+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, predicate); | ||
+ } | ||
+ | ||
+ /** | ||
+ * Gets all nearby entities of the specified type, within the specified radius (bounding box) | ||
+ * @param clazz Type to filter by | ||
+ * @param xRadius X Radius | ||
+ * @param yRadius Y Radius | ||
+ * @param zRadius Z Radius | ||
+ * @param predicate a predicate used to filter results | ||
+ * @param <T> the entity type | ||
+ * @return the collection of entities near location. This will always be a non-null collection. | ||
+ */ | ||
+ @NotNull | ||
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(@Nullable Class<? extends Entity> clazz, double xRadius, double yRadius, double zRadius, @Nullable Predicate<T> predicate) { | ||
+ if (world == null) { | ||
+ throw new IllegalArgumentException("Location has no world"); | ||
+ } | ||
+ return world.getNearbyEntitiesByType(clazz, this, xRadius, yRadius, zRadius, predicate); | ||
+ } | ||
// Paper end | ||
@Override | ||
public boolean equals(Object obj) { | ||
-- | ||
2.21.0 | ||
|
2 changes: 1 addition & 1 deletion
2
...-Patches/0110-PlayerReadyArrowEvent.patch → ...-Patches/0111-PlayerReadyArrowEvent.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...11-Add-EntityKnockbackByEntityEvent.patch → ...12-Add-EntityKnockbackByEntityEvent.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...I-additions-for-quantity-flags-lore.patch → ...I-additions-for-quantity-flags-lore.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...vingEntity-Hand-Raised-Item-Use-API.patch → ...vingEntity-Hand-Raised-Item-Use-API.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...t-API-Patches/0115-RangedEntity-API.patch → ...t-API-Patches/0116-RangedEntity-API.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...s/0116-Add-World.getEntity-UUID-API.patch → ...s/0117-Add-World.getEntity-UUID-API.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...0117-InventoryCloseEvent-Reason-API.patch → ...0118-InventoryCloseEvent-Reason-API.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...PI-Patches/0118-Entity-getChunk-API.patch → ...PI-Patches/0119-Entity-getChunk-API.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...d-an-asterisk-to-legacy-API-plugins.patch → ...d-an-asterisk-to-legacy-API-plugins.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...API-Patches/0120-EnderDragon-Events.patch → ...API-Patches/0121-EnderDragon-Events.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...es/0121-PlayerLaunchProjectileEvent.patch → ...es/0122-PlayerLaunchProjectileEvent.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Patches/0122-PlayerElytraBoostEvent.patch → ...Patches/0123-PlayerElytraBoostEvent.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Patches/0123-EntityTransformedEvent.patch → ...Patches/0124-EntityTransformedEvent.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
ea855e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failed? I guess it's because of
d3ed1516 Fix dangerously threaded beacons
ea855e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Builds just fine on both the CI server we use for releases and locally.
Perhaps you missed this note in the commit message?
Developers!: You will need to clean up your work/Minecraft/1.13.2 folder for this
ea855e2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is in reference to the commit status, i'll fix it in a sec, travis needs a cache dropping \o/