Merge branch 'master' into pre/1.13

This commit is contained in:
Shane Freeder
2018-08-17 05:10:45 +01:00
18 changed files with 191 additions and 53 deletions

View File

@@ -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. 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 diff --git a/src/main/java/org/bukkit/entity/Player.java b/src/main/java/org/bukkit/entity/Player.java
index 22b8cb916..805faaf35 100644 index 17c74f0ce..15bcb2929 100644
--- a/src/main/java/org/bukkit/entity/Player.java --- a/src/main/java/org/bukkit/entity/Player.java
+++ b/src/main/java/org/bukkit/entity/Player.java +++ b/src/main/java/org/bukkit/entity/Player.java
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline @@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, CommandSender, Offline
@@ -40,8 +40,8 @@ index 22b8cb916..805faaf35 100644
+ * + *
+ * Can also be called with {@link #giveExp(int, boolean)} by passing true to applyMending + * Can also be called with {@link #giveExp(int, boolean)} by passing true to applyMending
+ * + *
+ * @param amount + * @param amount Exp to apply
+ * @return + * @return the remaining experience
+ */ + */
+ public int applyMending(int amount); + public int applyMending(int amount);
+ // Paper end + // Paper end

View File

@@ -6,7 +6,7 @@ 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 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 new file mode 100644
index 00000000..99f7ef70 index 000000000..f6ef11624
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/entity/EntityKnockbackByEntityEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -57,22 +57,31 @@ index 00000000..99f7ef70
+ cancelled = cancel; + cancelled = cancel;
+ } + }
+ +
+ /**
+ * @return the entity which was knocked back
+ */
+ @Override + @Override
+ public LivingEntity getEntity() { + public LivingEntity getEntity() {
+ return (LivingEntity) super.getEntity(); + return (LivingEntity) super.getEntity();
+ } + }
+ +
+ /** + /**
+ * Returns the original knockback strength. + * @return the original knockback strength.
+ */ + */
+ public float getKnockbackStrength() { + public float getKnockbackStrength() {
+ return knockbackStrength; + return knockbackStrength;
+ } + }
+ +
+ /**
+ * @return the Entity which hit
+ */
+ public Entity getHitBy() { + public Entity getHitBy() {
+ return hitBy; + return hitBy;
+ } + }
+ +
+ /**
+ * @return the acceleration that will be applied
+ */
+ public Vector getAcceleration() { + public Vector getAcceleration() {
+ return acceleration; + return acceleration;
+ } + }

View File

@@ -5,7 +5,7 @@ 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 diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 81d9e1df..6e583b42 100644 index ef3a2f2d2..860e4374f 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View File

