use of net.minecraft.village.TradeOffer in project MCDungeonsArmors by chronosacaria.
the class TradesRegistry method registerVillagerOffers.
public static void registerVillagerOffers() {
TradeOfferHelper.registerVillagerOffers(VillagerProfession.ARMORER, 5, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 64), new ItemStack(ArmorsRegistry.armorItems.get(ArmorSets.CHAMPION).get(EquipmentSlot.HEAD)), 1, 30, 0.2F))));
TradeOfferHelper.registerVillagerOffers(VillagerProfession.ARMORER, 5, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 64), new ItemStack(ArmorsRegistry.armorItems.get(ArmorSets.CHAMPION).get(EquipmentSlot.CHEST)), 1, 30, 0.2F))));
TradeOfferHelper.registerVillagerOffers(VillagerProfession.ARMORER, 5, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 64), new ItemStack(ArmorsRegistry.armorItems.get(ArmorSets.CHAMPION).get(EquipmentSlot.LEGS)), 1, 30, 0.2F))));
TradeOfferHelper.registerVillagerOffers(VillagerProfession.ARMORER, 5, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 64), new ItemStack(ArmorsRegistry.armorItems.get(ArmorSets.CHAMPION).get(EquipmentSlot.FEET)), 1, 30, 0.2F))));
}
use of net.minecraft.village.TradeOffer in project MCDungeonsArmors by chronosacaria.
the class TradesRegistry method registerWanderingTrades.
public static void registerWanderingTrades() {
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 64), new ItemStack(ArmorsRegistry.armorItems.get(ArmorSets.ENTERTAINER).get(EquipmentSlot.HEAD), 1), 1, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 64), new ItemStack(ArmorsRegistry.armorItems.get(ArmorSets.ENTERTAINER).get(EquipmentSlot.CHEST), 1), 1, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 64), new ItemStack(ArmorsRegistry.armorItems.get(ArmorSets.ENTERTAINER).get(EquipmentSlot.LEGS), 1), 1, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 64), new ItemStack(ArmorsRegistry.armorItems.get(ArmorSets.ENTERTAINER).get(EquipmentSlot.FEET), 1), 1, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 16), new ItemStack(ItemsRegistry.items.get(ItemID.FOX_PELT), 1), 1, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 24), new ItemStack(ItemsRegistry.items.get(ItemID.FOX_PELT_ARCTIC), 1), 1, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 16), new ItemStack(ItemsRegistry.items.get(ItemID.OCELOT_PELT), 1), 4, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 24), new ItemStack(ItemsRegistry.items.get(ItemID.OCELOT_PELT_BLACK), 1), 1, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 16), new ItemStack(ItemsRegistry.items.get(ItemID.WOLF_PELT), 1), 4, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 24), new ItemStack(ItemsRegistry.items.get(ItemID.WOLF_PELT_BLACK), 1), 1, 2, 0.0F))));
TradeOfferHelper.registerWanderingTraderOffers(1, factories -> factories.add(new BasicTradeFactory(new TradeOffer(new ItemStack(Items.EMERALD, 16), new ItemStack(ItemsRegistry.items.get(ItemID.GOAT_PELT), 1), 4, 2, 0.0F))));
}
use of net.minecraft.village.TradeOffer in project tweakermore by Fallen-Breath.
the class MerchantScreenWidgetButtonPageMixin method renderMaxUsesAmount.
@Inject(method = "renderToolTip(II)V", at = @At(value = "FIELD", target = "Lnet/minecraft/client/gui/screen/ingame/MerchantScreen$WidgetButtonPage;x:I", ordinal = 0))
private void renderMaxUsesAmount(int mouseX, int mouseY, CallbackInfo ci) {
if (TweakerMoreConfigs.VILLAGER_OFFER_USES_DISPLAY.getBooleanValue()) {
if (this.x + 50 <= mouseX && mouseX <= this.x + 65) {
TradeOffer offer = this.field_19166.getContainer().getRecipes().get(this.index + ((MerchantScreenAccessor) this.field_19166).getIndexStartOffset());
this.field_19166.renderTooltip(String.format("%d / %d", offer.getUses(), offer.getMaxUses()), mouseX, mouseY);
}
}
}
use of net.minecraft.village.TradeOffer in project Biome-Makeover by Lemonszz.
the class MushroomVillagerEntity method fillRecipes.
protected void fillRecipes() {
TradeOffers.Factory[] tradesCommon = TRADES.get(1);
TradeOffers.Factory[] tradesRare = TRADES.get(2);
if (tradesCommon != null && tradesRare != null) {
TradeOfferList traderOfferList = this.getOffers();
this.fillRecipesFromPool(traderOfferList, tradesCommon, 5);
int i = this.random.nextInt(tradesRare.length);
TradeOffers.Factory factory = tradesRare[i];
TradeOffer tradeOffer = factory.create(this, this.random);
if (tradeOffer != null) {
traderOfferList.add(tradeOffer);
}
}
}
use of net.minecraft.village.TradeOffer in project Fabric-Course-118 by Kaupenjoe.
the class ModRegistries method registerCustomTrades.
private static void registerCustomTrades() {
TradeOfferHelper.registerVillagerOffers(VillagerProfession.FARMER, 1, factories -> {
factories.add((entity, random) -> new TradeOffer(new ItemStack(Items.EMERALD, 2), new ItemStack(ModItems.TURNIP, 12), 6, 2, 0.02f));
});
TradeOfferHelper.registerVillagerOffers(VillagerProfession.TOOLSMITH, 3, factories -> {
factories.add((entity, random) -> new TradeOffer(new ItemStack(Items.EMERALD, 6), new ItemStack(ModItems.ORICHALCUM_PAXEL, 1), 12, 3, 0.08f));
});
}
Aggregations