本文整理汇总了Java中net.minecraft.entity.player.EntityPlayer.displayVillagerTradeGui方法的典型用法代码示例。如果您正苦于以下问题:Java EntityPlayer.displayVillagerTradeGui方法的具体用法?Java EntityPlayer.displayVillagerTradeGui怎么用?Java EntityPlayer.displayVillagerTradeGui使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.entity.player.EntityPlayer
的用法示例。
在下文中一共展示了EntityPlayer.displayVillagerTradeGui方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: interact
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
/**
* Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
*/
public boolean interact(EntityPlayer player)
{
ItemStack itemstack = player.inventory.getCurrentItem();
boolean flag = itemstack != null && itemstack.getItem() == Items.spawn_egg;
if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild())
{
if (!this.worldObj.isRemote && (this.buyingList == null || this.buyingList.size() > 0))
{
this.setCustomer(player);
player.displayVillagerTradeGui(this);
}
player.triggerAchievement(StatList.timesTalkedToVillagerStat);
return true;
}
else
{
return super.interact(player);
}
}
示例2: processInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand) {
if (!(player.getHeldItemMainhand() != null
&& player.getHeldItemMainhand().getItem() instanceof ItemMonsterPlacerPlus)
&& this.getAttackTarget() == null && this.isEntityAlive() && !this.isTrading() && !this.isChild()
&& !player.isSneaking()) {
if (this.world.isRemote && player.getTeam() == null && !player.isCreative())
ClientProxy.displayScreenJoinTeam();
else if (!this.world.isRemote && (player.getTeam() != null || player.isCreative())
&& (this.tradeOffers == null || !this.tradeOffers.isEmpty())) {
this.setCustomer(player);
player.displayVillagerTradeGui(this);
}
player.addStat(StatList.TALKED_TO_VILLAGER);
return true;
} else
return super.processInteract(player, hand);
}
示例3: processInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean processInteract(EntityPlayer player, EnumHand hand, @Nullable ItemStack stack)
{
boolean flag = stack != null && stack.getItem() == Items.SPAWN_EGG;
if (!flag && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !player.isSneaking())
{
if (!this.worldObj.isRemote && (this.buyingList == null || !this.buyingList.isEmpty()))
{
this.setCustomer(player);
player.displayVillagerTradeGui(this);
}
player.addStat(StatList.TALKED_TO_VILLAGER);
return true;
}
else
{
return super.processInteract(player, hand, stack);
}
}
示例4: processInteract
import net.minecraft.entity.player.EntityPlayer; //导入方法依赖的package包/类
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
ItemStack itemstack = player.getHeldItem(hand);
boolean flag = itemstack.getItem() == Items.NAME_TAG;
if (flag)
{
itemstack.interactWithEntity(player, this, hand);
return true;
}
else if (!this.func_190669_a(itemstack, this.getClass()) && this.isEntityAlive() && !this.isTrading() && !this.isChild())
{
if (this.buyingList == null)
{
this.populateBuyingList();
}
if (hand == EnumHand.MAIN_HAND)
{
player.addStat(StatList.TALKED_TO_VILLAGER);
}
if (!this.world.isRemote && !this.buyingList.isEmpty())
{
this.setCustomer(player);
player.displayVillagerTradeGui(this);
}
else if (this.buyingList.isEmpty())
{
return super.processInteract(player, hand);
}
return true;
}
else
{
return super.processInteract(player, hand);
}
}