CitizensBooks is now AstralBooks

This commit is contained in:
PikaMug 2023-03-24 23:21:08 -04:00
parent ccea1acba5
commit a91b033d4e
6 changed files with 43 additions and 33 deletions

View File

@ -16,7 +16,7 @@
<repositories>
<repository>
<!-- CitizensBooks, DungeonsXL, mcMMO Classic, PhatLoots, Unite, ZNPCs -->
<!-- DungeonsXL, mcMMO Classic, PhatLoots, Unite, ZNPCs -->
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
@ -49,6 +49,11 @@
<id>hc-repo</id>
<url>https://nexus.hc.to/content/repositories/pub_releases/</url>
</repository>
<repository>
<!-- AstralBooks -->
<id>repsy-release</id>
<url>https://repo.repsy.io/mvn/niconeko/release</url>
</repository>
</repositories>
<dependencies>
@ -107,9 +112,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.nicuch</groupId>
<artifactId>CitizensBooks</artifactId>
<version>2.5.5</version>
<groupId>ro.niconeko</groupId>
<artifactId>AstralBooks</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -27,7 +27,7 @@ import net.citizensnpcs.api.CitizensPlugin;
import net.milkbowl.vault.economy.Economy;
import net.milkbowl.vault.permission.Permission;
import org.bukkit.Location;
import ro.nicuch.citizensbooks.CitizensBooksAPI;
import ro.niconeko.astralbooks.AstralBooksAPI;
import java.util.Set;
import java.util.UUID;
@ -57,7 +57,7 @@ public interface IDependencies {
DenizenAPI getDenizenApi();
CitizensBooksAPI getCitizensBooksApi();
AstralBooksAPI getAstralBooksApi();
ServersNPC getZnpcs();

View File

@ -16,7 +16,7 @@
<repositories>
<repository>
<!-- CitizensBooks, DungeonsXL, LocaleLib, mcMMO Classic, PhatLoots, Unite, ZNPCs -->
<!-- DungeonsXL, LocaleLib, mcMMO Classic, PhatLoots, Unite, ZNPCs -->
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
@ -49,6 +49,11 @@
<id>hc-repo</id>
<url>https://nexus.hc.to/content/repositories/pub_releases/</url>
</repository>
<repository>
<!-- AstralBooks -->
<id>repsy-release</id>
<url>https://repo.repsy.io/mvn/niconeko/release</url>
</repository>
</repositories>
<dependencies>
@ -103,13 +108,13 @@
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.9.2</version>
<version>2.11.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.nicuch</groupId>
<artifactId>CitizensBooks</artifactId>
<version>2.5.5</version>
<groupId>ro.niconeko</groupId>
<artifactId>AstralBooks</artifactId>
<version>3.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -40,8 +40,8 @@ import org.bukkit.plugin.RegisteredListener;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import ro.nicuch.citizensbooks.CitizensBooksAPI;
import ro.nicuch.citizensbooks.CitizensBooksPlugin;
import ro.niconeko.astralbooks.AstralBooksAPI;
import ro.niconeko.astralbooks.AstralBooksPlugin;
import java.util.Collections;
import java.util.HashSet;
@ -58,13 +58,13 @@ public class Dependencies implements IDependencies {
private static Permission permission = null;
private static PartyProvider partyProvider = null;
private static final Set<PartyProvider> partyProviders = new HashSet<>();
private static WorldGuardAPI worldGuardApi = null;
private static WorldGuardAPI worldGuard = null;
private static mcMMO mcmmo = null;
private static Heroes heroes = null;
public static PlaceholderAPIPlugin placeholder = null;
public static CitizensPlugin citizens = null;
private static DenizenAPI denizenApi = null;
private static CitizensBooksAPI citizensBooks = null;
private static DenizenAPI denizen = null;
private static AstralBooksAPI astralBooks = null;
private static ServersNPC znpcs = null;
private static PartiesAPI parties = null;
@ -109,10 +109,10 @@ public class Dependencies implements IDependencies {
}
public WorldGuardAPI getWorldGuardApi() {
if (worldGuardApi == null && isPluginAvailable("WorldGuard")) {
worldGuardApi = new WorldGuardAPI(plugin.getServer().getPluginManager().getPlugin("WorldGuard"));
if (worldGuard == null && isPluginAvailable("WorldGuard")) {
worldGuard = new WorldGuardAPI(plugin.getServer().getPluginManager().getPlugin("WorldGuard"));
}
return worldGuardApi;
return worldGuard;
}
public mcMMO getMcmmoClassic() {
@ -178,22 +178,22 @@ public class Dependencies implements IDependencies {
}
public DenizenAPI getDenizenApi() {
if (denizenApi == null && isPluginAvailable("Denizen")) {
denizenApi = new DenizenAPI();
if (denizen == null && isPluginAvailable("Denizen")) {
denizen = new DenizenAPI();
}
return denizenApi;
return denizen;
}
public CitizensBooksAPI getCitizensBooksApi() {
if (citizensBooks == null && isPluginAvailable("CitizensBooks")) {
public AstralBooksAPI getAstralBooksApi() {
if (astralBooks == null && isPluginAvailable("AstralBooks")) {
try {
citizensBooks = ((CitizensBooksPlugin) Objects.requireNonNull(plugin.getServer().getPluginManager()
.getPlugin("CitizensBooks"))).getAPI();
astralBooks = ((AstralBooksPlugin) Objects.requireNonNull(plugin.getServer().getPluginManager()
.getPlugin("AstralBooks"))).getAPI();
} catch (final Exception e) {
e.printStackTrace();
}
}
return citizensBooks;
return astralBooks;
}
public ServersNPC getZnpcs() {
@ -369,7 +369,7 @@ public class Dependencies implements IDependencies {
getMcmmoClassic();
getHeroes();
getPlaceholderApi();
getCitizensBooksApi();
getAstralBooksApi();
getPartiesApi();
getPartyProvider();
getVaultEconomy();

View File

@ -404,10 +404,10 @@ public class Action implements IAction {
}
if (book != null) {
if (!book.isEmpty()) {
if (plugin.getDependencies().getCitizensBooksApi() != null) {
if (plugin.getDependencies().getCitizensBooksApi().hasFilter(book)) {
plugin.getDependencies().getCitizensBooksApi().openBook(player, plugin.getDependencies()
.getCitizensBooksApi().getFilter(book));
if (plugin.getDependencies().getAstralBooksApi() != null) {
if (plugin.getDependencies().getAstralBooksApi().hasFilterBook(book)) {
plugin.getDependencies().getAstralBooksApi().openBook(player, plugin.getDependencies()
.getAstralBooksApi().getFilterBook(book));
}
}
}

View File

@ -5,7 +5,7 @@ api-version: 1.13
description: An extensive questing system.
website: https://github.com/PikaMug/Quests
author: PikaMug
softdepend: [Citizens, CitizensBooks, Denizen, DungeonsXL, GPS, Heroes, mcMMO, Parties, PlaceholderAPI, Unite, Vault, WorldGuard]
softdepend: [AstralBooks, Citizens, Denizen, DungeonsXL, GPS, Heroes, mcMMO, Parties, PlaceholderAPI, Unite, Vault, WorldGuard]
permissions:
quests.*:
description: Access ALL Quests functionality