Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package games.coob.portals;
- import games.coob.portals.model.PortalData;
- import games.coob.portals.settings.Settings;
- import games.coob.portals.task.CosmicTeleportTask;
- import games.coob.portals.task.HologramTask;
- import games.coob.portals.task.RouletteTeleportTask;
- import games.coob.portals.task.TargetedTeleportTask;
- import org.bukkit.Bukkit;
- import org.mineacademy.fo.Common;
- import org.mineacademy.fo.MinecraftVersion;
- import org.mineacademy.fo.plugin.SimplePlugin;
- /**
- * PluginTemplate is a simple template you can use every time you make
- * a new plugin. This will save you time because you no longer have to
- * recreate the same skeleton and features each time.
- * <p>
- * It uses Foundation for fast and efficient development process.
- */
- public final class AnchorPortals extends SimplePlugin {
- /**
- * Automatically perform login ONCE when the plugin starts.
- */
- @Override
- protected void onPluginStart() {
- Common.setLogPrefix("[AnchorPortals]");
- if (!MinecraftVersion.atLeast(MinecraftVersion.V.v1_16)) {
- Common.log("Disabled because the version you are using is too old.");
- this.setEnabled(false);
- }
- if (!Bukkit.getPluginManager().isPluginEnabled("DecentHolograms")) {
- Common.log("Disabled do to DecentHolograms not being installed or not enabled.");
- this.setEnabled(false);
- }
- }
- @Override
- protected void onPluginStop() {
- // Hologram.deleteAll();
- }
- @Override
- protected void onPluginReload() {
- // Hologram.deleteAll();
- }
- /**
- * Automatically perform login when the plugin starts and each time it is reloaded.
- */
- @Override
- protected void onReloadablesStart() {
- // You can check for necessary plugins and disable loading if they are missing
- PortalData.loadPortals();
- Common.runTimer(Settings.PortalSection.CHARGE_SPEED, new HologramTask());
- Common.runTimer(5, new RouletteTeleportTask());
- Common.runTimer(5, new CosmicTeleportTask());
- Common.runTimer(5, new TargetedTeleportTask());
- for (final PortalData portalData : PortalData.getPortals()) {
- portalData.setChargePercentage(100);
- }
- // Uncomment to load variables
- // Variable.loadVariables();
- //
- // Add your own plugin parts to load automatically here
- // Please see @AutoRegister for parts you do not have to register manually
- //
- }
- /* ------------------------------------------------------------------------------- */
- /* Static */
- /* ------------------------------------------------------------------------------- */
- /**
- * Return the instance of this plugin, which simply refers to a static
- * field already created for you in SimplePlugin but casts it to your
- * specific plugin instance for your convenience.
- *
- * @return
- */
- public static AnchorPortals getInstance() {
- return (AnchorPortals) SimplePlugin.getInstance();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement