This commit is contained in:
yaohunya 2025-08-13 07:55:07 +08:00
parent d4b0aa1e4b
commit 03285d62a7
5 changed files with 18 additions and 3 deletions

View File

@ -33,5 +33,10 @@
<artifactId>DemonAPI</artifactId> <artifactId>DemonAPI</artifactId>
<version>2.2.9</version> <version>2.2.9</version>
</dependency> </dependency>
<dependency>
<groupId>me.Demon.DemonSoulBind</groupId>
<artifactId>DemonSoulBind</artifactId>
<version>1.5.9</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -8,6 +8,7 @@ import com.yaohun.trade.util.MessageUtil;
import com.yaohun.trade.util.TradeState; import com.yaohun.trade.util.TradeState;
import me.Demon.DemonPlugin.DemonAPI; import me.Demon.DemonPlugin.DemonAPI;
import me.Demon.DemonPlugin.Util.CDTimeAPI; import me.Demon.DemonPlugin.Util.CDTimeAPI;
import me.Demon.DemonSoulBind.api.SBindAPI;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Sound; import org.bukkit.Sound;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -45,6 +46,15 @@ public class ClickInventory implements Listener {
MessageUtil.sendMessage(player,Config.getString("shfitClickAnit"),Sound.ENTITY_VILLAGER_NO); MessageUtil.sendMessage(player,Config.getString("shfitClickAnit"),Sound.ENTITY_VILLAGER_NO);
return; 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) { if(rawSlot >0 && rawSlot < 45) {
e.setCancelled(true); e.setCancelled(true);
TradeData tradeData = InviteManager.getTradeData(player); TradeData tradeData = InviteManager.getTradeData(player);
@ -52,7 +62,6 @@ public class ClickInventory implements Listener {
player.closeInventory(); player.closeInventory();
return; return;
} }
ItemStack stack = e.getCurrentItem();
if(tradeData.getPlayer().equals(player)){ if(tradeData.getPlayer().equals(player)){
if(!isClickValidPlace(false,rawSlot)){ if(!isClickValidPlace(false,rawSlot)){
if(rawSlot == 36 || rawSlot == 37 || rawSlot == 38 || rawSlot == 39){ if(rawSlot == 36 || rawSlot == 37 || rawSlot == 38 || rawSlot == 39){

View File

@ -57,5 +57,6 @@ public class LogsManager {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
Bukkit.getConsoleSender().sendMessage("§6[交易系统] §7成功保存交易日志: §a"+logDataList.size()+""); Bukkit.getConsoleSender().sendMessage("§6[交易系统] §7成功保存交易日志: §a"+logDataList.size()+"");
logDataList.clear();
} }
} }

View File

@ -2,6 +2,5 @@ package com.yaohun.trade.util;
public enum TradeState { public enum TradeState {
OPEN, OPEN,
CONFIRM, CONFIRM
SUCCEED
} }

View File

@ -24,5 +24,6 @@ Message:
closeTheInterface2: "§f[§c系统§f] §b玩家 §e{name} §b取消了与你的交易." closeTheInterface2: "§f[§c系统§f] §b玩家 §e{name} §b取消了与你的交易."
doubleClickAnit: "§f[§c系统§f] §b交易取消,交易系统不支持双击点击." doubleClickAnit: "§f[§c系统§f] §b交易取消,交易系统不支持双击点击."
shfitClickAnit: "§f[§c系统§f] §b交易取消,交易系统不支持SHIFT点击." shfitClickAnit: "§f[§c系统§f] §b交易取消,交易系统不支持SHIFT点击."
bindClickAnit: "§f[§c系统§f] §b交易取消,绑定的物品无法进行交易."
CompleteTrade: "§f[§c系统§f] §6交易成功,您获得了 §a{count}件 §6交易物品." CompleteTrade: "§f[§c系统§f] §6交易成功,您获得了 §a{count}件 §6交易物品."
CompleteTrade2: "§f[§c系统§f] §6交易成功,物品已发送至对方背包." CompleteTrade2: "§f[§c系统§f] §6交易成功,物品已发送至对方背包."