Cleanup javadoc warnings

This commit is contained in:
Shane Freeder 2018-08-16 12:20:58 +01:00
parent 6e2711d666
commit 4f4a4fc100
No known key found for this signature in database
GPG Key ID: A3F61EA5A085289C
20 changed files with 257 additions and 116 deletions

View File

@ -1,4 +1,4 @@
From 8a79fb272338e01bf067f3a27797b26311e25815 Mon Sep 17 00:00:00 2001
From 4de1d10c76e74caa93a1c41fe7708c76183e0d16 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 15 Jan 2018 21:46:46 -0500
Subject: [PATCH] Basic PlayerProfile API
@ -7,10 +7,10 @@ Provides basic elements of a PlayerProfile to be used by future API/events
diff --git a/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
new file mode 100644
index 00000000..e060c38a
index 000000000..62f7aa2c8
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
@@ -0,0 +1,149 @@
@@ -0,0 +1,151 @@
+package com.destroystokyo.paper.profile;
+
+import com.mojang.authlib.GameProfile;
@ -142,6 +142,7 @@ index 00000000..e060c38a
+ * This is a blocking operation and should be done asynchronously.
+ *
+ * Optionally will also fill textures.
+ * @param textures controls if we should fill the profile with texture properties
+ * @return If the profile is now complete (has UUID and Name) (if you get rate limited, this operation may fail)
+ */
+ boolean complete(boolean textures);
@ -156,13 +157,14 @@ index 00000000..e060c38a
+
+ /**
+ * @deprecated Will be removed in 1.13
+ * @return the GameProfile for this PlayerProfile
+ */
+ @Deprecated
+ GameProfile getGameProfile();
+}
diff --git a/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java b/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java
new file mode 100644
index 00000000..d17061e6
index 000000000..d17061e66
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/ProfileProperty.java
@@ -0,0 +1,72 @@
@ -239,7 +241,7 @@ index 00000000..d17061e6
+ }
+}
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
index ed403c33..690d9c07 100644
index ed403c333..690d9c071 100644
--- a/src/main/java/org/bukkit/Bukkit.java
+++ b/src/main/java/org/bukkit/Bukkit.java
@@ -44,6 +44,9 @@ import org.bukkit.generator.ChunkGenerator;
@ -291,7 +293,7 @@ index ed403c33..690d9c07 100644
public static Server.Spigot spigot()
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index 87ab9d2b..f2ee6516 100644
index 87ab9d2b8..f2ee6516e 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -45,6 +45,9 @@ import org.bukkit.generator.ChunkGenerator;
@ -336,5 +338,5 @@ index 87ab9d2b..f2ee6516 100644
// Paper end
}
--
2.16.2
2.18.0

View File

@ -1,11 +1,11 @@
From 3fe26d396837d1f3aad927133722332e4d1f7b51 Mon Sep 17 00:00:00 2001
From ea0fde004ae78c943abd4f37b26bc00cd370a642 Mon Sep 17 00:00:00 2001
From: willies952002 <admin@domnian.com>
Date: Thu, 20 Jul 2017 18:05:36 -0400
Subject: [PATCH] Allow Changing of Player Sample in ServerListPingEvent
diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
index 3c38d857..cb8d0fcd 100644
index 3c38d8573..a293bc212 100644
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
@@ -2,6 +2,7 @@ package org.bukkit.event.server;
@ -16,7 +16,7 @@ index 3c38d857..cb8d0fcd 100644
import org.apache.commons.lang.Validate;
import org.bukkit.entity.Player;
@@ -145,4 +146,25 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
@@ -145,4 +146,27 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
public Iterator<Player> iterator() throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
@ -26,6 +26,7 @@ index 3c38d857..cb8d0fcd 100644
+
+ /**
+ * @deprecated Will be replaced in 1.13
+ * @param sample the new player list sample
+ */
+ @Deprecated
+ public void setSampleText(java.util.List<String> sample) {
@ -34,6 +35,7 @@ index 3c38d857..cb8d0fcd 100644
+
+ /**
+ * @deprecated Will be replaced in 1.13
+ * @return the player list sample
+ */
+ @Deprecated
+ public java.util.List<String> getSampleText() {
@ -43,5 +45,5 @@ index 3c38d857..cb8d0fcd 100644
+
}
--
2.15.1
2.18.0

View File

@ -1,4 +1,4 @@
From 69a0afed643918933b0ad8f6d81780dafa33cf6b Mon Sep 17 00:00:00 2001
From 95b96d1f00b60025a37c01dc679702b835a1d78d Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 3 Jul 2017 18:11:34 -0500
Subject: [PATCH] ProfileWhitelistVerifyEvent
@ -9,10 +9,10 @@ Allows you to do dynamic whitelisting and change of kick message
diff --git a/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java
new file mode 100644
index 00000000..662e79e3
index 000000000..199daf2b3
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java
@@ -0,0 +1,120 @@
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2017 - Daniel Ennis (Aikar) - MIT License
+ *
@ -67,7 +67,7 @@ index 00000000..662e79e3
+ }
+
+ /**
+ * Gets the currently planned message to send to the user if they are not whitelisted
+ * @return the currently planned message to send to the user if they are not whitelisted
+ */
+ public String getKickMessage() {
+ return kickMessage;
@ -81,7 +81,7 @@ index 00000000..662e79e3
+ }
+
+ /**
+ * The gameprofile of the player trying to connect
+ * @return the gameprofile of the player trying to connect
+ * @deprecated Will be removed in 1.13, use #{@link #getPlayerProfile()}
+ */
+ @Deprecated
@ -97,7 +97,7 @@ index 00000000..662e79e3
+ }
+
+ /**
+ * Whether the player is whitelisted to play on this server (whitelist may be off is why its true)
+ * @return Whether the player is whitelisted to play on this server (whitelist may be off is why its true)
+ */
+ public boolean isWhitelisted() {
+ return whitelisted;
@ -105,20 +105,21 @@ index 00000000..662e79e3
+
+ /**
+ * Changes the players whitelisted state. false will deny the login
+ * @param whitelisted The new whitelisted state
+ */
+ public void setWhitelisted(boolean whitelisted) {
+ this.whitelisted = whitelisted;
+ }
+
+ /**
+ * Returns if the player obtained whitelist status by having op
+ * @return if the player obtained whitelist status by having op
+ */
+ public boolean isOp() {
+ return isOp;
+ }
+
+ /**
+ * Returns if the server even has whitelist on
+ * @return if the server even has whitelist on
+ */
+ public boolean isWhitelistEnabled() {
+ return whitelistEnabled;
@ -134,5 +135,5 @@ index 00000000..662e79e3
+ }
+}
--
2.15.1
2.18.0

