From bd508c1d5e368ee26c969732159b5e6c304a104d Mon Sep 17 00:00:00 2001
From: BenceX100 <52270269+BenceX100@users.noreply.github.com>
Date: Sun, 19 May 2024 18:57:56 +0200
Subject: [PATCH] 1.1.0
---
pom.xml | 481 +++++++++---------
.../axtrade/commands/Commands.java | 10 +-
.../PlayerInteractEntityListener.java | 3 +
src/main/resources/config.yml | 5 +-
src/main/resources/lang.yml | 4 +-
src/main/resources/plugin.yml | 6 +
6 files changed, 261 insertions(+), 248 deletions(-)
diff --git a/pom.xml b/pom.xml
index 657b6ea..731354f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,255 +2,252 @@
- 4.0.0
+ 4.0.0
- com.artillexstudios
- AxTrade
- 1.0.0
- jar
+ com.artillexstudios
+ AxTrade
+ 1.1.0
+ jar
- AxTrade
+ AxTrade
-
- 1.8
- UTF-8
-
+
+ 1.8
+ UTF-8
+
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.8.1
-
-
- 12
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 3.5.3
-
-
- package
-
- shade
-
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.8.1
- false
-
-
- com.artillexstudios.axapi
- com.artillexstudios.axtrade.libs.axapi
-
-
- org.bstats
- com.artillexstudios.axtrade.libs.bstats
-
-
- dev.triumphteam.gui
- com.artillexstudios.axtrade.libs.gui
-
-
- net.kyori
- com.artillexstudios.axtrade.libs.kyori
-
-
- revxrsal.commands
- com.artillexstudios.axtrade.libs.lamp
-
-
+
+ 12
+
+ -parameters
+
-
-
-
-
-
-
- src/main/resources
- true
-
-
-
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 3.5.3
+
+
+ package
+
+ shade
+
+
+ false
+
+
+ com.artillexstudios.axapi
+ com.artillexstudios.axtrade.libs.axapi
+
+
+ org.bstats
+ com.artillexstudios.axtrade.libs.bstats
+
+
+ dev.triumphteam.gui
+ com.artillexstudios.axtrade.libs.gui
+
+
+ net.kyori
+ com.artillexstudios.axtrade.libs.kyori
+
+
+ revxrsal.commands
+ com.artillexstudios.axtrade.libs.lamp
+
+
+
+
+
+
+
+
+
+ src/main/resources
+ true
+
+
+
-
-
- Artillex-Studios
- https://repo.artillex-studios.com/releases/
-
-
- spigotmc-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
- sonatype
- https://oss.sonatype.org/content/groups/public/
-
-
- jitpack.io
- https://jitpack.io
-
-
- placeholderapi
- https://repo.extendedclip.com/content/repositories/placeholderapi/
-
-
- techscode
- https://repo.techscode.com/repository/maven-releases/
-
-
- rosewood-repo
- https://repo.rosewooddev.io/repository/public/
-
-
+
+
+ Artillex-Studios
+ https://repo.artillex-studios.com/releases/
+
+
+ spigotmc-repo
+ https://hub.spigotmc.org/nexus/content/repositories/snapshots/
+
+
+ sonatype
+ https://oss.sonatype.org/content/groups/public/
+
+
+ jitpack.io
+ https://jitpack.io
+
+
+ placeholderapi
+ https://repo.extendedclip.com/content/repositories/placeholderapi/
+
+
+ techscode
+ https://repo.techscode.com/repository/maven-releases/
+
+
+ rosewood-repo
+ https://repo.rosewooddev.io/repository/public/
+
+
-
-
- com.artillexstudios.axapi
- axapi
- 1.4.232
- compile
- all
-
-
- org.spigotmc
- spigot-api
- 1.18-R0.1-SNAPSHOT
- provided
-
-
- dev.triumphteam
- triumph-gui
- 3.1.7
- compile
-
-
- me.clip
- placeholderapi
- 2.11.5
- provided
-
-
- org.bstats
- bstats-bukkit
- 3.0.2
- compile
-
-
- net.kyori
- adventure-platform-bukkit
- 4.3.2
- compile
-
-
- net.kyori
- adventure-text-minimessage
- 4.16.0
- compile
-
-
- net.kyori
- adventure-text-serializer-legacy
- 4.16.0
- compile
-
-
- net.kyori
- adventure-api
- 4.16.0
- compile
-
+
+
+ com.artillexstudios.axapi
+ axapi
+ 1.4.234
+ compile
+ all
+
+
+ org.spigotmc
+ spigot-api
+ 1.18.2-R0.1-SNAPSHOT
+ provided
+
+
+ dev.triumphteam
+ triumph-gui
+ 3.1.7
+ compile
+
+
+ me.clip
+ placeholderapi
+ 2.11.5
+ provided
+
+
+ org.bstats
+ bstats-bukkit
+ 3.0.2
+ compile
+
+
+ net.kyori
+ adventure-platform-bukkit
+ 4.3.2
+ compile
+
+
+ net.kyori
+ adventure-text-minimessage
+ 4.17.0
+ compile
+
+
+ net.kyori
+ adventure-text-serializer-legacy
+ 4.17.0
+ compile
+
+
+ net.kyori
+ adventure-api
+ 4.17.0
+ compile
+
-
- me.aglerr.mobcoins
- MobCoins
- 1.1.3
- ${project.basedir}/libs/TheOnly-MobCoins-1.1.3.jar
- system
-
-
- com.artillexstudios
- AxQuestBoardAPI
- 1
- provided
-
-
- com.github.Realizedd
- TokenManager
- 3.2.4
- provided
-
-
- *
- *
-
-
-
-
- me.swanis.mobcoins
- MobCoins
- 1.1.2
- ${project.basedir}/libs/mobcoins-api-1.1.2-SNAPSHOT.jar
- system
-
-
- me.rivaldev.harvesterhoes
- Main
- LATEST
- ${project.basedir}/libs/RivalHarvesterHoesAPI.jar
- system
-
-
- com.github.cryptomorin
- kingdoms
- LATEST
- ${project.basedir}/libs/KingdomsX-1.16.14.1.jar
- system
-
-
- su.nightexpress.coinsengine
- CoinsEngine
- 2.1.1
- ${project.basedir}/libs/CoinsEngine-2.1.1.jar
- system
-
-
- me.qKing12.RoyaleEconomy
- RoyaleEconomy
- 1.4.4
- ${project.basedir}/libs/RoyaleEconomyAPI.jar
- system
-
-
- com.github.MilkBowl
- VaultAPI
- 1.7
- provided
-
-
- org.black_ixx
- playerpoints
- 3.2.6
- provided
-
-
- me.TechsCode
- UltraEconomyAPI
- 2.6.4
- provided
-
-
-
-
-
-
-
-
- com.artillexstudios
- AxShulkers
- 1.5.6
- provided
-
-
+
+ me.aglerr.mobcoins
+ MobCoins
+ 1.1.3
+ ${project.basedir}/libs/TheOnly-MobCoins-1.1.3.jar
+ system
+
+
+ com.artillexstudios
+ AxQuestBoardAPI
+ 1
+ provided
+
+
+ com.github.Realizedd
+ TokenManager
+ 3.2.4
+ provided
+
+
+ *
+ *
+
+
+
+
+ me.swanis.mobcoins
+ MobCoins
+ 1.1.2
+ ${project.basedir}/libs/mobcoins-api-1.1.2-SNAPSHOT.jar
+ system
+
+
+ me.rivaldev.harvesterhoes
+ Main
+ LATEST
+ ${project.basedir}/libs/RivalHarvesterHoesAPI.jar
+ system
+
+
+ com.github.cryptomorin
+ kingdoms
+ LATEST
+ ${project.basedir}/libs/KingdomsX-1.16.14.1.jar
+ system
+
+
+ su.nightexpress.coinsengine
+ CoinsEngine
+ 2.1.1
+ ${project.basedir}/libs/CoinsEngine-2.1.1.jar
+ system
+
+
+ me.qKing12.RoyaleEconomy
+ RoyaleEconomy
+ 1.4.4
+ ${project.basedir}/libs/RoyaleEconomyAPI.jar
+ system
+
+
+ com.github.MilkBowl
+ VaultAPI
+ 1.7
+ provided
+
+
+ org.black_ixx
+ playerpoints
+ 3.2.6
+ provided
+
+
+ me.TechsCode
+ UltraEconomyAPI
+ 2.6.4
+ provided
+
+
+ com.artillexstudios
+ AxShulkers
+ 1.5.6
+ provided
+
+
diff --git a/src/main/java/com/artillexstudios/axtrade/commands/Commands.java b/src/main/java/com/artillexstudios/axtrade/commands/Commands.java
index 3acd6fe..1b7c686 100644
--- a/src/main/java/com/artillexstudios/axtrade/commands/Commands.java
+++ b/src/main/java/com/artillexstudios/axtrade/commands/Commands.java
@@ -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("FFDD[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);
}
diff --git a/src/main/java/com/artillexstudios/axtrade/listeners/PlayerInteractEntityListener.java b/src/main/java/com/artillexstudios/axtrade/listeners/PlayerInteractEntityListener.java
index 4e2d67c..f305dd8 100644
--- a/src/main/java/com/artillexstudios/axtrade/listeners/PlayerInteractEntityListener.java
+++ b/src/main/java/com/artillexstudios/axtrade/listeners/PlayerInteractEntityListener.java
@@ -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 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;
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index b896ea0..2e6c932 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -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
\ No newline at end of file
+version: 2
\ No newline at end of file
diff --git a/src/main/resources/lang.yml b/src/main/resources/lang.yml
index 1bd832c..89611f0 100644
--- a/src/main/resources/lang.yml
+++ b/src/main/resources/lang.yml
@@ -44,8 +44,8 @@ request:
sent-sender: "CCFFEEYou have successfully sent a trade request to FFDD%player%CCFFEE!"
sent-receiver: |
CCFFEEYou have received a trade request from FFDD%player%CCFFEE!
- FF00/trade accept %player%
- FF0000/trade deny %player%
+ FF00/trade accept %player%
+ FF0000/trade deny %player%
no-request: "CCFFEEYou don't have an active trade request from FFDD%player%CCFFEE!"
deny-sender: "CCFFEEYou trade request was denied by FFDD%player%CCFFEE!"
deny-receiver: "CCFFEEYou have successfully denied FFDD%player%CCFFEE's trade request!"
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index de98bac..9214342 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -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