This commit is contained in:
BenceX100 2024-05-19 18:57:56 +02:00
parent 37f04944f9
commit bd508c1d5e
6 changed files with 261 additions and 248 deletions

481
pom.xml
View File

@ -2,255 +2,252 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
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>
<modelVersion>4.0.0</modelVersion>
<groupId>com.artillexstudios</groupId>
<artifactId>AxTrade</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<groupId>com.artillexstudios</groupId>
<artifactId>AxTrade</artifactId>
<version>1.1.0</version>
<packaging>jar</packaging>
<name>AxTrade</name>
<name>AxTrade</name>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>12</source>
<target>12</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>com.artillexstudios.axapi</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.axapi</shadedPattern>
</relocation>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>dev.triumphteam.gui</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.gui</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.kyori</shadedPattern>
</relocation>
<relocation>
<pattern>revxrsal.commands</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.lamp</shadedPattern>
</relocation>
</relocations>
<source>12</source>
<target>12</target>
<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<relocations>
<relocation>
<pattern>com.artillexstudios.axapi</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.axapi</shadedPattern>
</relocation>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.bstats</shadedPattern>
</relocation>
<relocation>
<pattern>dev.triumphteam.gui</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.gui</shadedPattern>
</relocation>
<relocation>
<pattern>net.kyori</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.kyori</shadedPattern>
</relocation>
<relocation>
<pattern>revxrsal.commands</pattern>
<shadedPattern>com.artillexstudios.axtrade.libs.lamp</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>Artillex-Studios</id>
<url>https://repo.artillex-studios.com/releases/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository>
<id>techscode</id>
<url>https://repo.techscode.com/repository/maven-releases/</url>
</repository>
<repository>
<id>rosewood-repo</id>
<url>https://repo.rosewooddev.io/repository/public/</url>
</repository>
</repositories>
<repositories>
<repository>
<id>Artillex-Studios</id>
<url>https://repo.artillex-studios.com/releases/</url>
</repository>
<repository>
<id>spigotmc-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
<repository>
<id>placeholderapi</id>
<url>https://repo.extendedclip.com/content/repositories/placeholderapi/</url>
</repository>
<repository>
<id>techscode</id>
<url>https://repo.techscode.com/repository/maven-releases/</url>
</repository>
<repository>
<id>rosewood-repo</id>
<url>https://repo.rosewooddev.io/repository/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.artillexstudios.axapi</groupId>
<artifactId>axapi</artifactId>
<version>1.4.232</version>
<scope>compile</scope>
<classifier>all</classifier>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.triumphteam</groupId>
<artifactId>triumph-gui</artifactId>
<version>3.1.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>4.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.16.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>4.16.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.16.0</version>
<scope>compile</scope>
</dependency>
<dependencies>
<dependency>
<groupId>com.artillexstudios.axapi</groupId>
<artifactId>axapi</artifactId>
<version>1.4.234</version>
<scope>compile</scope>
<classifier>all</classifier>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>dev.triumphteam</groupId>
<artifactId>triumph-gui</artifactId>
<version>3.1.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.clip</groupId>
<artifactId>placeholderapi</artifactId>
<version>2.11.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-platform-bukkit</artifactId>
<version>4.3.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-minimessage</artifactId>
<version>4.17.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-text-serializer-legacy</artifactId>
<version>4.17.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.kyori</groupId>
<artifactId>adventure-api</artifactId>
<version>4.17.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>me.aglerr.mobcoins</groupId>
<artifactId>MobCoins</artifactId>
<version>1.1.3</version>
<systemPath>${project.basedir}/libs/TheOnly-MobCoins-1.1.3.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>com.artillexstudios</groupId>
<artifactId>AxQuestBoardAPI</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.Realizedd</groupId>
<artifactId>TokenManager</artifactId>
<version>3.2.4</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>me.swanis.mobcoins</groupId>
<artifactId>MobCoins</artifactId>
<version>1.1.2</version>
<systemPath>${project.basedir}/libs/mobcoins-api-1.1.2-SNAPSHOT.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>me.rivaldev.harvesterhoes</groupId>
<artifactId>Main</artifactId>
<version>LATEST</version>
<systemPath>${project.basedir}/libs/RivalHarvesterHoesAPI.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>kingdoms</artifactId>
<version>LATEST</version>
<systemPath>${project.basedir}/libs/KingdomsX-1.16.14.1.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>su.nightexpress.coinsengine</groupId>
<artifactId>CoinsEngine</artifactId>
<version>2.1.1</version>
<systemPath>${project.basedir}/libs/CoinsEngine-2.1.1.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>me.qKing12.RoyaleEconomy</groupId>
<artifactId>RoyaleEconomy</artifactId>
<version>1.4.4</version>
<systemPath>${project.basedir}/libs/RoyaleEconomyAPI.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.black_ixx</groupId>
<artifactId>playerpoints</artifactId>
<version>3.2.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.TechsCode</groupId>
<artifactId>UltraEconomyAPI</artifactId>
<version>2.6.4</version>
<scope>provided</scope>
</dependency>
<!-- <dependency>-->
<!-- <groupId>de.rapha149.signgui</groupId>-->
<!-- <artifactId>signgui</artifactId>-->
<!-- <version>2.3.2</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>com.artillexstudios</groupId>
<artifactId>AxShulkers</artifactId>
<version>1.5.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependency>
<groupId>me.aglerr.mobcoins</groupId>
<artifactId>MobCoins</artifactId>
<version>1.1.3</version>
<systemPath>${project.basedir}/libs/TheOnly-MobCoins-1.1.3.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>com.artillexstudios</groupId>
<artifactId>AxQuestBoardAPI</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.github.Realizedd</groupId>
<artifactId>TokenManager</artifactId>
<version>3.2.4</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>me.swanis.mobcoins</groupId>
<artifactId>MobCoins</artifactId>
<version>1.1.2</version>
<systemPath>${project.basedir}/libs/mobcoins-api-1.1.2-SNAPSHOT.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>me.rivaldev.harvesterhoes</groupId>
<artifactId>Main</artifactId>
<version>LATEST</version>
<systemPath>${project.basedir}/libs/RivalHarvesterHoesAPI.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>com.github.cryptomorin</groupId>
<artifactId>kingdoms</artifactId>
<version>LATEST</version>
<systemPath>${project.basedir}/libs/KingdomsX-1.16.14.1.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>su.nightexpress.coinsengine</groupId>
<artifactId>CoinsEngine</artifactId>
<version>2.1.1</version>
<systemPath>${project.basedir}/libs/CoinsEngine-2.1.1.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>me.qKing12.RoyaleEconomy</groupId>
<artifactId>RoyaleEconomy</artifactId>
<version>1.4.4</version>
<systemPath>${project.basedir}/libs/RoyaleEconomyAPI.jar</systemPath>
<scope>system</scope>
</dependency>
<dependency>
<groupId>com.github.MilkBowl</groupId>
<artifactId>VaultAPI</artifactId>
<version>1.7</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.black_ixx</groupId>
<artifactId>playerpoints</artifactId>
<version>3.2.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>me.TechsCode</groupId>
<artifactId>UltraEconomyAPI</artifactId>
<version>2.6.4</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.artillexstudios</groupId>
<artifactId>AxShulkers</artifactId>
<version>1.5.6</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>

