mirror of
https://github.com/EpicEricEE/ShopChest.git
synced 2024-11-15 23:25:52 +01:00
Update some dependencies
Should fix #245, however PlotSquared support will not be working anymore for versions below 1.13.
This commit is contained in:
parent
d45bcb5a94
commit
8f2d2540ba
18
pom.xml
18
pom.xml
@ -31,10 +31,6 @@
|
|||||||
<id>vault-repo</id>
|
<id>vault-repo</id>
|
||||||
<url>http://nexus.hc.to/content/repositories/pub_releases/</url>
|
<url>http://nexus.hc.to/content/repositories/pub_releases/</url>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
|
||||||
<id>bstats-repo</id>
|
|
||||||
<url>http://repo.bstats.org/content/repositories/releases/</url>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>codemc-repo</id>
|
<id>codemc-repo</id>
|
||||||
<url>https://repo.codemc.org/repository/maven-public/</url>
|
<url>https://repo.codemc.org/repository/maven-public/</url>
|
||||||
@ -45,7 +41,7 @@
|
|||||||
</repository>
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>athion-repo</id>
|
<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>
|
||||||
<repository>
|
<repository>
|
||||||
<id>uskyblock-repo</id>
|
<id>uskyblock-repo</id>
|
||||||
@ -75,13 +71,13 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.milkbowl.vault</groupId>
|
<groupId>net.milkbowl.vault</groupId>
|
||||||
<artifactId>VaultAPI</artifactId>
|
<artifactId>VaultAPI</artifactId>
|
||||||
<version>1.6</version>
|
<version>1.7</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>bstats-bukkit</artifactId>
|
<artifactId>bstats-bukkit</artifactId>
|
||||||
<version>1.1</version>
|
<version>1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>fr.xephi</groupId>
|
<groupId>fr.xephi</groupId>
|
||||||
@ -90,9 +86,9 @@
|
|||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.plotsquared</groupId>
|
<groupId>com.github.intellectualsites.plotsquared</groupId>
|
||||||
<artifactId>plotsquared-api</artifactId>
|
<artifactId>PlotSquared-API</artifactId>
|
||||||
<version>latest</version>
|
<version>4.226</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -135,7 +131,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>me.wiefferink</groupId>
|
<groupId>me.wiefferink</groupId>
|
||||||
<artifactId>areashop</artifactId>
|
<artifactId>areashop</artifactId>
|
||||||
<version>2.4.0</version>
|
<version>2.6.0</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -33,7 +33,7 @@ import fr.xephi.authme.AuthMe;
|
|||||||
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
||||||
import me.wiefferink.areashop.AreaShop;
|
import me.wiefferink.areashop.AreaShop;
|
||||||
import net.milkbowl.vault.economy.Economy;
|
import net.milkbowl.vault.economy.Economy;
|
||||||
import org.bstats.Metrics;
|
import org.bstats.bukkit.Metrics;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
@ -52,6 +52,7 @@ import java.io.PrintWriter;
|
|||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.LinkedBlockingQueue;
|
import java.util.concurrent.LinkedBlockingQueue;
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
@ -186,6 +187,7 @@ public class ShopChest extends JavaPlugin {
|
|||||||
hologramFormat = new HologramFormat(this);
|
hologramFormat = new HologramFormat(this);
|
||||||
|
|
||||||
loadMetrics();
|
loadMetrics();
|
||||||
|
initDatabase();
|
||||||
checkForUpdates();
|
checkForUpdates();
|
||||||
|
|
||||||
shopUtils = new ShopUtils(this);
|
shopUtils = new ShopUtils(this);
|
||||||
@ -283,11 +285,10 @@ public class ShopChest extends JavaPlugin {
|
|||||||
|
|
||||||
private void loadMetrics() {
|
private void loadMetrics() {
|
||||||
debug("Initializing Metrics...");
|
debug("Initializing Metrics...");
|
||||||
Metrics metrics = new Metrics(this);
|
|
||||||
|
|
||||||
metrics.addCustomChart(new Metrics.AdvancedPie("shop_type") {
|
Metrics metrics = new Metrics(this);
|
||||||
@Override
|
metrics.addCustomChart(new Metrics.SimplePie("database_type", () -> Config.databaseType.toString()));
|
||||||
public HashMap<String, Integer> getValues(HashMap<String, Integer> hashMap) {
|
metrics.addCustomChart(new Metrics.AdvancedPie("shop_type", () -> {
|
||||||
int normal = 0;
|
int normal = 0;
|
||||||
int admin = 0;
|
int admin = 0;
|
||||||
|
|
||||||
@ -296,20 +297,16 @@ public class ShopChest extends JavaPlugin {
|
|||||||
else if (shop.getShopType() == ShopType.ADMIN) admin++;
|
else if (shop.getShopType() == ShopType.ADMIN) admin++;
|
||||||
}
|
}
|
||||||
|
|
||||||
hashMap.put("Admin", admin);
|
Map<String, Integer> result = new HashMap<>();
|
||||||
hashMap.put("Normal", normal);
|
|
||||||
|
|
||||||
return hashMap;
|
result.put("Admin", admin);
|
||||||
}
|
result.put("Normal", normal);
|
||||||
});
|
|
||||||
|
|
||||||
metrics.addCustomChart(new Metrics.SimplePie("database_type") {
|
return result;
|
||||||
@Override
|
}));
|
||||||
public String getValue() {
|
}
|
||||||
return Config.databaseType.toString();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
private void initDatabase() {
|
||||||
if (Config.databaseType == Database.DatabaseType.SQLite) {
|
if (Config.databaseType == Database.DatabaseType.SQLite) {
|
||||||
debug("Using database type: SQLite");
|
debug("Using database type: SQLite");
|
||||||
getLogger().info("Using SQLite");
|
getLogger().info("Using SQLite");
|
||||||
@ -515,6 +512,10 @@ public class ShopChest extends JavaPlugin {
|
|||||||
* @return Whether the plugin 'PlotSquared' is enabled
|
* @return Whether the plugin 'PlotSquared' is enabled
|
||||||
*/
|
*/
|
||||||
public boolean hasPlotSquared() {
|
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");
|
Plugin p = getServer().getPluginManager().getPlugin("PlotSquared");
|
||||||
return p != null && p.isEnabled();
|
return p != null && p.isEnabled();
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package de.epiceric.shopchest.external;
|
package de.epiceric.shopchest.external;
|
||||||
|
|
||||||
import com.intellectualcrafters.plot.flag.Flag;
|
import com.github.intellectualsites.plotsquared.plot.flag.Flag;
|
||||||
import com.intellectualcrafters.plot.flag.Flags;
|
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||||
import com.intellectualcrafters.plot.object.Plot;
|
import com.github.intellectualsites.plotsquared.plot.object.Plot;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
@ -236,8 +236,8 @@ public class ChestProtectListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (externalPluginsAllowed && plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
|
if (externalPluginsAllowed && plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
|
||||||
com.intellectualcrafters.plot.object.Location loc =
|
com.github.intellectualsites.plotsquared.plot.object.Location loc =
|
||||||
new com.intellectualcrafters.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
|
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);
|
externalPluginsAllowed = PlotSquaredShopFlag.isFlagAllowedOnPlot(loc.getOwnedPlot(), PlotSquaredShopFlag.CREATE_SHOP, p);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package de.epiceric.shopchest.listeners;
|
package de.epiceric.shopchest.listeners;
|
||||||
|
|
||||||
import com.google.gson.JsonPrimitive;
|
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.Resident;
|
||||||
import com.palmergames.bukkit.towny.object.Town;
|
import com.palmergames.bukkit.towny.object.Town;
|
||||||
import com.palmergames.bukkit.towny.object.TownBlock;
|
import com.palmergames.bukkit.towny.object.TownBlock;
|
||||||
@ -223,7 +223,7 @@ public class ShopInteractListener implements Listener {
|
|||||||
plugin.debug("Checking if PlotSquared allows shop creation...");
|
plugin.debug("Checking if PlotSquared allows shop creation...");
|
||||||
for (Location loc : chestLocations) {
|
for (Location loc : chestLocations) {
|
||||||
if (loc != null) {
|
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());
|
loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||||
|
|
||||||
Plot plot = plotLocation.getOwnedPlot();
|
Plot plot = plotLocation.getOwnedPlot();
|
||||||
@ -457,8 +457,8 @@ public class ShopInteractListener implements Listener {
|
|||||||
boolean externalPluginsAllowed = true;
|
boolean externalPluginsAllowed = true;
|
||||||
|
|
||||||
if (plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
|
if (plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
|
||||||
com.intellectualcrafters.plot.object.Location plotLocation =
|
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
|
||||||
new com.intellectualcrafters.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
|
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
|
||||||
|
|
||||||
Plot plot = plotLocation.getOwnedPlot();
|
Plot plot = plotLocation.getOwnedPlot();
|
||||||
GroupFlag flag = shop.getShopType() == Shop.ShopType.ADMIN ? PlotSquaredShopFlag.USE_ADMIN_SHOP : PlotSquaredShopFlag.USE_SHOP;
|
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;
|
boolean externalPluginsAllowed = true;
|
||||||
|
|
||||||
if (plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
|
if (plugin.hasPlotSquared() && Config.enablePlotsquaredIntegration) {
|
||||||
com.intellectualcrafters.plot.object.Location plotLocation =
|
com.github.intellectualsites.plotsquared.plot.object.Location plotLocation =
|
||||||
new com.intellectualcrafters.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
|
new com.github.intellectualsites.plotsquared.plot.object.Location(b.getWorld().getName(), b.getX(), b.getY(), b.getZ());
|
||||||
|
|
||||||
Plot plot = plotLocation.getOwnedPlot();
|
Plot plot = plotLocation.getOwnedPlot();
|
||||||
GroupFlag flag = shop.getShopType() == Shop.ShopType.ADMIN ? PlotSquaredShopFlag.USE_ADMIN_SHOP : PlotSquaredShopFlag.USE_SHOP;
|
GroupFlag flag = shop.getShopType() == Shop.ShopType.ADMIN ? PlotSquaredShopFlag.USE_ADMIN_SHOP : PlotSquaredShopFlag.USE_SHOP;
|
||||||
|
Loading…
Reference in New Issue
Block a user