Update towny hook / fix pattern traverser

This commit is contained in:
Jesse Boyd
2018-08-29 01:04:25 +10:00
parent abd886acd7
commit 418cfa6d03
3 changed files with 27 additions and 31 deletions

View File

@ -34,7 +34,7 @@ public class PatternTraverser {
Field field = current.getDeclaredField("extent");
field.setAccessible(true);
field.set(pattern, newExtent);
} catch (NoSuchFieldException | IllegalAccessException ignore) {
} catch (NoSuchFieldException | IllegalAccessException | ClassCastException ignore) {
}
}
try {
@ -42,7 +42,7 @@ public class PatternTraverser {
field.setAccessible(true);
Object next = field.get(pattern);
reset(next, newExtent);
} catch (NoSuchFieldException | IllegalAccessException ignore) {
} catch (NoSuchFieldException | IllegalAccessException | ClassCastException ignore) {
}
try {
Field field = current.getDeclaredField("mask");
@ -56,7 +56,7 @@ public class PatternTraverser {
field.setAccessible(true);
Pattern next = (Pattern) field.get(pattern);
reset(next, newExtent);
} catch (NoSuchFieldException | IllegalAccessException ignore) {
} catch (NoSuchFieldException | IllegalAccessException | ClassCastException ignore) {
}
try {
Field field = current.getDeclaredField("patterns");
@ -65,7 +65,7 @@ public class PatternTraverser {
for (Pattern next : patterns) {
reset(next, newExtent);
}
} catch (NoSuchFieldException | IllegalAccessException ignore) {
} catch (NoSuchFieldException | IllegalAccessException | ClassCastException ignore) {
}
current = current.getSuperclass();
}

View File

@ -1014,6 +1014,7 @@ public enum BlockTypes implements BlockType {
int size = blockMap.size();
for (BlockTypes type : oldValues) {
if (!blockMap.containsKey(type.getId())) {
type.init(type.getId(), 0, new ArrayList<>());
Fawe.debug("Invalid block registered " + type.getId());
size++;
}