Chat fixes, town color fixes, some features #72
3 changed files with 66 additions and 63 deletions
|
@ -1,14 +1,14 @@
|
|||
package buttondevteam.chat.commands.ucmds.admin;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.dynmap.towny.DynmapTownyPlugin;
|
||||
|
||||
import buttondevteam.chat.PluginMain;
|
||||
import buttondevteam.lib.chat.Color;
|
||||
import lombok.val;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.dynmap.towny.DynmapTownyPlugin;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TownColorCommand extends AdminCommandBase {
|
||||
@Override
|
||||
|
@ -41,6 +41,7 @@ public class TownColorCommand extends AdminCommandBase {
|
|||
val c = Arrays.stream(Color.values()).filter(cc -> cc.getName().equalsIgnoreCase(args[ii])).findAny();
|
||||
if (!c.isPresent()) {
|
||||
sender.sendMessage("§cThe color '" + args[i] + "' cannot be found.");
|
||||
sender.sendMessage("§cAvailable colors: " + Arrays.stream(Color.values()).map(Color::getName).collect(Collectors.joining(", ")));
|
||||
return true;
|
||||
}
|
||||
clrs[i - 1] = c.get();
|
||||
|
|
|
@ -1,15 +1,5 @@
|
|||
package buttondevteam.chat.listener;
|
||||
|
||||
import java.util.Timer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import com.earth2me.essentials.Essentials;
|
||||
|
||||
import buttondevteam.chat.ChatPlayer;
|
||||
import buttondevteam.chat.FlairStates;
|
||||
import buttondevteam.chat.PlayerJoinTimerTask;
|
||||
|
@ -18,6 +8,15 @@ import buttondevteam.chat.commands.UnlolCommand;
|
|||
import buttondevteam.lib.player.TBMCPlayerJoinEvent;
|
||||
import buttondevteam.lib.player.TBMCPlayerLoadEvent;
|
||||
import buttondevteam.lib.player.TBMCPlayerSaveEvent;
|
||||
import com.earth2me.essentials.Essentials;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
|
||||
import java.util.Timer;
|
||||
|
||||
public class PlayerJoinLeaveListener implements Listener {
|
||||
|
||||
|
@ -46,9 +45,7 @@ public class PlayerJoinLeaveListener implements Listener {
|
|||
tt.mp = cp;
|
||||
timer.schedule(tt, 1000);
|
||||
} else {
|
||||
if (cp.FlairTime().get() == 0x00)
|
||||
cp.SetFlair(ChatPlayer.FlairTimeNone);
|
||||
Timer timer = new Timer();
|
||||
/*Timer timer = new Timer();
|
||||
PlayerJoinTimerTask tt = new PlayerJoinTimerTask() {
|
||||
|
||||
@Override
|
||||
|
@ -70,10 +67,13 @@ public class PlayerJoinLeaveListener implements Listener {
|
|||
}
|
||||
};
|
||||
tt.mp = cp;
|
||||
timer.schedule(tt, 15 * 1000);
|
||||
timer.schedule(tt, 15 * 1000);*/ //TODO: Better Reddit integration (OAuth)
|
||||
}
|
||||
|
||||
String nwithoutformatting = PluginMain.essentials.getUser(p).getNickname();
|
||||
|
||||
p.setDisplayName();
|
||||
|
||||
int index;
|
||||
if (nwithoutformatting != null) {
|
||||
while ((index = nwithoutformatting.indexOf("§k")) != -1)
|
||||
|
|
|
@ -79,7 +79,9 @@ public class PlayerListener implements Listener {
|
|||
else
|
||||
mp = null;
|
||||
String cmd = "";
|
||||
if (index == -1 && (sender instanceof Player || sender instanceof ConsoleCommandSender)) { // Only the command is run
|
||||
if (index == -1) { // Only the command is run
|
||||
if (!(sender instanceof Player || sender instanceof ConsoleCommandSender))
|
||||
return false;
|
||||
// ^^ We can only store player or console channels - Directly sending to channels would still work if they had an event
|
||||
cmd = sender instanceof ConsoleCommandSender ? message : message.substring(1);
|
||||
for (Channel channel : Channel.getChannels()) {
|
||||
|
|
Loading…
Reference in a new issue