Merchant#getRecipes should return an immutable list
This commit is contained in:
@@ -16,7 +16,7 @@ public interface CraftMerchant extends Merchant {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
default List<MerchantRecipe> getRecipes() {
|
default List<MerchantRecipe> getRecipes() {
|
||||||
return Collections.unmodifiableList(Lists.transform(this.getMerchant().getOffers(), new Function<net.minecraft.world.item.trading.MerchantOffer, MerchantRecipe>() {
|
return List.copyOf(Lists.transform(this.getMerchant().getOffers(), new Function<net.minecraft.world.item.trading.MerchantOffer, MerchantRecipe>() { // Paper - javadoc says 'an immutable list of trades' - not 'an unmodifiable view of a list of trades'. fixes issue with setRecipes(getRecipes())
|
||||||
@Override
|
@Override
|
||||||
public MerchantRecipe apply(net.minecraft.world.item.trading.MerchantOffer recipe) {
|
public MerchantRecipe apply(net.minecraft.world.item.trading.MerchantOffer recipe) {
|
||||||
return recipe.asBukkit();
|
return recipe.asBukkit();
|
||||||
|
|||||||
Reference in New Issue
Block a user