Skip to content

Commit

Permalink
priest trade improvements (#1111)
Browse files Browse the repository at this point in the history
  • Loading branch information
chochem authored Dec 17, 2024
1 parent d016bf4 commit 3bd107b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/java/com/dreammaster/NHTradeHandler/NHTradeHandler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.dreammaster.NHTradeHandler;

import java.util.Random;

import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.village.MerchantRecipe;
import net.minecraft.village.MerchantRecipeList;

import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;

public class NHTradeHandler implements IVillageTradeHandler {

@Override
public void manipulateTradesForVillager(final EntityVillager villager, final MerchantRecipeList recipeList,
final Random random) {
recipeList.addToListWithCheck(
new MerchantRecipe(new ItemStack(Items.emerald, 1), new ItemStack(Items.ender_pearl, 1)));
recipeList.addToListWithCheck(
new MerchantRecipe(new ItemStack(Items.emerald, 1), new ItemStack(Items.dye, 1, 4)));
}
}
3 changes: 3 additions & 0 deletions src/main/java/com/dreammaster/main/MainRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fluids.FluidContainerRegistry;

import com.dreammaster.NHTradeHandler.NHTradeHandler;
import com.dreammaster.TwilightForest.TF_Loot_Chests;
import com.dreammaster.amazingtrophies.AchievementHandler;
import com.dreammaster.bartworksHandler.BWGlassAdder;
Expand Down Expand Up @@ -92,6 +93,7 @@
import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.VillagerRegistry;
import cpw.mods.fml.relauncher.Side;
import eu.usrv.yamcore.YAMCore;
import eu.usrv.yamcore.auxiliary.IngameErrorLog;
Expand Down Expand Up @@ -374,6 +376,7 @@ public void load(FMLInitializationEvent event) {
MinecraftForge.EVENT_BUS.register(new GTNHPauseScreen());
}

VillagerRegistry.instance().registerVillageTradeHandler(2, new NHTradeHandler());
}

public static Block _mBlockBabyChest = new BlockBabyChest();
Expand Down

0 comments on commit 3bd107b

Please sign in to comment.