-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrie full API #29
Comments
Can you please add a Callback method. For example we use ASyncWorldEdit's EditSession for an edit, we can also provide an interface with an "execute" method so that code will be executed, in the main thread, by the plugin. For example: public interface Callback<T> {
public void execute(T response);
} The execute method will be called once the edit is done. |
I really need API for loading schematic, it lags a lot! |
@mbcx2 API or support for that command? I have seen other plugins load schematic in async thread then placed in the world either in main thread or using AWE. |
There is both. |
As far as I know the schematic loading consists of i/o operations only, so it should be good to do that in an async thread. |
@runky Exactly, you can do that in an async thread. |
I agree, there needs to be some way for developers to know when a job is finished, how long until it will be finished, and the current BPS... the same information the player is able to contain when using worldedit. |
@Intensearmadillo: As you can see all the features that you have mentioned are available. To get BlockPlacer:
For job start/finish use:
Then for job state change (in job added listener):
For block placing speed use:
|
@SBPrime
Which then uses it to paste, the issue I have is the player I use later on...
Is an anonymous player, and multiple of these may be setting off at once, meaning that I can't just use the player unknown name or what. Is there a way to turn an EditSession into the a Job ID so I can keep track of these? I don't really want to make fake players as that's not very good practice, is there anything you would suggest for this sort of thing? I'd also like to not rely on timing it to catch the job in the listener because it's possible that the jobs could have multiple added at a time and i'd never be able to work out which one belongs to which part of it. I can't see any way to turn a job into more information such as block coordinates etc? |
@MylesIsCool First of all don't use new AsyncEditSession. Use getEditSessionFactory from WorldEdit. Regarding "Fake player" in AWE its simply a UUID, so its not a bad practice :) You could use:
Whan you use this, remember to add the jobAdded listener, and jobStateChanged listener. For reference look at: #53 |
Any way to get composition of certain blocks in a region asynchronously and return its percentage? It would be extremely useful for calculating the percentages of mines. Thanks. |
try using the standard WE function (getDistribution if i remember correctly) within PerformAsAsyncJob. |
Implemented premium API. Details available here: |
No description provided.
The text was updated successfully, but these errors were encountered: