本文整理汇总了Java中com.imaginarycode.minecraft.redisbungee.RedisBungee.getApi方法的典型用法代码示例。如果您正苦于以下问题:Java RedisBungee.getApi方法的具体用法?Java RedisBungee.getApi怎么用?Java RedisBungee.getApi使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.imaginarycode.minecraft.redisbungee.RedisBungee
的用法示例。
在下文中一共展示了RedisBungee.getApi方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadRedis
import com.imaginarycode.minecraft.redisbungee.RedisBungee; //导入方法依赖的package包/类
private void loadRedis() {
if (!DiscordBotCore.getInstance().getConfiguration().isRedisEnabled()) {
return;
}
redisBungee = RedisBungee.getApi();
redisBungee.registerPubSubChannels("DiscordBot");
getProxy().getPluginManager().registerListener(this, new RedisListener());
getLogger().info("Redis Enabled.");
}
示例2: giveApplicableContext
import com.imaginarycode.minecraft.redisbungee.RedisBungee; //导入方法依赖的package包/类
@Nonnull
@Override
public MutableContextSet giveApplicableContext(@Nonnull MutableContextSet accumulator) {
RedisBungeeAPI redisBungee = RedisBungee.getApi();
if (redisBungee != null) {
accumulator.add(PROXY_KEY, redisBungee.getServerId());
}
return accumulator;
}
示例3: RedisUtils
import com.imaginarycode.minecraft.redisbungee.RedisBungee; //导入方法依赖的package包/类
public RedisUtils(final boolean enable) {
if(enable){
if (BAT.getInstance().getProxy().getPluginManager().getPlugin("RedisBungee") != null && RedisBungee.getApi() != null) {
BAT.getInstance().getLogger().info("Detected RedisBungee. Enabling experimental RedisBungee support. This currently only supports RedisBungee 0.3.3 or higher (but not 0.4).");
BAT.getInstance().getProxy().getPluginManager()
.registerListener(BAT.getInstance(), this);
RedisBungee.getApi().registerPubSubChannels(channel);
redis = true;
} else {
redis = false;
}
}else{
redis = false;
}
}
示例4: run
import com.imaginarycode.minecraft.redisbungee.RedisBungee; //导入方法依赖的package包/类
@Override
public void run() {
RedisBungeeAPI api = RedisBungee.getApi();
if (api == null) return;
int onlineCount = 0;
if (plugin.getProxy().getServers().containsKey(serverName)) {
Set<UUID> playersOnServer = api.getPlayersOnServer(serverName);
onlineCount = playersOnServer != null ? playersOnServer.size() : 0;
}
if (onlineCount != RedisServerOnlineCountPlaceholder.this.onlineCount) {
RedisServerOnlineCountPlaceholder.this.onlineCount = onlineCount;
updateToAll();
}
}
示例5: run
import com.imaginarycode.minecraft.redisbungee.RedisBungee; //导入方法依赖的package包/类
@Override
public void run() {
RedisBungeeAPI api = RedisBungee.getApi();
if (api == null) return;
int onlineCount = api.getPlayerCount();
if (onlineCount != RedisOnlineCountPlaceholder.this.onlineCount) {
RedisOnlineCountPlaceholder.this.onlineCount = onlineCount;
updateToAll();
}
}
示例6: init
import com.imaginarycode.minecraft.redisbungee.RedisBungee; //导入方法依赖的package包/类
public void init() {
this.redisBungee = RedisBungee.getApi();
this.redisBungee.registerPubSubChannels(CHANNEL);
this.plugin.getProxy().getPluginManager().registerListener(this.plugin, this);
}