1.4.4 (event and \n)
This commit is contained in:
@@ -61,6 +61,9 @@ public class Main extends JavaPlugin implements PluginMessageListener,Listener {
|
|||||||
final String text = data.split(";time=")[0];
|
final String text = data.split(";time=")[0];
|
||||||
//getLogger().info("recieved actionbar for "+player.getName()+": "+text);
|
//getLogger().info("recieved actionbar for "+player.getName()+": "+text);
|
||||||
VersionSupport.sendActionBar(p, text);
|
VersionSupport.sendActionBar(p, text);
|
||||||
|
|
||||||
|
QueueActionbarUpdateEvent e = new QueueActionbarUpdateEvent(p);
|
||||||
|
Bukkit.getPluginManager().callEvent(e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(subchannel.equals("queuename") && papi) {
|
if(subchannel.equals("queuename") && papi) {
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package us.ajg0702.queue.spigot;
|
||||||
|
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.Event;
|
||||||
|
import org.bukkit.event.HandlerList;
|
||||||
|
|
||||||
|
public class QueueActionbarUpdateEvent extends Event {
|
||||||
|
private static final HandlerList HANDLERS = new HandlerList();
|
||||||
|
|
||||||
|
public HandlerList getHandlers() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static HandlerList getHandlerList() {
|
||||||
|
return HANDLERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
Player ply;
|
||||||
|
|
||||||
|
public QueueActionbarUpdateEvent(Player p) {
|
||||||
|
this.ply = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPlayer() {
|
||||||
|
return ply.getPlayer();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package us.ajg0702.queue.utils;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
import net.md_5.bungee.api.chat.BaseComponent;
|
import net.md_5.bungee.api.chat.BaseComponent;
|
||||||
import net.md_5.bungee.api.chat.TextComponent;
|
import net.md_5.bungee.api.chat.TextComponent;
|
||||||
@@ -91,6 +92,7 @@ public class BungeeMessages {
|
|||||||
|
|
||||||
|
|
||||||
for(String k : d.keySet()) {
|
for(String k : d.keySet()) {
|
||||||
|
//pl.getLogger().info("Checking "+k);
|
||||||
if(!msgs.contains(k)) {
|
if(!msgs.contains(k)) {
|
||||||
msgs.set(k, d.get(k));
|
msgs.set(k, d.get(k));
|
||||||
}
|
}
|
||||||
@@ -113,7 +115,8 @@ public class BungeeMessages {
|
|||||||
return TextComponent.fromLegacyText(m);
|
return TextComponent.fromLegacyText(m);
|
||||||
}
|
}
|
||||||
public String color(String msg) {
|
public String color(String msg) {
|
||||||
return net.md_5.bungee.api.ChatColor.translateAlternateColorCodes('&', msg);
|
|
||||||
|
return net.md_5.bungee.api.ChatColor.translateAlternateColorCodes('&', msg).replaceAll(Matcher.quoteReplacement("\\n"), "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reload() {
|
public void reload() {
|
||||||
|
|||||||
Reference in New Issue
Block a user