<s>[INST] I'm making a plugin for a bukkit server, and I want to check if a player has a certain permission when they join the server. 

Here is my code so far:
```java
public class Main extends JavaPlugin {

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
        System.out.println("Plugin enabled!");
    }

    @Override
    public void onDisable() {
        System.out.println("Plugin disabled!");
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent e) {
        Player p = e.getPlayer();
        if (!(permission().has(p, "my.plugin.perm"))) {
            p.kickPlayer("You don't have permission to join this server!");
        }
    }
}
```

However, the class `permission()` isn't recognized, and when I try to cast the player to `PermissionAttachment` it won't let me. What's going on?[/INST]