src/main/java/com/alttd/playerutils/PlayerUtils.java gelöscht
This commit is contained in:
parent
18de5cebd6
commit
4cff7bb407
|
|
@ -1,67 +0,0 @@
|
||||||
package com.alttd.playerutils;
|
|
||||||
|
|
||||||
import com.alttd.playerutils.commands.PlayerUtilsCommand;
|
|
||||||
import com.alttd.playerutils.commands.playerutils_subcommands.GhastSpeed;
|
|
||||||
import com.alttd.playerutils.commands.playerutils_subcommands.RotateBlock;
|
|
||||||
import com.alttd.playerutils.config.Config;
|
|
||||||
import com.alttd.playerutils.config.KeyStorage;
|
|
||||||
import com.alttd.playerutils.config.Messages;
|
|
||||||
import com.alttd.playerutils.event_listeners.*;
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
|
||||||
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
public final class PlayerUtils extends JavaPlugin {
|
|
||||||
|
|
||||||
private PlayerUtilsCommand playerUtilsCommand;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEnable() {
|
|
||||||
registerCommands();
|
|
||||||
registerEvents();
|
|
||||||
reloadConfigs();
|
|
||||||
registerSchedulers();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisable() {
|
|
||||||
KeyStorage.STORAGE.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerCommands() {
|
|
||||||
playerUtilsCommand = new PlayerUtilsCommand(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerEvents() {
|
|
||||||
PluginManager pluginManager = getServer().getPluginManager();
|
|
||||||
pluginManager.registerEvents(new XpBottleEvent(this), this);
|
|
||||||
pluginManager.registerEvents(new TeleportEvent(), this);
|
|
||||||
pluginManager.registerEvents(new GoatHornEvent(), this);
|
|
||||||
pluginManager.registerEvents(new LimitArmorStands(this), this);
|
|
||||||
pluginManager.registerEvents(new BlockBlockUseEvent(), this);
|
|
||||||
pluginManager.registerEvents(new PlayerJoin(this), this);
|
|
||||||
pluginManager.registerEvents(new BookWriteEvent(), this);
|
|
||||||
pluginManager.registerEvents(new BookByteLimitListener(), this);
|
|
||||||
|
|
||||||
RotateBlockEvent rotateBlockEvent = new RotateBlockEvent();
|
|
||||||
pluginManager.registerEvents(rotateBlockEvent, this);
|
|
||||||
playerUtilsCommand.addSubCommand(new RotateBlock(rotateBlockEvent));
|
|
||||||
|
|
||||||
GhastSpeedEvent ghastSpeedEvent = new GhastSpeedEvent();
|
|
||||||
pluginManager.registerEvents(ghastSpeedEvent, this);
|
|
||||||
playerUtilsCommand.addSubCommand(new GhastSpeed(ghastSpeedEvent));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void reloadConfigs() {
|
|
||||||
Config.reload();
|
|
||||||
Messages.reload();
|
|
||||||
KeyStorage.reload();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerSchedulers() {
|
|
||||||
Bukkit.getScheduler().runTaskTimerAsynchronously(this, KeyStorage.STORAGE::save,
|
|
||||||
TimeUnit.MINUTES.toSeconds(5) * 20, TimeUnit.MINUTES.toSeconds(5) * 20);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user