本文整理汇总了Java中net.minecraft.village.MerchantRecipe.func_82783_a方法的典型用法代码示例。如果您正苦于以下问题:Java MerchantRecipe.func_82783_a方法的具体用法?Java MerchantRecipe.func_82783_a怎么用?Java MerchantRecipe.func_82783_a使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.village.MerchantRecipe
的用法示例。
在下文中一共展示了MerchantRecipe.func_82783_a方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: manipulateTradesForVillager
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) {
if(villager.getProfession() == Config.hereticID) {
/*recipeList.add(new MerchantRecipe(new ItemStack(ConfigItems.itemResource, 20 + random.nextInt(3), 18), new ItemStack(Items.emerald)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald), new ItemStack(ConfigItems.itemResource, 1, 9)));
recipeList.add(new MerchantRecipe(new ItemStack(ConfigItems.itemResource, 4 + random.nextInt(3), 3), new ItemStack(Items.emerald)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald), new ItemStack(ConfigItems.itemResource, 1, 0)));
recipeList.add(new MerchantRecipe(new ItemStack(ConfigItems.itemResource, 4 + random.nextInt(3), 6), new ItemStack(Items.emerald)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald), new ItemStack(ConfigItems.itemResource, 1, 1)));
recipeList.add(new MerchantRecipe(new ItemStack(ConfigItems.itemNuggetChicken, 24 + random.nextInt(8), 0), new ItemStack(Items.emerald)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.book, 4 + random.nextInt(3), 0), new ItemStack(ConfigItems.itemResource, 1, 9)));
recipeList.add(new MerchantRecipe(new ItemStack(ConfigItems.itemNuggetBeef, 24 + random.nextInt(8), 0), new ItemStack(Items.emerald)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald), new ItemStack(ConfigItems.itemShard, 2 + random.nextInt(2), random.nextInt(6))));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald), new ItemStack(ConfigItems.itemManaBean, 1 + random.nextInt(2), 0)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 5 + random.nextInt(3)), new ItemStack(ConfigItems.itemBathSalts, 1, 0)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 5 + random.nextInt(3)), new ItemStack(ConfigItems.itemRingRunic, 1, 0)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 5 + random.nextInt(3)), new ItemStack(ConfigItems.itemAmuletVis, 1, 0)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 5 + random.nextInt(3)), new ItemStack(ConfigItems.itemBaubleBlanks, 1, 3 + random.nextInt(6))));
*/
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 1 + random.nextInt(2)), new ItemStack(ForbiddenItems.deadlyShards, 3 + random.nextInt(2), 6)));
if(!Config.noLust)
recipeList.add(new MerchantRecipe(new ItemStack(ForbiddenItems.deadlyShards, 2 + random.nextInt(4), 4), new ItemStack(Items.emerald)));
recipeList.add(new MerchantRecipe(new ItemStack(ForbiddenItems.deadlyShards, 4 + random.nextInt(6), 0), new ItemStack(Items.emerald)));
recipeList.add(new MerchantRecipe(new ItemStack(ForbiddenItems.gluttonyShard, 4 + random.nextInt(6), 0), new ItemStack(Items.emerald)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 1 + random.nextInt(3)), new ItemStack(Items.skull, 1, 0)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 4 + random.nextInt(4)), new ItemStack(Items.ghast_tear, 1)));
recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 1), new ItemStack(Items.glowstone_dust, 8 + random.nextInt(9))));
ItemStack wand = new ItemStack(ConfigItems.itemWandCasting, 1, 36);
((ItemWandCasting) wand.getItem()).setCap(wand, (WandCap) WandCap.caps.get("iron"));
((ItemWandCasting) wand.getItem()).setRod(wand, (WandRod) WandRod.rods.get("profane"));
((ItemWandCasting) wand.getItem()).storeAllVis(wand, new AspectList().add(Aspect.FIRE, 5000).add(Aspect.WATER, 5000).add(Aspect.EARTH, 5000).add(Aspect.AIR, 5000).add(Aspect.ORDER, 5000).add(Aspect.ENTROPY, 5000));
MerchantRecipe profane = new MerchantRecipe(new ItemStack(Items.emerald, 8 + random.nextInt(5)), new ItemStack(Items.stick), wand);
profane.func_82783_a(-6);
recipeList.add(profane);
MerchantRecipe fire = new MerchantRecipe(new ItemStack(Items.emerald, 4 + random.nextInt(5)), new ItemStack(Items.diamond, 1), new ItemStack(ConfigItems.itemFocusFire, 1));
fire.func_82783_a(-6);
recipeList.add(fire);
}
}
示例2: updateAITick
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
/**
* main AI tick function, replaces updateEntityActionState
*/
@Override
protected void updateAITick()
{
if (--this.randomTickDivider <= 0)
{
this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
this.randomTickDivider = 70 + this.rand.nextInt(50);
this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32);
if (this.villageObj == null)
{
this.detachHome();
}
else
{
ChunkCoordinates chunkcoordinates = this.villageObj.getCenter();
this.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, (int) (this.villageObj.getVillageRadius() * 0.6F));
if (this.field_82190_bM)
{
this.field_82190_bM = false;
this.villageObj.setDefaultPlayerReputation(5);
}
}
}
////ASD
if (!this.isTrading() && this.timeUntilReset > 0)
{
--this.timeUntilReset;
if (this.timeUntilReset <= 0)
{
if (this.needsInit)
{
if (this.buyingList.size() > 1)
{
Iterator iterator = this.buyingList.iterator();
while (iterator.hasNext())
{
MerchantRecipe merchantrecipe = (MerchantRecipe)iterator.next();
if (merchantrecipe.isRecipeDisabled())
{
merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
}
}
}
this.addDefaultEquipmentAndRecipies(1);
this.needsInit = false;
/*if (this.villageObj != null && this.lastBuyingPlayer != null)
{
this.worldObj.setEntityState(this, (byte)14);
this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1);
}*/
}
this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0));
}
}
////ASD
super.updateAITick();
}
示例3: updateAITick
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
/**
* main AI tick function, replaces updateEntityActionState
*/
protected void updateAITick()
{
if (--this.randomTickDivider <= 0)
{
this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
this.randomTickDivider = 70 + this.rand.nextInt(50);
this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32);
if (this.villageObj == null)
{
this.detachHome();
}
else
{
ChunkCoordinates var1 = this.villageObj.getCenter();
this.setHomeArea(var1.posX, var1.posY, var1.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F));
if (this.isLookingForHome)
{
this.isLookingForHome = false;
this.villageObj.setDefaultPlayerReputation(5);
}
}
}
if (!this.isTrading() && this.timeUntilReset > 0)
{
--this.timeUntilReset;
if (this.timeUntilReset <= 0)
{
if (this.needsInitilization)
{
if (this.buyingList.size() > 1)
{
Iterator var3 = this.buyingList.iterator();
while (var3.hasNext())
{
MerchantRecipe var2 = (MerchantRecipe)var3.next();
if (var2.isRecipeDisabled())
{
var2.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
}
}
}
this.addDefaultEquipmentAndRecipies(1);
this.needsInitilization = false;
if (this.villageObj != null && this.lastBuyingPlayer != null)
{
this.worldObj.setEntityState(this, (byte)14);
this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1);
}
}
this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0));
}
}
super.updateAITick();
}
示例4: updateAITick
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
protected void updateAITick()
{
if (--this.randomTickDivider <= 0)
{
this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
this.randomTickDivider = 70 + this.rand.nextInt(50);
this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32);
if (this.villageObj == null)
{
this.detachHome();
}
else
{
ChunkCoordinates chunkcoordinates = this.villageObj.getCenter();
this.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F));
if (this.isLookingForHome)
{
this.isLookingForHome = false;
this.villageObj.setDefaultPlayerReputation(5);
}
}
}
if (!this.isTrading() && this.timeUntilReset > 0)
{
--this.timeUntilReset;
if (this.timeUntilReset <= 0)
{
if (this.needsInitilization)
{
if (this.buyingList.size() > 1)
{
Iterator iterator = this.buyingList.iterator();
while (iterator.hasNext())
{
MerchantRecipe merchantrecipe = (MerchantRecipe)iterator.next();
if (merchantrecipe.isRecipeDisabled())
{
merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
}
}
}
this.addDefaultEquipmentAndRecipies(1);
this.needsInitilization = false;
if (this.villageObj != null && this.lastBuyingPlayer != null)
{
this.worldObj.setEntityState(this, (byte)14);
this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1);
}
}
this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0));
}
}
super.updateAITick();
}
示例5: updateAITick
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
/**
* main AI tick function, replaces updateEntityActionState
*/
protected void updateAITick()
{
if (--this.randomTickDivider <= 0)
{
this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
this.randomTickDivider = 70 + this.rand.nextInt(50);
this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32);
if (this.villageObj == null)
{
this.detachHome();
}
else
{
ChunkCoordinates chunkcoordinates = this.villageObj.getCenter();
this.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F));
if (this.field_82190_bM)
{
this.field_82190_bM = false;
this.villageObj.func_82683_b(5);
}
}
}
if (!this.isTrading() && this.timeUntilReset > 0)
{
--this.timeUntilReset;
if (this.timeUntilReset <= 0)
{
if (this.needsInitilization)
{
if (this.buyingList.size() > 1)
{
Iterator iterator = this.buyingList.iterator();
while (iterator.hasNext())
{
MerchantRecipe merchantrecipe = (MerchantRecipe)iterator.next();
if (merchantrecipe.func_82784_g())
{
merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
}
}
}
this.addDefaultEquipmentAndRecipies(1);
this.needsInitilization = false;
if (this.villageObj != null && this.lastBuyingPlayer != null)
{
this.worldObj.setEntityState(this, (byte)14);
this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1);
}
}
this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0));
}
}
super.updateAITick();
}
示例6: func_70629_bd
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
protected void func_70629_bd() {
if(--this.field_70955_e <= 0) {
this.field_70170_p.field_72982_D.func_75551_a(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.field_70163_u), MathHelper.func_76128_c(this.field_70161_v));
this.field_70955_e = 70 + this.field_70146_Z.nextInt(50);
this.field_70954_d = this.field_70170_p.field_72982_D.func_75550_a(MathHelper.func_76128_c(this.field_70165_t), MathHelper.func_76128_c(this.field_70163_u), MathHelper.func_76128_c(this.field_70161_v), 32);
if(this.field_70954_d == null) {
this.func_110177_bN();
} else {
ChunkCoordinates var1 = this.field_70954_d.func_75577_a();
this.func_110171_b(var1.field_71574_a, var1.field_71572_b, var1.field_71573_c, (int)((float)this.field_70954_d.func_75568_b() * 0.6F));
if(this.field_82190_bM) {
this.field_82190_bM = false;
this.field_70954_d.func_82683_b(5);
}
}
}
if(!this.func_70940_q() && this.field_70961_j > 0) {
--this.field_70961_j;
if(this.field_70961_j <= 0) {
if(this.field_70959_by) {
if(this.field_70963_i.size() > 1) {
Iterator var3 = this.field_70963_i.iterator();
while(var3.hasNext()) {
MerchantRecipe var2 = (MerchantRecipe)var3.next();
if(var2.func_82784_g()) {
var2.func_82783_a(this.field_70146_Z.nextInt(6) + this.field_70146_Z.nextInt(6) + 2);
}
}
}
this.func_70950_c(1);
this.field_70959_by = false;
if(this.field_70954_d != null && this.field_82189_bL != null) {
this.field_70170_p.func_72960_a(this, (byte)14);
this.field_70954_d.func_82688_a(this.field_82189_bL, 1);
}
}
this.func_70690_d(new PotionEffect(Potion.field_76428_l.field_76415_H, 200, 0));
}
}
super.func_70629_bd();
}
示例7: updateAITick
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
/**
* main AI tick function, replaces updateEntityActionState
*/
protected void updateAITick()
{
if (--this.randomTickDivider <= 0)
{
this.worldObj.villageCollectionObj.addVillagerPosition(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
this.randomTickDivider = 70 + this.rand.nextInt(50);
this.villageObj = this.worldObj.villageCollectionObj.findNearestVillage(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 32);
if (this.villageObj == null)
{
this.detachHome();
}
else
{
ChunkCoordinates chunkcoordinates = this.villageObj.getCenter();
this.setHomeArea(chunkcoordinates.posX, chunkcoordinates.posY, chunkcoordinates.posZ, (int)((float)this.villageObj.getVillageRadius() * 0.6F));
if (this.isLookingForHome)
{
this.isLookingForHome = false;
this.villageObj.setDefaultPlayerReputation(5);
}
}
}
if (!this.isTrading() && this.timeUntilReset > 0)
{
--this.timeUntilReset;
if (this.timeUntilReset <= 0)
{
if (this.needsInitilization)
{
if (this.buyingList.size() > 1)
{
Iterator iterator = this.buyingList.iterator();
while (iterator.hasNext())
{
MerchantRecipe merchantrecipe = (MerchantRecipe)iterator.next();
if (merchantrecipe.isRecipeDisabled())
{
merchantrecipe.func_82783_a(this.rand.nextInt(6) + this.rand.nextInt(6) + 2);
}
}
}
this.addDefaultEquipmentAndRecipies(1);
this.needsInitilization = false;
if (this.villageObj != null && this.lastBuyingPlayer != null)
{
this.worldObj.setEntityState(this, (byte)14);
this.villageObj.setReputationForPlayer(this.lastBuyingPlayer, 1);
}
}
this.addPotionEffect(new PotionEffect(Potion.regeneration.id, 200, 0));
}
}
super.updateAITick();
}