public class Shop implements Listener {
private final JavaPlugin plugin;
public Shop(JavaPlugin plugin) {
this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
The gist of the question: I read somewhere that you can avoid writing class registration in the main method (because it takes up a lot of space and makes the code unreadable) How to get rid of
У меня есть основной класс Main.java (метод onEnable) и еще 3. в Main.java я регистрирую другие классы так: [code]new Example(this); new Shop(this); new Info(this); [/code] and in the classes themselves, I use this construction: [code]public class Shop implements Listener {
private final JavaPlugin plugin;
public Shop(JavaPlugin plugin) { this.plugin = plugin; plugin.getServer().getPluginManager().registerEvents(this, plugin); } [/code] The gist of the question: I read somewhere that you can avoid writing class registration in the main method (because it takes up a lot of space and makes the code unreadable) How to get rid of [code]new Example(this); new Shop(this); new Info(this); [/code] I've tried [code]plugin = this;[/code] But it's not working.
Сейчас я работаю над плагином, который позволит вам выдавать себя за другого игрока. Он делает это почти безупречно: ваш UUID и имя пользователя изменяются на имя пользователя, чью личность вы принимаете на стороне сервера, и, насколько могут судить...
Недавно я запустил плагин Bukkit, и у меня возникли проблемы с использованием двух классов (main и CommandExecutor). Я перепробовал все, но когда я загружаю свой плагин, он выдает ошибку, которая находится в конце сообщения.
Основной (называемый...
У меня есть несколько языковых файлов в одном каталоге внутри моего проекта.
Эти языковые файлы представляют собой, по сути, пользовательские файлы конфигурации, которые я также хочу сохранить в подпапке в папке моего плагина. >