if (stock.isEmpty()) { existingList = new MerchantRecipeList(); } else {
@Override public boolean processInteract(EntityPlayer player, EnumHand hand) { ItemStack stack = player.getHeldItem(hand); final boolean flag = stack != ItemStack.EMPTY && stack.getItem() == Items.SPAWN_EGG; if (!flag && isEntityAlive() && !isTrading() && !isChild() && !player.isSneaking()) { if (!world.isRemote && (buyingList == null || !buyingList.isEmpty())) { setCustomer(player); player.displayVillagerTradeGui(this); } player.addStat(StatList.TALKED_TO_VILLAGER); return true; } else { return super.processInteract(player, hand); } }
public boolean processInteract(EntityPlayer player, EnumHand hand) { ItemStack itemstack = player.getHeldItem(hand); boolean flag2 = itemstack.getItem() == ModItems.myrmex_jungle_staff || itemstack.getItem() == ModItems.myrmex_desert_staff; if(flag2){ this.onStaffInteract(player, itemstack); player.swingArm(hand); return true; } boolean flag = itemstack.getItem() == Items.NAME_TAG || itemstack.getItem() == Items.LEAD; if (flag) { itemstack.interactWithEntity(player, this, hand); return true; } else if (!this.holdingSpawnEggOfClass(itemstack, this.getClass()) && this.getGrowthStage() >= 2 && this.isEntityAlive() && !this.isTrading() && !this.isChild() && !player.isSneaking()) { 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.getHive() == null || !this.getHive().isPlayerReputationTooLowToTrade(player.getUniqueID()))) { this.setCustomer(player); player.displayVillagerTradeGui(this); } else if (this.buyingList.isEmpty()) { return super.processInteract(player, hand); } return true; } else { return super.processInteract(player, hand); } }
MerchantRecipeList merchantRecipeList = guiMerchant.getMerchant().getRecipes(mc.thePlayer); if (merchantRecipeList == null || merchantRecipeList.isEmpty()) return false;