Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Optimized sending of me and say command
Browse files Browse the repository at this point in the history
  • Loading branch information
Timongcraft committed Nov 14, 2023
1 parent eed22d0 commit 8f217e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/main/java/timongcraft/system/commands/MeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import dev.jorel.commandapi.CommandTree;
import dev.jorel.commandapi.arguments.GreedyStringArgument;
import dev.jorel.commandapi.executors.CommandArguments;
import net.md_5.bungee.api.chat.TranslatableComponent;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;

Expand All @@ -23,9 +24,7 @@ public static void register() {
}

private static void meManager(CommandSender sender, CommandArguments args) {
String msg = (String) args.get("message");

Bukkit.broadcastMessage("* " + sender.getName() + " " + msg);
Bukkit.spigot().broadcast(new TranslatableComponent("chat.type.emote", sender.getName(), args.get("message")));
}

}
4 changes: 1 addition & 3 deletions src/main/java/timongcraft/system/commands/SayCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ public static void register() {
}

private static void sayManager(CommandSender sender, CommandArguments args) {
TranslatableComponent message = new TranslatableComponent("chat.type.announcement", sender.getName(), args.get("message"));

Bukkit.spigot().broadcast(message);
Bukkit.spigot().broadcast(new TranslatableComponent("chat.type.announcement", sender.getName(), args.get("message")));
}

}

0 comments on commit 8f217e9

Please sign in to comment.