Don't allow them to set the watcher willy nilly without verifiying it
This commit is contained in:
parent
19f895667a
commit
c9b9710a78
@ -632,6 +632,10 @@ public abstract class Disguise {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setWatcher(FlagWatcher newWatcher) {
|
public void setWatcher(FlagWatcher newWatcher) {
|
||||||
|
if (!getType().getWatcherClass().isInstance(newWatcher)) {
|
||||||
|
throw new IllegalArgumentException(newWatcher.getClass().getSimpleName() + " is not a instance of "
|
||||||
|
+ getType().getWatcherClass().getSimpleName() + " for DisguiseType " + getType().name());
|
||||||
|
}
|
||||||
watcher = newWatcher;
|
watcher = newWatcher;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user