EntityTradeable.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:Count-Armours 作者:
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand) {
    ItemStack itemstack = player.getHeldItem(hand);
    boolean flag = itemstack.getItem() == Items.NAME_TAG;

    if (flag) {
        return itemstack.interactWithEntity(player, this, hand);
    } else if (this.isEntityAlive() && !this.isTrading()) {
        if (this.buyingList == null) {
            this.populateBuyingList();
        }

        if (!this.buyingList.isEmpty()) {
            FMLNetworkHandler.openGui(player, AOTA.instance, hashCode(), world, (int) posX, (int) posY, (int) posZ);
            if (!this.world.isRemote)
                this.setCustomer(player);
            return true;
        } else {
            AOTA.logWarn("Tradeable entity " + hashCode() + " has an empty buyingList.");
            return super.processInteract(player, hand);
        }
    } else {
        return super.processInteract(player, hand);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号