Skip to content

Commit

Permalink
Fix target patterns compilation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xDec0de committed Oct 7, 2024
1 parent d8fdd14 commit 098f975
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<ab:", "/ab>", message -> {
if (target instanceof MCPlayer<?> player)
if (target instanceof MCPlayer player)
player.sendActionBar(message);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<c:", "/c>", message -> {
if (target instanceof MCConsole<?> console)
if (target instanceof MCConsole console)
console.sendMessage(message);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<p:", "/p>", message -> {
if (target instanceof MCPlayer<?> player) {
if (target instanceof MCPlayer player) {
if (applyEventPatterns)
player.sendMessage(MCStrings.applyEventPatterns(message));
else
Expand Down

0 comments on commit 098f975

Please sign in to comment.