这咋还有个类乱码了

This commit is contained in:
坏黑 2018-02-20 15:12:26 +08:00
parent e7ebf50ff2
commit 021c89a0e8
2 changed files with 29 additions and 28 deletions

View File

@ -48,12 +48,13 @@ public class ActionUtils {
Object ab = getNMSClass("ChatComponentText").getConstructor(new Class[] { String.class }).newInstance(new Object[] { msg }); Object ab = getNMSClass("ChatComponentText").getConstructor(new Class[] { String.class }).newInstance(new Object[] { msg });
Constructor<?> ac = null; Constructor<?> ac = null;
Object abPacket = null; Object abPacket = null;
// <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1.11.0 // 如果版本大于 1.11.0
if (TabooLib.getVerint() > 11100) { if (TabooLib.getVerint() > 11100) {
Class<?> chatMessageType = getNMSClass("ChatMessageType"); Class<?> chatMessageType = getNMSClass("ChatMessageType");
ac = getNMSClass("PacketPlayOutChat").getConstructor(getNMSClass("IChatBaseComponent"), chatMessageType); ac = getNMSClass("PacketPlayOutChat").getConstructor(getNMSClass("IChatBaseComponent"), chatMessageType);
abPacket = ac.newInstance(ab, chatMessageType.getMethod("a", Byte.TYPE).invoke(null, (byte) 2)); abPacket = ac.newInstance(ab, chatMessageType.getMethod("a", Byte.TYPE).invoke(null, (byte) 2));
} else { } else {
ac = getNMSClass("PacketPlayOutChat").getConstructor(getNMSClass("IChatBaseComponent"), Byte.TYPE);
abPacket = ac.newInstance(ab, Byte.valueOf((byte) 2)); abPacket = ac.newInstance(ab, Byte.valueOf((byte) 2));
} }
sendPacket(p, abPacket); sendPacket(p, abPacket);

View File

@ -17,7 +17,7 @@ import me.skymc.tlm.module.ITabooLibraryModule;
/** /**
* @author sky * @author sky
* @since 2018쾨2墩18휑 苟敎12:13:55 * @since 2018年2月18日 下午12:13:55
*/ */
public class ModuleKits implements ITabooLibraryModule { public class ModuleKits implements ITabooLibraryModule {
@ -34,28 +34,28 @@ public class ModuleKits implements ITabooLibraryModule {
} }
/** /**
* <EFBFBD>零鯤소角뤠쥴혤쟉관 * 设置玩家是否领取礼包
* *
* @param player 鯤소 * @param player 玩家
*/ */
public void setPlayerReward(Player player, String kit, boolean reward) { public void setPlayerReward(Player player, String kit, boolean reward) {
data.set(kit + "." + player.getName(), reward ? System.currentTimeMillis() : null); data.set(kit + "." + player.getName(), reward ? System.currentTimeMillis() : null);
} }
/** /**
* 헌왕쟉관鑒앴 * 清空礼包数据
* *
* @param kit 쟉관 * @param kit 礼包
*/ */
public void resetKit(String kit) { public void resetKit(String kit) {
data.set(kit, null); data.set(kit, null);
} }
/** /**
* 鯤소角뤠쥴혤쟉관 * 玩家是否领取礼包
* *
* @param player 鯤소 * @param player 玩家
* @param kit 쟉관 * @param kit 礼包
* @return boolean * @return boolean
*/ */
public boolean isPlayerRewared(Player player, String kit) { public boolean isPlayerRewared(Player player, String kit) {
@ -63,7 +63,7 @@ public class ModuleKits implements ITabooLibraryModule {
} }
/** /**
* 쟉관角뤠瞳잤홱櫓 * 礼包是否在冷却中
* *
* @param player * @param player
* @param kit * @param kit
@ -74,9 +74,9 @@ public class ModuleKits implements ITabooLibraryModule {
} }
/** /**
* 쟉관角뤠닸瞳 * 礼包是否存在
* *
* @param kit 쟉관츰 * @param kit 礼包名
* @return boolean * @return boolean
*/ */
public boolean contains(String kit) { public boolean contains(String kit) {
@ -84,9 +84,9 @@ public class ModuleKits implements ITabooLibraryModule {
} }
/** /**
* 삿혤쟉관잤홱珂쇌 * 获取礼包冷却时间
* *
* @param kit 쟉관츰 * @param kit 礼包名
* @return long * @return long
*/ */
public long getCooldown(String kit) { public long getCooldown(String kit) {
@ -94,9 +94,9 @@ public class ModuleKits implements ITabooLibraryModule {
} }
/** /**
* 삿혤쟉관왕쇌꼇璃珂돨뇹잿렘駕 * 获取礼包空间不足时的处理方式
* *
* @param kit 쟉관츰 * @param kit 礼包名
* @return boolean * @return boolean
*/ */
public Boolean isFullDrop(String kit) { public Boolean isFullDrop(String kit) {
@ -104,9 +104,9 @@ public class ModuleKits implements ITabooLibraryModule {
} }
/** /**
* 쟉관角뤠怜콘쥴혤寧늴 * 礼包是否只能领取一次
* *
* @param kit 쟉관츰 * @param kit 礼包名
* @return boolean * @return boolean
*/ */
public boolean isDisposable(String kit) { public boolean isDisposable(String kit) {
@ -114,9 +114,9 @@ public class ModuleKits implements ITabooLibraryModule {
} }
/** /**
* 삿혤쟉관홈掘 * 获取礼包权限
* *
* @param kit 쟉관츰 * @param kit 礼包名
* @return String * @return String
*/ */
public String getPermission(String kit) { public String getPermission(String kit) {
@ -124,19 +124,19 @@ public class ModuleKits implements ITabooLibraryModule {
} }
/** /**
* 삿혤쟉관홈掘瓊刻 * 获取礼包权限提示
* *
* @param kit 쟉관츰 * @param kit 礼包名
* @return String * @return String
*/ */
public String getPermissionMessage(String kit) { 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} * @return {@link List}
*/ */
public List<ItemStack> getItems(String kit) { public List<ItemStack> getItems(String kit) {
@ -149,9 +149,9 @@ public class ModuleKits implements ITabooLibraryModule {
item.setAmount(NumberUtils.getInteger(itemStr.split(" ")[1])); item.setAmount(NumberUtils.getInteger(itemStr.split(" ")[1]));
items.add(item); items.add(item);
} catch (Exception e) { } catch (Exception e) {
MsgUtils.warn("친욥토零潼흙嫩끽: &4膠틔鑒좆댄轎"); MsgUtils.warn("模块配置载入异常: &4物品数量错误");
MsgUtils.warn("친욥: &4Kits"); MsgUtils.warn("模块: &4Kits");
MsgUtils.warn("貫黨: &4" + itemStr); MsgUtils.warn("位于: &4" + itemStr);
} }
} }
} }