Unicopia/src/main/java/com/minelittlepony/unicopia/entity/UTradeOffers.java

31 lines
1.7 KiB
Java
Raw Normal View History

package com.minelittlepony.unicopia.entity;
2021-08-24 21:14:18 +02:00
import com.minelittlepony.unicopia.ability.magic.spell.SpellType;
import com.minelittlepony.unicopia.item.GemstoneItem;
2021-08-24 21:14:18 +02:00
import com.minelittlepony.unicopia.item.UItems;
import net.fabricmc.fabric.api.object.builder.v1.trade.TradeOfferHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.village.TradeOffer;
import net.minecraft.village.VillagerProfession;
public interface UTradeOffers {
static void bootstrap() {
TradeOfferHelper.registerVillagerOffers(VillagerProfession.MASON, 1, factories -> {
factories.add((e, rng) -> new TradeOffer(UItems.GEMSTONE.getDefaultStack(), Items.EMERALD.getDefaultStack(), 30, 2, 0.05F));
});
TradeOfferHelper.registerVillagerOffers(VillagerProfession.LIBRARIAN, 1, factories -> {
factories.add((e, rng) -> new TradeOffer(new ItemStack(UItems.GEMSTONE, 2), Items.EMERALD.getDefaultStack(), 20, 1, 0.05F));
2021-08-24 21:14:18 +02:00
});
TradeOfferHelper.registerVillagerOffers(VillagerProfession.CARTOGRAPHER, 1, factories -> {
factories.add((e, rng) -> new TradeOffer(new ItemStack(UItems.GEMSTONE, 3), Items.EMERALD.getDefaultStack(), 20, 1, 0.05F));
});
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> {
factories.add((e, rng) -> new TradeOffer(new ItemStack(UItems.GEMSTONE, 30), UItems.GOLDEN_FEATHER.getDefaultStack(), UItems.GOLDEN_WING.getDefaultStack(), 30, 2, 0.05F));
factories.add((e, rng) -> new TradeOffer(new ItemStack(UItems.GEMSTONE, 3), GemstoneItem.enchanted(UItems.GEMSTONE.getDefaultStack(), SpellType.random(rng)), 20, 1, 0.05F));
});
2021-08-24 21:14:18 +02:00
}
}