Skip to content

Commit

Permalink
make sure villager is not null when passed to tradelist, should fix #483
Browse files Browse the repository at this point in the history
  • Loading branch information
way2muchnoise committed Jun 21, 2024
1 parent 04b4a5b commit 0ad4b92
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AbstractVillagerEntry(Int2ObjectMap<VillagerTrades.ItemListing[]> itemLis
public void addITradeLists(Int2ObjectMap<VillagerTrades.ItemListing[]> itemListings) {
for (int i = 1;i < itemListings.size() + 1;i++) {
VillagerTrades.ItemListing[] levelList = itemListings.get(i);
TradeList trades = this.tradeList.size() > i ? this.tradeList.get(i) : new TradeList(entity);
TradeList trades = this.tradeList.size() > i ? this.tradeList.get(i) : new TradeList(getVillagerEntity());
trades.addITradeList(levelList);
this.tradeList.add(trades);
}
Expand All @@ -34,7 +34,7 @@ public TradeList getVillagerTrades(int level) {
if (tradeList.size() > level) {
return tradeList.get(level);
} else {
return new TradeList(entity);
return new TradeList(getVillagerEntity());
}
}

Expand Down

0 comments on commit 0ad4b92

Please sign in to comment.