版本更新至:4.04

调整:命令帮助的格式现在可以在语言文件中更改了。
调整:@CommandRegister 现在可以直接标注在 BaseSubCommand 成员变量上进行注册了(详见 TabooLibPluginMainCommand 写法)。
调整:TagAPI,TagManager 作废,但部分方法仍可使用。
新增:BaseSubCommand 类新增 getPermission 方法用于判断子命令权限
新增:TagDataHandler 类用于代替 TagManager 类
新增:TagPacket 类用于代替 TagAPI 类
修复:前后缀以及昵称的各种不兼容问题
修复:ItemUtils 工具载入物品时因 material 值不存在而导致的报错
删除:me.skymc.taboolib.team.TagUtils 类永久删除
This commit is contained in:
坏黑
2018-05-23 04:36:51 +08:00
parent ffa2d616c4
commit 0acf324b15
29 changed files with 1996 additions and 1844 deletions

View File

@@ -377,7 +377,7 @@ public class NMSUtil19 {
class_NBTTagCompound_getByteMethod = class_NBTTagCompound.getMethod("getByte", String.class);
class_NBTTagCompound_getByteArrayMethod = class_NBTTagCompound.getMethod("getByteArray", String.class);
class_NBTTagCompound_getListMethod = class_NBTTagCompound.getMethod("getList", String.class, Integer.TYPE);
class_CraftItemStack_copyMethod = class_CraftItemStack.getMethod("asNMSCopy", org.bukkit.inventory.ItemStack.class);
class_CraftItemStack_copyMethod = class_CraftItemStack.getMethod("asNMSCopy", ItemStack.class);
class_CraftItemStack_asBukkitCopyMethod = class_CraftItemStack.getMethod("asBukkitCopy", class_ItemStack);
class_CraftItemStack_mirrorMethod = class_CraftItemStack.getMethod("asCraftMirror", class_ItemStack);
class_World_addEntityMethod = class_World.getMethod("addEntity", class_Entity, CreatureSpawnEvent.SpawnReason.class);
@@ -931,7 +931,7 @@ public class NMSUtil19 {
return NMSUtils.class.getClassLoader().loadClass(className);
}
public static Object getHandle(org.bukkit.Server server) {
public static Object getHandle(Server server) {
Object handle = null;
try {
handle = class_CraftServer_getServerMethod.invoke(server);
@@ -941,7 +941,7 @@ public class NMSUtil19 {
return handle;
}
public static Object getHandle(org.bukkit.inventory.ItemStack stack) {
public static Object getHandle(ItemStack stack) {
Object handle = null;
try {
handle = class_CraftItemStack_getHandleField.get(stack);
@@ -951,7 +951,7 @@ public class NMSUtil19 {
return handle;
}
public static Object getHandle(org.bukkit.World world) {
public static Object getHandle(World world) {
if (world == null) {
return null;
}
@@ -964,7 +964,7 @@ public class NMSUtil19 {
return handle;
}
public static Object getHandle(org.bukkit.entity.Entity entity) {
public static Object getHandle(Entity entity) {
if (entity == null) {
return null;
}
@@ -990,7 +990,7 @@ public class NMSUtil19 {
return handle;
}
public static boolean isDone(org.bukkit.Chunk chunk) {
public static boolean isDone(Chunk chunk) {
Object chunkHandle = getHandle(chunk);
boolean done = false;
try {
@@ -1001,7 +1001,7 @@ public class NMSUtil19 {
return done;
}
public static Object getHandle(org.bukkit.Chunk chunk) {
public static Object getHandle(Chunk chunk) {
Object handle = null;
try {
handle = class_CraftChunk_getHandleMethod.invoke(chunk);
@@ -1011,7 +1011,7 @@ public class NMSUtil19 {
return handle;
}
public static Object getHandle(org.bukkit.entity.Player player) {
public static Object getHandle(Player player) {
Object handle = null;
try {
handle = class_CraftPlayer_getHandleMethod.invoke(player);
@@ -1068,7 +1068,7 @@ public class NMSUtil19 {
return dir;
}
public static org.bukkit.entity.Entity getBukkitEntity(Object entity)
public static Entity getBukkitEntity(Object entity)
{
if (entity == null) {
return null;
@@ -1076,10 +1076,10 @@ public class NMSUtil19 {
try {
Method getMethod = entity.getClass().getMethod("getBukkitEntity");
Object bukkitEntity = getMethod.invoke(entity);
if (!(bukkitEntity instanceof org.bukkit.entity.Entity)) {
if (!(bukkitEntity instanceof Entity)) {
return null;
}
return (org.bukkit.entity.Entity)bukkitEntity;
return (Entity)bukkitEntity;
} catch (Throwable ex) {
ex.printStackTrace();
}