Update some dependencies

Should fix #245, however PlotSquared support will not be working anymore
for versions below 1.13.
This commit is contained in:
Eric 2019-04-30 22:21:12 +02:00
parent d45bcb5a94
commit 8f2d2540ba
5 changed files with 35 additions and 38 deletions

18
pom.xml
View File

@ -31,10 +31,6 @@
<id>vault-repo</id>
<url>http://nexus.hc.to/content/repositories/pub_releases/</url>
</repository>
<repository>
<id>bstats-repo</id>
<url>http://repo.bstats.org/content/repositories/releases/</url>
</repository>
<repository>
<id>codemc-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
@ -45,7 +41,7 @@
</repository>
<repository>
<id>athion-repo</id>
<url>http://ci.athion.net/job/PlotSquared/ws/mvn/</url>
<url>http://ci.athion.net/job/PlotSquared-Releases/ws/mvn/</url>
</repository>
<repository>
<id>uskyblock-repo</id>
@ -75,13 +71,13 @@
<dependency>
<groupId>net.milkbowl.vault</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.6</version>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>1.1</version>
<version>1.4</version>
</dependency>
<dependency>
<groupId>fr.xephi</groupId>
@ -90,9 +86,9 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.plotsquared</groupId>
<artifactId>plotsquared-api</artifactId>
<version>latest</version>
<groupId>com.github.intellectualsites.plotsquared</groupId>
<artifactId>PlotSquared-API</artifactId>
<version>4.226</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -135,7 +131,7 @@
<dependency>
<groupId>me.wiefferink</groupId>
<artifactId>areashop</artifactId>
<version>2.4.0</version>
<version>2.6.0</version>
<scope>provided</scope>
</dependency>
<dependency>

View File

@ -33,7 +33,7 @@ import fr.xephi.authme.AuthMe;
import me.ryanhamshire.GriefPrevention.GriefPrevention;
import me.wiefferink.areashop.AreaShop;
import net.milkbowl.vault.economy.Economy;
import org.bstats.Metrics;
import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
@ -52,6 +52,7 @@ import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
@ -186,6 +187,7 @@ public class ShopChest extends JavaPlugin {
hologramFormat = new HologramFormat(this);
loadMetrics();
initDatabase();
checkForUpdates();
shopUtils = new ShopUtils(this);
@ -283,11 +285,10 @@ public class ShopChest extends JavaPlugin {
private void loadMetrics() {
debug("Initializing Metrics...");
Metrics metrics = new Metrics(this);
metrics.addCustomChart(new Metrics.AdvancedPie("shop_type") {
@Override
public HashMap<String, Integer> getValues(HashMap<String, Integer> hashMap) {
Metrics metrics = new Metrics(this);
metrics.addCustomChart(new Metrics.SimplePie("database_type", () -> Config.databaseType.toString()));
metrics.addCustomChart(new Metrics.AdvancedPie("shop_type", () -> {
int normal = 0;
int admin = 0;
@ -296,20 +297,16 @@ public class ShopChest extends JavaPlugin {
else if (shop.getShopType() == ShopType.ADMIN) admin++;
}
hashMap.put("Admin", admin);
hashMap.put("Normal", normal);
Map<String, Integer> result = new HashMap<>();
return hashMap;
}
});
result.put("Admin", admin);
result.put("Normal", normal);
metrics.addCustomChart(new Metrics.SimplePie("database_type") {
@Override
public String getValue() {
return Config.databaseType.toString();
}
});
return result;
}));
}
private void initDatabase() {
if (Config.databaseType == Database.DatabaseType.SQLite) {
debug("Using database type: SQLite");
getLogger().info("Using SQLite");
@ -515,6 +512,10 @@ public class ShopChest extends JavaPlugin {
* @return Whether the plugin 'PlotSquared' is enabled
*/
public boolean hasPlotSquared() {
if (Utils.getMajorVersion() < 13) {
// Supported PlotSquared versions don't support versions below 1.13
return false;
}
Plugin p = getServer().getPluginManager().getPlugin("PlotSquared");
return p != null && p.isEnabled();
}

View File

@ -1,8 +1,8 @@
package de.epiceric.shopchest.external;
import com.intellectualcrafters.plot.flag.Flag;
import com.intellectualcrafters.plot.flag.Flags;
import com.intellectualcrafters.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.flag.Flag;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import org.bukkit.entity.Player;

View File

@ -236,8 +236,8 @@ public class ChestProtectListener implements Listener {
}
if (externalPluginsAllowed && plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
com.intellectualcrafters.plot.object.Location loc =
new com.intellectualcrafters.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
com.github.intellectualsites.plotsquared.plot.object.Location loc =
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
externalPluginsAllowed = PlotSquaredShopFlag.isFlagAllowedOnPlot(loc.getOwnedPlot(), PlotSquaredShopFlag.CREATE_SHOP, p);
}

View File

@ -1,7 +1,7 @@
package de.epiceric.shopchest.listeners;
import com.google.gson.JsonPrimitive;
import com.intellectualcrafters.plot.object.Plot;
import com.github.intellectualsites.plotsquared.plot.object.Plot;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Town;
import com.palmergames.bukkit.towny.object.TownBlock;
@ -223,7 +223,7 @@ public class ShopInteractListener implements Listener {
plugin.debug("Checking if PlotSquared allows shop creation...");
for (Location loc : chestLocations) {
if (loc != null) {
com.intellectualcrafters.plot.object.Location plotLocation = new com.intellectualcrafters.plot.object.Location(
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation = new com.github.intellectualsites.plotsquared.plot.object.Location(
loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
Plot plot = plotLocation.getOwnedPlot();
@ -457,8 +457,8 @@ public class ShopInteractListener implements Listener {
boolean externalPluginsAllowed = true;
if (plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
com.intellectualcrafters.plot.object.Location plotLocation =
new com.intellectualcrafters.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
Plot plot = plotLocation.getOwnedPlot();
GroupFlag flag = shop.getShopType() == Shop.ShopType.ADMIN ? PlotSquaredShopFlag.USE_ADMIN_SHOP : PlotSquaredShopFlag.USE_SHOP;
@ -571,8 +571,8 @@ public class ShopInteractListener implements Listener {
boolean externalPluginsAllowed = true;
if (plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
com.intellectualcrafters.plot.object.Location plotLocation =
new com.intellectualcrafters.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
Plot plot = plotLocation.getOwnedPlot();
GroupFlag flag = shop.getShopType() == Shop.ShopType.ADMIN ? PlotSquaredShopFlag.USE_ADMIN_SHOP : PlotSquaredShopFlag.USE_SHOP;