Files
src
build.gradle
manifest.kod
settings.gradle
Code
28 1,570
src/main/java/com/kodari/chaosweather/ChaosWeatherSMP.java
package com.kodari.chaosweather;
import com.kodari.chaosweather.artifact.ArtifactManager;
import com.kodari.chaosweather.command.WeatherCommand;
import com.kodari.chaosweather.config.ConfigManager;
import com.kodari.chaosweather.gui.GUIListener;
import com.kodari.chaosweather.gui.GUIManager;
import com.kodari.chaosweather.listener.GameplayListener;
import com.kodari.chaosweather.listener.WeatherControlListener;
import com.kodari.chaosweather.progression.ChallengeManager;
import com.kodari.chaosweather.progression.ProgressionManager;
import com.kodari.chaosweather.weather.WeatherManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class ChaosWeatherSMP extends JavaPlugin {
private ConfigManager configManager;
private ProgressionManager progressionManager;
private ChallengeManager challengeManager;
private ArtifactManager artifactManager;
private WeatherManager weatherManager;
private GUIManager guiManager;
@Override
public void onEnable() {
this.configManager = new ConfigManager(this);
this.progressionManager = new ProgressionManager(this);
this.challengeManager = new ChallengeManager(this, progressionManager);
this.artifactManager = new ArtifactManager(this);
this.weatherManager = new WeatherManager(this, configManager, progressionManager, challengeManager);
this.guiManager = new GUIManager();
Bukkit.getPluginManager().registerEvents(new WeatherControlListener(), this);
Bukkit.getPluginManager().registerEvents(new GameplayListener(this), this);
Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
WeatherCommand weatherCommand = new WeatherCommand(this);
getCommand("weather").setExecutor(weatherCommand);
getCommand("weather").setTabCompleter(weatherCommand);
weatherManager.startScheduler();
if (configManager.autoStart()) {
weatherManager.startRandom();
}
}
@Override
public void onDisable() {
if (weatherManager != null) {
weatherManager.shutdown();
}
if (progressionManager != null) {
progressionManager.save();
}
}
public ConfigManager getConfigManager() {
return configManager;
}
public ProgressionManager getProgressionManager() {
return progressionManager;
}
public ChallengeManager getChallengeManager() {
return challengeManager;
}
public ArtifactManager getArtifactManager() {
return artifactManager;
}
public WeatherManager getWeatherManager() {
return weatherManager;
}
public GUIManager getGuiManager() {
return guiManager;
}
}