我主类始于此:不能使用“本”,由于静态方法,但我不得不
public class ranks extends JavaPlugin implements Listener{
类里,我有:
public static boolean isAdmin(String playerName){
File adminFile = new File(this.getDataFolder() + File.separator + "admins.txt");
的问题是,我不能使用“this”。 isAdmin必须因为另一个类是静态的:
public class customInventory implements Listener{
我需要使用访问它:
if(!ranks.isAdmin(e.getPlayer().getName())){
作为概述,位居使用方法从customInventory,反之亦然。谷歌搜索静态方法,不能使用“这个”没有任何帮助。
这是Java的惯例,大写类名的第一个字母 – leeor
也许是这样。这并不能解决我的问题,虽然 – Rixterz
我觉得人们不高兴,因为我遇到了问题,需要帮助解决它。这就是我首先写了这个该死的问题。 – Rixterz