EntityClick_Listener.java 文件源码

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

项目:Achtbaan 作者:
@EventHandler
public void EntityClick(PlayerInteractAtEntityEvent e)
{
    Player p = e.getPlayer();
    if(e.getRightClicked() instanceof ArmorStand){
        ArmorStand clickedA = (ArmorStand) e.getRightClicked();
        if(clickedA.getPassenger() == null){
            for(attractie att : Main.r.Attracties.values()){
                for(ArmorStand a : att.getSeats())
                {
                    if(a.getLocation().getX() == clickedA.getLocation().getX() && 
                            a.getLocation().getY() == clickedA.getLocation().getY() && 
                            a.getLocation().getZ() == clickedA.getLocation().getZ())
                    {
                        if(att.allowSit == true){
                            e.setCancelled(true);
                            p.teleport(clickedA);
                            clickedA.setPassenger(p);
                            att.addPassagier(p, clickedA);
                        }
                        return;
                    }
                }
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号