com.imaginarycode.minecraft.redisbungee.RedisBungeeAPI Java Examples
The following examples show how to use
com.imaginarycode.minecraft.redisbungee.RedisBungeeAPI.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RedisPlayersOnlineSupplier.java From Plan with GNU Lesser General Public License v3.0 | 5 votes |
@Override public int getAsInt() { RedisBungeeAPI api = RedisBungee.getApi(); try { return api != null ? api.getPlayerCount() : -1; } catch (NullPointerException e) { return -1; } }
Example #2
Source File: RedisBungeeCalculator.java From LuckPerms with MIT License | 5 votes |
@Override public void calculate(@NonNull ContextConsumer consumer) { RedisBungeeAPI redisBungee = RedisBungee.getApi(); if (redisBungee != null) { consumer.accept(PROXY_KEY, redisBungee.getServerId()); } }
Example #3
Source File: RedisBungeeCalculator.java From LuckPerms with MIT License | 5 votes |
@Override public ContextSet estimatePotentialContexts() { RedisBungeeAPI redisBungee = RedisBungee.getApi(); if (redisBungee == null) { return ImmutableContextSetImpl.EMPTY; } ImmutableContextSet.Builder builder = new ImmutableContextSetImpl.BuilderImpl(); for (String server : redisBungee.getAllServers()) { builder.add(PROXY_KEY, server); } return builder.build(); }
Example #4
Source File: DiscordBot.java From DiscordBot with Apache License 2.0 | 4 votes |
public RedisBungeeAPI getRedisBungee() { return this.redisBungee; }