From 03285d62a74b3dd42b8dee37fc0777397f3bdaac Mon Sep 17 00:00:00 2001
From: yaohunya <1763917516@qq.com>
Date: Wed, 13 Aug 2025 07:55:07 +0800
Subject: [PATCH] 1.0.0
---
pom.xml | 5 +++++
.../com/yaohun/trade/listener/ClickInventory.java | 11 ++++++++++-
.../java/com/yaohun/trade/manage/LogsManager.java | 1 +
src/main/java/com/yaohun/trade/util/TradeState.java | 3 +--
src/main/resources/DemonTrade.yml | 1 +
5 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/pom.xml b/pom.xml
index 55a04b0..4ab1816 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,5 +33,10 @@
DemonAPI
2.2.9
+
+ me.Demon.DemonSoulBind
+ DemonSoulBind
+ 1.5.9
+
\ No newline at end of file
diff --git a/src/main/java/com/yaohun/trade/listener/ClickInventory.java b/src/main/java/com/yaohun/trade/listener/ClickInventory.java
index 6201720..28aca56 100644
--- a/src/main/java/com/yaohun/trade/listener/ClickInventory.java
+++ b/src/main/java/com/yaohun/trade/listener/ClickInventory.java
@@ -8,6 +8,7 @@ import com.yaohun.trade.util.MessageUtil;
import com.yaohun.trade.util.TradeState;
import me.Demon.DemonPlugin.DemonAPI;
import me.Demon.DemonPlugin.Util.CDTimeAPI;
+import me.Demon.DemonSoulBind.api.SBindAPI;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
@@ -45,6 +46,15 @@ public class ClickInventory implements Listener {
MessageUtil.sendMessage(player,Config.getString("shfitClickAnit"),Sound.ENTITY_VILLAGER_NO);
return;
}
+ ItemStack stack = e.getCurrentItem();
+ if(!DemonAPI.itemIsNull(stack)){
+ if(SBindAPI.isItemsBindTag(stack)){
+ e.setCancelled(true);
+ player.closeInventory();
+ MessageUtil.sendMessage(player,Config.getString("bindClickAnitc"),Sound.ENTITY_VILLAGER_NO);
+ return;
+ }
+ }
if(rawSlot >0 && rawSlot < 45) {
e.setCancelled(true);
TradeData tradeData = InviteManager.getTradeData(player);
@@ -52,7 +62,6 @@ public class ClickInventory implements Listener {
player.closeInventory();
return;
}
- ItemStack stack = e.getCurrentItem();
if(tradeData.getPlayer().equals(player)){
if(!isClickValidPlace(false,rawSlot)){
if(rawSlot == 36 || rawSlot == 37 || rawSlot == 38 || rawSlot == 39){
diff --git a/src/main/java/com/yaohun/trade/manage/LogsManager.java b/src/main/java/com/yaohun/trade/manage/LogsManager.java
index aaf3554..cfb847c 100644
--- a/src/main/java/com/yaohun/trade/manage/LogsManager.java
+++ b/src/main/java/com/yaohun/trade/manage/LogsManager.java
@@ -57,5 +57,6 @@ public class LogsManager {
throw new RuntimeException(e);
}
Bukkit.getConsoleSender().sendMessage("§6[交易系统] §7成功保存交易日志: §a"+logDataList.size()+"条");
+ logDataList.clear();
}
}
diff --git a/src/main/java/com/yaohun/trade/util/TradeState.java b/src/main/java/com/yaohun/trade/util/TradeState.java
index 0700ce1..31b3f05 100644
--- a/src/main/java/com/yaohun/trade/util/TradeState.java
+++ b/src/main/java/com/yaohun/trade/util/TradeState.java
@@ -2,6 +2,5 @@ package com.yaohun.trade.util;
public enum TradeState {
OPEN,
- CONFIRM,
- SUCCEED
+ CONFIRM
}
diff --git a/src/main/resources/DemonTrade.yml b/src/main/resources/DemonTrade.yml
index 6acfe24..1ad22fe 100644
--- a/src/main/resources/DemonTrade.yml
+++ b/src/main/resources/DemonTrade.yml
@@ -24,5 +24,6 @@ Message:
closeTheInterface2: "§f[§c系统§f] §b玩家 §e{name} §b取消了与你的交易."
doubleClickAnit: "§f[§c系统§f] §b交易取消,交易系统不支持双击点击."
shfitClickAnit: "§f[§c系统§f] §b交易取消,交易系统不支持SHIFT点击."
+ bindClickAnit: "§f[§c系统§f] §b交易取消,绑定的物品无法进行交易."
CompleteTrade: "§f[§c系统§f] §6交易成功,您获得了 §a{count}件 §6交易物品."
CompleteTrade2: "§f[§c系统§f] §6交易成功,物品已发送至对方背包."