@@ -5,7 +5,7 @@ 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 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 --- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java
@@ -0,0 +0,0 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable; @@ -0,0 +0,0 @@ import org.bukkit.configuration.serialization.ConfigurationSerializable;
@@ -49,6 +49,7 @@ index 916238c4..c1689168 100644
+ /** + /**
+ * Gets nearby players within the specified radius (bounding box) + * Gets nearby players within the specified radius (bounding box)
+ * @param radius X Radius + * @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) { + public Collection<LivingEntity> getNearbyLivingEntities(double radius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, 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) + * Gets nearby players within the specified radius (bounding box)
+ * @param xzRadius X/Z Radius + * @param xzRadius X/Z Radius
+ * @param yRadius Y 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) { + public Collection<LivingEntity> getNearbyLivingEntities(double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius); + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius);
@@ -68,6 +70,7 @@ index 916238c4..c1689168 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + public Collection<LivingEntity> getNearbyLivingEntities(double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, 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) + * 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) { + public Collection<LivingEntity> getNearbyLivingEntities(double radius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, radius, radius, radius, 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) + * Gets nearby players within the specified radius (bounding box)
+ * @param xzRadius X/Z Radius + * @param xzRadius X/Z Radius
+ * @param yRadius Y 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) { + public Collection<LivingEntity> getNearbyLivingEntities(double xzRadius, double yRadius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xzRadius, yRadius, xzRadius, 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 xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + public Collection<LivingEntity> getNearbyLivingEntities(double xRadius, double yRadius, double zRadius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, xRadius, yRadius, zRadius, 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) + * Gets nearby players within the specified radius (bounding box)
+ * @param radius X/Y/Z Radius + * @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) { + public Collection<Player> getNearbyPlayers(double radius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, 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) + * Gets nearby players within the specified radius (bounding box)
+ * @param xzRadius X/Z Radius + * @param xzRadius X/Z Radius
+ * @param yRadius Y 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) { + public Collection<Player> getNearbyPlayers(double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius); + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius);
@@ -122,6 +134,7 @@ index 916238c4..c1689168 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + public Collection<Player> getNearbyPlayers(double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, 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) + * Gets nearby players within the specified radius (bounding box)
+ * @param radius X/Y/Z Radius + * @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) { + public Collection<Player> getNearbyPlayers(double radius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, radius, radius, radius, 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) + * Gets nearby players within the specified radius (bounding box)
+ * @param xzRadius X/Z Radius + * @param xzRadius X/Z Radius
+ * @param yRadius Y 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) { + public Collection<Player> getNearbyPlayers(double xzRadius, double yRadius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xzRadius, yRadius, xzRadius, 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 xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + public Collection<Player> getNearbyPlayers(double xRadius, double yRadius, double zRadius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, xRadius, yRadius, zRadius, 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) + * Gets all nearby entities of the specified type, within the specified radius (bounding box)
+ * @param clazz Type to filter by + * @param clazz Type to filter by
+ * @param radius X/Y/Z radius to search within + * @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) { + public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double radius) {
+ return getNearbyEntitiesByType(clazz, radius, radius, radius, null); + return getNearbyEntitiesByType(clazz, radius, radius, radius, null);
@@ -168,6 +189,8 @@ index 916238c4..c1689168 100644
+ * @param clazz Type to filter by + * @param clazz Type to filter by
+ * @param xzRadius X/Z radius to search within + * @param xzRadius X/Z radius to search within
+ * @param yRadius Y 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) { + public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, null); + return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, null);
@@ -179,6 +202,8 @@ index 916238c4..c1689168 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(clazz, xRadius, yRadius, zRadius, null); + 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) + * Gets all nearby entities of the specified type, within the specified radius (bounding box)
+ * @param clazz Type to filter by + * @param clazz Type to filter by
+ * @param radius X/Y/Z radius to search within + * @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) { + public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, double radius, Predicate<T> predicate) {
+ return getNearbyEntitiesByType(clazz, radius, radius, radius, predicate); + return getNearbyEntitiesByType(clazz, radius, radius, radius, predicate);
@@ -198,6 +226,9 @@ index 916238c4..c1689168 100644
+ * @param clazz Type to filter by + * @param clazz Type to filter by
+ * @param xzRadius X/Z radius to search within + * @param xzRadius X/Z radius to search within
+ * @param yRadius Y 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) { + 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); + return getNearbyEntitiesByType(clazz, xzRadius, yRadius, xzRadius, predicate);
@@ -209,6 +240,9 @@ index 916238c4..c1689168 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + public <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends Entity> clazz, double xRadius, double yRadius, double zRadius, Predicate<T> predicate) {
+ if (world == null) { + if (world == null) {

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Additional world.getNearbyEntities API's
Provides more methods to get nearby entities, and filter by types and predicates 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 diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index 4e07af2e..49d2cc45 100644 index 9f3d805c2..f9d8b14c6 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ package org.bukkit; @@ -0,0 +0,0 @@ package org.bukkit;
@@ -32,7 +32,8 @@ index 4e07af2e..49d2cc45 100644
+ /** + /**
+ * Gets nearby players within the specified radius (bounding box) + * Gets nearby players within the specified radius (bounding box)
+ * @param loc Center location + * @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) { + public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double radius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius); + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius);
@@ -43,6 +44,7 @@ index 4e07af2e..49d2cc45 100644
+ * @param loc Center location + * @param loc Center location
+ * @param xzRadius X/Z Radius + * @param xzRadius X/Z Radius
+ * @param yRadius Y 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) { + public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius); + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius);
@@ -54,6 +56,7 @@ index 4e07af2e..49d2cc45 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius); + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius);
@@ -63,6 +66,8 @@ index 4e07af2e..49d2cc45 100644
+ * Gets nearby players within the specified radius (bounding box) + * Gets nearby players within the specified radius (bounding box)
+ * @param loc Center location + * @param loc Center location
+ * @param radius X Radius + * @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) { + public default Collection<LivingEntity> getNearbyLivingEntities(Location loc, double radius, Predicate<LivingEntity> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius, predicate); + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, radius, radius, radius, predicate);
@@ -73,6 +78,8 @@ index 4e07af2e..49d2cc45 100644
+ * @param loc Center location + * @param loc Center location
+ * @param xzRadius X/Z Radius + * @param xzRadius X/Z Radius
+ * @param yRadius Y 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) { + 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); + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xzRadius, yRadius, xzRadius, predicate);
@@ -84,6 +91,8 @@ index 4e07af2e..49d2cc45 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + 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); + return getNearbyEntitiesByType(org.bukkit.entity.LivingEntity.class, loc, xRadius, yRadius, zRadius, predicate);
@@ -93,6 +102,7 @@ index 4e07af2e..49d2cc45 100644
+ * Gets nearby players within the specified radius (bounding box) + * Gets nearby players within the specified radius (bounding box)
+ * @param loc Center location + * @param loc Center location
+ * @param radius X/Y/Z Radius + * @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) { + public default Collection<Player> getNearbyPlayers(Location loc, double radius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius); + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius);
@@ -103,6 +113,7 @@ index 4e07af2e..49d2cc45 100644
+ * @param loc Center location + * @param loc Center location
+ * @param xzRadius X/Z Radius + * @param xzRadius X/Z Radius
+ * @param yRadius Y 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) { + public default Collection<Player> getNearbyPlayers(Location loc, double xzRadius, double yRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius); + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius);
@@ -114,6 +125,7 @@ index 4e07af2e..49d2cc45 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + public default Collection<Player> getNearbyPlayers(Location loc, double xRadius, double yRadius, double zRadius) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius); + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius);
@@ -123,6 +135,8 @@ index 4e07af2e..49d2cc45 100644
+ * Gets nearby players within the specified radius (bounding box) + * Gets nearby players within the specified radius (bounding box)
+ * @param loc Center location + * @param loc Center location
+ * @param radius X/Y/Z Radius + * @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) { + public default Collection<Player> getNearbyPlayers(Location loc, double radius, Predicate<Player> predicate) {
+ return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius, predicate); + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, radius, radius, radius, predicate);
@@ -133,6 +147,8 @@ index 4e07af2e..49d2cc45 100644
+ * @param loc Center location + * @param loc Center location
+ * @param xzRadius X/Z Radius + * @param xzRadius X/Z Radius
+ * @param yRadius Y 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) { + 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); + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xzRadius, yRadius, xzRadius, predicate);
@@ -144,6 +160,8 @@ index 4e07af2e..49d2cc45 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + 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); + return getNearbyEntitiesByType(org.bukkit.entity.Player.class, loc, xRadius, yRadius, zRadius, predicate);
@@ -154,6 +172,8 @@ index 4e07af2e..49d2cc45 100644
+ * @param clazz Type to filter by + * @param clazz Type to filter by
+ * @param loc Center location + * @param loc Center location
+ * @param radius X/Y/Z radius to search within + * @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) { + public default <T extends Entity> Collection<T> getNearbyEntitiesByType(Class<? extends T> clazz, Location loc, double radius) {
+ return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, null); + return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, null);
@@ -165,6 +185,8 @@ index 4e07af2e..49d2cc45 100644
+ * @param loc Center location + * @param loc Center location
+ * @param xzRadius X/Z radius to search within + * @param xzRadius X/Z radius to search within
+ * @param yRadius Y 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) { + 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); + return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, null);
@@ -177,6 +199,8 @@ index 4e07af2e..49d2cc45 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + 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); + return getNearbyEntitiesByType(clazz, loc, xRadius, yRadius, zRadius, null);
@@ -187,6 +211,9 @@ index 4e07af2e..49d2cc45 100644
+ * @param clazz Type to filter by + * @param clazz Type to filter by
+ * @param loc Center location + * @param loc Center location
+ * @param radius X/Y/Z radius to search within + * @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) { + 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); + return getNearbyEntitiesByType(clazz, loc, radius, radius, radius, predicate);
@@ -198,6 +225,9 @@ index 4e07af2e..49d2cc45 100644
+ * @param loc Center location + * @param loc Center location
+ * @param xzRadius X/Z radius to search within + * @param xzRadius X/Z radius to search within
+ * @param yRadius Y 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) { + 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); + return getNearbyEntitiesByType(clazz, loc, xzRadius, yRadius, xzRadius, predicate);
@@ -210,6 +240,9 @@ index 4e07af2e..49d2cc45 100644
+ * @param xRadius X Radius + * @param xRadius X Radius
+ * @param yRadius Y Radius + * @param yRadius Y Radius
+ * @param zRadius Z 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) { + 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) { + if (clazz == null) {

View File

@@ -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 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 new file mode 100644
index 00000000..3071320e index 000000000..3c51aaf92
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -154,7 +154,7 @@ index 00000000..3071320e
+ * If true, the standard process of calling {@link Command#tabComplete(CommandSender, String, String[])} + * If true, the standard process of calling {@link Command#tabComplete(CommandSender, String, String[])}
+ * or current player names will not be called. + * 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) { + public void setHandled(boolean handled) {
+ this.handled = handled; + this.handled = handled;
@@ -170,7 +170,7 @@ index 00000000..3071320e
+ +
+ /** + /**
+ * Will provide no completions, and will not fire the synchronous process + * Will provide no completions, and will not fire the synchronous process
+ * @param cancelled + * @param cancelled true if you wish to cancel this event
+ */ + */
+ @Override + @Override
+ public void setCancelled(boolean cancelled) { + 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 diff --git a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
index a6229839..f0bc3563 100644 index a6229839c..f0bc3563f 100644
--- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java --- a/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
+++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java +++ b/src/main/java/org/bukkit/event/server/TabCompleteEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@

View File

@@ -7,7 +7,7 @@ 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 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 new file mode 100644
index 000000000..1a69e5f75 index 000000000..529c53760
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java +++ b/src/main/java/com/destroystokyo/paper/profile/PlayerProfile.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -140,6 +140,7 @@ index 000000000..1a69e5f75
+ * This is a blocking operation and should be done asynchronously. + * This is a blocking operation and should be done asynchronously.
+ * + *
+ * Optionally will also fill textures. + * 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) + * @return If the profile is now complete (has UUID and Name) (if you get rate limited, this operation may fail)
+ */ + */
+ boolean complete(boolean textures); + boolean complete(boolean textures);

