SBPrime / AsyncWorldEdit-Premium

Async WorldEdit - Edit millions of blocks without lag! (Premium version)
Other
19 stars 4 forks source link

API: getClassScannerOptions returns null #112

Closed Postremus closed 7 years ago

Postremus commented 7 years ago

Hello,

Example code:

IAsyncWorldEdit awe = (IAsyncWorldEdit)Bukkit.getPluginManager().getPlugin("AsyncWorldEdit");
System.out.println("awe: " + awe  == null); //false
System.out.println("classscanner: " + awe.getClassScannerOptions() == null); // true

The ClasscannerOptions are null. Is there anything special needed to do in order to get an instance? For example, pasting using the api works.

AsyncWorldEditInjector version 3.4.3
AsyncWorldEdit version 3.4.6

Paper 1.10.2

Thank you Postremus

SBPrime commented 7 years ago
  1. Did the plugin finish loading?
  2. What is the result for getAPI()
Postremus commented 7 years ago

1) Yes, it did finish loading. This code is executed with a command. 2) There is no method getApi() in IAsyncWorldEdit defined. I guess you mean getAPIVersion?

IAsyncWorldEdit awe = (IAsyncWorldEdit) Bukkit.getPluginManager().getPlugin("AsyncWorldEdit");
System.out.println("awe: " + awe == null); //false
System.out.println("classscanner: " + awe.getClassScannerOptions() == null); // true
System.out.println("api-version: " + awe.getAPIVersion()); // 3.002000005
SBPrime commented 7 years ago

There is a public method called getApi, but getAPIVersion will do. I'll check why you get null for the class scanner and get back to you.

Postremus commented 7 years ago

I guess (?) i found the problem. Look at AsyncWorlEditMain.getClassScannerOptions(). When the api is not null, return null..

SBPrime commented 7 years ago

Your right that might be the problem ;) I left the implementation of the IAsyncWorldEdit for compatibility and I use the getAPI from AsyncWorlEditMain.

SBPrime commented 7 years ago

Fixed in 3.4.7