当前位置: 首页>>代码示例>>Java>>正文


Java MerchantRecipe.getToolUses方法代码示例

本文整理汇总了Java中net.minecraft.village.MerchantRecipe.getToolUses方法的典型用法代码示例。如果您正苦于以下问题:Java MerchantRecipe.getToolUses方法的具体用法?Java MerchantRecipe.getToolUses怎么用?Java MerchantRecipe.getToolUses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.village.MerchantRecipe的用法示例。


在下文中一共展示了MerchantRecipe.getToolUses方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
public void useRecipe(MerchantRecipe recipe) {
	recipe.incrementToolUses();
	livingSoundTime = -getTalkInterval();
	playSound("mob.villager.yes", getSoundVolume(), getSoundPitch());
	int xp = 3 + rand.nextInt(4);
	if (recipe.getToolUses() == 1 || rand.nextInt(5) == 0) {
		refreshTimer = 40;
		refreshTrades = true;
		lastCustomer = (customer == null ? null : customer.getName());
		xp += 5;
	}
	if (recipe.getRewardsExp()) {
		worldObj.spawnEntityInWorld(new EntityXPOrb(worldObj, posX, posY + 0.5D, posZ, xp));
	}
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:17,代码来源:EntityNpcMerchantBase.java

示例2: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe recipe)
{
    recipe.incrementToolUses();
    this.livingSoundTime = -this.getTalkInterval();
    this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch());
    int i = 3 + this.rand.nextInt(4);

    if (recipe.getToolUses() == 1 || this.rand.nextInt(5) == 0)
    {
        this.timeUntilReset = 40;
        this.needsInitilization = true;
        this.isWillingToMate = true;

        if (this.buyingPlayer != null)
        {
            this.lastBuyingPlayer = this.buyingPlayer.getName();
        }
        else
        {
            this.lastBuyingPlayer = null;
        }

        i += 5;
    }

    if (recipe.getItemToBuy().getItem() == Items.emerald)
    {
        this.wealth += recipe.getItemToBuy().stackSize;
    }

    if (recipe.getRewardsExp())
    {
        this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, i));
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:36,代码来源:EntityVillager.java

示例3: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe recipe)
{
    recipe.incrementToolUses();
    this.livingSoundTime = -this.getTalkInterval();
    this.playSound(SoundEvents.ENTITY_VILLAGER_YES, this.getSoundVolume(), this.getSoundPitch());
    int i = 3 + this.rand.nextInt(4);

    if (recipe.getToolUses() == 1 || this.rand.nextInt(5) == 0)
    {
        this.timeUntilReset = 40;
        this.needsInitilization = true;
        this.isWillingToMate = true;

        if (this.buyingPlayer != null)
        {
            this.lastBuyingPlayer = this.buyingPlayer.getName();
        }
        else
        {
            this.lastBuyingPlayer = null;
        }

        i += 5;
    }

    if (recipe.getItemToBuy().getItem() == Items.EMERALD)
    {
        this.wealth += recipe.getItemToBuy().func_190916_E();
    }

    if (recipe.getRewardsExp())
    {
        this.world.spawnEntityInWorld(new EntityXPOrb(this.world, this.posX, this.posY + 0.5D, this.posZ, i));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:36,代码来源:EntityVillager.java

示例4: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe recipe)
{
    recipe.incrementToolUses();
    this.livingSoundTime = -this.getTalkInterval();
    this.playSound(SoundEvents.ENTITY_VILLAGER_YES, this.getSoundVolume(), this.getSoundPitch());
    int i = 3 + this.rand.nextInt(4);

    if (recipe.getToolUses() == 1 || this.rand.nextInt(5) == 0)
    {
        this.timeUntilReset = 40;
        this.needsInitilization = true;
        this.isWillingToMate = true;

        if (this.buyingPlayer != null)
        {
            this.lastBuyingPlayer = this.buyingPlayer.getName();
        }
        else
        {
            this.lastBuyingPlayer = null;
        }

        i += 5;
    }

    if (recipe.getItemToBuy().getItem() == Items.EMERALD)
    {
        this.wealth += recipe.getItemToBuy().stackSize;
    }

    if (recipe.getRewardsExp())
    {
        this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, i));
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:36,代码来源:EntityVillager.java

示例5: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
public void useRecipe(MerchantRecipe recipe) {
    recipe.incrementToolUses();
    this.livingSoundTime = -this.getTalkInterval();
    this.playSound(SoundEvents.ENTITY_GHAST_SHOOT, this.getSoundVolume()-20, this.getSoundPitch());
    int i = 3 + this.rand.nextInt(4);

    if (recipe.getToolUses() == 1 || this.rand.nextInt(5) == 0) {
        this.timeUntilReset = 40;
        this.needsInitilization = true;

        if (this.buyingPlayer != null) {
            this.lastBuyingPlayer = this.buyingPlayer.getName();
        } else {
            this.lastBuyingPlayer = null;
        }

        i += 5;
    }

    if (recipe.getItemToBuy().getItem() == ModItems.trading_token) {
        this.wealth += recipe.getItemToBuy().getCount();
    }

    if (recipe.getRewardsExp()) {
        this.world.spawnEntity(new EntityXPOrb(this.world, this.posX, this.posY + 0.5D, this.posZ, i));
    }
}
 
开发者ID:CountGrimhart,项目名称:Count-Armours,代码行数:29,代码来源:EntityTradeable.java

示例6: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe p_70933_1_)
{
    p_70933_1_.incrementToolUses();
    this.livingSoundTime = -this.getTalkInterval();
    this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch());
    int i = 3 + this.rand.nextInt(4);

    if (p_70933_1_.getToolUses() == 1 || this.rand.nextInt(5) == 0)
    {
        this.timeUntilReset = 40;
        this.needsInitilization = true;
        this.isWillingToTrade = true;

        if (this.buyingPlayer != null)
        {
            this.lastBuyingPlayer = this.buyingPlayer.getName();
        }
        else
        {
            this.lastBuyingPlayer = null;
        }

        i += 5;
    }

    if (p_70933_1_.getItemToBuy().getItem() == Items.emerald)
    {
        this.wealth += p_70933_1_.getItemToBuy().stackSize;
    }

    if (p_70933_1_.getRewardsExp())
    {
        this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, i));
    }
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.8,代码行数:36,代码来源:EntityGreenVillager.java

