Skip to content

Commit

Permalink
Fix async event if async chat event is caused synchronously
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Oct 3, 2021
1 parent b44c6c1 commit 238b401
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>net.pistonmaster</groupId>
<artifactId>PistonChat</artifactId>
<version>1.5.1</version>
<version>1.5.2</version>
<packaging>jar</packaging>

<name>PistonChat</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ public final class PistonChatEvent extends Event implements Cancellable {
private boolean isCancelled;
private String message;

public PistonChatEvent(Player player, String message) {
super(true);
public PistonChatEvent(Player player, String message, boolean isAsync) {
super(isAsync);

this.player = player;
this.message = message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class ChatEvent implements Listener {
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onChat(AsyncPlayerChatEvent event) {
Player chatter = event.getPlayer();
PistonChatEvent pistonChatEvent = new PistonChatEvent(chatter, event.getMessage());
PistonChatEvent pistonChatEvent = new PistonChatEvent(chatter, event.getMessage(), event.isAsynchronous());

event.getRecipients().clear();

Expand Down

0 comments on commit 238b401

Please sign in to comment.