AsyncTabCompleteEvent shouldn't store Immutable Lists
This commit is contained in:
parent
c208d652b4
commit
7fb767fe41
1 changed files with 9 additions and 4 deletions
|
@ -1,4 +1,4 @@
|
||||||
From b1e104401c9584500679340438d6b818f6644c07 Mon Sep 17 00:00:00 2001
|
From 661d9fecb9f68354bfd35d767c3256ef1869009c Mon Sep 17 00:00:00 2001
|
||||||
From: Aikar <aikar@aikar.co>
|
From: Aikar <aikar@aikar.co>
|
||||||
Date: Sun, 26 Nov 2017 13:17:09 -0500
|
Date: Sun, 26 Nov 2017 13:17:09 -0500
|
||||||
Subject: [PATCH] AsyncTabCompleteEvent
|
Subject: [PATCH] AsyncTabCompleteEvent
|
||||||
|
@ -13,10 +13,10 @@ 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..1e81fe1c
|
index 00000000..2fa4cb1c
|
||||||
--- /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 +1,162 @@
|
@@ -0,0 +1,167 @@
|
||||||
+/*
|
+/*
|
||||||
+ * Copyright (c) 2017 Daniel Ennis (Aikar) MIT License
|
+ * Copyright (c) 2017 Daniel Ennis (Aikar) MIT License
|
||||||
+ *
|
+ *
|
||||||
|
@ -42,6 +42,7 @@ index 00000000..1e81fe1c
|
||||||
+
|
+
|
||||||
+package com.destroystokyo.paper.event.server;
|
+package com.destroystokyo.paper.event.server;
|
||||||
+
|
+
|
||||||
|
+import com.google.common.collect.ImmutableList;
|
||||||
+import org.bukkit.Location;
|
+import org.bukkit.Location;
|
||||||
+import org.bukkit.command.Command;
|
+import org.bukkit.command.Command;
|
||||||
+import org.bukkit.command.CommandSender;
|
+import org.bukkit.command.CommandSender;
|
||||||
|
@ -49,6 +50,7 @@ index 00000000..1e81fe1c
|
||||||
+import org.bukkit.event.Event;
|
+import org.bukkit.event.Event;
|
||||||
+import org.bukkit.event.HandlerList;
|
+import org.bukkit.event.HandlerList;
|
||||||
+
|
+
|
||||||
|
+import java.util.ArrayList;
|
||||||
+import java.util.List;
|
+import java.util.List;
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
|
@ -107,6 +109,9 @@ index 00000000..1e81fe1c
|
||||||
+ * @param completions the new completions
|
+ * @param completions the new completions
|
||||||
+ */
|
+ */
|
||||||
+ public void setCompletions(List<String> completions) {
|
+ public void setCompletions(List<String> completions) {
|
||||||
|
+ if (completions instanceof ImmutableList) {
|
||||||
|
+ completions = new ArrayList<>(completions);
|
||||||
|
+ }
|
||||||
+ this.completions = completions;
|
+ this.completions = completions;
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -223,5 +228,5 @@ index 6ac437d5..fef57f5f 100644
|
||||||
* Set the completions offered, overriding any already set.
|
* Set the completions offered, overriding any already set.
|
||||||
*
|
*
|
||||||
--
|
--
|
||||||
2.15.0
|
2.15.1
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue