From 41fd1852ae1142f1736510e1daf81c7c573c7064 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Wed, 10 Feb 2021 14:53:36 -0800 Subject: [PATCH] Merchant#getRecipes should return an immutable list --- .../java/org/bukkit/craftbukkit/inventory/CraftMerchant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java index 770686757a..72b5f67242 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java @@ -16,7 +16,7 @@ public interface CraftMerchant extends Merchant { @Override default List getRecipes() { - return Collections.unmodifiableList(Lists.transform(this.getMerchant().getOffers(), new Function() { + return List.copyOf(Lists.transform(this.getMerchant().getOffers(), new Function() { // Paper - javadoc says 'an immutable list of trades' - not 'an unmodifiable view of a list of trades'. fixes issue with setRecipes(getRecipes()) @Override public MerchantRecipe apply(net.minecraft.world.item.trading.MerchantOffer recipe) { return recipe.asBukkit();