mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-25 10:37:41 +01:00
TypeToken is not available on old Guava.
This commit is contained in:
parent
520f9e3fcf
commit
fdddb17d2f
@ -70,10 +70,10 @@ public SchedulerReport() {
|
||||
@SuppressWarnings("unchecked")
|
||||
@Nullable
|
||||
private Class<?> getTaskClass(BukkitTask task) {
|
||||
Class<?> clazz = task.getClass();
|
||||
Set<Class<?>> classes = (Set) TypeToken.of(clazz).getTypes().rawTypes();
|
||||
|
||||
try {
|
||||
Class<?> clazz = task.getClass();
|
||||
Set<Class<?>> classes = (Set) TypeToken.of(clazz).getTypes().rawTypes();
|
||||
|
||||
for (Class<?> type : classes) {
|
||||
Optional<Field> field = taskFieldCache.getUnchecked(type);
|
||||
if (field.isPresent()) {
|
||||
@ -81,6 +81,7 @@ private Class<?> getTaskClass(BukkitTask task) {
|
||||
}
|
||||
}
|
||||
} catch (IllegalAccessException ignored) {
|
||||
} catch (NoClassDefFoundError ignored) {
|
||||
}
|
||||
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user