final Set<UUID> getPlayersOnServer(@NonNull String server) { checkArgument(getProxy().getServers().containsKey(server), "server does not exist"); Collection<String> asStrings = (Collection<String>) getServerPlayersScript.eval( ImmutableList.<String>of(), ImmutableList.<String>of(server)); ImmutableSet.Builder<UUID> builder = ImmutableSet.builder(); for (String s : asStrings) { builder.add(UUID.fromString(s)); } return builder.build(); }
@Override public Map<String, Object> getValuesDeep() { final Tag tag = this.findLastTag(this.path, false); if (!(tag instanceof CompoundTag)) { return Collections.emptyMap(); } final Queue<Node> node = new ArrayDeque<Node>( (Collection<? extends Node>) ImmutableList.of((Object) new Node(tag))); final Map<String, Object> values = (Map<String, Object>) Maps.newHashMap(); while (!node.isEmpty()) { final Node root = node.poll(); for (final Map.Entry<String, Tag> entry : root.values.entrySet()) { final String key = this.createRelativeKey(root.parent, entry.getKey()); if (entry.getValue() instanceof CompoundTag) { node.add(new Node(key, entry.getValue())); } else { values.put(key, entry.getValue().getValue()); } } } return values; }
/** * Gets the value at the specified quantile +/- maxError. The quantile must be in the range [0, 1] */ public long getQuantile(double quantile) { return getQuantiles(ImmutableList.of(quantile)).get(0); }
public static ImmutableSortedSet of(Comparable comparable) { return new RegularImmutableSortedSet(ImmutableList.of(comparable), Ordering.natural()); }
final int getCurrentCount() { Long count = (Long) getPlayerCountScript.eval(ImmutableList.<String>of(), ImmutableList.<String>of()); return count.intValue(); }