У меня есть основной класс Main.java (метод onEnable)
и еще 3.
в Main.java я регистрирую другие классы так:
Код: Выделить всё
new Example(this);
new Shop(this);
new Info(this);
Код: Выделить всё
public class Shop implements Listener {
private final JavaPlugin plugin;
public Shop(JavaPlugin plugin) {
this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
Код: Выделить всё
new Example(this);
new Shop(this);
new Info(this);
Код: Выделить всё
plugin = this;Источник: https://stackoverflow.com/questions/774 ... le-classes
Мобильная версия