Skip to content

Commit

Permalink
Merge branch 'Ghost-chu:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris6ix authored Jun 25, 2021
2 parents 587d9db + 35238c7 commit a31f204
Show file tree
Hide file tree
Showing 11 changed files with 352 additions and 56 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
- name: Build with Maven
run: mvn -B compile --file pom.xml -Pdebug
- uses: actions/checkout@v2
- name: Set up JDK 16
uses: actions/setup-java@v2
with:
java-version: '16'
distribution: 'adopt'
- name: Build Integration
run: mvn -B install --file src/integration/plotsquared/5/pom.xml
- name: Build with Maven
run: mvn -B compile --file pom.xml -Pdebug
File renamed without changes.
Binary file added lib/PlotSquared5-Core-5.13.11.jar
Binary file not shown.
43 changes: 27 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<artifactId>QuickShop</artifactId>

<properties>
<pluginver>4.0.9.3</pluginver>
<pluginver>4.0.9.4</pluginver>
<package>org.maxgamer.quickshop</package>
<developer>Ghost-chu</developer>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -272,7 +272,9 @@
<archive>${project.basedir}/target/${artifactId}.jar</archive>
<keystore>${project.basedir}/keystore.jks</keystore>
<alias>selfsigned</alias>
<!--suppress UnresolvedMavenProperty -->
<storepass>${env.quickshop-signer-pwd}</storepass>
<!--suppress UnresolvedMavenProperty -->
<keypass>${env.quickshop-signer-pwd}</keypass>
</configuration>
</plugin>
Expand Down Expand Up @@ -684,17 +686,24 @@
</exclusion>
</exclusions>
</dependency>
<!--PlotSquared 5 Core-->
<dependency>
<groupId>org.maxgamer.quickshop.integration</groupId>
<artifactId>PlotSquared5</artifactId>
<version>1.1</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--PlotSquared 6 Core-->
<dependency>
<groupId>com.plotsquared</groupId>
<artifactId>PlotSquared-Core</artifactId>
<version>5.13.11</version>
<version>6.0.0-SNAPSHOT</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>worldedit-core</artifactId>
<groupId>com.sk89q.worldedit</groupId>
</exclusion>
<exclusion>
<artifactId>snakeyaml</artifactId>
<groupId>org.yaml</groupId>
Expand Down Expand Up @@ -732,10 +741,10 @@
<!--PlotSquared 4-->
<dependency>
<groupId>com.github.intellectualsite</groupId>
<artifactId>PlotSquared</artifactId>
<artifactId>PlotSquared4</artifactId>
<version>4</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/PlotSquared-Bukkit.jar</systemPath>
<systemPath>${project.basedir}/lib/PlotSquared4-Bukkit-4.4.jar</systemPath>
<exclusions>
<exclusion>
<artifactId>worldedit-core</artifactId>
Expand Down Expand Up @@ -804,6 +813,14 @@
<artifactId>guava</artifactId>
<groupId>com.google.guava</groupId>
</exclusion>
<exclusion>
<artifactId>paste-gg-api</artifactId>
<groupId>org.kitteh</groupId>
</exclusion>
<exclusion>
<artifactId>paperlib</artifactId>
<groupId>io.papermc</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -896,7 +913,7 @@
<dependency>
<groupId>me.lucko</groupId>
<artifactId>helper</artifactId>
<version>5.6.5</version>
<version>5.6.8</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand All @@ -915,11 +932,5 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
69 changes: 69 additions & 0 deletions src/integration/plotsquared/5/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.maxgamer.quickshop.integration</groupId>
<artifactId>PlotSquared5</artifactId>
<version>1.1</version>
<packaging>jar</packaging>
<repositories>
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>enginehub-repo</id>
<url>https://maven.enginehub.org/repo/</url>
</repository>
<repository>
<id>CodeMC</id>
<url>https://repo.codemc.io/repository/maven-public/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!--PlotSquared 5 Core-->
<dependency>
<groupId>com.plotsquared</groupId>
<artifactId>PlotSquared5-Core</artifactId>
<version>5</version>
<scope>system</scope>
<systemPath>${project.basedir}/../../../../lib/PlotSquared5-Core-5.13.11.jar</systemPath>
</dependency>
<dependency>
<groupId>org.maxgamer</groupId>
<artifactId>QuickShop</artifactId>
<version>4.0.9.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q.worldedit</groupId>
<artifactId>worldedit-core</artifactId>
<version>7.2.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>21.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
35 changes: 35 additions & 0 deletions src/main/java/org/maxgamer/quickshop/api/ShopAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.maxgamer.quickshop.QuickShop;
import org.maxgamer.quickshop.shop.Shop;

Expand Down Expand Up @@ -114,4 +116,37 @@ public Optional<Shop> getShop(Block block) {
public Optional<Shop> getShop(Location location) {
return Optional.ofNullable(plugin.getShopManager().getShopIncludeAttached(location));
}

// == Backward compatibility ==

@Deprecated
public @Nullable Shop getShopWithCaching(@NotNull Location location) {
if (plugin.getShopCache() == null) {
return getShop(location).orElse(null);
}
return plugin.getShopCache().getCaching(location, false);
}

@Deprecated
public @Nullable Shop getShopIncludeAttached(@NotNull Location location) {
return plugin.getShopManager().getShopIncludeAttached(location);
}

@Deprecated
public @Nullable Shop getShopIncludeAttachedWithCaching(@NotNull Location location) {
if (plugin.getShopCache() == null) {
return getShopIncludeAttached(location);
}
return plugin.getShopCache().getCaching(location, true);
}

@Deprecated
public @NotNull List<Shop> getPlayerAllShops(@NotNull UUID uuid) {
return new ArrayList<>(plugin.getShopManager().getPlayerAllShops(uuid));
}

@Deprecated
public @NotNull List<Shop> getShopsInWorld(@NotNull World world) {
return new ArrayList<>(plugin.getShopManager().getShopsInWorld(world));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.maxgamer.quickshop.integration.IntegrateStage;
import org.maxgamer.quickshop.integration.IntegrationStage;
import org.maxgamer.quickshop.integration.QSIntegratedPlugin;
import org.maxgamer.quickshop.util.Util;

@IntegrationStage(loadStage = IntegrateStage.onEnableAfter)
public class PlotSquaredIntegrationProxy extends QSIntegratedPlugin {
Expand All @@ -36,8 +37,10 @@ public PlotSquaredIntegrationProxy(QuickShop instance) {
if (plotSquared == null) {
if (plugin.getServer().getPluginManager().getPlugin("PlotSquared").getClass().getPackage().getName().contains("intellectualsite")) {
plotSquared = new PlotSquaredIntegrationV4(instance);
} else {
} else if (Util.isClassAvailable("com.plotsquared.core.configuration.Caption")) {
plotSquared = new PlotSquaredIntegrationV5(instance);
} else {
plotSquared = new PlotSquaredIntegrationV6(instance);
}
}
}
Expand Down
Loading

0 comments on commit a31f204

Please sign in to comment.