Update NMS

Update MenuBuilder
Update Reflection
Update BaseCommand
This commit is contained in:
sky
2019-12-11 20:19:12 +08:00
parent 9aa72cdc91
commit 5908428403
11 changed files with 168 additions and 90 deletions

View File

@@ -66,11 +66,11 @@ public class SimpleReflection {
try {
Map<String, Field> fields = fieldCached.get(nmsClass.getName());
if (fields == null) {
return;
throw new RuntimeException("Not Found Cache.");
}
Field field = fields.get(fieldName);
if (value == null) {
return;
throw new RuntimeException("Not Found Field.");
}
field.set(instance, value);
} catch (Exception e) {
@@ -82,11 +82,11 @@ public class SimpleReflection {
try {
Map<String, Field> fields = fieldCached.get(nmsClass.getName());
if (fields == null) {
return null;
throw new RuntimeException("Not Found Cache.");
}
Field field = fields.get(fieldName);
if (field == null) {
return null;
throw new RuntimeException("Not Found Field.");
}
return field.get(instance);
} catch (Exception e) {
@@ -99,11 +99,11 @@ public class SimpleReflection {
try {
Map<String, Field> fields = fieldCached.get(nmsClass.getName());
if (fields == null) {
return def;
throw new RuntimeException("Not Found Cache.");
}
Field field = fields.get(fieldName);
if (field == null) {
return def;
throw new RuntimeException("Not Found Field.");
}
return (T) field.get(instance);
} catch (Exception e) {