Disable the paper uuid service for offline mode servers and add toggles for all third party uuid services

This commit is contained in:
Alexander Söderberg 2020-07-12 17:04:30 +02:00
parent a2ec404014
commit 6cf2c0ad97
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678
2 changed files with 21 additions and 7 deletions

View File

@ -259,9 +259,11 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain<
PlotSquared.log(Captions.PREFIX + "(UUID) Using the offline mode UUID service");
}
final OfflinePlayerUUIDService offlinePlayerUUIDService = new OfflinePlayerUUIDService();
impromptuPipeline.registerService(offlinePlayerUUIDService);
backgroundPipeline.registerService(offlinePlayerUUIDService);
if (Settings.UUID.SERVICE_BUKKIT) {
final OfflinePlayerUUIDService offlinePlayerUUIDService = new OfflinePlayerUUIDService();
impromptuPipeline.registerService(offlinePlayerUUIDService);
backgroundPipeline.registerService(offlinePlayerUUIDService);
}
final SQLiteUUIDService sqLiteUUIDService = new SQLiteUUIDService("user_cache.db");
@ -274,7 +276,8 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain<
}
final LuckPermsUUIDService luckPermsUUIDService;
if (Bukkit.getPluginManager().getPlugin("LuckPerms") != null) {
if (Settings.UUID.SERVICE_LUCKPERMS &&
Bukkit.getPluginManager().getPlugin("LuckPerms") != null) {
luckPermsUUIDService = new LuckPermsUUIDService();
PlotSquared
.log(Captions.PREFIX + "(UUID) Using LuckPerms as a complementary UUID service");
@ -283,7 +286,8 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain<
}
final BungeePermsUUIDService bungeePermsUUIDService;
if (Bukkit.getPluginManager().getPlugin("BungeePerms") != null) {
if (Settings.UUID.SERVICE_BUNGEE_PERMS &&
Bukkit.getPluginManager().getPlugin("BungeePerms") != null) {
bungeePermsUUIDService = new BungeePermsUUIDService();
PlotSquared
.log(Captions.PREFIX + "(UUID) Using BungeePerms as a complementary UUID service");
@ -292,7 +296,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain<
}
final EssentialsUUIDService essentialsUUIDService;
if (Bukkit.getPluginManager().getPlugin("Essentials") != null) {
if (Settings.UUID.SERVICE_ESSX && Bukkit.getPluginManager().getPlugin("Essentials") != null) {
essentialsUUIDService = new EssentialsUUIDService();
PlotSquared
.log(Captions.PREFIX + "(UUID) Using Essentials as a complementary UUID service");
@ -302,7 +306,7 @@ public final class BukkitMain extends JavaPlugin implements Listener, IPlotMain<
if (!Settings.UUID.OFFLINE) {
// If running Paper we'll also try to use their profiles
if (PaperLib.isPaper()) {
if (Bukkit.getOnlineMode() && PaperLib.isPaper() && Settings.UUID.SERVICE_PAPER) {
final PaperUUIDService paperUUIDService = new PaperUUIDService();
impromptuPipeline.registerService(paperUUIDService);
backgroundPipeline.registerService(paperUUIDService);

View File

@ -260,6 +260,16 @@ public class Settings extends Config {
@Comment("Whether or not automatic background caching should be enabled. It is HIGHLY recommended to keep this turned on."
+ " This should only be disabled if the server has a very large number of plots (>100k)")
public static boolean BACKGROUND_CACHING_ENABLED = true;
@Comment("Whether the paper service is enabled")
public static boolean SERVICE_PAPER = true;
@Comment("Whether the LP service is enabled")
public static boolean SERVICE_LUCKPERMS = true;
@Comment("Whether the Bukkit service is enabled")
public static boolean SERVICE_BUKKIT = true;
@Comment("Whether the EssX service is enabled")
public static boolean SERVICE_ESSX = true;
@Comment("Whether the BungeePerms service is enabled")
public static boolean SERVICE_BUNGEE_PERMS = true;
}