Add support for ping pass-through

By default, ping pass-through is not enabled. However, you can use
ping passthrough to pass through just mods (great for modded servers)
or everything.
This commit is contained in:
Andrew Steinborn
2019-08-06 02:06:53 -04:00
parent 9f3d1a2390
commit ca9a4492c4
9 changed files with 152 additions and 31 deletions

View File

@@ -182,6 +182,19 @@ public final class ServerPing {
return this;
}
/**
* Uses the modified {@code mods} list in the response.
* @param mods the mods list to use
* @return this build, for chaining
*/
public Builder mods(ModInfo mods) {
Preconditions.checkNotNull(mods, "mods");
this.modType = mods.getType();
this.mods.clear();
this.mods.addAll(mods.getMods());
return this;
}
public Builder clearMods() {
this.mods.clear();
return this;