mirror of
https://github.com/PaperMC/Paper.git
synced 2025-02-16 18:31:53 +01:00
Fix potential for NPE if receivers is null and the world was empty
This commit is contained in:
parent
d4e763c30e
commit
d72d79efee
1 changed files with 5 additions and 3 deletions
|
@ -10,7 +10,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
|
||||
new file mode 100644
|
||||
index 00000000..bf4edd07
|
||||
index 00000000..2bccc409
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/com/destroystokyo/paper/ParticleBuilder.java
|
||||
@@ -0,0 +0,0 @@
|
||||
|
@ -96,11 +96,13 @@ index 00000000..bf4edd07
|
|||
+ * @return If this particle is going to be sent to someone
|
||||
+ */
|
||||
+ public boolean hasReceivers() {
|
||||
+ return (receivers == null && !location.getWorld().getPlayers().isEmpty()) || !receivers.isEmpty();
|
||||
+ return (receivers == null && !location.getWorld().getPlayers().isEmpty()) || (receivers != null && !receivers.isEmpty());
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Sends this particle to all players in the world
|
||||
+ * 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.
|
||||
+ */
|
||||
+ public ParticleBuilder allPlayers() {
|
||||
+ this.receivers = null;
|
||||
|
|
Loading…
Add table
Reference in a new issue