com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier Java Examples

The following examples show how to use com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier. 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: VelocityChannelRegistrar.java    From Velocity with MIT License 5 votes vote down vote up
/**
 * Returns all channel IDs (as strings) for use with Minecraft 1.13 and above.
 *
 * @return the channel IDs for Minecraft 1.13 and above
 */
public Collection<String> getModernChannelIds() {
  Collection<String> ids = new HashSet<>();
  for (ChannelIdentifier value : identifierMap.values()) {
    if (value instanceof MinecraftChannelIdentifier) {
      ids.add(value.getId());
    } else {
      ids.add(PluginMessageUtil.transformLegacyToModernChannel(value.getId()));
    }
  }
  return ids;
}
 
Example #2
Source File: VelocityUtil.java    From NuVotifier with GNU General Public License v3.0 5 votes vote down vote up
public static ChannelIdentifier getId(String channel) {
    if (channel.contains(":")) {
        String[] split = channel.split(":");
        return MinecraftChannelIdentifier.create(split[0], split[1]);
    }
    return new LegacyChannelIdentifier(channel);
}
 
Example #3
Source File: PluginMessenger.java    From TAB with Apache License 2.0 4 votes vote down vote up
public PluginMessenger(Main plugin) {
	mc = MinecraftChannelIdentifier.create("tab", "placeholders");
	plugin.server.getChannelRegistrar().register(mc);
	plugin.server.getEventManager().register(plugin, this);
	
}