Skip to content

Commit

Permalink
Node: setMaintanceMode - change property name
Browse files Browse the repository at this point in the history
  • Loading branch information
DerMistkaefer committed Jan 1, 2024
1 parent ae17c8d commit 0ba95c4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023 Matt Malec, and the Pterodactyl4J contributors
* Copyright 2021-2024 Matt Malec, and the Pterodactyl4J contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -55,7 +55,7 @@ protected RequestBody finalizeData() {
json.put("daemon_listen", daemonListenPort);
json.put("daemon_sftp", daemonSFTPPort);
json.put("throttle", new JSONObject().put("enabled", throttle));
json.put("maintenance_mode", hasMaintanceMode ? "1" : "0");
json.put("maintenance_mode", isInMaintenanceMode ? "1" : "0");
return getRequestBody(json);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023 Matt Malec, and the Pterodactyl4J contributors
* Copyright 2021-2024 Matt Malec, and the Pterodactyl4J contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -65,7 +65,9 @@ protected RequestBody finalizeData() {
throttle == null ? new JSONObject().put("enabled", false) : new JSONObject().put("enabled", throttle));
json.put(
"maintenance_mode",
hasMaintanceMode == null ? (node.hasMaintanceMode() ? "1" : "0") : (hasMaintanceMode ? "1" : "0"));
isInMaintenanceMode == null
? (node.hasMaintanceMode() ? "1" : "0")
: (isInMaintenanceMode ? "1" : "0"));

return getRequestBody(json);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023 Matt Malec, and the Pterodactyl4J contributors
* Copyright 2021-2024 Matt Malec, and the Pterodactyl4J contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -66,5 +66,5 @@ default NodeAction setDiskSpaceOverallocate(long diskSpaceOverallocate) {

NodeAction setScheme(boolean secure);

NodeAction setMaintanceMode(boolean hasMaintanceMode);
NodeAction setMaintanceMode(boolean isInMaintenanceMode);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023 Matt Malec, and the Pterodactyl4J contributors
* Copyright 2021-2024 Matt Malec, and the Pterodactyl4J contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,7 +40,7 @@ public abstract class AbstractNodeAction extends PteroActionImpl<Node> implement
protected String daemonListenPort;
protected Boolean throttle;
protected Boolean secure;
protected Boolean hasMaintanceMode;
protected Boolean isInMaintenanceMode;

public AbstractNodeAction(PteroApplicationImpl impl, Route.CompiledRoute route) {
super(impl.getP4J(), route, (response, request) -> new NodeImpl(response.getObject(), impl));
Expand Down Expand Up @@ -131,8 +131,8 @@ public NodeAction setScheme(boolean secure) {
}

@Override
public NodeAction setMaintanceMode(boolean hasMaintanceMode) {
this.hasMaintanceMode = hasMaintanceMode;
public NodeAction setMaintanceMode(boolean isInMaintenanceMode) {
this.isInMaintenanceMode = isInMaintenanceMode;
return this;
}
}

0 comments on commit 0ba95c4

Please sign in to comment.