示例7: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe p_70933_1_)
{
    p_70933_1_.incrementToolUses();
    this.livingSoundTime = -this.getTalkInterval();
    this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch());
    int i = 3 + this.rand.nextInt(4);

    if (p_70933_1_.getToolUses() == 1 || this.rand.nextInt(5) == 0)
    {
        this.timeUntilReset = 40;
        this.needsInitilization = true;
        this.isWillingToTrade = true;

        if (this.buyingPlayer != null)
        {
            this.lastBuyingPlayer = this.buyingPlayer.getName();
        }
        else
        {
            this.lastBuyingPlayer = null;
        }

        i += 5;
    }

    if (p_70933_1_.getItemToBuy().getItem() == mod_Rediscovered.gemRuby)
    {
        this.wealth += p_70933_1_.getItemToBuy().stackSize;
    }

    if (p_70933_1_.getRewardsExp())
    {
        this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, i));
    }
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.8,代码行数:36,代码来源:EntityPigman.java

示例8: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe p_70933_1_)
{
    p_70933_1_.incrementToolUses();
    this.livingSoundTime = -this.getTalkInterval();
    this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch());
    int i = 3 + this.rand.nextInt(4);

    if (p_70933_1_.getToolUses() == 1 || this.rand.nextInt(5) == 0)
    {
        this.timeUntilReset = 40;
        this.needsInitilization = true;
        this.isWillingToTrade = true;

        if (this.buyingPlayer != null)
        {
            this.lastBuyingPlayer = this.buyingPlayer.getDisplayName().getUnformattedText();
        }
        else
        {
            this.lastBuyingPlayer = null;
        }

        i += 5;
    }

    if (p_70933_1_.getItemToBuy().getItem() == Items.emerald)
    {
        this.wealth += p_70933_1_.getItemToBuy().stackSize;
    }

    if (p_70933_1_.getRewardsExp())
    {
        this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, i));
    }
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.8.8,代码行数:36,代码来源:EntityGreenVillager.java

示例9: useRecipe

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe p_70933_1_)
{
    p_70933_1_.incrementToolUses();
    this.livingSoundTime = -this.getTalkInterval();
    this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch());
    int i = 3 + this.rand.nextInt(4);

    if (p_70933_1_.getToolUses() == 1 || this.rand.nextInt(5) == 0)
    {
        this.timeUntilReset = 40;
        this.needsInitilization = true;
        this.isWillingToMate = true;

        if (this.buyingPlayer != null)
        {
            this.lastBuyingPlayer = this.buyingPlayer.getDisplayName().getUnformattedText();
        }
        else
        {
            this.lastBuyingPlayer = null;
        }

        i += 5;
    }

    if (p_70933_1_.getItemToBuy().getItem() == mod_Rediscovered.gemRuby)
    {
        this.wealth += p_70933_1_.getItemToBuy().stackSize;
    }

    if (p_70933_1_.getRewardsExp())
    {
        this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY + 0.5D, this.posZ, i));
    }
}
 
开发者ID:Stormister,项目名称:Rediscovered-Mod-1.8.8,代码行数:36,代码来源:EntityPigman.java

示例10: refreshTradingList

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
protected void refreshTradingList() {
	for (ListIterator<MerchantRecipe> iterator = trades.listIterator(); iterator.hasNext();) {
		MerchantRecipe trade = iterator.next();
		// replace bomb trades so he can't ever become sold out
		if (isBombTrade(trade) && trade.getToolUses() > 49) {
			iterator.set(getRefreshedBombTrade(trade));
		} else if (trade.isRecipeDisabled()) {
			trade.increaseMaxTradeUses(rand.nextInt(6) + rand.nextInt(6) + 2);
		}
	}
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:13,代码来源:EntityNpcBarnes.java

示例11: getRefreshedBombTrade

import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
private MerchantRecipe getRefreshedBombTrade(MerchantRecipe trade) {
	int uses = trade.getToolUses();
	return new MerchantRecipe(trade.getItemToBuy(), trade.getSecondItemToBuy(), trade.getItemToSell(), (uses > 0 ? 1 : 0), 99);
}
 
开发者ID:coolAlias,项目名称:ZeldaSwordSkills,代码行数:5,代码来源:EntityNpcBarnes.java


注:本文中的net.minecraft.village.MerchantRecipe.getToolUses方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。