EntityTF2Character.java 文件源码

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

项目:Mods 作者:
@Override
public boolean processInteract(EntityPlayer player, EnumHand hand) {
    if (!(player.getHeldItemMainhand() != null
            && player.getHeldItemMainhand().getItem() instanceof ItemMonsterPlacerPlus)
            && (this.getOwner() == player || this.getAttackTarget() == null || this.friendly) && this.isEntityAlive() && !this.isTrading()
            && !this.isChild() && !player.isSneaking()) {
        if (this.world.isRemote && player.getTeam() == null
                && ((this.getCapability(TF2weapons.WEAPONS_CAP, null).state & 1) == 0 || this.friendly)
                && !player.isCreative())
            ClientProxy.displayScreenConfirm("Choose a team to interact",
                    "Visit the Mann Co. Store located in a village");
        if (!this.world.isRemote && (TF2Util.isOnSameTeam(this, player) || player.isCreative())
                && (this.tradeOffers == null || !this.tradeOffers.isEmpty())) {
            this.setCustomer(player);
            FMLNetworkHandler.openGui(player, TF2weapons.instance, 4, world, this.getEntityId(), 0, 0);
        }

        player.addStat(StatList.TALKED_TO_VILLAGER);
        return true;
    } else
        return super.processInteract(player, hand);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号