Skip to content

Commit

Permalink
Updated Upstream (Bukkit/CraftBukkit/Spigot)
Browse files Browse the repository at this point in the history
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
electronicboy committed Mar 20, 2019
1 parent 0976d52 commit ea855e2
Show file tree
Hide file tree
Showing 332 changed files with 1,073 additions and 843 deletions.
276 changes: 276 additions & 0 deletions Spigot-API-Patches/0110-Add-getNearbyXXX-methods-to-Location.patch
@@ -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

@@ -1,4 +1,4 @@
From 7d9404735f62f21ff8abdfd04ff311e83f8f4450 Mon Sep 17 00:00:00 2001
From 3cda6a60572fc259cad45a8139459d64f5e612de Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 18 Jun 2018 01:09:27 -0400
Subject: [PATCH] PlayerReadyArrowEvent
Expand Down
@@ -1,4 +1,4 @@
From acf227fce14d905b08ae26e7dc84a1b5b1d058ce Mon Sep 17 00:00:00 2001
From e511b78eb2bf54d781d89bcfb556bf3c152242ac Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Mon, 18 Jun 2018 15:40:39 +0200
Subject: [PATCH] Add EntityKnockbackByEntityEvent
Expand Down
@@ -1,12 +1,12 @@
From 131511b623888266c1f263c0a85cd91ab890dff9 Mon Sep 17 00:00:00 2001
From 9724f0d2d9d912f2d6c523950ddb5257b4e793df Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 19 Dec 2017 16:24:42 -0500
Subject: [PATCH] Expand Explosions API

Add Entity as a Source capability, and add more API choices, and on Location.

diff --git a/src/main/java/org/bukkit/Location.java b/src/main/java/org/bukkit/Location.java
index 3387fb477..56be7e5fa 100644
index 768af6b15..e57e22a21 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -5,6 +5,7 @@ import java.util.Map;
Expand All @@ -17,11 +17,10 @@ index 3387fb477..56be7e5fa 100644
import org.bukkit.util.NumberConversions;
import org.bukkit.util.Vector;
import org.jetbrains.annotations.NotNull;
@@ -531,6 +532,87 @@ public class Location implements Cloneable, ConfigurationSerializable {
centerLoc.setZ(getBlockZ() + 0.5);
@@ -541,6 +542,87 @@ public class Location implements Cloneable, ConfigurationSerializable {
return centerLoc;
}
+
+ /**
+ * Creates explosion at this location with given power
+ *
Expand Down Expand Up @@ -102,9 +101,10 @@ index 3387fb477..56be7e5fa 100644
+ public boolean createExplosion(@NotNull Entity source, float power, boolean setFire, boolean breakBlocks) {
+ return world.createExplosion(source, source.getLocation(), power, setFire, breakBlocks);
+ }
// Paper end
@Override
public boolean equals(Object obj) {
+
/**
* Returns a list of entities within a bounding box centered around a Location.
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index bec405feb..dcc47cde5 100644
--- a/src/main/java/org/bukkit/World.java
Expand Down
@@ -1,4 +1,4 @@
From 639b480d0adabe542928fc67eb429075a4165e3d Mon Sep 17 00:00:00 2001
From 4d3cc2c3c2ad606f01cea7d7be635e7ef1dd9e4a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 22 Jun 2018 22:59:18 -0400
Subject: [PATCH] ItemStack API additions for quantity/flags/lore
Expand Down
@@ -1,4 +1,4 @@
From 73b751f99086d330a0ae7ee23ef86bc7285ce418 Mon Sep 17 00:00:00 2001
From f2d5cff8c7433166cab3ee3e4558b43f7ac9ded1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Fri, 29 Jun 2018 00:19:19 -0400
Subject: [PATCH] LivingEntity Hand Raised/Item Use API
Expand Down
@@ -1,4 +1,4 @@
From 1714ba00b49694e8134e075d1efcc2258213de83 Mon Sep 17 00:00:00 2001
From 4edc97bf2dd769c484114310a58e1588666e9a12 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 26 Jun 2018 21:34:40 -0400
Subject: [PATCH] RangedEntity API
Expand Down
@@ -1,4 +1,4 @@
From 19a954d1f19d9c3d5211d42c13b11991e61f5359 Mon Sep 17 00:00:00 2001
From 99845fa0f02668b5e2832bf55b82ad4ac15a7fe0 Mon Sep 17 00:00:00 2001
From: Brokkonaut <hannos17@gmx.de>
Date: Tue, 3 Jul 2018 16:07:16 +0200
Subject: [PATCH] Add World.getEntity(UUID) API
Expand Down
@@ -1,4 +1,4 @@
From 67edac3ee5ed7a4ccc201a7fa1ce0380146edc36 Mon Sep 17 00:00:00 2001
From 6e0d5f987f21ccf9cb93bb8fafaece4a7e066736 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 3 Jul 2018 21:52:52 -0400
Subject: [PATCH] InventoryCloseEvent Reason API
Expand Down
@@ -1,4 +1,4 @@
From d25016411d092dd36d7e807178a41c8234563559 Mon Sep 17 00:00:00 2001
From dc0c46f1dc30775f7790fca15bfcf4ec99f40fc2 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 4 Jul 2018 02:25:48 -0400
Subject: [PATCH] Entity#getChunk API
Expand Down
@@ -1,4 +1,4 @@
From 839637a0c0acddcbe5b6089b22ca43c304297616 Mon Sep 17 00:00:00 2001
From 607c463ca170254672f70fd10b81157db6b8b114 Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 19 Jul 2018 15:07:02 -0500
Subject: [PATCH] Add an asterisk to legacy API plugins
Expand Down
@@ -1,4 +1,4 @@
From 3277130260cb38dff43dc2bd7729a7853200b224 Mon Sep 17 00:00:00 2001
From ca66c23763bf5a5e99d61b42651f0070e61b931d Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 21 Jul 2018 01:51:05 -0500
Subject: [PATCH] EnderDragon Events
Expand Down
@@ -1,4 +1,4 @@
From 41a26a4f7bcee9d007e63faf6b8eddcea3ddb64d Mon Sep 17 00:00:00 2001
From 6739996e04cca7984ebc73aedb8b09594575bee3 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 21 Jul 2018 03:10:50 -0500
Subject: [PATCH] PlayerLaunchProjectileEvent
Expand Down
@@ -1,4 +1,4 @@
From 512606bd2ea928ab0c900d85440f8107a17fa26f Mon Sep 17 00:00:00 2001
From e499534f205a08bf1a17dcde59e8b0339d4c1b27 Mon Sep 17 00:00:00 2001
From: BillyGalbreath <Blake.Galbreath@GMail.com>
Date: Sat, 21 Jul 2018 01:59:53 -0500
Subject: [PATCH] PlayerElytraBoostEvent
Expand Down
@@ -1,4 +1,4 @@
From 5b2eff30f6fc1cf8f9794b1599d1d92eb76928d6 Mon Sep 17 00:00:00 2001
From 7d3567b6c8679fa401dd7a9a51f1d538b956e539 Mon Sep 17 00:00:00 2001
From: Anthony MacAllister <anthonymmacallister@gmail.com>
Date: Thu, 26 Jul 2018 15:28:53 -0400
Subject: [PATCH] EntityTransformedEvent
Expand Down

3 comments on commit ea855e2

@cakoyo
Copy link
Contributor

@cakoyo cakoyo commented on ea855e2 Mar 20, 2019

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

@zachbr
Copy link
Contributor

@zachbr zachbr commented on ea855e2 Mar 20, 2019

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

@electronicboy
Copy link
Member Author

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/

Please sign in to comment.