mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-09-05 17:07:06 +02:00
started moving to pure adventure
This commit is contained in:
@@ -75,7 +75,7 @@ public final class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
private final LocalExpansionManager localExpansionManager = new LocalExpansionManager(this);
|
||||
@NotNull
|
||||
private final CloudExpansionManager cloudExpansionManager = new CloudExpansionManager(this);
|
||||
@NotNull
|
||||
|
||||
private BukkitAudiences adventure;
|
||||
|
||||
/**
|
||||
@@ -143,7 +143,7 @@ public final class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
setupMetrics();
|
||||
setupExpansions();
|
||||
|
||||
this.adventure = BukkitAudiences.create(this);
|
||||
adventure = BukkitAudiences.create(this);
|
||||
|
||||
if (config.isCloudEnabled()) {
|
||||
getCloudExpansionManager().load();
|
||||
@@ -163,6 +163,9 @@ public final class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
|
||||
Bukkit.getScheduler().cancelTasks(this);
|
||||
|
||||
adventure.close();
|
||||
adventure = null;
|
||||
|
||||
instance = null;
|
||||
}
|
||||
|
||||
@@ -191,11 +194,12 @@ public final class PlaceholderAPIPlugin extends JavaPlugin {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public BukkitAudiences adventure() {
|
||||
if(this.adventure == null) {
|
||||
public BukkitAudiences getAdventure() {
|
||||
if(adventure == null) {
|
||||
throw new IllegalStateException("Tried to access Adventure when the plugin was disabled!");
|
||||
}
|
||||
return this.adventure;
|
||||
|
||||
return adventure;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user