gpt4 book ai didi

net.md_5.bungee.conf.YamlConfig.get()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-20 20:38:31 27 4
gpt4 key购买 nike

本文整理了Java中net.md_5.bungee.conf.YamlConfig.get()方法的一些代码示例,展示了YamlConfig.get()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlConfig.get()方法的具体详情如下:
包路径:net.md_5.bungee.conf.YamlConfig
类名称:YamlConfig
方法名:get

YamlConfig.get介绍

暂无

代码示例

代码示例来源:origin: SpigotMC/BungeeCord

@Override
public String getString(String path, String def)
{
  return get( path, def );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Override
public Collection<?> getList(String path, Collection<?> def)
{
  return get( path, def );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Override
public int getInt(String path, int def)
{
  return get( path, def );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Override
public boolean getBoolean(String path, boolean def)
{
  return get( path, def );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Override
  @SuppressWarnings("unchecked")
  public Collection<String> getPermissions(String group)
  {
    Collection<String> permissions = get( "permissions." + group, null );
    return ( permissions == null ) ? Collections.EMPTY_SET : permissions;
  }
}

代码示例来源:origin: SpigotMC/BungeeCord

private <T> T get(String path, T def)
{
  return get( path, def, config );
}

代码示例来源:origin: SpigotMC/BungeeCord

@Override
@SuppressWarnings("unchecked")
public Collection<String> getGroups(String player)
{
  Collection<String> groups = get( "groups." + player, null );
  Collection<String> ret = ( groups == null ) ? new HashSet<String>() : new HashSet<>( groups );
  ret.add( "default" );
  return ret;
}

代码示例来源:origin: SpigotMC/BungeeCord

@Override
@SuppressWarnings("unchecked")
public Map<String, ServerInfo> getServers()
{
  Map<String, Map<String, Object>> base = get( "servers", (Map) Collections.singletonMap( "lobby", new HashMap<>() ) );
  Map<String, ServerInfo> ret = new HashMap<>();
  for ( Map.Entry<String, Map<String, Object>> entry : base.entrySet() )
  {
    Map<String, Object> val = entry.getValue();
    String name = entry.getKey();
    String addr = get( "address", "localhost:25565", val );
    String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another BungeeCord - Forced Host", val ) );
    boolean restricted = get( "restricted", false, val );
    InetSocketAddress address = Util.getAddr( addr );
    ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted );
    ret.put( name, info );
  }
  return ret;
}

代码示例来源:origin: SpigotMC/BungeeCord

Collection<Map<String, Object>> base = get( "listeners", (Collection) Arrays.asList( new Map[]
  String motd = get( "motd", "&1Another Bungee server", val );
  motd = ChatColor.translateAlternateColorCodes( '&', motd );
  int maxPlayers = get( "max_players", 1, val );
  boolean forceDefault = get( "force_default_server", false, val );
  String host = get( "host", "0.0.0.0:25577", val );
  int tabListSize = get( "tab_size", 60, val );
  InetSocketAddress address = Util.getAddr( host );
  Map<String, String> forced = new CaseInsensitiveMap<>( get( "forced_hosts", forcedDef, val ) );
  String tabListName = get( "tab_list", "GLOBAL_PING", val );
  DefaultTabList value = DefaultTabList.valueOf( tabListName.toUpperCase( Locale.ROOT ) );
  if ( value == null )
  boolean setLocalAddress = get( "bind_local_address", true, val );
  boolean pingPassthrough = get( "ping_passthrough", false, val );
  boolean query = get( "query_enabled", false, val );
  int queryPort = get( "query_port", 25577, val );
  boolean proxyProtocol = get( "proxy_protocol", false, val );
  List<String> serverPriority = new ArrayList<>( get( "priorities", Collections.EMPTY_LIST, val ) );
  String defaultServer = get( "default_server", null, val );
  String fallbackServer = get( "fallback_server", null, val );
  if ( defaultServer != null )

代码示例来源:origin: SpigotMC/BungeeCord

@SuppressWarnings("unchecked")
private <T> T get(String path, T def, Map submap)
{
  int index = path.indexOf( '.' );
  if ( index == -1 )
  {
    Object val = submap.get( path );
    if ( val == null && def != null )
    {
      val = def;
      submap.put( path, def );
      save();
    }
    return (T) val;
  } else
  {
    String first = path.substring( 0, index );
    String second = path.substring( index + 1, path.length() );
    Map sub = (Map) submap.get( first );
    if ( sub == null )
    {
      sub = new LinkedHashMap();
      submap.put( first, sub );
    }
    return get( second, def, sub );
  }
}

代码示例来源:origin: SpigotMC/BungeeCord

Map<String, Object> permissions = get( "permissions", null );
if ( permissions == null )
Map<String, Object> groups = get( "groups", null );
if ( groups == null )

代码示例来源:origin: WaterfallMC/Waterfall-Old

@Override
public boolean getBoolean(String path, boolean def)
{
  return get( path, def );
}

代码示例来源:origin: WaterfallMC/Waterfall-Old

@Override
public int getInt(String path, int def)
{
  return get( path, def );
}

代码示例来源:origin: WaterfallMC/Waterfall-Old

@Override
public String getString(String path, String def)
{
  return get( path, def );
}

代码示例来源:origin: WaterfallMC/Waterfall-Old

@Override
public <T> Collection<T> getList(String path, Collection<T> def)
{
  return get( path, def );
}

代码示例来源:origin: WaterfallMC/Waterfall-Old

private <T> T get(String path, T def)
{
  return get( path, def, config );
}

代码示例来源:origin: WaterfallMC/Waterfall-Old

@Override
  public Collection<String> getPermissions(String group)
  {
    Collection<String> permissions = get( "permissions." + group, null );
    return ( permissions == null ) ? Collections.<String>emptySet() : permissions;
  }
}

代码示例来源:origin: WaterfallMC/Waterfall-Old

@Override
public Collection<String> getGroups(String player)
{
  Collection<String> groups = get( "groups." + player, null );
  Collection<String> ret = ( groups == null ) ? new HashSet<String>() : new HashSet<>( groups );
  ret.add( "default" );
  return ret;
}

代码示例来源:origin: WaterfallMC/Waterfall-Old

@Override
@SuppressWarnings("unchecked")
public Map<String, ServerInfo> getServers()
{
  Map<String, Map<String, Object>> base = get( "servers", (Map) Collections.singletonMap( "lobby", new HashMap<>() ) );
  Map<String, ServerInfo> ret = new HashMap<>();
  for ( Map.Entry<String, Map<String, Object>> entry : base.entrySet() )
  {
    Map<String, Object> val = entry.getValue();
    String name = entry.getKey();
    String addr = get( "address", "localhost:25565", val );
    String motd = ChatColor.translateAlternateColorCodes( '&', get( "motd", "&1Just another Waterfall - Forced Host", val ) );
    boolean restricted = get( "restricted", false, val );
    InetSocketAddress address = Util.getAddr( addr );
    ServerInfo info = ProxyServer.getInstance().constructServerInfo( name, address, motd, restricted );
    ret.put( name, info );
  }
  return ret;
}

代码示例来源:origin: WaterfallMC/Waterfall-Old

@SuppressWarnings("unchecked")
private <T> T get(String path, T def, Map submap)
{
  int index = path.indexOf( '.' );
  if ( index == -1 )
  {
    Object val = submap.get( path );
    if ( val == null && def != null )
    {
      val = def;
      submap.put( path, def );
      save();
    }
    return (T) val;
  } else
  {
    String first = path.substring( 0, index );
    String second = path.substring( index + 1, path.length() );
    Map sub = (Map) submap.get( first );
    if ( sub == null )
    {
      sub = new LinkedHashMap();
      submap.put( first, sub );
    }
    return get( second, def, sub );
  }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com