mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 18:45:27 +01:00
Remove unused methods from #1758
This commit is contained in:
parent
19e0684469
commit
6e79e81df5
@ -55,7 +55,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class Quest implements Comparable<Quest> {
|
||||
|
||||
@ -525,45 +524,6 @@ public class Quest implements Comparable<Quest> {
|
||||
public void completeQuest(final Quester quester) {
|
||||
completeQuest(quester, true);
|
||||
}
|
||||
|
||||
public void runEvent(Quester quester, Consumer<Boolean> callback) {
|
||||
if (Bukkit.isPrimaryThread()) {
|
||||
final QuesterPreCompleteQuestEvent preEvent
|
||||
= new QuesterPreCompleteQuestEvent(quester, this, false);
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
callback.accept(preEvent.isCancelled());
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
final QuesterPreCompleteQuestEvent preEvent
|
||||
= new QuesterPreCompleteQuestEvent(quester, Quest.this, true);
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
callback.accept(preEvent.isCancelled());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public CompletableFuture<Boolean> completeEvent(Quester quester) {
|
||||
CompletableFuture<Boolean> result = new CompletableFuture<>();
|
||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
final QuesterPreCompleteQuestEvent preEvent
|
||||
= new QuesterPreCompleteQuestEvent(quester, Quest.this, true);
|
||||
plugin.getServer().getPluginManager().callEvent(preEvent);
|
||||
result.complete(preEvent.isCancelled());
|
||||
}
|
||||
});
|
||||
// do your processes asynchronously
|
||||
// in the asynchronous process, call "result.complete(theValueOfMoney)" to complete the task
|
||||
// or if an exception is thrown, you can also "result.completeExceptionally(theException)"
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Proceed to finish this quest, issuing applicable rewards
|
||||
|
Loading…
Reference in New Issue
Block a user