From 098f9754c21f67f60bca77fd157cee6a7f87f351 Mon Sep 17 00:00:00 2001 From: xDec0de_ Date: Mon, 7 Oct 2024 20:17:15 +0200 Subject: [PATCH] Fix target patterns compilation errors --- .../java/strings/pattern/target/ActionBarTargetPattern.java | 2 +- .../java/strings/pattern/target/ConsoleTargetPattern.java | 2 +- .../java/strings/pattern/target/PlayerTargetPattern.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/ActionBarTargetPattern.java b/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/ActionBarTargetPattern.java index 7684c56..6a2e337 100644 --- a/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/ActionBarTargetPattern.java +++ b/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/ActionBarTargetPattern.java @@ -12,7 +12,7 @@ public class ActionBarTargetPattern implements TargetPattern { @Override public String process(@NotNull MessageReceiver target, @NotNull String string, boolean applyEventPatterns) { return MCStrings.match(string, "", message -> { - if (target instanceof MCPlayer player) + if (target instanceof MCPlayer player) player.sendActionBar(message); }); } diff --git a/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/ConsoleTargetPattern.java b/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/ConsoleTargetPattern.java index 2cec6fd..284e1b1 100644 --- a/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/ConsoleTargetPattern.java +++ b/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/ConsoleTargetPattern.java @@ -13,7 +13,7 @@ public class ConsoleTargetPattern implements TargetPattern { @Override public String process(@NotNull MessageReceiver target, @NotNull String string, boolean applyEventPatterns) { return MCStrings.match(string, "", message -> { - if (target instanceof MCConsole console) + if (target instanceof MCConsole console) console.sendMessage(message); }); } diff --git a/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/PlayerTargetPattern.java b/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/PlayerTargetPattern.java index 17f6938..07c93d4 100644 --- a/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/PlayerTargetPattern.java +++ b/shared/src/main/java/net/codersky/mcutils/java/strings/pattern/target/PlayerTargetPattern.java @@ -28,7 +28,7 @@ public class PlayerTargetPattern implements TargetPattern { @Override public String process(@NotNull MessageReceiver target, @NotNull String string, boolean applyEventPatterns) { return MCStrings.match(string, "", message -> { - if (target instanceof MCPlayer player) { + if (target instanceof MCPlayer player) { if (applyEventPatterns) player.sendMessage(MCStrings.applyEventPatterns(message)); else