From f09901f0b59ec21dacf9ff4a05e2143263bf5ef7 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sun, 6 Dec 2015 16:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=AB=E6=8F=8F=E6=B5=81?= =?UTF-8?q?=E7=A8=8B=20=E5=8F=91=E7=8E=B0=E9=9D=9E=E6=B3=95=E7=89=A9?= =?UTF-8?q?=E5=93=81=E5=90=8E=E6=89=AB=E6=8F=8F=E7=8E=A9=E5=AE=B6=E8=83=8C?= =?UTF-8?q?=E5=8C=85...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- pom.xml | 4 ++-- .../maxgamer/QuickShop/Listeners/ProtectListener.java | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 9624f40..5d76360 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.maxgamer QuickShop - 1.6.2 + 1.6.3 快捷商店重置版本... ${project.name} @@ -54,7 +54,7 @@ http://ci.citycraft.cn:8080 - &c修复部分回收悬浮物的插件导致的刷物品 异步检测装备... + &a修改扫描流程 &c发现非法物品后扫描玩家背包... UTF-8 diff --git a/src/main/java/org/maxgamer/QuickShop/Listeners/ProtectListener.java b/src/main/java/org/maxgamer/QuickShop/Listeners/ProtectListener.java index 2227fa6..f460730 100644 --- a/src/main/java/org/maxgamer/QuickShop/Listeners/ProtectListener.java +++ b/src/main/java/org/maxgamer/QuickShop/Listeners/ProtectListener.java @@ -95,7 +95,7 @@ public class ProtectListener implements Listener { try { if (MarkUtil.hasMark(ci)) { inv.setItem(solt, new ItemStack(Material.AIR)); - Bukkit.broadcastMessage("§6[§b快捷商店§6] §4警告 " + p.getDisplayName() + " §c非法 §d§l获取 " + ci.getItemMeta().getDisplayName() + " §a已清理..."); + sendWarning(p, ci, "§d§l获取"); p.closeInventory(); } } catch (final Exception ex) { @@ -114,7 +114,7 @@ public class ProtectListener implements Listener { final ItemStack itemStack = cis[i]; if (MarkUtil.hasMark(itemStack)) { cis[i] = new ItemStack(Material.AIR); - Bukkit.broadcastMessage("§6[§b快捷商店§6] §4警告 " + p.getDisplayName() + " §c非法 §e§l穿戴 " + itemStack.getItemMeta().getDisplayName() + " §a已清理..."); + sendWarning(p, itemStack, "§e§l穿戴"); } } inv.setArmorContents(cis); @@ -122,7 +122,7 @@ public class ProtectListener implements Listener { final ItemStack newItem = inv.getItem(newslot); if (MarkUtil.hasMark(newItem)) { inv.setItem(newslot, new ItemStack(Material.AIR)); - Bukkit.broadcastMessage("§6[§b快捷商店§6] §4警告 " + p.getDisplayName() + " §c非法 §e§l使用 " + newItem.getItemMeta().getDisplayName() + " §a已清理..."); + sendWarning(p, newItem, "§3§l使用"); } } }); @@ -135,4 +135,9 @@ public class ProtectListener implements Listener { e.setCancelled(true); } } + + private void sendWarning(final Player p, final ItemStack ci, final String action) { + Bukkit.broadcastMessage(plugin.getConfigManager().getGuiTitle() + " §4警告 " + p.getDisplayName() + " §c非法 " + action + " " + ci.getItemMeta().getDisplayName()); + Bukkit.broadcastMessage(plugin.getConfigManager().getGuiTitle() + " §d保护系统 §d已清理 §c非法获取的物品 §a并扫描玩家背包..."); + } }