9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-27 19:09:09 +00:00

Fixed using the wrong plugin instance

This commit is contained in:
XiaoMoMi
2024-09-14 18:29:10 +08:00
parent 60d2525fbb
commit 0a4946c7a8
15 changed files with 39 additions and 39 deletions

View File

@@ -46,7 +46,7 @@ import java.util.function.Supplier;
public abstract class BukkitCustomCropsPlugin implements CustomCropsPlugin {
private static BukkitCustomCropsPlugin instance;
private final Plugin boostrap;
private final Plugin bootstrap;
protected static boolean isReloading = false;
protected AbstractJavaScheduler<Location, World> scheduler;
@@ -67,13 +67,13 @@ public abstract class BukkitCustomCropsPlugin implements CustomCropsPlugin {
/**
* Constructs a new BukkitCustomCropsPlugin instance.
*
* @param boostrap the plugin instance used to initialize this class
* @param bootstrap the plugin instance used to initialize this class
*/
public BukkitCustomCropsPlugin(Plugin boostrap) {
if (!boostrap.getName().equals("CustomCrops")) {
public BukkitCustomCropsPlugin(Plugin bootstrap) {
if (!bootstrap.getName().equals("CustomCrops")) {
throw new IllegalArgumentException("CustomCrops plugin requires custom crops plugin");
}
this.boostrap = boostrap;
this.bootstrap = bootstrap;
instance = this;
}
@@ -95,8 +95,8 @@ public abstract class BukkitCustomCropsPlugin implements CustomCropsPlugin {
*
* @return the {@link Plugin} instance
*/
public Plugin getBoostrap() {
return boostrap;
public Plugin getBootstrap() {
return bootstrap;
}
/**
@@ -260,7 +260,7 @@ public abstract class BukkitCustomCropsPlugin implements CustomCropsPlugin {
* @return the data folder as a {@link File}
*/
public File getDataFolder() {
return boostrap.getDataFolder();
return bootstrap.getDataFolder();
}
/**

View File

@@ -58,7 +58,7 @@ public class HologramManager implements Listener, Reloadable {
@Override
public void load() {
Bukkit.getPluginManager().registerEvents(this, plugin.getBoostrap());
Bukkit.getPluginManager().registerEvents(this, plugin.getBootstrap());
this.cacheCheckTask = plugin.getScheduler().asyncRepeating(() -> {
ArrayList<UUID> removed = new ArrayList<>();
long current = System.currentTimeMillis();

View File

@@ -60,7 +60,7 @@ public class CoolDownManager implements Listener, Reloadable {
@Override
public void load() {
Bukkit.getPluginManager().registerEvents(this, plugin.getBoostrap());
Bukkit.getPluginManager().registerEvents(this, plugin.getBootstrap());
}
@Override