Nation color, /tableflip fix, improvements and other fixes #92
3 changed files with 6 additions and 8 deletions
|
@ -1,12 +1,11 @@
|
||||||
package buttondevteam.chat.commands;
|
package buttondevteam.chat.commands;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import buttondevteam.lib.chat.CommandClass;
|
import buttondevteam.lib.chat.CommandClass;
|
||||||
import buttondevteam.lib.chat.TBMCCommandBase;
|
import buttondevteam.lib.chat.TBMCCommandBase;
|
||||||
import buttondevteam.lib.player.TBMCYEEHAWEvent;
|
import buttondevteam.lib.player.TBMCYEEHAWEvent;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.command.CommandSender;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@CommandClass(modOnly = false)
|
@CommandClass(modOnly = false)
|
||||||
public class YeehawCommand extends TBMCCommandBase {
|
public class YeehawCommand extends TBMCCommandBase {
|
||||||
|
@ -22,9 +21,9 @@ public class YeehawCommand extends TBMCCommandBase {
|
||||||
+ (sender instanceof Player ? ((Player) sender).getDisplayName() : sender.getName()) + " §bYEEHAWs.";
|
+ (sender instanceof Player ? ((Player) sender).getDisplayName() : sender.getName()) + " §bYEEHAWs.";
|
||||||
for (Player p : Bukkit.getOnlinePlayers()) {
|
for (Player p : Bukkit.getOnlinePlayers()) {
|
||||||
p.playSound(p.getLocation(), "tbmc.yeehaw", 1f, 1f);
|
p.playSound(p.getLocation(), "tbmc.yeehaw", 1f, 1f);
|
||||||
|
p.sendMessage(message); //Not broadcasting, so the Discord plugin can handle the event in a special way
|
||||||
} // Even a cmdblock could yeehaw in theory
|
} // Even a cmdblock could yeehaw in theory
|
||||||
// Or anyone from Discord
|
// Or anyone from Discord
|
||||||
Bukkit.broadcastMessage(message);
|
|
||||||
Bukkit.getPluginManager().callEvent(new TBMCYEEHAWEvent(sender));
|
Bukkit.getPluginManager().callEvent(new TBMCYEEHAWEvent(sender));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ import buttondevteam.lib.chat.CommandClass;
|
||||||
import buttondevteam.lib.chat.TBMCChatAPI;
|
import buttondevteam.lib.chat.TBMCChatAPI;
|
||||||
import buttondevteam.lib.chat.TBMCCommandBase;
|
import buttondevteam.lib.chat.TBMCCommandBase;
|
||||||
import buttondevteam.lib.player.ChromaGamerBase;
|
import buttondevteam.lib.player.ChromaGamerBase;
|
||||||
import buttondevteam.lib.player.TBMCPlayer;
|
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
@CommandClass(modOnly = false, excludeFromPath = true)
|
@CommandClass(modOnly = false, excludeFromPath = true)
|
||||||
|
@ -21,7 +20,7 @@ public abstract class AppendTextCommandBase extends TBMCCommandBase {
|
||||||
for (String arg : args) msg.append(arg).append(" ");
|
for (String arg : args) msg.append(arg).append(" ");
|
||||||
msg.append(GetAppendedText());
|
msg.append(GetAppendedText());
|
||||||
TBMCChatAPI.SendChatMessage(ChatMessage.builder(sender,
|
TBMCChatAPI.SendChatMessage(ChatMessage.builder(sender,
|
||||||
ChromaGamerBase.getFromSender(sender, TBMCPlayer.class), msg.toString())
|
ChromaGamerBase.getFromSender(sender), msg.toString())
|
||||||
.fromCommand(true).build());
|
.fromCommand(true).build());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,7 @@ public class PlayerListener implements Listener {
|
||||||
if (message.length() < 2)
|
if (message.length() < 2)
|
||||||
return false;
|
return false;
|
||||||
int index = message.indexOf(" ");
|
int index = message.indexOf(" ");
|
||||||
val mp = ChromaGamerBase.getFromSender(sender, TBMCPlayer.class);
|
val mp = ChromaGamerBase.getFromSender(sender);
|
||||||
String cmd;
|
String cmd;
|
||||||
final BiPredicate<Channel, String> checkchid = (chan, cmd1) -> cmd1.equalsIgnoreCase(chan.ID) || (chan.IDs != null && Arrays.stream(chan.IDs).anyMatch(cmd1::equalsIgnoreCase));
|
final BiPredicate<Channel, String> checkchid = (chan, cmd1) -> cmd1.equalsIgnoreCase(chan.ID) || (chan.IDs != null && Arrays.stream(chan.IDs).anyMatch(cmd1::equalsIgnoreCase));
|
||||||
if (index == -1) { // Only the command is run
|
if (index == -1) { // Only the command is run
|
||||||
|
|
Loading…
Reference in a new issue