#937 Add option for AuthMe to run in sync
- Create BukkitService#runTaskOptionallyAsync and BukkitService#scheduleSyncTaskFromOptionallyAsyncTask whose behavior depends on a new setting - Use the new methods where applicable - Declare events async or sync depending on the new setting
This commit is contained in:
@@ -19,9 +19,10 @@ public class AuthMeAsyncPreLoginEvent extends CustomEvent {
|
||||
* Constructor.
|
||||
*
|
||||
* @param player The player
|
||||
* @param isAsync True if the event is async, false otherwise
|
||||
*/
|
||||
public AuthMeAsyncPreLoginEvent(Player player) {
|
||||
super(true);
|
||||
public AuthMeAsyncPreLoginEvent(Player player, boolean isAsync) {
|
||||
super(isAsync);
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,10 @@ public class ProtectInventoryEvent extends CustomEvent implements Cancellable {
|
||||
* Constructor.
|
||||
*
|
||||
* @param player The player
|
||||
* @param isAsync True if the event is async, false otherwise
|
||||
*/
|
||||
public ProtectInventoryEvent(Player player) {
|
||||
super(true);
|
||||
public ProtectInventoryEvent(Player player, boolean isAsync) {
|
||||
super(isAsync);
|
||||
this.player = player;
|
||||
this.storedInventory = player.getInventory().getContents();
|
||||
this.storedArmor = player.getInventory().getArmorContents();
|
||||
|
||||
Reference in New Issue
Block a user