forked from AlpsBTE/Plot-System
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDependencyManager.java
More file actions
63 lines (52 loc) · 2.15 KB
/
DependencyManager.java
File metadata and controls
63 lines (52 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.alpsbte.plotsystem.utils;
import com.alpsbte.plotsystem.PlotSystem;
import com.sk89q.worldguard.bukkit.WorldGuardPlugin;
import org.bukkit.Bukkit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.mvplugins.multiverse.core.MultiverseCoreApi;
import java.util.Objects;
public class DependencyManager {
private DependencyManager() {}
/**
* @return True if ParticleNativeAPI is present
*/
public static boolean isParticleNativeAPIEnabled() {
return PlotSystem.getPlugin().getServer().getPluginManager().isPluginEnabled("ParticleNativeAPI");
}
public static boolean isMultiverseInventoriesEnabled() {
return PlotSystem.getPlugin().getServer().getPluginManager().isPluginEnabled("Multiverse-Inventories");
}
public static boolean isWorldGuardExtraFlagsEnabled() {
return PlotSystem.getPlugin().getServer().getPluginManager().isPluginEnabled("WorldGuardExtraFlags");
}
public static @Nullable org.bukkit.plugin.Plugin getDiscordIntegration() {
return PlotSystem.getPlugin().getServer().getPluginManager().getPlugin("DiscordPlotSystem");
}
/**
* @param worldName Name of the world
* @return Config path for the world
*/
public static @NotNull String getMultiverseInventoriesConfigPath(String worldName) {
return DependencyManager.isMultiverseInventoriesEnabled() ? Objects.requireNonNull(Bukkit.getPluginManager().getPlugin("Multiverse-Inventories")).getDataFolder() + "/worlds/" + worldName : "";
}
/**
* @return Multiverse-Core instance
*/
public static MultiverseCoreApi getMultiverseCore() {
return MultiverseCoreApi.get();
}
/**
* @return World Guard instance
*/
public static WorldGuardPlugin getWorldGuard() {
return WorldGuardPlugin.inst();
}
/**
* @param worldName Name of the world
* @return Config path for the world
*/
public static @NotNull String getWorldGuardConfigPath(String worldName) {
return Objects.requireNonNull(Bukkit.getPluginManager().getPlugin("WorldGuard")).getDataFolder() + "/worlds/" + worldName;
}
}