Modify OpenToLANConfig method names

This commit is contained in:
Kieran Wallbanks 2021-05-05 16:05:40 +01:00
parent 42933e58b0
commit a43c0e1291
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ public class OpenToLANConfig {
* @return {@code this}, for chaining
*/
@Contract("_ -> this")
public @NotNull OpenToLANConfig setPort(int port) {
public @NotNull OpenToLANConfig port(int port) {
this.port = port;
return this;
}
@ -46,7 +46,7 @@ public class OpenToLANConfig {
* @return {@code this}, for chaining
*/
@Contract("_ -> this")
public @NotNull OpenToLANConfig setDelayBetweenPings(@NotNull UpdateOption delay) {
public @NotNull OpenToLANConfig pingDelay(@NotNull UpdateOption delay) {
this.delayBetweenPings = Objects.requireNonNull(delay, "delay");
return this;
}
@ -58,7 +58,7 @@ public class OpenToLANConfig {
* @return {@code this}, for chaining
*/
@Contract("_ -> this")
public @NotNull OpenToLANConfig setDelayBetweenEventCalls(@NotNull UpdateOption delay) {
public @NotNull OpenToLANConfig eventCallDelay(@NotNull UpdateOption delay) {
this.delayBetweenEvent = Objects.requireNonNull(delay, "delay");
return this;
}

View File

@ -105,7 +105,7 @@ public class Main {
//MojangAuth.init();
// useful for testing - we don't need to worry about event calls so just set this to a long time
OpenToLAN.open(new OpenToLANConfig().setDelayBetweenEventCalls(new UpdateOption(1, TimeUnit.DAY)));
OpenToLAN.open(new OpenToLANConfig().eventCallDelay(new UpdateOption(1, TimeUnit.DAY)));
minecraftServer.start("0.0.0.0", 25565);
//Runtime.getRuntime().addShutdownHook(new Thread(MinecraftServer::stopCleanly));