46 lines
1.5 KiB
Java
46 lines
1.5 KiB
Java
|
|
package com.alttd.fishingevent;
|
||
|
|
|
||
|
|
import com.alttd.fishingevent.commands.FishCommand;
|
||
|
|
import com.alttd.fishingevent.config.Config;
|
||
|
|
import com.alttd.fishingevent.config.Fishes;
|
||
|
|
import com.alttd.fishingevent.config.Messages;
|
||
|
|
import com.alttd.fishingevent.fish_generator.WaterFishGenerator;
|
||
|
|
import com.alttd.fishingevent.listeners.CatchFish;
|
||
|
|
import com.alttd.fishingevent.points.PointsManagement;
|
||
|
|
import com.alttd.fishingevent.util.Logger;
|
||
|
|
import org.bukkit.plugin.PluginManager;
|
||
|
|
import org.bukkit.plugin.java.JavaPlugin;
|
||
|
|
import org.jetbrains.annotations.NotNull;
|
||
|
|
|
||
|
|
public final class FishingEvent extends JavaPlugin {
|
||
|
|
|
||
|
|
private Logger logger;
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void onEnable() {
|
||
|
|
this.logger = new Logger(getLogger());
|
||
|
|
registerEvents(getServer().getPluginManager());
|
||
|
|
//add a way to stop and start the fishing event and a way to stop all fishing (so 3 modes normal, active, disabled)
|
||
|
|
reloadFishConfigs();
|
||
|
|
registerCommands();
|
||
|
|
}
|
||
|
|
|
||
|
|
@Override
|
||
|
|
public void onDisable() {
|
||
|
|
}
|
||
|
|
|
||
|
|
private void registerEvents(@NotNull PluginManager pluginManager) {
|
||
|
|
pluginManager.registerEvents(new CatchFish(logger, new WaterFishGenerator(Fishes.WATER_FISH.RARITY_FISH_MAP, logger), PointsManagement.getInstance()), this);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void registerCommands() {
|
||
|
|
new FishCommand(this, logger);
|
||
|
|
}
|
||
|
|
|
||
|
|
public void reloadFishConfigs() {
|
||
|
|
Config.reload(this, logger);
|
||
|
|
Fishes.reload(this, logger);
|
||
|
|
Messages.reload(this, logger);
|
||
|
|
}
|
||
|
|
}
|