File tree Expand file tree Collapse file tree
src/main/java/org/inventivetalent/reflection/resolver/minecraft Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,19 +12,18 @@ public class NMSClassResolver extends ClassResolver {
1212 @ Override
1313 public Class resolve (String ... names ) throws ClassNotFoundException {
1414 for (int i = 0 ; i < names .length ; i ++) {
15- if (!names [i ].startsWith ("net.minecraft" )) {
16- names [i ] = Minecraft .getNMSPackage () + "." + names [i ];
17- } else if (names [i ].contains ("." )) {
18- /* name contains dot but don't start with NMS (ex: world.entity.Entity) */
19- if (MinecraftVersion .VERSION .hasNMSVersionPrefix ()) {
20- /* use class name only */
21- String [] path = names [i ].split ("\\ ." );
22- names [i ] = Minecraft .getNMSPackage () + "." + path [path .length - 1 ];
23- } else {
24- /* use the whole name */
25- names [i ] = Minecraft .getNMSPackage () + "." + names [i ];
26- }
15+ if (names [i ].startsWith ("net.minecraft" ))
16+ continue ;
17+
18+ if (names [i ].contains ("." ) && MinecraftVersion .VERSION .hasNMSVersionPrefix ()) {
19+ /* use class name only */
20+ String [] path = names [i ].split ("\\ ." );
21+ names [i ] = Minecraft .getNMSPackage () + "." + path [path .length - 1 ];
22+ continue ;
2723 }
24+
25+ /* use the whole name */
26+ names [i ] = Minecraft .getNMSPackage () + "." + names [i ];
2827 }
2928 return super .resolve (names );
3029 }
You can’t perform that action at this time.
0 commit comments