From f73b516f196df8a3ee7c8cf26ddfa5eea9189b80 Mon Sep 17 00:00:00 2001 From: MagicHarp <@2749380016@qq.com> Date: Fri, 27 Sep 2024 19:14:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=82=E6=97=B6=E7=A0=81=E5=AE=8C=E4=BA=86?= =?UTF-8?q?=E7=9B=94=E7=94=B2=E5=95=86=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mod/entity/npc/ModVillagers.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/confluence/mod/entity/npc/ModVillagers.java b/src/main/java/org/confluence/mod/entity/npc/ModVillagers.java index e00d5457b..0da76e979 100644 --- a/src/main/java/org/confluence/mod/entity/npc/ModVillagers.java +++ b/src/main/java/org/confluence/mod/entity/npc/ModVillagers.java @@ -23,6 +23,7 @@ import org.confluence.mod.block.ModBlocks; import org.confluence.mod.block.common.DecorativeBlocks; import org.confluence.mod.item.ModItems; +import org.confluence.mod.item.armor.Armors; import org.confluence.mod.item.common.Materials; import org.confluence.mod.item.food.Foods; @@ -72,8 +73,27 @@ public static void villagerTrades(VillagerTradesEvent event) { trades.get(2).add(new SkyVillagerItemListing(new ItemStack(Items.EMERALD,6), new ItemStack(Foods.HONEY_MOONCAKES.get(),1), 10, 25, 0.05F)); trades.get(3).add(new SkyVillagerItemListing(new ItemStack(Materials.FALLING_STAR.get(),getRandomQuantity(20, 22)), new ItemStack(Items.EMERALD,2), 10, 25, 0.05F)); trades.get(4).add(new SkyVillagerItemListing(new ItemStack(Items.EMERALD,1), new ItemStack(ModItems.CLOUDWEAVER_SEED.get(),2), 10, 25, 0.05F)); - trades.get(4).add(new SkyVillagerItemListing(new ItemStack(Items.EMERALD,1), new ItemStack(ModItems.STELLAR_BLOSSOM_SEED.get(),2), 10, 25, 0.05F)); + trades.get(5).add(new SkyVillagerItemListing(new ItemStack(Items.EMERALD,1), new ItemStack(ModItems.STELLAR_BLOSSOM_SEED.get(),2), 10, 25, 0.05F)); trades.get(4).add(new SkyVillagerItemListing(new ItemStack(Items.EMERALD,1), new ItemStack(ModItems.FLOATING_WHEAT_SEED.get(),2), 10, 25, 0.05F)); + } else if (type == VillagerProfession.ARMORER) { + // 故意替换原版的一部分(铅和铂金部分) + trades.get(1).add(new BasicItemListing(new ItemStack(Items.EMERALD, getRandomQuantity(6, 10)), new ItemStack(Armors.LEAD_HELMET.get()), 5, 25, 0.05F)); + trades.get(1).add(new BasicItemListing(new ItemStack(Items.EMERALD,getRandomQuantity(10, 14)), new ItemStack(Armors.LEAD_CHESTPLATE.get()), 5, 25, 0.05F)); + trades.get(1).add(new BasicItemListing(new ItemStack(Items.EMERALD,getRandomQuantity(8, 12)), new ItemStack(Armors.LEAD_LEGGINGS.get()), 5, 25, 0.05F)); + trades.get(1).add(new BasicItemListing(new ItemStack(Items.EMERALD,getRandomQuantity(6, 10)), new ItemStack(Armors.LEAD_BOOTS.get()),5, 25, 0.05F)); + trades.get(2).add(new BasicItemListing(new ItemStack(Materials.LEAD_INGOT.get(),5), new ItemStack(Items.EMERALD, 1), 10, 25, 0.05F)); + trades.get(2).add(new BasicItemListing(new ItemStack(Items.EMERALD,1), new ItemStack(Items.COPPER_INGOT,8), 10, 25, 0.05F)); + trades.get(3).add(new SkyVillagerItemListing(new ItemStack(Materials.RUBY.get(),getRandomQuantity(1, 2)), new ItemStack(Items.EMERALD,2), 10, 25, 0.05F)); + trades.get(3).add(new SkyVillagerItemListing(new ItemStack(Materials.AMBER.get(),getRandomQuantity(1, 2)), new ItemStack(Items.EMERALD,2), 10, 25, 0.05F)); + trades.get(3).add(new SkyVillagerItemListing(new ItemStack(Materials.TOPAZ.get(),getRandomQuantity(1, 2)), new ItemStack(Items.EMERALD,2), 10, 25, 0.05F)); + trades.get(3).add(new SkyVillagerItemListing(new ItemStack(Materials.TR_EMERALD.get(),getRandomQuantity(1, 2)), new ItemStack(Items.EMERALD,2), 10, 25, 0.05F)); + trades.get(3).add(new SkyVillagerItemListing(new ItemStack(Materials.TR_AMETHYST.get(),getRandomQuantity(1, 2)), new ItemStack(Items.EMERALD,2), 10, 25, 0.05F)); + trades.get(3).add(new SkyVillagerItemListing(new ItemStack(Materials.SAPPHIRE.get(),getRandomQuantity(1, 2)), new ItemStack(Items.EMERALD,2), 10, 25, 0.05F)); + trades.get(4).add(new BasicItemListing(new ItemStack(Items.EMERALD,getRandomQuantity(7, 9)), new ItemStack(Materials.PLATINUM_INGOT.get(),1), 10, 25, 0.05F)); + trades.get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD, getRandomQuantity(19, 20)), new ItemStack(Armors.PLATINUM_HELMET.get()), 10, 25, 0.05F)); + trades.get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD,getRandomQuantity(22, 23)), new ItemStack(Armors.PLATINUM_CHESTPLATE.get()), 10, 25, 0.05F)); + trades.get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD,getRandomQuantity(20, 21)), new ItemStack(Armors.PLATINUM_LEGGINGS.get()), 10, 25, 0.05F)); + trades.get(5).add(new BasicItemListing(new ItemStack(Items.EMERALD,getRandomQuantity(18, 19)), new ItemStack(Armors.PLATINUM_BOOTS.get()),10, 25, 0.05F)); } } private static int getRandomQuantity(int min, int max) {