Skip to content

Commit

Permalink
Hotfix error in /xc update
Browse files Browse the repository at this point in the history
  • Loading branch information
WasabiThumb committed Apr 29, 2024
1 parent dba384e commit 9cc6e9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>codes.wasabi</groupId>
<artifactId>xclaim</artifactId>
<version>1.12.2</version>
<version>1.12.3</version>
<packaging>jar</packaging>

<name>XClaim</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@

import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;

public class UpdateCommand implements Command {

private static final Map<UUID, AutoUpdater.UpdateOption> map = new ConcurrentHashMap<>();
private static final Map<UUID, Optional<AutoUpdater.UpdateOption>> map = new ConcurrentHashMap<>();
public static String initialCheck() {
AutoUpdater.UpdateOption opt;
try {
Expand All @@ -32,7 +33,7 @@ public static String initialCheck() {
return null;
}
if (opt == null) return null;
map.put(new UUID(0L, 0L), opt);
map.put(new UUID(0L, 0L), Optional.of(opt));
return opt.updateOption();
}

Expand Down Expand Up @@ -116,7 +117,7 @@ public void execute(@NotNull CommandSender sender, @NotNull Object @NotNull ...
return;
}
} else {
opt = map.get(uuid);
opt = map.get(uuid).orElse(null);
}
if (opt == null) {
audience.sendMessage(XClaim.lang.getComponent("cmd-update-none"));
Expand Down Expand Up @@ -149,7 +150,7 @@ public void execute(@NotNull CommandSender sender, @NotNull Object @NotNull ...
audience.sendMessage(XClaim.lang.getComponent("cmd-update-err-check"));
return;
}
map.put(uuid, opt);
map.put(uuid, Optional.ofNullable(opt));
if (opt == null) {
audience.sendMessage(XClaim.lang.getComponent("cmd-update-redundant"));
return;
Expand Down

0 comments on commit 9cc6e9f

Please sign in to comment.