TalkRequirement.java 文件源码

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

项目:QuestManager 作者:
/**
 * Catches a player's interaction and sees if it's the one we've been waiting for
 */
@EventHandler
public void onInteract(PlayerInteractAtEntityEvent e) {

    if (state) {
        HandlerList.unregisterAll(this);
        return;
    }

    if (QuestManagerPlugin.questManagerPlugin.getPluginConfiguration().getWorlds()
            .contains(e.getPlayer().getPlayer().getWorld().getName())) {
        for (QuestPlayer qp : participants.getParticipants()) {
            if (qp.getPlayer().isOnline() && qp.getPlayer().getPlayer().getUniqueId()
                    .equals(e.getPlayer().getUniqueId())) {
                //one of our participants
                //actually check interaction now
                if (e.getRightClicked().equals(npc.getEntity())) {
                    //cancel and interact
                    e.setCancelled(true);
                    this.state = true;
                    HandlerList.unregisterAll(this);
                    updateQuest();

                    menu.show(e.getPlayer(), getGoal().getQuest());
                }
            }
        }
    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号