mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
062733b903
Doesn't compile yet. CraftBukkit Changes: 90d6905b Repackage NMS 69cf961d Repackage patches Spigot Changes: 79d53c28 Repackage NMS
19 lines
1.4 KiB
Diff
19 lines
1.4 KiB
Diff
From 0000000000000000000000000000000000000000 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
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java
|
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMerchant.java
|
|
@@ -0,0 +0,0 @@ public class CraftMerchant implements Merchant {
|
|
|
|
@Override
|
|
public List<MerchantRecipe> getRecipes() {
|
|
- return Collections.unmodifiableList(Lists.transform(merchant.getOffers(), new Function<net.minecraft.world.item.trading.MerchantRecipe, MerchantRecipe>() {
|
|
+ return com.google.common.collect.ImmutableList.copyOf(Lists.transform(merchant.getOffers(), new Function<net.minecraft.world.item.trading.MerchantRecipe, MerchantRecipe>() { // 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.MerchantRecipe recipe) {
|
|
return recipe.asBukkit();
|