public class ConfigurableVillager extends java.lang.Object implements IConfigurable, cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler
| Modifier and Type | Class and Description |
|---|---|
class |
ConfigurableVillager.WeightedItemStack
An ItemStack that has a certain weight that can be used to occur with a certain chance.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
addedRecipes |
protected java.util.List<ConfigurableVillager.WeightedItemStack> |
allowedTradeInputs |
protected java.util.List<ConfigurableVillager.WeightedItemStack> |
allowedTradeOutputs |
protected ExtendedConfig<VillagerConfig> |
eConfig |
protected int |
inputMaxStackSize |
protected int |
inputMinStackSize |
protected int |
maxWeightDifference |
protected int |
requiredAddedRecipes |
| Modifier | Constructor and Description |
|---|---|
protected |
ConfigurableVillager(ExtendedConfig eConfig)
Make a new instance of a villager.
|
| Modifier and Type | Method and Description |
|---|---|
ExtendedConfig<?> |
getConfig() |
protected int |
getRandomBetween(java.util.Random random,
int min,
int max) |
protected ConfigurableVillager.WeightedItemStack |
getRandomInput(java.util.Random random) |
protected ConfigurableVillager.WeightedItemStack |
getRandomOutput(java.util.Random random) |
protected ConfigurableVillager.WeightedItemStack |
getRandomWeightedItemStack(java.util.List<ConfigurableVillager.WeightedItemStack> trades,
java.util.Random random) |
void |
manipulateTradesForVillager(net.minecraft.entity.passive.EntityVillager villager,
net.minecraft.village.MerchantRecipeList recipeList,
java.util.Random random) |
protected float |
safeDivide(int i,
float j) |
protected ExtendedConfig<VillagerConfig> eConfig
protected java.util.List<ConfigurableVillager.WeightedItemStack> allowedTradeInputs
protected java.util.List<ConfigurableVillager.WeightedItemStack> allowedTradeOutputs
protected int maxWeightDifference
protected int inputMinStackSize
protected int inputMaxStackSize
protected int addedRecipes
protected int requiredAddedRecipes
protected ConfigurableVillager(ExtendedConfig eConfig)
eConfig - The config for this villager.public ExtendedConfig<?> getConfig()
getConfig in interface IConfigurablepublic void manipulateTradesForVillager(net.minecraft.entity.passive.EntityVillager villager,
net.minecraft.village.MerchantRecipeList recipeList,
java.util.Random random)
manipulateTradesForVillager in interface cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandlerprotected float safeDivide(int i,
float j)
protected ConfigurableVillager.WeightedItemStack getRandomWeightedItemStack(java.util.List<ConfigurableVillager.WeightedItemStack> trades, java.util.Random random)
protected ConfigurableVillager.WeightedItemStack getRandomInput(java.util.Random random)
protected ConfigurableVillager.WeightedItemStack getRandomOutput(java.util.Random random)
protected int getRandomBetween(java.util.Random random,
int min,
int max)