View File

@@ -9,7 +9,7 @@ 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 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 new file mode 100644
index 00000000..55912659 index 000000000..ab5a7a6b5
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/entity/EndermanAttackPlayerEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -62,6 +62,8 @@ index 00000000..55912659
+ +
+ /** + /**
+ * The enderman considering attacking + * The enderman considering attacking
+ *
+ * @return The enderman considering attacking
+ */ + */
+ @Override + @Override
+ public Enderman getEntity() { + public Enderman getEntity() {
@@ -70,6 +72,8 @@ index 00000000..55912659
+ +
+ /** + /**
+ * The player the Enderman is considering attacking + * The player the Enderman is considering attacking
+ *
+ * @return The player the Enderman is considering attacking
+ */ + */
+ public Player getPlayer() { + public Player getPlayer() {
+ return player; + return player;

View File

@@ -6,7 +6,7 @@ Subject: [PATCH] Expand Explosions API
Add Entity as a Source capability, and add more API choices, and on Location. 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 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 --- a/src/main/java/org/bukkit/Location.java
+++ b/src/main/java/org/bukkit/Location.java +++ b/src/main/java/org/bukkit/Location.java
@@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable { @@ -0,0 +0,0 @@ public class Location implements Cloneable, ConfigurationSerializable {
@@ -58,6 +58,7 @@ index c1689168..d0d86e1a 100644
+ * + *
+ * Will break blocks and ignite blocks on fire. + * 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 + * @param power The power of explosion, where 4F is TNT
+ * @return false if explosion was canceled, otherwise true + * @return false if explosion was canceled, otherwise true
+ */ + */
@@ -71,6 +72,7 @@ index c1689168..d0d86e1a 100644
+ * + *
+ * Will break blocks. + * Will break blocks.
+ * + *
+ * @param source The source entity of the explosion
+ * @param power The power of explosion, where 4F is TNT + * @param power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire + * @param setFire Whether or not to set blocks on fire
+ * @return false if explosion was canceled, otherwise true + * @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 + * Creates explosion at this location with given power and optionally
+ * setting blocks on fire, with the specified entity as the source. + * 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 power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire + * @param setFire Whether or not to set blocks on fire
+ * @param breakBlocks Whether or not to have blocks be destroyed + * @param breakBlocks Whether or not to have blocks be destroyed
@@ -95,7 +98,7 @@ index c1689168..d0d86e1a 100644
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index fd3a63fa..81d9e1df 100644 index 5630c624a..ef3a2f2d2 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -108,6 +111,7 @@ index fd3a63fa..81d9e1df 100644
+ * setting blocks on fire, with the specified entity as the source. + * setting blocks on fire, with the specified entity as the source.
+ * + *
+ * @param source The source entity of the explosion + * @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 power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire + * @param setFire Whether or not to set blocks on fire
+ * @param breakBlocks Whether or not to have blocks be destroyed + * @param breakBlocks Whether or not to have blocks be destroyed
@@ -122,6 +126,7 @@ index fd3a63fa..81d9e1df 100644
+ * Will destroy other blocks + * Will destroy other blocks
+ * + *
+ * @param source The source entity of the explosion + * @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 power The power of explosion, where 4F is TNT
+ * @param setFire Whether or not to set blocks on fire + * @param setFire Whether or not to set blocks on fire
+ * @return false if explosion was canceled, otherwise true + * @return false if explosion was canceled, otherwise true
@@ -134,6 +139,7 @@ index fd3a63fa..81d9e1df 100644
+ * Will set blocks on fire and destroy blocks. + * Will set blocks on fire and destroy blocks.
+ * + *
+ * @param source The source entity of the explosion + * @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 power The power of explosion, where 4F is TNT
+ * @return false if explosion was canceled, otherwise true + * @return false if explosion was canceled, otherwise true
+ */ + */

View File

@@ -11,7 +11,7 @@ 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 diff --git a/src/main/java/com/destroystokyo/paper/ParticleBuilder.java b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
new file mode 100644 new file mode 100644
index 000000000..f7aa162fb index 000000000..feebfb653
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java +++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -52,6 +52,8 @@ index 000000000..f7aa162fb
+ /** + /**
+ * Sends the particle to all receiving players (or all). + * Sends the particle to all receiving players (or all).
+ * This method is safe to use Asynchronously + * This method is safe to use Asynchronously
+ *
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder spawn() { + public ParticleBuilder spawn() {
+ if (this.location == null) { + if (this.location == null) {
@@ -74,6 +76,7 @@ index 000000000..f7aa162fb
+ /** + /**
+ * Changes what particle will be sent + * Changes what particle will be sent
+ * @param particle The particle + * @param particle The particle
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder particle(Particle particle) { + public ParticleBuilder particle(Particle particle) {
+ this.particle = particle; + this.particle = particle;
@@ -105,6 +108,7 @@ index 000000000..f7aa162fb
+ * Sends this particle to all players in the world. This is rather silly and you should likely not be doing this. + * 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. + * Just be a logical person and use receivers by radius or collection.
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder allPlayers() { + public ParticleBuilder allPlayers() {
+ this.receivers = null; + this.receivers = null;
@@ -113,6 +117,7 @@ index 000000000..f7aa162fb
+ +
+ /** + /**
+ * @param receivers List of players to receive this particle, or null for all players in the world + * @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) { + 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 + // 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 000000000..f7aa162fb
+ +
+ /** + /**
+ * @param receivers List of players to receive this particle, or null for all players in the world + * @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) { + public ParticleBuilder receivers(@Nullable Collection<Player> receivers) {
+ this.receivers = receivers != null ? Lists.newArrayList(receivers) : null; + this.receivers = receivers != null ? Lists.newArrayList(receivers) : null;
@@ -131,6 +137,7 @@ index 000000000..f7aa162fb
+ +
+ /** + /**
+ * @param receivers List of players to be receive this particle, or null for all players in the world + * @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) { + public ParticleBuilder receivers(Player... receivers) {
+ this.receivers = receivers != null ? Lists.newArrayList(receivers) : null; + this.receivers = receivers != null ? Lists.newArrayList(receivers) : null;
@@ -142,6 +149,7 @@ index 000000000..f7aa162fb
+ * If you want a more spherical check, see {@link #receivers(int, boolean)} + * If you want a more spherical check, see {@link #receivers(int, boolean)}
+ * + *
+ * @param radius amount to add on all axis + * @param radius amount to add on all axis
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder receivers(int radius) { + public ParticleBuilder receivers(int radius) {
+ return receivers(radius, radius); + return receivers(radius, radius);
@@ -153,6 +161,7 @@ index 000000000..f7aa162fb
+ * If byDistance is true, radius is tested by distance in a spherical shape + * If byDistance is true, radius is tested by distance in a spherical shape
+ * @param radius amount to add on each axis + * @param radius amount to add on each axis
+ * @param byDistance true to use a spherical radius, false to use a cuboid + * @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) { + public ParticleBuilder receivers(int radius, boolean byDistance) {
+ if (!byDistance) { + if (!byDistance) {
@@ -181,6 +190,7 @@ index 000000000..f7aa162fb
+ * + *
+ * @param xzRadius amount to add on the x/z axis + * @param xzRadius amount to add on the x/z axis
+ * @param yRadius amount to add on the y axis + * @param yRadius amount to add on the y axis
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder receivers(int xzRadius, int yRadius) { + public ParticleBuilder receivers(int xzRadius, int yRadius) {
+ return receivers(xzRadius, yRadius, xzRadius); + return receivers(xzRadius, yRadius, xzRadius);
@@ -193,6 +203,7 @@ index 000000000..f7aa162fb
+ * @param xzRadius amount to add on the x/z axis + * @param xzRadius amount to add on the x/z axis
+ * @param yRadius amount to add on the y axis + * @param yRadius amount to add on the y axis
+ * @param byDistance true to use a cylinder shape, false to use cuboid + * @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) { + public ParticleBuilder receivers(int xzRadius, int yRadius, boolean byDistance) {
+ if (!byDistance) { + if (!byDistance) {
@@ -223,6 +234,7 @@ index 000000000..f7aa162fb
+ * @param xRadius amount to add on the x axis + * @param xRadius amount to add on the x axis
+ * @param yRadius amount to add on the y axis + * @param yRadius amount to add on the y axis
+ * @param zRadius amount to add on the z 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) { + public ParticleBuilder receivers(int xRadius, int yRadius, int zRadius) {
+ if (location == null) { + if (location == null) {
@@ -241,6 +253,7 @@ index 000000000..f7aa162fb
+ /** + /**
+ * Sets the source of this particle for visibility concerns (Vanish API) + * Sets the source of this particle for visibility concerns (Vanish API)
+ * @param source The player who is considered the source + * @param source The player who is considered the source
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder source(Player source) { + public ParticleBuilder source(Player source) {
+ this.source = source; + this.source = source;
@@ -257,6 +270,7 @@ index 000000000..f7aa162fb
+ /** + /**
+ * Sets the location of where to spawn the particle + * Sets the location of where to spawn the particle
+ * @param location The location of the particle + * @param location The location of the particle
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder location(Location location) { + public ParticleBuilder location(Location location) {
+ this.location = location.clone(); + this.location = location.clone();
@@ -269,6 +283,7 @@ index 000000000..f7aa162fb
+ * @param x X location + * @param x X location
+ * @param y Y location + * @param y Y location
+ * @param z Z location + * @param z Z location
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder location(World world, double x, double y, double z) { + public ParticleBuilder location(World world, double x, double y, double z) {
+ this.location = new Location(world, x, y, z); + this.location = new Location(world, x, y, z);
@@ -285,6 +300,7 @@ index 000000000..f7aa162fb
+ /** + /**
+ * Sets the number of particles to spawn + * Sets the number of particles to spawn
+ * @param count Number of particles + * @param count Number of particles
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder count(int count) { + public ParticleBuilder count(int count) {
+ this.count = count; + this.count = count;
@@ -293,18 +309,21 @@ index 000000000..f7aa162fb
+ +
+ /** + /**
+ * Particle offset X. Varies by particle on how this is used + * Particle offset X. Varies by particle on how this is used
+ * @return Particle offset X.
+ */ + */
+ public double offsetX() { + public double offsetX() {
+ return offsetX; + return offsetX;
+ } + }
+ /** + /**
+ * Particle offset Y. Varies by particle on how this is used + * Particle offset Y. Varies by particle on how this is used
+ * @return Particle offset Y.
+ */ + */
+ public double offsetY() { + public double offsetY() {
+ return offsetY; + return offsetY;
+ } + }
+ /** + /**
+ * Particle offset Z. Varies by particle on how this is used + * Particle offset Z. Varies by particle on how this is used
+ * @return Particle offset Z.
+ */ + */
+ public double offsetZ() { + public double offsetZ() {
+ return offsetZ; + return offsetZ;
@@ -312,6 +331,10 @@ index 000000000..f7aa162fb
+ +
+ /** + /**
+ * Sets the particle offset. Varies by particle on how this is used + * 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) { + public ParticleBuilder offset(double offsetX, double offsetY, double offsetZ) {
+ this.offsetX = offsetX; + this.offsetX = offsetX;
@@ -322,6 +345,7 @@ index 000000000..f7aa162fb
+ +
+ /** + /**
+ * Gets the Particle extra data. Varies by particle on how this is used + * Gets the Particle extra data. Varies by particle on how this is used
+ * @return the extra particle data
+ */ + */
+ public double extra() { + public double extra() {
+ return extra; + return extra;
@@ -329,6 +353,8 @@ index 000000000..f7aa162fb
+ +
+ /** + /**
+ * Sets the particle extra data. Varies by particle on how this is used + * 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) { + public ParticleBuilder extra(double extra) {
+ this.extra = extra; + this.extra = extra;
@@ -337,6 +363,8 @@ index 000000000..f7aa162fb
+ +
+ /** + /**
+ * Gets the particle custom data. Varies by particle on how this is used + * 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() { + public <T> T data() {
+ //noinspection unchecked + //noinspection unchecked
@@ -345,6 +373,9 @@ index 000000000..f7aa162fb
+ +
+ /** + /**
+ * Sets the particle custom data. Varies by particle on how this is used + * 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) { + public <T> ParticleBuilder data(T data) {
+ this.data = data; + this.data = data;
@@ -357,6 +388,7 @@ index 000000000..f7aa162fb
+ * If false, the particle will show according to the client's particle settings. + * If false, the particle will show according to the client's particle settings.
+ * + *
+ * @param force true to force, false for normal + * @param force true to force, false for normal
+ * @return a reference to this object.
+ */ + */
+ public ParticleBuilder force(boolean force) { + public ParticleBuilder force(boolean force) {
+ this.force = force; + this.force = force;
@@ -366,6 +398,8 @@ index 000000000..f7aa162fb
+ /** + /**
+ * Sets the particle Color. + * Sets the particle Color.
+ * Only valid for REDSTONE, SPELL_MOB and SPELL_MOB_AMBIENT. + * 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) { + public ParticleBuilder color(Color color) {
+ return color(color.getRed(), color.getGreen(), color.getBlue()); + return color(color.getRed(), color.getGreen(), color.getBlue());
@@ -374,6 +408,10 @@ index 000000000..f7aa162fb
+ /** + /**
+ * Sets the particle Color. + * Sets the particle Color.
+ * Only valid for REDSTONE, SPELL_MOB and SPELL_MOB_AMBIENT. + * 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) { + public ParticleBuilder color(int r, int g, int b) {
+ if (particle != Particle.REDSTONE && particle != Particle.SPELL_MOB && particle != Particle.SPELL_MOB_AMBIENT) { + if (particle != Particle.REDSTONE && particle != Particle.SPELL_MOB && particle != Particle.SPELL_MOB_AMBIENT) {
@@ -394,7 +432,7 @@ index 000000000..f7aa162fb
+ } + }
+} +}
diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java diff --git a/src/main/java/org/bukkit/Particle.java b/src/main/java/org/bukkit/Particle.java
index 4d0acaf5b..0ae85d855 100644 index 4d0acaf5b..255efab76 100644
--- a/src/main/java/org/bukkit/Particle.java --- a/src/main/java/org/bukkit/Particle.java
+++ b/src/main/java/org/bukkit/Particle.java +++ b/src/main/java/org/bukkit/Particle.java
@@ -0,0 +0,0 @@ public enum Particle { @@ -0,0 +0,0 @@ public enum Particle {
@@ -415,6 +453,8 @@ index 4d0acaf5b..0ae85d855 100644
+ // Paper start - Particle API expansion + // Paper start - Particle API expansion
+ /** + /**
+ * Creates a {@link com.destroystokyo.paper.ParticleBuilder} + * Creates a {@link com.destroystokyo.paper.ParticleBuilder}
+ *
+ * @return a {@link com.destroystokyo.paper.ParticleBuilder} for the particle
+ */ + */
+ public com.destroystokyo.paper.ParticleBuilder builder() { + public com.destroystokyo.paper.ParticleBuilder builder() {
+ return new com.destroystokyo.paper.ParticleBuilder(this); + return new com.destroystokyo.paper.ParticleBuilder(this);
@@ -424,7 +464,7 @@ index 4d0acaf5b..0ae85d855 100644
* Options which can be applied to redstone dust particles - a particle * Options which can be applied to redstone dust particles - a particle
* color and size. * color and size.
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index cf5bd1540..ef1494dee 100644 index f9d8b14c6..5630c624a 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {

View File

@@ -7,7 +7,7 @@ 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. 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 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 --- a/src/main/java/org/bukkit/entity/HumanEntity.java
+++ b/src/main/java/org/bukkit/entity/HumanEntity.java +++ b/src/main/java/org/bukkit/entity/HumanEntity.java
@@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv @@ -0,0 +0,0 @@ public interface HumanEntity extends LivingEntity, AnimalTamer, Permissible, Inv
@@ -17,6 +17,8 @@ index dd95773e..3924d00c 100644
+ // Paper start + // Paper start
+ /** + /**
+ * Force-closes the currently open inventory view for this player, if any. + * 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); + public void closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason reason);
+ // Paper end + // Paper end
@@ -25,7 +27,7 @@ index dd95773e..3924d00c 100644
* Returns the ItemStack currently in your hand, can be empty. * 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 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 --- a/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
+++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java +++ b/src/main/java/org/bukkit/event/inventory/InventoryCloseEvent.java
@@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryView; @@ -0,0 +0,0 @@ import org.bukkit.inventory.InventoryView;

View File

@@ -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 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 diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 932cc249a..4b7a19d31 100644 index 932cc249a..41619f09a 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java --- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -0,0 +0,0 @@ import org.bukkit.Material; @@ -0,0 +0,0 @@ import org.bukkit.Material;
@@ -36,11 +36,15 @@ index 932cc249a..4b7a19d31 100644
+ +
+ /** + /**
+ * Get how long the players hands have been raised (Charging Bow attack, using a potion, etc) + * 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(); + int getHandRaisedTime();
+ +
+ /** + /**
+ * Whether or not this entity is using or charging an attack (Bow pulled back, drinking potion, eating food) + * 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(); + boolean isHandRaised();
// Paper end // Paper end

View File

@@ -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 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 new file mode 100644
index 00000000..c6add1b1 index 000000000..6fde1e97f
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/player/PlayerReadyArrowEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -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() { + public ItemStack getBow() {
+ return bow; + return bow;
+ } + }
+ +
+ /** + /**
+ * What arrow is being attempted to use + * @return the arrow that is attempting to be used
+ */ + */
+ public ItemStack getArrow() { + public ItemStack getArrow() {
+ return arrow; + return arrow;

View File

@@ -9,7 +9,7 @@ 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 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 new file mode 100644
index 00000000..a11f811e index 000000000..b57fff9fb
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/profile/ProfileWhitelistVerifyEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -66,7 +66,7 @@ index 00000000..a11f811e
+ } + }
+ +
+ /** + /**
+ * 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() { + public String getKickMessage() {
+ return kickMessage; + return kickMessage;
@@ -87,7 +87,7 @@ index 00000000..a11f811e
+ } + }
+ +
+ /** + /**
+ * 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() { + public boolean isWhitelisted() {
+ return whitelisted; + return whitelisted;
@@ -95,20 +95,21 @@ index 00000000..a11f811e
+ +
+ /** + /**
+ * Changes the players whitelisted state. false will deny the login + * Changes the players whitelisted state. false will deny the login
+ * @param whitelisted The new whitelisted state
+ */ + */
+ public void setWhitelisted(boolean whitelisted) { + public void setWhitelisted(boolean whitelisted) {
+ this.whitelisted = 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() { + public boolean isOp() {
+ return isOp; + return isOp;
+ } + }
+ +
+ /** + /**
+ * Returns if the server even has whitelist on + * @return if the server even has whitelist on
+ */ + */
+ public boolean isWhitelistEnabled() { + public boolean isWhitelistEnabled() {
+ return whitelistEnabled; + return whitelistEnabled;

View File

@@ -27,7 +27,7 @@ index 079b9febe..c75bce07a 100644
* Gets the world containing this chunk * Gets the world containing this chunk
* *
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java
index a9054d8f5..53517dab1 100644 index ba300c294..f84f151ad 100644
--- a/src/main/java/org/bukkit/World.java --- a/src/main/java/org/bukkit/World.java
+++ b/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java
@@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable { @@ -0,0 +0,0 @@ public interface World extends PluginMessageRecipient, Metadatable {
@@ -39,7 +39,7 @@ index a9054d8f5..53517dab1 100644
+ * Gets the chunk at the specified chunk key, which is the X and Z packed into a long. + * 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: + * 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 + * @param chunkKey The Chunk Key to look up the chunk by
+ * @return The chunk at the specified key + * @return The chunk at the specified key

View File

@@ -8,7 +8,7 @@ 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 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 new file mode 100644
index 00000000..7b07f10c index 000000000..ded25f214
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java +++ b/src/main/java/com/destroystokyo/paper/entity/RangedEntity.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -20,6 +20,7 @@ index 00000000..7b07f10c
+ /** + /**
+ * Attack the specified entity using a ranged attack. + * 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). + * @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. + * 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 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 --- a/src/main/java/org/bukkit/entity/Illusioner.java
+++ b/src/main/java/org/bukkit/entity/Illusioner.java +++ b/src/main/java/org/bukkit/entity/Illusioner.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -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 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 --- a/src/main/java/org/bukkit/entity/Llama.java
+++ b/src/main/java/org/bukkit/entity/Llama.java +++ b/src/main/java/org/bukkit/entity/Llama.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -75,7 +76,7 @@ index 9422d56c..92c30ed5 100644
/** /**
* Represents the base color that the llama has. * 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 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 --- a/src/main/java/org/bukkit/entity/Skeleton.java
+++ b/src/main/java/org/bukkit/entity/Skeleton.java +++ b/src/main/java/org/bukkit/entity/Skeleton.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -92,7 +93,7 @@ index e33d00b3..40157bef 100644
/** /**
* Gets the current type of this skeleton. * 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 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 --- a/src/main/java/org/bukkit/entity/Snowman.java
+++ b/src/main/java/org/bukkit/entity/Snowman.java +++ b/src/main/java/org/bukkit/entity/Snowman.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -109,7 +110,7 @@ index 818efe2a..10f8f6d4 100644
/** /**
* Gets whether this snowman is in "derp mode", meaning it is not wearing a * 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 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 --- a/src/main/java/org/bukkit/entity/Witch.java
+++ b/src/main/java/org/bukkit/entity/Witch.java +++ b/src/main/java/org/bukkit/entity/Witch.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -124,7 +125,7 @@ index 9c5dc1f9..4b27f689 100644
+public interface Witch extends Monster, RangedEntity { // Paper +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 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 --- a/src/main/java/org/bukkit/entity/Wither.java
+++ b/src/main/java/org/bukkit/entity/Wither.java +++ b/src/main/java/org/bukkit/entity/Wither.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@

View File

@@ -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 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 new file mode 100644
index 00000000..e3035110 index 000000000..790218998
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchConsumePotionEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -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() { + public ItemStack getPotion() {
+ return potion; + 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 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 new file mode 100644
index 00000000..6ef6367b index 000000000..6ef6367b6
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchThrowPotionEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@

View File

@@ -7,7 +7,7 @@ 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 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 new file mode 100644
index 00000000..5082662a index 000000000..0e0c6da71
--- /dev/null --- /dev/null
+++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java +++ b/src/main/java/com/destroystokyo/paper/event/entity/WitchReadyPotionEvent.java
@@ -0,0 +0,0 @@ @@ -0,0 +0,0 @@
@@ -31,6 +31,9 @@ index 00000000..5082662a
+ +
+ /** + /**
+ * Fires thee event, returning the desired potion, or air of cancelled + * 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) { + public static ItemStack process(Witch witch, ItemStack potion) {
+ WitchReadyPotionEvent event = new WitchReadyPotionEvent(witch, 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() { + public ItemStack getPotion() {
+ return potion; + return potion;