Skip to content

Commit d1d7fe4

Browse files
authored
Removed the --offline flag in the manage-users command as it was redundant (#687)
1 parent 51c15e1 commit d1d7fe4

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,6 @@ Usage: mc-image-helper manage-users [-fh] [--existing=<existingFileBehavior>]
775775
>] -t=<type>
776776
[--user-api-provider=<userApiProvider>]
777777
[--version=<version>]
778-
[--offline]
779778
[[--http-response-timeout=DURATION]
780779
[--tls-handshake-timeout=DURATION]
781780
[--connection-pool-pending-acquire-timeout=D
@@ -814,8 +813,6 @@ Usage: mc-image-helper manage-users [-fh] [--existing=<existingFileBehavior>]
814813
Allowed: mojang, playerdb
815814
--version=<version> Minecraft game version. If not provided, assumes
816815
JSON format
817-
--offline Server is in offline mode, for users that have the
818-
offline flag the UUID is generated locally
819816
```
820817

821818
### maven-download

src/main/java/me/itzg/helpers/users/ManageUsersCommand.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@ public class ManageUsersCommand implements Callable<Integer> {
5353
@Option(names = {"--help", "-h"}, usageHelp = true)
5454
boolean help;
5555

56-
@Option(names = {"--offline"}, description = "Use for offline server, UUIDs are generated")
57-
boolean offline;
58-
5956
@Option(names = "--output-directory", defaultValue = ".")
6057
Path outputDirectory;
6158

@@ -245,7 +242,7 @@ private JavaUser resolveJavaUserId(SharedFetch sharedFetch, List<? extends JavaU
245242
}
246243

247244
// User is not online, generating offline UUID
248-
if (offline && user.getFlags().contains("offline")) {
245+
if (user.getFlags().contains("offline")) {
249246
log.debug("Resolved '{}' as offline user", user.getName());
250247
// update UUID keeping the other fields in case of existing user
251248
return finalUser.setUuid(getOfflineUUID(user.getName()));

src/test/java/me/itzg/helpers/users/ManageUsersCommandTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,6 @@ void allOffline(WireMockRuntimeInfo wmInfo) {
420420
.execute(
421421
"--mojang-api-base-url", wmInfo.getHttpBaseUrl(),
422422
"--user-api-provider", "mojang",
423-
"--offline",
424423
"--type", "JAVA_WHITELIST",
425424
"--output-directory", tempDir.toString(),
426425
"user1:offline", "user2:offline"
@@ -456,7 +455,6 @@ void allOnline(WireMockRuntimeInfo wmInfo) {
456455
.execute(
457456
"--mojang-api-base-url", wmInfo.getHttpBaseUrl(),
458457
"--user-api-provider", "mojang",
459-
"--offline",
460458
"--type", "JAVA_WHITELIST",
461459
"--output-directory", tempDir.toString(),
462460
"user1", "user2"
@@ -492,7 +490,6 @@ void partialOnlineOffline(WireMockRuntimeInfo wmInfo) {
492490
.execute(
493491
"--mojang-api-base-url", wmInfo.getHttpBaseUrl(),
494492
"--user-api-provider", "mojang",
495-
"--offline",
496493
"--type", "JAVA_WHITELIST",
497494
"--output-directory", tempDir.toString(),
498495
"user1:offline", "user2"
@@ -538,7 +535,6 @@ void givenNameExistsInCache(WireMockRuntimeInfo wmInfo) throws IOException {
538535
"--user-api-provider", "mojang",
539536
"--type", "JAVA_WHITELIST",
540537
"--output-directory", tempDir.toString(),
541-
"--offline",
542538
"user1:offline"
543539
);
544540

@@ -582,7 +578,6 @@ void changeOnlineToOffline(WireMockRuntimeInfo wmInfo) throws IOException {
582578
"--user-api-provider", "mojang",
583579
"--type", "JAVA_WHITELIST",
584580
"--output-directory", tempDir.toString(),
585-
"--offline",
586581
"user1:offline", "user2"
587582
);
588583

0 commit comments

Comments
 (0)