File tree Expand file tree Collapse file tree
bukkit/module/bukkit-versions/src/main/kotlin/io/github/rothes/esu/bukkit/util/version Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,9 +25,8 @@ class Versioned<T, V>(
2525 val prefix = target.packageName + " .v"
2626 val find = classes
2727 .filter {
28- ! it.contains(' $' ) // Not subclass!
29- && it.startsWith(prefix)
30- && it.substringAfterLast(' .' ).startsWith(target.simpleName)
28+ it.startsWith(prefix)
29+ && it.substringAfterLast(' .' ).substringAfterLast(' $' ).startsWith(target.simpleName)
3130 && (type == null || it.endsWith(type))
3231 }
3332 .mapNotNull {
@@ -49,7 +48,7 @@ class Versioned<T, V>(
4948
5049 val clazz = Class .forName(find.first)
5150 if (! target.isAssignableFrom(clazz))
52- error(" Found ${clazz.canonicalName } , but it is not an instance of ${target.canonicalName} " )
51+ error(" Found ${clazz.name } , but it is not an instance of ${target.canonicalName} " )
5352
5453 @Suppress(" UNCHECKED_CAST" )
5554 (clazz.kotlin.objectInstance ? : clazz.getConstructor().newInstance()) as V
You can’t perform that action at this time.
0 commit comments