yarn icon indicating copy to clipboard operation
yarn copied to clipboard

TradeOffers.BuyItemFactory price -> buyAmount

Open Draylar opened this issue 5 years ago • 1 comments

The price field in TradeOffers.BuyForOneEmeraldFactory seems to be wrong. It actually represents the amount of items the Villager wants of a certain type-- for example, in this trade:

image The farmer wants 6 pumpkins. This is defined in TradeOffers:

new BuyForOneEmeraldFactory(Blocks.PUMPKIN, 6, 12, 10)

6 is the quantity bought, 12 is the number of trades allowed before it is blocked (maxUses, correct), and 10 is the XP gained by the villager (experience, correct, but may be better as experienceGained). The second argument is stored to the price field, and is then passed into the wanted ItemStack constructor as count.

Something like buyAmount, purchaseAmount, or wantedQuantity would be better.

Draylar avatar Oct 10 '19 19:10 Draylar

I would not say the name is completely wrong - the price of an emerald is 6 pumpkins - but it is a bit unclear. I would personally vote for wantedQuantity.

Pyrofab avatar Oct 11 '19 12:10 Pyrofab