mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-03 22:16:34 +00:00
Remove useless HuskHomes instance setter
Move instance initialization into onLoad method
This commit is contained in:
1 file changed
+33
-7
@@ -1,7 +1,30 @@
|
|||||||
package me.william278.huskhomes2;
|
package me.william278.huskhomes2;
|
||||||
|
|
||||||
import me.william278.huskhomes2.api.HuskHomesAPI;
|
import me.william278.huskhomes2.api.HuskHomesAPI;
|
||||||
import me.william278.huskhomes2.commands.*;
|
import me.william278.huskhomes2.commands.BackCommand;
|
||||||
|
import me.william278.huskhomes2.commands.CommandBase;
|
||||||
|
import me.william278.huskhomes2.commands.DelhomeCommand;
|
||||||
|
import me.william278.huskhomes2.commands.DelwarpCommand;
|
||||||
|
import me.william278.huskhomes2.commands.EdithomeCommand;
|
||||||
|
import me.william278.huskhomes2.commands.EditwarpCommand;
|
||||||
|
import me.william278.huskhomes2.commands.HomeCommand;
|
||||||
|
import me.william278.huskhomes2.commands.HomelistCommand;
|
||||||
|
import me.william278.huskhomes2.commands.HuskhomesCommand;
|
||||||
|
import me.william278.huskhomes2.commands.PublichomeCommand;
|
||||||
|
import me.william278.huskhomes2.commands.PublichomelistCommand;
|
||||||
|
import me.william278.huskhomes2.commands.RtpCommand;
|
||||||
|
import me.william278.huskhomes2.commands.SethomeCommand;
|
||||||
|
import me.william278.huskhomes2.commands.SetspawnCommand;
|
||||||
|
import me.william278.huskhomes2.commands.SetwarpCommand;
|
||||||
|
import me.william278.huskhomes2.commands.SpawnCommand;
|
||||||
|
import me.william278.huskhomes2.commands.TpCommand;
|
||||||
|
import me.william278.huskhomes2.commands.TpaCommand;
|
||||||
|
import me.william278.huskhomes2.commands.TpacceptCommand;
|
||||||
|
import me.william278.huskhomes2.commands.TpahereCommand;
|
||||||
|
import me.william278.huskhomes2.commands.TpdenyCommand;
|
||||||
|
import me.william278.huskhomes2.commands.TphereCommand;
|
||||||
|
import me.william278.huskhomes2.commands.WarpCommand;
|
||||||
|
import me.william278.huskhomes2.commands.WarplistCommand;
|
||||||
import me.william278.huskhomes2.config.ConfigManager;
|
import me.william278.huskhomes2.config.ConfigManager;
|
||||||
import me.william278.huskhomes2.config.Settings;
|
import me.william278.huskhomes2.config.Settings;
|
||||||
import me.william278.huskhomes2.data.DataManager;
|
import me.william278.huskhomes2.data.DataManager;
|
||||||
@@ -24,12 +47,11 @@ import java.net.URLConnection;
|
|||||||
public final class HuskHomes extends JavaPlugin {
|
public final class HuskHomes extends JavaPlugin {
|
||||||
|
|
||||||
private static HuskHomes instance;
|
private static HuskHomes instance;
|
||||||
|
|
||||||
public static HuskHomes getInstance() {
|
public static HuskHomes getInstance() {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
private void setInstance(HuskHomes instance) {
|
|
||||||
HuskHomes.instance = instance;
|
|
||||||
}
|
|
||||||
public static Settings settings;
|
public static Settings settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -94,14 +116,18 @@ public final class HuskHomes extends JavaPlugin {
|
|||||||
plugin.getServer().getPluginManager().registerEvents(new PlayerListener(), plugin);
|
plugin.getServer().getPluginManager().registerEvents(new PlayerListener(), plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoad() {
|
||||||
|
// TODO Remove
|
||||||
|
// Set instance for easy cross-class referencing
|
||||||
|
instance = this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
// Plugin startup logic
|
// Plugin startup logic
|
||||||
getLogger().info("Enabling HuskHomes version " + this.getDescription().getVersion());
|
getLogger().info("Enabling HuskHomes version " + this.getDescription().getVersion());
|
||||||
|
|
||||||
// Set instance for easy cross-class referencing
|
|
||||||
setInstance(this);
|
|
||||||
|
|
||||||
// MIGRATION: Check if a migration needs to occur
|
// MIGRATION: Check if a migration needs to occur
|
||||||
LegacyMigrator.checkStartupMigration();
|
LegacyMigrator.checkStartupMigration();
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user