mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-26 02:57:42 +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")
|
@SuppressWarnings("unchecked")
|
||||||
@Nullable
|
@Nullable
|
||||||
private Class<?> getTaskClass(BukkitTask task) {
|
private Class<?> getTaskClass(BukkitTask task) {
|
||||||
Class<?> clazz = task.getClass();
|
|
||||||
Set<Class<?>> classes = (Set) TypeToken.of(clazz).getTypes().rawTypes();
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Class<?> clazz = task.getClass();
|
||||||
|
Set<Class<?>> classes = (Set) TypeToken.of(clazz).getTypes().rawTypes();
|
||||||
|
|
||||||
for (Class<?> type : classes) {
|
for (Class<?> type : classes) {
|
||||||
Optional<Field> field = taskFieldCache.getUnchecked(type);
|
Optional<Field> field = taskFieldCache.getUnchecked(type);
|
||||||
if (field.isPresent()) {
|
if (field.isPresent()) {
|
||||||
@ -81,6 +81,7 @@ private Class<?> getTaskClass(BukkitTask task) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IllegalAccessException ignored) {
|
} catch (IllegalAccessException ignored) {
|
||||||
|
} catch (NoClassDefFoundError ignored) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user