From 6364cb25916c04a4bff21f68c3f33f736198ff5f Mon Sep 17 00:00:00 2001 From: Aikar <aikar@aikar.co> Date: Tue, 19 Dec 2017 16:52:53 -0500 Subject: [PATCH] AsyncTabCompleteEvent shouldn't store Immutable Lists --- Spigot-API-Patches/AsyncTabCompleteEvent.patch | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Spigot-API-Patches/AsyncTabCompleteEvent.patch b/Spigot-API-Patches/AsyncTabCompleteEvent.patch index 6a16f60e93..b94f81dc82 100644 --- a/Spigot-API-Patches/AsyncTabCompleteEvent.patch +++ b/Spigot-API-Patches/AsyncTabCompleteEvent.patch @@ -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..1e81fe1c +index 00000000..2fa4cb1c --- /dev/null +++ b/src/main/java/com/destroystokyo/paper/event/server/AsyncTabCompleteEvent.java @@ -0,0 +0,0 @@ @@ -42,6 +42,7 @@ index 00000000..1e81fe1c + +package com.destroystokyo.paper.event.server; + ++import com.google.common.collect.ImmutableList; +import org.bukkit.Location; +import org.bukkit.command.Command; +import org.bukkit.command.CommandSender; @@ -49,6 +50,7 @@ index 00000000..1e81fe1c +import org.bukkit.event.Event; +import org.bukkit.event.HandlerList; + ++import java.util.ArrayList; +import java.util.List; + +/** @@ -107,6 +109,9 @@ index 00000000..1e81fe1c + * @param completions the new completions + */ + public void setCompletions(List<String> completions) { ++ if (completions instanceof ImmutableList) { ++ completions = new ArrayList<>(completions); ++ } + this.completions = completions; + } +