本文整理汇总了Java中net.minecraft.village.MerchantRecipe.incrementToolUses方法的典型用法代码示例。如果您正苦于以下问题:Java MerchantRecipe.incrementToolUses方法的具体用法?Java MerchantRecipe.incrementToolUses怎么用?Java MerchantRecipe.incrementToolUses使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.village.MerchantRecipe
的用法示例。
在下文中一共展示了MerchantRecipe.incrementToolUses方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
public void useRecipe(MerchantRecipe recipe) {
recipe.incrementToolUses();
if (recipe.getItemToBuy().getItem() instanceof ItemWeapon) {
this.loadout.setStackInSlot(ItemFromData.getData(recipe.getItemToBuy()).getInt(PropertyType.SLOT), recipe.getItemToBuy());
this.switchSlot(0);
}
else if(recipe.getItemToBuy().getItem() instanceof ItemWearable) {
this.setItemStackToSlot(EntityEquipmentSlot.HEAD, recipe.getItemToBuy());
}
this.livingSoundTime = -this.getTalkInterval();
this.playSound(SoundEvents.ENTITY_VILLAGER_YES, this.getSoundVolume(), this.getSoundPitch());
int i = 3 + this.rand.nextInt(4);
this.lastTrader = this.trader;
this.tradeCount.put(this.trader,
this.tradeCount.containsKey(trader) ? this.tradeCount.get(this.trader) + 1 : 1);
this.traderFollowTicks = Math.min(4800, this.tradeCount.get(this.trader) * 250 + 350);
if (recipe.getRewardsExp())
this.world.spawnEntity(new EntityXPOrb(this.world, this.posX, this.posY + 0.5D, this.posZ, i));
}
示例2: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe par1MerchantRecipe)
{
par1MerchantRecipe.incrementToolUses();
this.livingSoundTime = -this.getTalkInterval();
this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch());
if (par1MerchantRecipe.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1)))
{
this.timeUntilReset = 40;
this.needsInitilization = true;
if (this.buyingPlayer != null)
{
this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName();
}
else
{
this.lastBuyingPlayer = null;
}
}
if (par1MerchantRecipe.getItemToBuy().getItem() == Items.emerald)
{
this.wealth += par1MerchantRecipe.getItemToBuy().stackSize;
}
}
示例3: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
public void useRecipe(MerchantRecipe var1) {
var1.incrementToolUses();
if(var1.getItemToSell().getItem() instanceof ItemTool ||
var1.getItemToSell().getItem() instanceof ItemArmor){
var1.incrementToolUses();
var1.incrementToolUses();
var1.incrementToolUses();
}
if(var1.getItemToBuy().getItem() instanceof ItemNecronomicon ||
var1.getItemToBuy().getItem() instanceof ItemDrainStaff)
var1.compensateToolUses();
livingSoundTime = -getTalkInterval();
playSound(ACSounds.remnant_yes, getSoundVolume(), getSoundPitch());
if (hasSameIDsAs(var1, tradingList.get(tradingList.size() - 1)))
{
timeUntilReset = 40;
needsInitilization = true;
}
if (APIUtils.isCoin(var1.getItemToBuy()))
wealth += var1.getItemToBuy().getCount();
}
示例4: 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());
if (p_70933_1_.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1)))
{
this.timeUntilReset = 40;
this.needsInitilization = true;
if (this.buyingPlayer != null)
{
this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName();
}
else
{
this.lastBuyingPlayer = null;
}
}
if (p_70933_1_.getItemToBuy().getItem() == Items.emerald)
{
this.wealth += p_70933_1_.getItemToBuy().stackSize;
}
}
示例5: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe par1MerchantRecipe)
{
par1MerchantRecipe.incrementToolUses();
if (par1MerchantRecipe.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1)))
{
this.timeUntilReset = 40;
this.needsInitilization = true;
if (this.buyingPlayer != null)
{
this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName();
}
else
{
this.lastBuyingPlayer = null;
}
}
if (par1MerchantRecipe.getItemToBuy().itemID == Item.emerald.itemID)
{
this.wealth += par1MerchantRecipe.getItemToBuy().stackSize;
}
}
示例6: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe par1MerchantRecipe)
{
par1MerchantRecipe.incrementToolUses();
if (par1MerchantRecipe.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1)))
{
this.timeUntilReset = 40;
this.needsInitilization = true;
if (this.buyingPlayer != null)
{
this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName();
}
else
{
this.lastBuyingPlayer = null;
}
}
if (par1MerchantRecipe.getItemToBuy().itemID == mod_Rediscovered.gemRuby.itemID)
{
this.wealth += par1MerchantRecipe.getItemToBuy().stackSize;
}
}
示例7: 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));
}
}
示例8: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe par1MerchantRecipe)
{
par1MerchantRecipe.incrementToolUses();
this.livingSoundTime = -this.getTalkInterval();
this.playSound("mob.villager.yes", this.getSoundVolume(), this.getSoundPitch());
if (par1MerchantRecipe.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1)))
{
this.timeUntilReset = 40;
this.needsInitilization = true;
if (this.buyingPlayer != null)
{
this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName();
}
else
{
this.lastBuyingPlayer = null;
}
}
if (par1MerchantRecipe.getItemToBuy().itemID == Item.emerald.itemID)
{
this.wealth += par1MerchantRecipe.getItemToBuy().stackSize;
}
}
示例9: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe par1MerchantRecipe)
{
par1MerchantRecipe.incrementToolUses();
this.livingSoundTime = -this.getTalkInterval();
this.playSound("mob.pig.say", this.getSoundVolume(), this.getSoundPitch());
if (par1MerchantRecipe.hasSameIDsAs((MerchantRecipe)this.buyingList.get(this.buyingList.size() - 1)))
{
this.timeUntilReset = 40;
this.needsInitilization = true;
if (this.buyingPlayer != null)
{
this.lastBuyingPlayer = this.buyingPlayer.getCommandSenderName();
}
else
{
this.lastBuyingPlayer = null;
}
}
if (par1MerchantRecipe.getItemToBuy().getItem() == mod_Rediscovered.gemRuby)
{
this.wealth += par1MerchantRecipe.getItemToBuy().stackSize;
}
}
示例10: 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));
}
}
示例11: 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));
}
}
示例12: 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));
}
}
示例13: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
public void useRecipe(MerchantRecipe par1MerchantRecipe)
{
par1MerchantRecipe.incrementToolUses();
if (par1MerchantRecipe.getItemToBuy().getItem() == Items.emerald)
{
this.wealth += par1MerchantRecipe.getItemToBuy().stackSize;
}
}
示例14: 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));
}
}
示例15: useRecipe
import net.minecraft.village.MerchantRecipe; //导入方法依赖的package包/类
@Override
public void useRecipe(MerchantRecipe par1MerchantRecipe)
{
par1MerchantRecipe.incrementToolUses();
if (par1MerchantRecipe.getItemToBuy().getItem() == Items.emerald)
{
this.wealth += par1MerchantRecipe.getItemToBuy().stackSize;
}
}