View File

@ -1,4 +1,4 @@
From ce5e52c29872bfca3e47d91777b075db4ce21d20 Mon Sep 17 00:00:00 2001
From 8633560ddd13cc2432790a2558dc16964351038b Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 26 Nov 2017 13:17:09 -0500
Subject: [PATCH] AsyncTabCompleteEvent
@ -13,7 +13,7 @@ completion, such as offline players.
diff --git a/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
new file mode 100644
index 00000000..3071320e
index 000000000..3c51aaf92
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
@@ -0,0 +1,168 @@
@ -154,7 +154,7 @@ index 00000000..3071320e
+ * If true, the standard process of calling {@link Command#tabComplete(CommandSender, String, String[])}
+ * or current player names will not be called.
+ *
+ * @param handled
+ * @param handled if this completion should be marked as being handled
+ */
+ public void setHandled(boolean handled) {
+ this.handled = handled;
@ -170,7 +170,7 @@ index 00000000..3071320e
+
+ /**
+ * Will provide no completions, and will not fire the synchronous process
+ * @param cancelled
+ * @param cancelled true if you wish to cancel this event
+ */
+ @Override
+ public void setCancelled(boolean cancelled) {
@ -186,7 +186,7 @@ index 00000000..3071320e
+ }
+}
diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
index 6ac437d5..df6eb53d 100644
index 6ac437d5e..df6eb53da 100644
--- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
+++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
@@ -1,5 +1,6 @@
@ -247,5 +247,5 @@ index 6ac437d5..df6eb53d 100644
@Override
--
2.15.1
2.18.0

View File

@ -1,4 +1,4 @@
From 6634c8cb6d911a9a2f4a4c9a75086cce90195078 Mon Sep 17 00:00:00 2001
From 4b81c4f5596c099e399669521044d64f39013c7a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 20 Dec 2017 17:38:07 -0500
Subject: [PATCH] Ability to apply mending to XP API
@ -10,7 +10,7 @@ of giving the player experience points.
Both an API To standalone mend, and apply mending logic to .giveExp has been added.
diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 23cc8b5e..a882323d 100644
index 23cc8b5e9..aa218f497 100644
--- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java
@@ -918,12 +918,33 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@ -40,8 +40,8 @@ index 23cc8b5e..a882323d 100644
+ *
+ * Can also be called with {@link #giveExp(int, boolean)} by passing true to applyMending
+ *
+ * @param amount
+ * @return
+ * @param amount Exp to apply
+ * @return the remaining experience
+ */
+ public int applyMending(int amount);
+ // Paper end
@ -49,5 +49,5 @@ index 23cc8b5e..a882323d 100644
/**
* Gives the player the amount of experience levels specified. Levels can
--
2.17.1
2.18.0

View File

@ -1,11 +1,11 @@
From d35e326f5e55fa14cdf9b1eacba970704ddcc16e Mon Sep 17 00:00:00 2001
From 73668957aa1621c7fb91a27bd4cd05ece98b4cd8 Mon Sep 17 00:00:00 2001
From: Minecrell <minecrell@minecrell.net>
Date: Mon, 27 Nov 2017 16:21:19 +0100
Subject: [PATCH] Implement deprecated player sample API
diff --git a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java
index dd1deafd..db992df2 100644
index dd1deafdb..db992df24 100644
--- a/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java
+++ b/src/main/java/com/destroystokyo/paper/event/server/PaperServerListPingEvent.java
@@ -4,6 +4,7 @@ import static java.util.Objects.requireNonNull;
@ -43,7 +43,7 @@ index dd1deafd..db992df2 100644
+
}
diff --git a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
index cb8d0fcd..116d7c7a 100644
index a293bc212..f552eab18 100644
--- a/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
+++ b/src/main/java/org/bukkit/event/server/ServerListPingEvent.java
@@ -4,6 +4,7 @@ import java.net.InetAddress;
@ -60,18 +60,18 @@ index cb8d0fcd..116d7c7a 100644
/**
- * @deprecated Will be replaced in 1.13
+ * @deprecated Will be removed in 1.13, use {@link PaperServerListPingEvent#getPlayerSample()}
* @param sample the new player list sample
*/
@Deprecated
public void setSampleText(java.util.List<String> sample) {
@@ -159,7 +160,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
@@ -160,7 +161,7 @@ public class ServerListPingEvent extends ServerEvent implements Iterable<Player>
}
/**
- * @deprecated Will be replaced in 1.13
+ * @deprecated Will be removed in 1.13, use {@link PaperServerListPingEvent#getPlayerSample()}
* @return the player list sample
*/
@Deprecated
public java.util.List<String> getSampleText() {
--
2.17.1
2.18.0

View File

@ -1,4 +1,4 @@
From bca4856590062be45da5792be0600f138ec97b03 Mon Sep 17 00:00:00 2001
From 248997582dca23978e9d01d1eaa264ab114f6a08 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 30 Apr 2018 17:55:28 -0400
Subject: [PATCH] Additional world.getNearbyEntities API's
@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 0bc47dd6..3b81f81e 100644
index 0bc47dd6e..8d29ede0a 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -2,11 +2,14 @@ package org.bukkit;
@ -24,7 +24,7 @@ index 0bc47dd6..3b81f81e 100644
import org.bukkit.block.Biome;
import org.bukkit.block.Block;
@@ -534,6 +537,205 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -534,6 +537,238 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public Collection<Entity> getEntitiesByClasses(Class<?>... classes);
@ -32,7 +32,8 @@ index 0bc47dd6..3b81f81e 100644
+ /**
+ * Gets nearby players within the specified radius (bounding box)
+ * @param loc Center location
+ * @param radius X Radius
+ * @param radius Radius
+ * @return the collection of entities near location. This will always be a non-null collection.
+ */
+ public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double radius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius);
@ -43,6 +44,7 @@ index 0bc47dd6..3b81f81e 100644
+ * @param loc Center location
+ * @param xzRadius X/Z Radius
+ * @param yRadius Y Radius
+ * @return the collection of entities near location. This will always be a non-null collection.
+ */
+ public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius);
@ -54,6 +56,7 @@ index 0bc47dd6..3b81f81e 100644
+ * @param xRadius X Radius
+ * @param yRadius Y Radius
+ * @param zRadius Z radius
+ * @return the collection of entities near location. This will always be a non-null collection.
+ */
+ public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius);
@ -63,6 +66,8 @@ index 0bc47dd6..3b81f81e 100644
+ * Gets nearby players within the specified radius (bounding box)
+ * @param loc Center location
+ * @param radius X 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
+ */
+ public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double radius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius, predicate);
@ -73,6 +78,8 @@ index 0bc47dd6..3b81f81e 100644
+ * @param loc Center location
+ * @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
+ */
+ public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double xzRadius, double yRadius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius, predicate);
@ -84,6 +91,8 @@ index 0bc47dd6..3b81f81e 100644
+ * @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.
+ */
+ public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double xRadius, double yRadius, double zRadius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius, predicate);
@ -93,6 +102,7 @@ index 0bc47dd6..3b81f81e 100644
+ * Gets nearby players within the specified radius (bounding box)
+ * @param loc Center location
+ * @param radius X/Y/Z Radius
+ * @return the collection of living entities near location. This will always be a non-null collection.
+ */
+ public default Collection<Player> getNearbyPlayers(Location loc, double radius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius);
@ -103,6 +113,7 @@ index 0bc47dd6..3b81f81e 100644
+ * @param loc Center location
+ * @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.
+ */
+ public default Collection<Player> getNearbyPlayers(Location loc, double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius);
@ -114,6 +125,7 @@ index 0bc47dd6..3b81f81e 100644
+ * @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.
+ */
+ public default Collection<Player> getNearbyPlayers(Location loc, double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius);
@ -123,6 +135,8 @@ index 0bc47dd6..3b81f81e 100644
+ * Gets nearby players within the specified radius (bounding box)
+ * @param loc Center location
+ * @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.
+ */
+ public default Collection<Player> getNearbyPlayers(Location loc, double radius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius, predicate);
@ -133,6 +147,8 @@ index 0bc47dd6..3b81f81e 100644
+ * @param loc Center location
+ * @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.
+ */
+ public default Collection<Player> getNearbyPlayers(Location loc, double xzRadius, double yRadius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius, predicate);
@ -144,6 +160,8 @@ index 0bc47dd6..3b81f81e 100644
+ * @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.
+ */
+ public default Collection<Player> getNearbyPlayers(Location loc, double xRadius, double yRadius, double zRadius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius, predicate);
@ -154,6 +172,8 @@ index 0bc47dd6..3b81f81e 100644
+ * @param clazz Type to filter by
+ * @param loc Center location
+ * @param radius X/Y/Z radius to search within
+ * @param <T> the entity type
+ * @return the collection of entities near location. This will always be a non-null collection.
+ */
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, Location loc, double radius) {
+ return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, null);
@ -165,6 +185,8 @@ index 0bc47dd6..3b81f81e 100644
+ * @param loc Center location
+ * @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.
+ */
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, Location loc, double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, null);
@ -177,6 +199,8 @@ index 0bc47dd6..3b81f81e 100644
+ * @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.
+ */
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, Location loc, double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(clazz, loc, xRadius, yRadius, zRadius, null);
@ -187,6 +211,9 @@ index 0bc47dd6..3b81f81e 100644
+ * @param clazz Type to filter by
+ * @param loc Center location
+ * @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.
+ */
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, Location loc, double radius, Predicate<T> predicate) {
+ return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, predicate);
@ -198,19 +225,25 @@ index 0bc47dd6..3b81f81e 100644
+ * @param loc Center location
+ * @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.
+ */
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, Location loc, double xzRadius, double yRadius, Predicate<T> predicate) {
+ return getNearbyEntitiesByType(clazz, loc, 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 loc Center location
+ * @param xRadius X Radius
+ * @param yRadius Y Radius
+ * @param zRadius Z Radius
+ */
+ * Gets all nearby entities of the specified type, within the specified radius (bounding box)
+ * @param clazz Type to filter by
+ * @param loc Center location
+ * @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.
+ */
+ public default <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends Entity> clazz, Location loc, double xRadius, double yRadius, double zRadius, Predicate<T> predicate) {
+ if (clazz == null) {
+ clazz = Entity.class;
@ -231,5 +264,5 @@ index 0bc47dd6..3b81f81e 100644
* Get a list of all players in this World
*
--
2.17.1
2.18.0

View File

@ -1,4 +1,4 @@
From ff3c644d6400800a4beba62ff9529f9f74a9282c Mon Sep 17 00:00:00 2001
From 75904952f2b86d366b6d620425b908832c554dee Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 29 Aug 2017 23:58:48 -0400
Subject: [PATCH] Expand World.spawnParticle API and add Builder
@ -11,10 +11,10 @@ This adds a new Builder API which is much friendlier to use.
diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
new file mode 100644
index 00000000..f7aa162f
index 000000000..feebfb653
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
@@ -0,0 +1,378 @@
@@ -0,0 +1,416 @@
+package com.destroystokyo.paper;
+
+import com.google.common.collect.Lists;
@ -52,6 +52,8 @@ index 00000000..f7aa162f
+ /**
+ * Sends the particle to all receiving players (or all).
+ * This method is safe to use Asynchronously
+ *
+ * @return a reference to this object.
+ */
+ public ParticleBuilder spawn() {
+ if (this.location == null) {
@ -74,6 +76,7 @@ index 00000000..f7aa162f
+ /**
+ * Changes what particle will be sent
+ * @param particle The particle
+ * @return a reference to this object.
+ */
+ public ParticleBuilder particle(Particle particle) {
+ this.particle = particle;
@ -105,6 +108,7 @@ index 00000000..f7aa162f
+ * Sends this particle to all players in the world. This is rather silly and you should likely not be doing this.
+ *
+ * Just be a logical person and use receivers by radius or collection.
+ * @return a reference to this object.
+ */
+ public ParticleBuilder allPlayers() {
+ this.receivers = null;
@ -113,6 +117,7 @@ index 00000000..f7aa162f
+
+ /**
+ * @param receivers List of players to receive this particle, or null for all players in the world
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(@Nullable List<Player> receivers) {
+ // Had to keep this as we first made API List<> and not Collection, but removing this may break plugins compiled on older jars
@ -123,6 +128,7 @@ index 00000000..f7aa162f
+
+ /**
+ * @param receivers List of players to receive this particle, or null for all players in the world
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(@Nullable Collection<Player> receivers) {
+ this.receivers = receivers != null ? Lists.newArrayList(receivers) : null;
@ -131,6 +137,7 @@ index 00000000..f7aa162f
+
+ /**
+ * @param receivers List of players to be receive this particle, or null for all players in the world
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(Player... receivers) {
+ this.receivers = receivers != null ? Lists.newArrayList(receivers) : null;
@ -142,6 +149,7 @@ index 00000000..f7aa162f
+ * If you want a more spherical check, see {@link #receivers(int, boolean)}
+ *
+ * @param radius amount to add on all axis
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int radius) {
+ return receivers(radius, radius);
@ -153,6 +161,7 @@ index 00000000..f7aa162f
+ * If byDistance is true, radius is tested by distance in a spherical shape
+ * @param radius amount to add on each axis
+ * @param byDistance true to use a spherical radius, false to use a cuboid
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int radius, boolean byDistance) {
+ if (!byDistance) {
@ -181,6 +190,7 @@ index 00000000..f7aa162f
+ *
+ * @param xzRadius amount to add on the x/z axis
+ * @param yRadius amount to add on the y axis
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int xzRadius, int yRadius) {
+ return receivers(xzRadius, yRadius, xzRadius);
@ -193,6 +203,7 @@ index 00000000..f7aa162f
+ * @param xzRadius amount to add on the x/z axis
+ * @param yRadius amount to add on the y axis
+ * @param byDistance true to use a cylinder shape, false to use cuboid
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int xzRadius, int yRadius, boolean byDistance) {
+ if (!byDistance) {
@ -223,6 +234,7 @@ index 00000000..f7aa162f
+ * @param xRadius amount to add on the x axis
+ * @param yRadius amount to add on the y axis
+ * @param zRadius amount to add on the z axis
+ * @return a reference to this object.
+ */
+ public ParticleBuilder receivers(int xRadius, int yRadius, int zRadius) {
+ if (location == null) {
@ -241,6 +253,7 @@ index 00000000..f7aa162f
+ /**
+ * Sets the source of this particle for visibility concerns (Vanish API)
+ * @param source The player who is considered the source
+ * @return a reference to this object.
+ */
+ public ParticleBuilder source(Player source) {
+ this.source = source;
@ -257,6 +270,7 @@ index 00000000..f7aa162f
+ /**
+ * Sets the location of where to spawn the particle
+ * @param location The location of the particle
+ * @return a reference to this object.
+ */
+ public ParticleBuilder location(Location location) {
+ this.location = location.clone();
@ -269,6 +283,7 @@ index 00000000..f7aa162f
+ * @param x X location
+ * @param y Y location
+ * @param z Z location
+ * @return a reference to this object.
+ */
+ public ParticleBuilder location(World world, double x, double y, double z) {
+ this.location = new Location(world, x, y, z);
@ -285,6 +300,7 @@ index 00000000..f7aa162f
+ /**
+ * Sets the number of particles to spawn
+ * @param count Number of particles
+ * @return a reference to this object.
+ */
+ public ParticleBuilder count(int count) {
+ this.count = count;
@ -293,18 +309,21 @@ index 00000000..f7aa162f
+
+ /**
+ * Particle offset X. Varies by particle on how this is used
+ * @return Particle offset X.
+ */
+ public double offsetX() {
+ return offsetX;
+ }
+ /**
+ * Particle offset Y. Varies by particle on how this is used
+ * @return Particle offset Y.
+ */
+ public double offsetY() {
+ return offsetY;
+ }
+ /**
+ * Particle offset Z. Varies by particle on how this is used
+ * @return Particle offset Z.
+ */
+ public double offsetZ() {
+ return offsetZ;
@ -312,6 +331,10 @@ index 00000000..f7aa162f
+
+ /**
+ * Sets the particle offset. Varies by particle on how this is used
+ * @param offsetX Particle offset X
+ * @param offsetY Particle offset Y
+ * @param offsetZ Particle offset Z
+ * @return a reference to this object.
+ */
+ public ParticleBuilder offset(double offsetX, double offsetY, double offsetZ) {
+ this.offsetX = offsetX;
@ -322,6 +345,7 @@ index 00000000..f7aa162f
+
+ /**
+ * Gets the Particle extra data. Varies by particle on how this is used
+ * @return the extra particle data
+ */
+ public double extra() {
+ return extra;
@ -329,6 +353,8 @@ index 00000000..f7aa162f
+
+ /**
+ * Sets the particle extra data. Varies by particle on how this is used
+ * @param extra the extra particle data
+ * @return a reference to this object.
+ */
+ public ParticleBuilder extra(double extra) {
+ this.extra = extra;
@ -337,6 +363,8 @@ index 00000000..f7aa162f
+
+ /**
+ * Gets the particle custom data. Varies by particle on how this is used
+ * @param <T> The Particle data type
+ * @return the ParticleData for this particle
+ */
+ public <T> T data() {
+ //noinspection unchecked
@ -345,6 +373,9 @@ index 00000000..f7aa162f
+
+ /**
+ * Sets the particle custom data. Varies by particle on how this is used
+ * @param data The new particle data
+ * @param <T> The Particle data type
+ * @return a reference to this object.
+ */
+ public <T> ParticleBuilder data(T data) {
+ this.data = data;
@ -357,6 +388,7 @@ index 00000000..f7aa162f
+ * If false, the particle will show according to the client's particle settings.
+ *
+ * @param force true to force, false for normal
+ * @return a reference to this object.
+ */
+ public ParticleBuilder force(boolean force) {
+ this.force = force;
@ -366,6 +398,8 @@ index 00000000..f7aa162f
+ /**
+ * Sets the particle Color.
+ * Only valid for REDSTONE, SPELL_MOB and SPELL_MOB_AMBIENT.
+ * @param color the new particle color
+ * @return a reference to this object.
+ */
+ public ParticleBuilder color(Color color) {
+ return color(color.getRed(), color.getGreen(), color.getBlue());
@ -374,6 +408,10 @@ index 00000000..f7aa162f
+ /**
+ * Sets the particle Color.
+ * Only valid for REDSTONE, SPELL_MOB and SPELL_MOB_AMBIENT.
+ * @param r red color component
+ * @param g green color component
+ * @param b blue color component
+ * @return a reference to this object.
+ */
+ public ParticleBuilder color(int r, int g, int b) {
+ if (particle != Particle.REDSTONE && particle != Particle.SPELL_MOB && particle != Particle.SPELL_MOB_AMBIENT) {
@ -394,10 +432,10 @@ index 00000000..f7aa162f
+ }
+}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 9794c13e..cc9c2c5e 100644
index 9794c13e5..6582e51f2 100644
--- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java
@@ -71,4 +71,13 @@ public enum Particle {
@@ -71,4 +71,15 @@ public enum Particle {
public Class<?> getDataType() {
return dataType;
}
@ -405,6 +443,8 @@ index 9794c13e..cc9c2c5e 100644
+ // Paper start - Particle API expansion
+ /**
+ * Creates a {@link com.destroystokyo.paper.ParticleBuilder}
+ *
+ * @return a {@link com.destroystokyo.paper.ParticleBuilder} for the particle
+ */
+ public com.destroystokyo.paper.ParticleBuilder builder() {
+ return new com.destroystokyo.paper.ParticleBuilder(this);
@ -412,10 +452,10 @@ index 9794c13e..cc9c2c5e 100644
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 3b81f81e..114e81dd 100644
index 8d29ede0a..b983bdc54 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -1775,7 +1775,57 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -1808,7 +1808,57 @@ public interface World extends PluginMessageRecipient, Metadatable {
* the type of this depends on {@link Particle#getDataType()}
* @param <T> Type
*/
@ -475,5 +515,5 @@ index 3b81f81e..114e81dd 100644
// Spigot start
public class Spigot
--
2.16.1.windows.1
2.18.0

View File

@ -1,4 +1,4 @@
From e92bcc778ef8292d527034e43d8621ce6759eb4c Mon Sep 17 00:00:00 2001
From ccb43230660d3203def37ef4cfce53ab31f03cb1 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 1 May 2018 20:17:44 -0400
Subject: [PATCH] EndermanAttackPlayerEvent
@ -9,10 +9,10 @@ This allows you to override/extend the pumpkin/stare logic.
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
new file mode 100644
index 00000000..55912659
index 000000000..ab5a7a6b5
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
@@ -0,0 +1,92 @@
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2018 Daniel Ennis (Aikar) MIT License
+ *
@ -62,6 +62,8 @@ index 00000000..55912659
+
+ /**
+ * The enderman considering attacking
+ *
+ * @return The enderman considering attacking
+ */
+ @Override
+ public Enderman getEntity() {
@ -70,6 +72,8 @@ index 00000000..55912659
+
+ /**
+ * The player the Enderman is considering attacking
+ *
+ * @return The player the Enderman is considering attacking
+ */
+ public Player getPlayer() {
+ return player;
@ -106,5 +110,5 @@ index 00000000..55912659
+ }
+}
--
2.17.1
2.18.0

View File

@ -1,4 +1,4 @@
From 7afba907835ff028bc6df4bbc8a61c721913e328 Mon Sep 17 00:00:00 2001
From ecb438caee87b324154cd73373aa423db86239b7 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Wed, 16 May 2018 20:26:16 -0400
Subject: [PATCH] WitchConsumePotionEvent
@ -7,7 +7,7 @@ Fires when a witch consumes the potion in their hand
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java
new file mode 100644
index 00000000..e3035110
index 000000000..790218998
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java
@@ -0,0 +1,64 @@
@ -36,7 +36,7 @@ index 00000000..e3035110
+ }
+
+ /**
+ * Gets the potion the witch will consume and have the effects applied.
+ * @return the potion the witch will consume and have the effects applied.
+ */
+ public ItemStack getPotion() {
+ return potion;
@ -77,7 +77,7 @@ index 00000000..e3035110
+}
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java
new file mode 100644
index 00000000..6ef6367b
index 000000000..6ef6367b6
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java
@@ -0,0 +1,33 @@
@ -115,5 +115,5 @@ index 00000000..6ef6367b
+ }
+}
--
2.17.1
2.18.0

View File

@ -1,4 +1,4 @@
From 2f1e07e1372f23f43228dfa883f7c68b3693efc0 Mon Sep 17 00:00:00 2001
From b07bf245ce402906a9d39ae8b21b386142509f7a Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Tue, 5 Jun 2018 22:47:08 -0400
Subject: [PATCH] WitchReadyPotionEvent
@ -7,10 +7,10 @@ Control what potion the witch readies to use
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java
new file mode 100644
index 00000000..5082662a
index 000000000..0e0c6da71
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java
@@ -0,0 +1,71 @@
@@ -0,0 +1,74 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.Material;
@ -31,6 +31,9 @@ index 00000000..5082662a
+
+ /**
+ * Fires thee event, returning the desired potion, or air of cancelled
+ * @param witch the witch whom is readying to use a potion
+ * @param potion the potion to be used
+ * @return The ItemStack to be used
+ */
+ public static ItemStack process(Witch witch, ItemStack potion) {
+ WitchReadyPotionEvent event = new WitchReadyPotionEvent(witch, potion);
@ -46,7 +49,7 @@ index 00000000..5082662a
+ }
+
+ /**
+ * Gets the potion the witch is readying to use
+ * @return the potion the witch is readying to use
+ */
+ public ItemStack getPotion() {
+ return potion;
@ -83,5 +86,5 @@ index 00000000..5082662a
+ }
+}
--
2.17.1
2.18.0

View File

@ -1,11 +1,11 @@
From 8dae21e28f695e73fa04d18e1bdc00d2436cbf22 Mon Sep 17 00:00:00 2001
From 9d60d519b1212418a5fbd20d6b34cf919f37952b 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 916238c4..c1689168 100644
index 916238c4d..162a76e8b 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -8,6 +8,15 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable;
@ -24,7 +24,7 @@ index 916238c4..c1689168 100644
/**
* Represents a 3-dimensional position in a world.
* <br>
@@ -514,6 +523,194 @@ public class Location implements Cloneable, ConfigurationSerializable {
@@ -514,6 +523,228 @@ public class Location implements Cloneable, ConfigurationSerializable {
centerLoc.setZ(getBlockZ() + 0.5);
return centerLoc;
}
@ -49,6 +49,7 @@ index 916238c4..c1689168 100644
+ /**
+ * 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.
+ */
+ public Collection<LivingEntity> getNearbyLivingEntities(double radius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius);
@ -58,6 +59,7 @@ index 916238c4..c1689168 100644
+ * 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.
+ */
+ public Collection<LivingEntity> getNearbyLivingEntities(double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius);
@ -68,6 +70,7 @@ index 916238c4..c1689168 100644
+ * @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.
+ */
+ public Collection<LivingEntity> getNearbyLivingEntities(double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius);
@ -75,7 +78,9 @@ index 916238c4..c1689168 100644
+
+ /**
+ * Gets nearby players within the specified radius (bounding box)
+ * @param radius X Radius
+ * @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.
+ */
+ public Collection<LivingEntity> getNearbyLivingEntities(double radius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius, predicate);
@ -85,6 +90,8 @@ index 916238c4..c1689168 100644
+ * 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.
+ */
+ public Collection<LivingEntity> getNearbyLivingEntities(double xzRadius, double yRadius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius, predicate);
@ -95,6 +102,8 @@ index 916238c4..c1689168 100644
+ * @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.
+ */
+ public Collection<LivingEntity> getNearbyLivingEntities(double xRadius, double yRadius, double zRadius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius, predicate);
@ -103,7 +112,9 @@ index 916238c4..c1689168 100644
+ /**
+ * 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.
+ */
+
+ public Collection<Player> getNearbyPlayers(double radius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius);
+ }
@ -112,6 +123,7 @@ index 916238c4..c1689168 100644
+ * 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.
+ */
+ public Collection<Player> getNearbyPlayers(double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius);
@ -122,6 +134,7 @@ index 916238c4..c1689168 100644
+ * @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.
+ */
+ public Collection<Player> getNearbyPlayers(double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius);
@ -130,6 +143,8 @@ index 916238c4..c1689168 100644
+ /**
+ * 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.
+ */
+ public Collection<Player> getNearbyPlayers(double radius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius, predicate);
@ -139,6 +154,8 @@ index 916238c4..c1689168 100644
+ * 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.
+ */
+ public Collection<Player> getNearbyPlayers(double xzRadius, double yRadius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius, predicate);
@ -149,6 +166,8 @@ index 916238c4..c1689168 100644
+ * @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.
+ */
+ public Collection<Player> getNearbyPlayers(double xRadius, double yRadius, double zRadius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius, predicate);
@ -158,6 +177,8 @@ index 916238c4..c1689168 100644
+ * 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.
+ */
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double radius) {
+ return getNearbyEntitiesByType(clazz, radius, radius, radius, null);
@ -168,6 +189,8 @@ index 916238c4..c1689168 100644
+ * @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.
+ */
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, null);
@ -179,6 +202,8 @@ index 916238c4..c1689168 100644
+ * @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.
+ */
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(clazz, xRadius, yRadius, zRadius, null);
@ -188,6 +213,9 @@ index 916238c4..c1689168 100644
+ * 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.
+ */
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double radius, Predicate<T> predicate) {
+ return getNearbyEntitiesByType(clazz, radius, radius, radius, predicate);
@ -198,6 +226,9 @@ index 916238c4..c1689168 100644
+ * @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.
+ */
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double xzRadius, double yRadius, Predicate<T> predicate) {
+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, predicate);
@ -209,6 +240,9 @@ index 916238c4..c1689168 100644
+ * @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.
+ */
+ public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends Entity> clazz, double xRadius, double yRadius, double zRadius, Predicate<T> predicate) {
+ if (world == null) {
@ -220,5 +254,5 @@ index 916238c4..c1689168 100644
@Override
public boolean equals(Object obj) {
--
2.17.1
2.18.0

View File

@ -1,4 +1,4 @@
From 464e3985e5e2c29198f15414c94c9abb75d8aed3 Mon Sep 17 00:00:00 2001
From 43a795bbef901edea80d46497de4270f86b08bec Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Mon, 18 Jun 2018 01:09:27 -0400
Subject: [PATCH] PlayerReadyArrowEvent
@ -8,7 +8,7 @@ Plugins can skip selection of certain arrows and control which is used.
diff --git a/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java
new file mode 100644
index 00000000..c6add1b1
index 000000000..6fde1e97f
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java
@@ -0,0 +1,88 @@
@ -58,14 +58,14 @@ index 00000000..c6add1b1
+ }
+
+ /**
+ * What bow the player is using to fire the arrow
+ * @return the player is using to fire the arrow
+ */
+ public ItemStack getBow() {
+ return bow;
+ }
+
+ /**
+ * What arrow is being attempted to use
+ * @return the arrow that is attempting to be used
+ */
+ public ItemStack getArrow() {
+ return arrow;
@ -101,5 +101,5 @@ index 00000000..c6add1b1
+ }
+}
--
2.17.1
2.18.0

View File

@ -1,4 +1,4 @@
From ec1d10299d09e368cbafa5917ea3f34d11ad6ef5 Mon Sep 17 00:00:00 2001
From 3aa00b8416f918d281c0bd49999ea499af44f3b2 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
@ -6,10 +6,10 @@ Subject: [PATCH] Add EntityKnockbackByEntityEvent
diff --git a/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java b/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java
new file mode 100644
index 00000000..99f7ef70
index 000000000..f6ef11624
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java
@@ -0,0 +1,67 @@
@@ -0,0 +1,76 @@
+package com.destroystokyo.paper.event.entity;
+
+import org.bukkit.entity.Entity;
@ -57,26 +57,35 @@ index 00000000..99f7ef70
+ cancelled = cancel;
+ }
+
+ /**
+ * @return the entity which was knocked back
+ */
+ @Override
+ public LivingEntity getEntity() {
+ return (LivingEntity) super.getEntity();
+ }
+
+ /**
+ * Returns the original knockback strength.
+ * @return the original knockback strength.
+ */
+ public float getKnockbackStrength() {
+ return knockbackStrength;
+ }
+
+ /**
+ * @return the Entity which hit
+ */
+ public Entity getHitBy() {
+ return hitBy;
+ }
+
+ /**
+ * @return the acceleration that will be applied
+ */
+ public Vector getAcceleration() {
+ return acceleration;
+ }
+}
--
2.16.1.windows.1
2.18.0

View File

@ -1,4 +1,4 @@
From ffb6892f7c3065b74096bed892df7da3bfe4dbeb Mon Sep 17 00:00:00 2001
From c6d0f2ab391f9e0227aaf3eff20c74400c750710 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
@ -6,10 +6,10 @@ 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 c1689168..d0d86e1a 100644
index 162a76e8b..056a4d6bb 100644
--- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java
@@ -711,6 +711,84 @@ public class Location implements Cloneable, ConfigurationSerializable {
@@ -745,6 +745,87 @@ public class Location implements Cloneable, ConfigurationSerializable {
}
return world.getNearbyEntitiesByType(clazz, this, xRadius, yRadius, zRadius, predicate);
}
@ -58,6 +58,7 @@ index c1689168..d0d86e1a 100644
+ *
+ * Will break blocks and ignite blocks on fire.
+ *
+ * @param source The source entity of the explosion
+ * @param power The power of explosion, where 4F is TNT
+ * @return false if explosion was canceled, otherwise true
+ */
@ -71,6 +72,7 @@ index c1689168..d0d86e1a 100644
+ *
+ * Will break blocks.
+ *
+ * @param source The source entity of the explosion
+ * @param power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire
+ * @return false if explosion was canceled, otherwise true
@ -83,6 +85,7 @@ index c1689168..d0d86e1a 100644
+ * Creates explosion at this location with given power and optionally
+ * setting blocks on fire, with the specified entity as the source.
+ *
+ * @param source The source entity of the explosion
+ * @param power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire
+ * @param breakBlocks Whether or not to have blocks be destroyed
@ -95,10 +98,10 @@ index c1689168..d0d86e1a 100644
@Override
public boolean equals(Object obj) {
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index e7973c73..4ed7d2dc 100644
index b983bdc54..c9c1a4352 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -956,6 +956,99 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -989,6 +989,102 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public boolean createExplosion(Location loc, float power, boolean setFire);
@ -108,6 +111,7 @@ index e7973c73..4ed7d2dc 100644
+ * setting blocks on fire, with the specified entity as the source.
+ *
+ * @param source The source entity of the explosion
+ * @param loc Location to blow up
+ * @param power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire
+ * @param breakBlocks Whether or not to have blocks be destroyed
@ -122,6 +126,7 @@ index e7973c73..4ed7d2dc 100644
+ * Will destroy other blocks
+ *
+ * @param source The source entity of the explosion
+ * @param loc Location to blow up
+ * @param power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire
+ * @return false if explosion was canceled, otherwise true
@ -134,6 +139,7 @@ index e7973c73..4ed7d2dc 100644
+ * Will set blocks on fire and destroy blocks.
+ *
+ * @param source The source entity of the explosion
+ * @param loc Location to blow up
+ * @param power The power of explosion, where 4F is TNT
+ * @return false if explosion was canceled, otherwise true
+ */
@ -199,5 +205,5 @@ index e7973c73..4ed7d2dc 100644
* Gets the {@link Environment} type of this world
*
--
2.17.1
2.18.0

View File

@ -1,4 +1,4 @@
From d76f522b7f164a56a7f9651170e439739ef6e015 Mon Sep 17 00:00:00 2001
From 98956ddc3685e0b100005ac2507d3ec8cbea1a5c 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
@ -6,7 +6,7 @@ Subject: [PATCH] LivingEntity Hand Raised/Item Use API
How long an entity has raised hands to charge an attack or use an item
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 5921c952..5ccb8ef3 100644
index 5921c9521..9c542951e 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -10,6 +10,7 @@ import org.bukkit.Material;
@ -17,7 +17,7 @@ index 5921c952..5ccb8ef3 100644
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.bukkit.projectiles.ProjectileSource;
@@ -399,5 +400,27 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti
@@ -399,5 +400,31 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti
* @param delay Delay in ticks
*/
void setShieldBlockingDelay(int delay);
@ -36,11 +36,15 @@ index 5921c952..5ccb8ef3 100644
+
+ /**
+ * Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
+ *
+ * @return Get how long the players hands have been raised (Charging Bow attack, using a potion, etc)
+ */
+ int getHandRaisedTime();
+
+ /**
+ * Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ *
+ * @return Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food)
+ */
+ boolean isHandRaised();
// Paper end

View File

@ -1,4 +1,4 @@
From d2a1657e1c25dc241d143ee6486513c024a5695b Mon Sep 17 00:00:00 2001
From b6cbd9ff3424e005703b27bb128264ddf877b591 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
@ -8,10 +8,10 @@ and to perform an attack.
diff --git a/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
new file mode 100644
index 00000000..7b07f10c
index 000000000..ded25f214
--- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
@@ -0,0 +1,28 @@
@@ -0,0 +1,29 @@
+package com.destroystokyo.paper.entity;
+
+import org.bukkit.entity.LivingEntity;
@ -20,6 +20,7 @@ index 00000000..7b07f10c
+ /**
+ * Attack the specified entity using a ranged attack.
+ *
+ * @param target the entity to target
+ * @param charge How "charged" the attack is (how far back the bow was pulled for Bow attacks).
+ * This should be a value between 0 and 1, represented as targetDistance/maxDistance.
+ */
@ -41,7 +42,7 @@ index 00000000..7b07f10c
+ }
+}
diff --git a/src/main/java/org/bukkit/entity/Illusioner.java b/src/main/java/org/bukkit/entity/Illusioner.java
index 7c92c431..14e6c5ee 100644
index 7c92c431b..14e6c5ee0 100644
--- a/src/main/java/org/bukkit/entity/Illusioner.java
+++ b/src/main/java/org/bukkit/entity/Illusioner.java
@@ -1,6 +1,10 @@
@ -57,7 +58,7 @@ index 7c92c431..14e6c5ee 100644
+
+}
diff --git a/src/main/java/org/bukkit/entity/Llama.java b/src/main/java/org/bukkit/entity/Llama.java
index 9422d56c..92c30ed5 100644
index 9422d56cd..92c30ed5a 100644
--- a/src/main/java/org/bukkit/entity/Llama.java
+++ b/src/main/java/org/bukkit/entity/Llama.java
@@ -1,11 +1,12 @@
@ -75,7 +76,7 @@ index 9422d56c..92c30ed5 100644
/**
* Represents the base color that the llama has.
diff --git a/src/main/java/org/bukkit/entity/Skeleton.java b/src/main/java/org/bukkit/entity/Skeleton.java
index e33d00b3..40157bef 100644
index e33d00b30..40157befd 100644
--- a/src/main/java/org/bukkit/entity/Skeleton.java
+++ b/src/main/java/org/bukkit/entity/Skeleton.java
@@ -1,9 +1,11 @@
@ -92,7 +93,7 @@ index e33d00b3..40157bef 100644
/**
* Gets the current type of this skeleton.
diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java
index 818efe2a..10f8f6d4 100644
index 818efe2a4..10f8f6d45 100644
--- a/src/main/java/org/bukkit/entity/Snowman.java
+++ b/src/main/java/org/bukkit/entity/Snowman.java
@@ -1,9 +1,11 @@
@ -109,7 +110,7 @@ index 818efe2a..10f8f6d4 100644
/**
* Gets whether this snowman is in "derp mode", meaning it is not wearing a
diff --git a/src/main/java/org/bukkit/entity/Witch.java b/src/main/java/org/bukkit/entity/Witch.java
index 9c5dc1f9..4b27f689 100644
index 9c5dc1f97..4b27f6890 100644
--- a/src/main/java/org/bukkit/entity/Witch.java
+++ b/src/main/java/org/bukkit/entity/Witch.java
@@ -1,7 +1,9 @@
@ -124,7 +125,7 @@ index 9c5dc1f9..4b27f689 100644
+public interface Witch extends Monster, RangedEntity { // Paper
}
diff --git a/src/main/java/org/bukkit/entity/Wither.java b/src/main/java/org/bukkit/entity/Wither.java
index 0922c5c6..c550ed06 100644
index 0922c5c6a..c550ed061 100644
--- a/src/main/java/org/bukkit/entity/Wither.java
+++ b/src/main/java/org/bukkit/entity/Wither.java
@@ -1,7 +1,9 @@

View File

@ -1,14 +1,14 @@
From e19fe3a36b5abf507c209e4a4b43c7b18f27b938 Mon Sep 17 00:00:00 2001
From 45ebcce14c6a802af79dbe6c1337ae682f1f8dbb 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
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 4ed7d2dc..4441a8e0 100644
index c9c1a4352..20cc4e121 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -756,6 +756,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -789,6 +789,16 @@ public interface World extends PluginMessageRecipient, Metadatable {
*/
public Collection<Entity> getNearbyEntities(Location location, double x, double y, double z);
@ -26,5 +26,5 @@ index 4ed7d2dc..4441a8e0 100644
* Gets the unique name of this world
*
--
2.16.1.windows.1
2.18.0

View File

@ -1,4 +1,4 @@
From eeec38e29cc2041734e18b87f80400f63fa7734c Mon Sep 17 00:00:00 2001
From 55294a8ba9d1d4d6530064b46ca0dcce99bc2288 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
@ -7,16 +7,18 @@ Allows you to determine why an inventory was closed, enabling plugin developers
to "confirm" things based on if it was player triggered close or not.
diff --git a/src/main/java/org/bukkit/entity/HumanEntity.java b/src/main/java/org/bukkit/entity/HumanEntity.java
index dd95773e..3924d00c 100644
index dd95773e2..8fe01e47e 100644
--- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -137,6 +137,13 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv
@@ -137,6 +137,15 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv
*/
public void closeInventory();
+ // Paper start
+ /**
+ * Force-closes the currently open inventory view for this player, if any.
+ *
+ * @param reason why the inventory is closing
+ */
+ public void closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason);
+ // Paper end
@ -25,7 +27,7 @@ index dd95773e..3924d00c 100644
* Returns the ItemStack currently in your hand, can be empty.
*
diff --git a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
index 19889b27..e6e45b93 100644
index 19889b278..e6e45b936 100644
--- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
@@ -11,8 +11,58 @@ import org.bukkit.inventory.InventoryView;

View File

@ -1,4 +1,4 @@
From fd3e920af22a4c66551ed2ff0d7d53a07be86dd0 Mon Sep 17 00:00:00 2001
From ef49bf8a4c89247a4a28cd3b59d80b44cb4d5ed9 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sat, 4 Aug 2018 19:37:35 -0400
Subject: [PATCH] Provide Chunk Coordinates as a Long API
@ -27,7 +27,7 @@ index 079b9febe..c75bce07a 100644
* Gets the world containing this chunk
*
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index f541107f7..7b166b213 100644
index 20cc4e121..9b46e8892 100644
--- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java
@@ -166,6 +166,21 @@ public interface World extends PluginMessageRecipient, Metadatable {
@ -39,7 +39,7 @@ index f541107f7..7b166b213 100644
+ * Gets the chunk at the specified chunk key, which is the X and Z packed into a long.
+ *
+ * See {@link Chunk#getChunkKey()} for easy access to the key, or you may calculate it as:
+ * long chunkKey = (long) chunkX & 0xffffffffL | ((long) chunkZ & 0xffffffffL) << 32;
+ * long chunkKey = (long) chunkX &amp; 0xffffffffL | ((long) chunkZ &amp; 0xffffffffL) &gt;&gt; 32;
+ *
+ * @param chunkKey The Chunk Key to look up the chunk by
+ * @return The chunk at the specified key