From 021c89a0e83eba157f5fa69a9956b23390e510ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=8F=E9=BB=91?= Date: Tue, 20 Feb 2018 15:12:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=99=E5=92=8B=E8=BF=98=E6=9C=89=E4=B8=AA?= =?UTF-8?q?=E7=B1=BB=E4=B9=B1=E7=A0=81=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skymc/taboolib/display/ActionUtils.java | 3 +- .../me/skymc/tlm/module/sub/ModuleKits.java | 54 +++++++++---------- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/main/src/me/skymc/taboolib/display/ActionUtils.java b/src/main/src/me/skymc/taboolib/display/ActionUtils.java index 7b4c273..6fc1015 100644 --- a/src/main/src/me/skymc/taboolib/display/ActionUtils.java +++ b/src/main/src/me/skymc/taboolib/display/ActionUtils.java @@ -48,12 +48,13 @@ public class ActionUtils { Object ab = getNMSClass("ChatComponentText").getConstructor(new Class[] { String.class }).newInstance(new Object[] { msg }); Constructor ac = null; Object abPacket = null; - // ����汾���� 1.11.0 + // 汾 1.11.0 if (TabooLib.getVerint() > 11100) { Class chatMessageType = getNMSClass("ChatMessageType"); ac = getNMSClass("PacketPlayOutChat").getConstructor(getNMSClass("IChatBaseComponent"), chatMessageType); abPacket = ac.newInstance(ab, chatMessageType.getMethod("a", Byte.TYPE).invoke(null, (byte) 2)); } else { + ac = getNMSClass("PacketPlayOutChat").getConstructor(getNMSClass("IChatBaseComponent"), Byte.TYPE); abPacket = ac.newInstance(ab, Byte.valueOf((byte) 2)); } sendPacket(p, abPacket); diff --git a/src/main/src/me/skymc/tlm/module/sub/ModuleKits.java b/src/main/src/me/skymc/tlm/module/sub/ModuleKits.java index d255695..94fd084 100644 --- a/src/main/src/me/skymc/tlm/module/sub/ModuleKits.java +++ b/src/main/src/me/skymc/tlm/module/sub/ModuleKits.java @@ -17,7 +17,7 @@ import me.skymc.tlm.module.ITabooLibraryModule; /** * @author sky - * @since 2018218 12:13:55 + * @since 2018年2月18日 下午12:13:55 */ public class ModuleKits implements ITabooLibraryModule { @@ -34,28 +34,28 @@ public class ModuleKits implements ITabooLibraryModule { } /** - * Ƿȡ + * 设置玩家是否领取礼包 * - * @param player + * @param player 玩家 */ public void setPlayerReward(Player player, String kit, boolean reward) { data.set(kit + "." + player.getName(), reward ? System.currentTimeMillis() : null); } /** - * + * 清空礼包数据 * - * @param kit + * @param kit 礼包 */ public void resetKit(String kit) { data.set(kit, null); } /** - * Ƿȡ + * 玩家是否领取礼包 * - * @param player - * @param kit + * @param player 玩家 + * @param kit 礼包 * @return boolean */ public boolean isPlayerRewared(Player player, String kit) { @@ -63,7 +63,7 @@ public class ModuleKits implements ITabooLibraryModule { } /** - * Ƿȴ + * 礼包是否在冷却中 * * @param player * @param kit @@ -74,9 +74,9 @@ public class ModuleKits implements ITabooLibraryModule { } /** - * Ƿ + * 礼包是否存在 * - * @param kit + * @param kit 礼包名 * @return boolean */ public boolean contains(String kit) { @@ -84,9 +84,9 @@ public class ModuleKits implements ITabooLibraryModule { } /** - * ȡȴʱ + * 获取礼包冷却时间 * - * @param kit + * @param kit 礼包名 * @return long */ public long getCooldown(String kit) { @@ -94,9 +94,9 @@ public class ModuleKits implements ITabooLibraryModule { } /** - * ȡռ䲻ʱĴʽ + * 获取礼包空间不足时的处理方式 * - * @param kit + * @param kit 礼包名 * @return boolean */ public Boolean isFullDrop(String kit) { @@ -104,9 +104,9 @@ public class ModuleKits implements ITabooLibraryModule { } /** - * Ƿֻȡһ + * 礼包是否只能领取一次 * - * @param kit + * @param kit 礼包名 * @return boolean */ public boolean isDisposable(String kit) { @@ -114,9 +114,9 @@ public class ModuleKits implements ITabooLibraryModule { } /** - * ȡȨ + * 获取礼包权限 * - * @param kit + * @param kit 礼包名 * @return String */ public String getPermission(String kit) { @@ -124,19 +124,19 @@ public class ModuleKits implements ITabooLibraryModule { } /** - * ȡȨʾ + * 获取礼包权限提示 * - * @param kit + * @param kit 礼包名 * @return String */ public String getPermissionMessage(String kit) { - return getConfig().getString("Kits." + kit + ".Permission-message").replace("&", ""); + return getConfig().getString("Kits." + kit + ".Permission-message").replace("&", "§"); } /** - * ȡƷ + * 获取礼包物品 * - * @param kit + * @param kit 礼包名 * @return {@link List} */ public List getItems(String kit) { @@ -149,9 +149,9 @@ public class ModuleKits implements ITabooLibraryModule { item.setAmount(NumberUtils.getInteger(itemStr.split(" ")[1])); items.add(item); } catch (Exception e) { - MsgUtils.warn("ģ쳣: &4Ʒ"); - MsgUtils.warn("ģ: &4Kits"); - MsgUtils.warn("λ: &4" + itemStr); + MsgUtils.warn("模块配置载入异常: &4物品数量错误"); + MsgUtils.warn("模块: &4Kits"); + MsgUtils.warn("位于: &4" + itemStr); } } }