added inqueue placeholder
This commit is contained in:
@@ -198,9 +198,10 @@ public class Main extends Plugin implements Listener {
|
|||||||
}
|
}
|
||||||
BungeeUtils.sendCustomData(player, "positionof", pos);
|
BungeeUtils.sendCustomData(player, "positionof", pos);
|
||||||
}
|
}
|
||||||
/*if(subchannel.equals("whitelist")) {
|
if(subchannel.equals("inqueue")) {
|
||||||
String data = in.readUTF();
|
Server server = man.findPlayerInQueue(player);
|
||||||
}*/
|
BungeeUtils.sendCustomData(player, "inqueue", (server != null)+"");
|
||||||
|
}
|
||||||
|
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
getLogger().warning("An error occured while reading data from spigot side:");
|
getLogger().warning("An error occured while reading data from spigot side:");
|
||||||
|
|||||||
@@ -99,6 +99,18 @@ public class Main extends JavaPlugin implements PluginMessageListener,Listener {
|
|||||||
phs.put("of", data);
|
phs.put("of", data);
|
||||||
placeholders.responseCache.put(p, phs);
|
placeholders.responseCache.put(p, phs);
|
||||||
}
|
}
|
||||||
|
if(subchannel.equals("inqueue") && papi) {
|
||||||
|
String playername = in.readUTF();
|
||||||
|
Player p = Bukkit.getPlayer(playername);
|
||||||
|
if(p == null) return;
|
||||||
|
if(!p.isOnline()) return;
|
||||||
|
|
||||||
|
String data = in.readUTF();
|
||||||
|
HashMap<String, String> phs = placeholders.responseCache.get(p);
|
||||||
|
if(phs == null) phs = new HashMap<>();
|
||||||
|
phs.put("inqueue", data);
|
||||||
|
placeholders.responseCache.put(p, phs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -171,6 +171,9 @@ public class Placeholders extends PlaceholderExpansion {
|
|||||||
if(identifier.equalsIgnoreCase("position") || identifier.equalsIgnoreCase("of")) {
|
if(identifier.equalsIgnoreCase("position") || identifier.equalsIgnoreCase("of")) {
|
||||||
return "None";
|
return "None";
|
||||||
}
|
}
|
||||||
|
if(identifier.equalsIgnoreCase("inqueue")) {
|
||||||
|
return "false";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -190,6 +193,10 @@ public class Placeholders extends PlaceholderExpansion {
|
|||||||
plugin.sendMessage(player, "positionof", "");
|
plugin.sendMessage(player, "positionof", "");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
if(identifier.equalsIgnoreCase("inqueue")) {
|
||||||
|
plugin.sendMessage(player, "inqueue", "");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user