Fix /mail sendall not working (#5263)

This commit is contained in:
Josh Roy 2023-04-02 18:12:04 -04:00 committed by GitHub
parent 75481925f7
commit 11e6d3ca7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,12 +2,15 @@ package net.essentialsx.api.v2.events;
import net.ess3.api.IUser;
import net.essentialsx.api.v2.services.mail.MailMessage;
import org.bukkit.Bukkit;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
/**
* Called when mail is sent to a {@link net.ess3.api.IUser IUser} by another player or the console.
* <p>
* Note: This event has no guarantee of the thread it is fired on, please use {@link #isAsynchronous()}} to see if this event is off the main Bukkit thread.
*/
public class UserMailEvent extends Event implements Cancellable {
private static final HandlerList handlers = new HandlerList();
@ -17,6 +20,7 @@ public class UserMailEvent extends Event implements Cancellable {
private boolean canceled;
public UserMailEvent(IUser recipient, MailMessage message) {
super(!Bukkit.isPrimaryThread());
this.recipient = recipient;
this.message = message;
}