mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-26 08:48:34 +01:00
Fix Bug with Villager Trade Handler (how did this even happen in the first place anyways?)
Fixes https://github.com/Ellpeck/ActuallyAdditions/issues/24
This commit is contained in:
parent
c545b162ff
commit
ff8e2b5bdd
1 changed files with 9 additions and 9 deletions
|
@ -52,17 +52,17 @@ public class JamVillagerTradeHandler implements VillagerRegistry.IVillageTradeHa
|
||||||
@Override
|
@Override
|
||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand){
|
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random rand){
|
||||||
for(int i = 0; i < trades.size(); i++){
|
for(int trade = 0; trade < trades.size(); trade++){
|
||||||
for(int j = 0; j < trades.get(i).wants.size(); j++){
|
for(int want = 0; want < trades.get(trade).wants.size(); want++){
|
||||||
ItemStack wantsTwo = null;
|
ItemStack wantsOne = trades.get(trade).wants.get(want);
|
||||||
ItemStack wantsOne = trades.get(i).wants.get(j);
|
wantsOne.stackSize = MathHelper.getRandomIntegerInRange(rand, trades.get(trade).minStackSize, trades.get(trade).maxStackSize);
|
||||||
|
|
||||||
wantsOne.stackSize = MathHelper.getRandomIntegerInRange(rand, trades.get(i).minStackSize, trades.get(i).maxStackSize);
|
ItemStack wantsTwo = null;
|
||||||
if(rand.nextInt(3) == 0){
|
if(rand.nextInt(3) == 0){
|
||||||
int toGet = rand.nextInt(trades.size());
|
int randomSecondTrade = rand.nextInt(trades.size());
|
||||||
for(int k = 0; k < trades.get(toGet).wants.size(); k++){
|
for(int randomSecondWant = 0; randomSecondWant < trades.get(randomSecondTrade).wants.size(); randomSecondWant++){
|
||||||
wantsTwo = trades.get(toGet).wants.get(k);
|
wantsTwo = trades.get(randomSecondTrade).wants.get(randomSecondWant);
|
||||||
wantsTwo.stackSize = MathHelper.getRandomIntegerInRange(rand, trades.get(k).minStackSize, trades.get(k).maxStackSize);
|
wantsTwo.stackSize = MathHelper.getRandomIntegerInRange(rand, trades.get(randomSecondTrade).minStackSize, trades.get(randomSecondTrade).maxStackSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(wantsOne == wantsTwo){
|
if(wantsOne == wantsTwo){
|
||||||
|
|
Loading…
Reference in a new issue