Skip to content

Commit

Permalink
Config data class
Browse files Browse the repository at this point in the history
  • Loading branch information
toonystank committed Apr 16, 2022
1 parent 694c9b8 commit b6ef336
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/taggernation/simplepvp/SimplePVP.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.taggernation.simplepvp.events.JoinEvent;
import com.taggernation.simplepvp.events.PlayerDamageEvent;
import com.taggernation.simplepvp.utils.ConfigManager;
import com.taggernation.simplepvp.utils.Data;
import com.taggernation.simplepvp.utils.PvPManager;
import org.bukkit.plugin.java.JavaPlugin;

Expand All @@ -12,6 +13,7 @@
public final class SimplePVP extends JavaPlugin {

private ConfigManager config;
public Data data;
@Override
public void onEnable() {
SimplePVP plugin = this;
Expand All @@ -23,10 +25,11 @@ public void onEnable() {
}
PvPManager pvpManager = new PvPManager(plugin, config.getStringList("pvp-disable-worlds"));
pvpManager.setServerPvPStatus(true);
data = new Data(config, pvpManager);
this.getServer().getPluginManager().registerEvents(new JoinEvent(pvpManager), this);
this.getServer().getPluginManager().registerEvents(new PlayerDamageEvent(pvpManager), this);
this.getCommand("simplepvp").setExecutor(new MainCommand(plugin, pvpManager));
this.getCommand("simplepvp").setTabCompleter(new MainCommand(plugin, pvpManager));
this.getCommand("simplepvp").setExecutor(new MainCommand(plugin, pvpManager, config));
this.getCommand("simplepvp").setTabCompleter(new MainCommand(plugin, pvpManager, config));
this.getLogger().info("Enabled " + plugin.getName() + " " + plugin.getDescription().getVersion() + "by Edward#1234 Successfully");

}
Expand Down

0 comments on commit b6ef336

Please sign in to comment.