View File

@ -11,7 +11,6 @@ import com.artillexstudios.axtrade.utils.SoundUtils;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissionDefault;
import org.jetbrains.annotations.NotNull;
import revxrsal.commands.annotation.DefaultFor;
import revxrsal.commands.annotation.Optional;
@ -29,6 +28,7 @@ import static com.artillexstudios.axtrade.AxTrade.HOOKS;
import static com.artillexstudios.axtrade.AxTrade.LANG;
import static com.artillexstudios.axtrade.AxTrade.MESSAGEUTILS;
@CommandPermission(value = "axtrade.trade")
public class Commands implements OrphanCommand {
public void help(@NotNull CommandSender sender) {
@ -79,7 +79,7 @@ public class Commands implements OrphanCommand {
}
@Subcommand("reload")
@CommandPermission(value = "axtrade.admin", defaultAccess = PermissionDefault.OP)
@CommandPermission(value = "axtrade.admin")
public void reload(@NotNull CommandSender sender) {
Bukkit.getConsoleSender().sendMessage(StringUtils.formatToString("&#00FFDD[AxTrade] &#AAFFDDReloading configuration..."));
if (!CONFIG.reload()) {
@ -118,8 +118,12 @@ public class Commands implements OrphanCommand {
}
@Subcommand("force")
@CommandPermission(value = "axtrade.admin", defaultAccess = PermissionDefault.OP)
@CommandPermission(value = "axtrade.admin")
public void force(@NotNull Player sender, Player other) {
if (sender.equals(other)) {
MESSAGEUTILS.sendLang(sender, "request.cant-trade-self");
return;
}
Trades.addTrade(sender, other);
}

View File

@ -9,11 +9,14 @@ import org.jetbrains.annotations.NotNull;
import java.util.WeakHashMap;
import static com.artillexstudios.axtrade.AxTrade.CONFIG;
public class PlayerInteractEntityListener implements Listener {
private final WeakHashMap<Player, Long> cd = new WeakHashMap<>();
@EventHandler (ignoreCancelled = true)
public void onClick(@NotNull PlayerInteractEntityEvent event) {
if (!CONFIG.getBoolean("shift-click-send-request", true)) return;
final Player player = event.getPlayer();
if (cd.containsKey(player) && System.currentTimeMillis() - cd.get(player) < 100L) return;

View File

@ -20,6 +20,9 @@ trade-request-expire-seconds: 60
# set to -1 to disable
trade-max-distance: 10
# should shift + right clicking on another player send them a trade request?
shift-click-send-request: true
number-formatting:
# modes:
# 0 - formatted (customizable, look at the formatted part)
@ -48,4 +51,4 @@ blacklisted-items:
name-contains: "Banned item's name"
# do not change this
version: 1
version: 2

View File

@ -44,8 +44,8 @@ request:
sent-sender: "&#CCFFEEYou have successfully sent a trade request to &#00FFDD%player%&#CCFFEE!"
sent-receiver: |
&#CCFFEEYou have received a trade request from &#00FFDD%player%&#CCFFEE!
&#00FF00<click:run_command:'/trade accept %player%'>/trade accept %player%</click>
&#FF0000<click:run_command:'/trade deny %player%'>/trade deny %player%</click>
&#00FF00/trade accept %player%
&#FF0000/trade deny %player%
no-request: "&#CCFFEEYou don't have an active trade request from &#00FFDD%player%&#CCFFEE!"
deny-sender: "&#CCFFEEYou trade request was denied by &#00FFDD%player%&#CCFFEE!"
deny-receiver: "&#CCFFEEYou have successfully denied &#00FFDD%player%&#CCFFEE's trade request!"

View File

@ -4,6 +4,12 @@ main: com.artillexstudios.axtrade.AxTrade
api-version: '1.18'
folia-supported: true
permissions:
axtrade.admin:
default: op
axtrade.trade:
default: true
softdepend:
- AxQuestBoard
- CoinsEngine