mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Fix TradeRegistryImpl throwing an AssertionError at runtime (#87)
This commit is contained in:
@@ -26,7 +26,7 @@ import net.minecraft.world.entity.npc.VillagerTrades;
|
||||
import java.util.Collections;
|
||||
|
||||
public class TradeRegistryImpl {
|
||||
private static void registerVillagerTrade0(VillagerProfession profession, int level, VillagerTrades.ItemListing... trades) {
|
||||
public static void registerVillagerTrade0(VillagerProfession profession, int level, VillagerTrades.ItemListing... trades) {
|
||||
TradeOfferHelper.registerVillagerOffers(profession, level, allTradesList -> Collections.addAll(allTradesList, trades));
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class TradeRegistryImpl {
|
||||
private static final List<VillagerTrades.ItemListing> WANDERER_TRADER_TRADES_GENERIC = new ArrayList<>();
|
||||
private static final List<VillagerTrades.ItemListing> WANDERER_TRADER_TRADES_RARE = new ArrayList<>();
|
||||
|
||||
private static void registerVillagerTrade0(VillagerProfession profession, int level, VillagerTrades.ItemListing... trades) {
|
||||
public static void registerVillagerTrade0(VillagerProfession profession, int level, VillagerTrades.ItemListing... trades) {
|
||||
Int2ObjectMap<List<VillagerTrades.ItemListing>> tradesForProfession = TRADES_TO_ADD.computeIfAbsent(profession, $ -> new Int2ObjectOpenHashMap<>());
|
||||
List<VillagerTrades.ItemListing> tradesForLevel = tradesForProfession.computeIfAbsent(level, $ -> new ArrayList<>());
|
||||
Collections.addAll(tradesForLevel, trades);
|
||||
|
||||
Reference in New Issue
Block a user