check if AVL is installed and disable plugin if yes

This commit is contained in:
xGinko 2024-07-16 11:41:05 +02:00
parent 4a775d5e7e
commit d0af45fc21
3 changed files with 11 additions and 1 deletions

View File

@ -6,7 +6,7 @@
<groupId>me.xginko</groupId> <groupId>me.xginko</groupId>
<artifactId>VillagerOptimizer</artifactId> <artifactId>VillagerOptimizer</artifactId>
<version>1.6.1</version> <version>1.6.2</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>VillagerOptimizer</name> <name>VillagerOptimizer</name>

View File

@ -67,6 +67,14 @@ public final class VillagerOptimizer extends JavaPlugin {
logger = ComponentLogger.logger(getLogger().getName()); logger = ComponentLogger.logger(getLogger().getName());
bStats = new Metrics(this, 19954); bStats = new Metrics(this, 19954);
if (getServer().getPluginManager().getPlugin("AntiVillagerLag") != null) {
logger.warn("While VillagerOptimizer can read data previously created by AVL, running");
logger.warn("both plugins at the same time is unsafe and definitely will cause issues.");
logger.warn("To protect your game from corruption, VillagerOptimizer will now disable!");
logger.warn("Please decide for one of the plugins!");
getServer().getPluginManager().disablePlugin(this);
}
try { try {
getDataFolder().mkdirs(); getDataFolder().mkdirs();
} catch (Exception e) { } catch (Exception e) {

View File

@ -5,6 +5,8 @@ authors: [ xGinko ]
description: ${project.description} description: ${project.description}
website: ${project.url} website: ${project.url}
api-version: '1.16' api-version: '1.16'
softdepend:
- AntiVillagerLag
folia-supported: true folia-supported: true
commands: commands: