diff --git a/src/main/java/com/yuyu/srappraise/appraise/AppraiseGuiService.java b/src/main/java/com/yuyu/srappraise/appraise/AppraiseGuiService.java index 48d3b5c..226e390 100644 --- a/src/main/java/com/yuyu/srappraise/appraise/AppraiseGuiService.java +++ b/src/main/java/com/yuyu/srappraise/appraise/AppraiseGuiService.java @@ -117,10 +117,12 @@ public class AppraiseGuiService extends GermGuiScreen { GermGuiSlot slot_biomass = this.germGuiSlotHashMap.get("slotConsume"); GermGuiCanvas canvas = (GermGuiCanvas) getGuiPart("utility"); GermGuiButton button_consume = (GermGuiButton) canvas.getGuiPart("button_consume"); - +// button_consume.setDefaultPath("local<->textures/gui/appraise/touming.gif"); +// button_consume.setHoverPath("local<->textures/gui/appraise/touming.gif"); button_consume.registerCallbackHandler((player, germGuiSlot) -> { + //验证产物槽上面是否存在没拿走的产物 for (int i = 1;i<=5;i++){ String slot = "slot_product_"+i; GermGuiSlot Germslot = this.germGuiSlotHashMap.get(slot); @@ -149,6 +151,7 @@ public class AppraiseGuiService extends GermGuiScreen { //这个是item的名字 String itemName = title.substring(title.indexOf('l') + 1); + //此处通过表示存在可鉴定的产物 if (SrAppraise.getConfigManager().getAppraiseItemMap().containsKey(itemName)){ itemStackHashMap.clear(); @@ -375,6 +378,7 @@ public class AppraiseGuiService extends GermGuiScreen { } int timeRun = 9 / itemStacks.size(); + ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(); AtomicInteger j = new AtomicInteger(0); diff --git a/src/main/java/com/yuyu/srappraise/appraise/AppraiseManager.java b/src/main/java/com/yuyu/srappraise/appraise/AppraiseManager.java index e87cf7e..4bc5878 100644 --- a/src/main/java/com/yuyu/srappraise/appraise/AppraiseManager.java +++ b/src/main/java/com/yuyu/srappraise/appraise/AppraiseManager.java @@ -53,9 +53,9 @@ public class AppraiseManager { - public void open(Player player,String guiName){ + public void open(Player player){ //获取鉴定的窗口 - AppraiseGuiService screen = new AppraiseGuiService(getAppraiseInventory(),guiName); + AppraiseGuiService screen = new AppraiseGuiService(getAppraiseInventory(),"appraise"); //获取gui的配置,此处会把读取到的gui配置传到ForgeScreen的构造类中 GermGuiScreen packscreen = GermGuiScreen.getGermGuiScreen("player_inventory-forge", getForgePlayerInventory()); diff --git a/src/main/java/com/yuyu/srappraise/command/OpenCommand.java b/src/main/java/com/yuyu/srappraise/command/OpenCommand.java index 9f4dfd5..c1cf801 100644 --- a/src/main/java/com/yuyu/srappraise/command/OpenCommand.java +++ b/src/main/java/com/yuyu/srappraise/command/OpenCommand.java @@ -28,26 +28,24 @@ public class OpenCommand implements SubCommand { } } - if (strings.length < 3){ - commandSender.sendMessage(ChatColor.RED+"正确的格式为:/srappraise open 姓名 GUIname"); + if (strings.length < 2){ + commandSender.sendMessage(ChatColor.RED+"正确的格式为:/srappraise open 姓名 "); return; } Player player = Bukkit.getPlayer(strings[1]); if (player == null){ - commandSender.sendMessage(ChatColor.RED+"玩家"+strings[2]+"不存在!"); + commandSender.sendMessage(ChatColor.RED+"玩家"+strings[1]+"不存在!"); return; } - String gui = strings[2]; - if (gui.equalsIgnoreCase("appraise")){ + + //为玩家打开GUI列表 - AppraiseManager.getInstance().open(player,gui); - }else { - commandSender.sendMessage(ChatColor.RED+"请输入正确的GUI名字"); - } + AppraiseManager.getInstance().open(player); + } }