Originally Posted by
veeer
The culprit line is here. (PS aren't you from rune-server?)
Class<Dialogue> dialogue = (Class<Dialogue>) Class.forName(file.getName().replaceAll(".class", "").getClass().getCanonicalName());
`file.getName().replaceAll(...)` is a String object, so calling `getClass()` returns String.class. `String.class.getCanonicalName()` will then be "java.lang.String.class", which, when passed through Class.forName(), will return String.class once again... heh. Maybe you should write your code a bit cleaner so you notice simple mistakes like this with ease.
EDIT: To clarify, what you probably want is:
String name = file.getName();
name = name.substring(0, name.length() - 6);
Class<? extends Dialogue> clazz = Class.forName("com.rs.game.player.dialogues.impl." + name).asSubclass(Dialogue.class);
if (!handledDialogues.containsKey(name)) {
handledDialogues.put(name, clazz);
}
Yeah, I'm from Rune-Server.