Skip to content

Commit

Permalink
registerCommands method
Browse files Browse the repository at this point in the history
  • Loading branch information
SeriousGuy888 committed Oct 6, 2021
1 parent 0bf55ac commit 0bc98f7
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public class BillzoVillagers extends JavaPlugin {
private static BillzoVillagers plugin;
FileConfiguration config = getConfig();
Expand All @@ -27,7 +29,7 @@ public void onEnable() {

new TaskNameVillagers().runTaskTimer(plugin, 0L, 200L);
registerListeners();
this.getCommand("villager").setExecutor(new CommandVillager());
registerCommands();
}

private void registerListeners() {
Expand All @@ -41,6 +43,10 @@ private void registerListeners() {
pluginManager.registerEvents(new VillagerMenu(), this);
}

private void registerCommands() {
Objects.requireNonNull(this.getCommand("villager")).setExecutor(new CommandVillager());
}

@Override
public void onDisable() {
System.out.println("f");
Expand Down

0 comments on commit 0bc98f7

Please sign in to comment.