forked from Nyancatpig/Cultural-Delights-1.18.2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
168 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
src/main/java/com/ncpbails/culturaldelights/event/ModEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.ncpbails.culturaldelights.event; | ||
|
||
import com.ncpbails.culturaldelights.CulturalDelights; | ||
import com.ncpbails.culturaldelights.item.ModItems; | ||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; | ||
import net.minecraft.world.entity.npc.VillagerProfession; | ||
import net.minecraft.world.entity.npc.VillagerTrades; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.item.trading.MerchantOffer; | ||
import net.minecraftforge.event.village.VillagerTradesEvent; | ||
import net.minecraftforge.eventbus.api.SubscribeEvent; | ||
import net.minecraftforge.fml.common.Mod; | ||
|
||
import java.util.List; | ||
|
||
@Mod.EventBusSubscriber(modid = CulturalDelights.MOD_ID) | ||
public class ModEvents { | ||
|
||
@SubscribeEvent | ||
public static void addCustomTrades(VillagerTradesEvent event) { | ||
|
||
if(event.getType() == VillagerProfession.FARMER) { | ||
Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades(); | ||
ItemStack stack = new ItemStack(Items.EMERALD, 1); | ||
int villagerLevel = 1; | ||
|
||
trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( | ||
new ItemStack(ModItems.CUCUMBER.get(), 22), | ||
stack,10,2,0.02F)); | ||
//max uses pXp price multiplier | ||
|
||
trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( | ||
new ItemStack(ModItems.EGGPLANT.get(), 15), | ||
stack,10,2,0.02F)); | ||
//max uses pXp price multiplier | ||
|
||
trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( | ||
new ItemStack(ModItems.WHITE_EGGPLANT.get(), 20), | ||
stack,10,2,0.02F)); | ||
//max uses pXp price multiplier | ||
|
||
trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( | ||
new ItemStack(ModItems.CORN_COB.get(), 15), | ||
stack,10,2,0.02F)); | ||
//max uses pXp price multiplier | ||
|
||
trades.get(villagerLevel).add((trader, rand) -> new MerchantOffer( | ||
new ItemStack(ModItems.AVOCADO.get(), 20), | ||
stack,10,2,0.02F)); | ||
//max uses pXp price multiplier | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
public-f net.minecraft.world.entity.animal.Chicken p_28271_ # FOOD_ITEMS | ||
public-f net.minecraft.world.entity.animal.Pig f_29458_ # FOOD_ITEMS | ||
public-f net.minecraft.world.entity.animal.Parrot f_29357_ # TAME_FOOD |