2424import dev .jorel .commandapi .CommandAPICommand ;
2525import dev .jorel .commandapi .arguments .ArgumentSuggestions ;
2626import dev .jorel .commandapi .arguments .StringArgument ;
27+ import dev .jorel .commandapi .arguments .UUIDArgument ;
2728import net .momirealms .customfishing .adventure .AdventureManagerImpl ;
2829import net .momirealms .customfishing .api .CustomFishingPlugin ;
2930import net .momirealms .customfishing .api .data .DataStorageInterface ;
@@ -58,12 +59,23 @@ public CommandAPICommand getDataCommand() {
5859 .withSubcommands (
5960 getExportLegacyCommand (),
6061 getExportCommand (),
61- getImportCommand ()
62+ getImportCommand (),
63+ getUnlockCommand ()
6264 );
6365 }
6466
67+ private CommandAPICommand getUnlockCommand () {
68+ return new CommandAPICommand ("unlock" )
69+ .withArguments (new UUIDArgument ("uuid" ))
70+ .executes ((sender , args ) -> {
71+ UUID uuid = (UUID ) args .get ("uuid" );
72+ CustomFishingPlugin .get ().getStorageManager ().getDataSource ().lockOrUnlockPlayerData (uuid , false );
73+ AdventureManagerImpl .getInstance ().sendMessageWithPrefix (sender , "Successfully unlocked." );
74+ });
75+ }
76+
6577 @ SuppressWarnings ("DuplicatedCode" )
66- public CommandAPICommand getExportLegacyCommand () {
78+ private CommandAPICommand getExportLegacyCommand () {
6779 return new CommandAPICommand ("export-legacy" )
6880 .withArguments (new StringArgument ("method" )
6981 .replaceSuggestions (ArgumentSuggestions .strings ("MySQL" , "MariaDB" , "YAML" )))
@@ -137,7 +149,7 @@ public CommandAPICommand getExportLegacyCommand() {
137149 }
138150
139151 @ SuppressWarnings ("DuplicatedCode" )
140- public CommandAPICommand getExportCommand () {
152+ private CommandAPICommand getExportCommand () {
141153 return new CommandAPICommand ("export" )
142154 .executesConsole ((sender , args ) -> {
143155 if (Bukkit .getOnlinePlayers ().size () != 0 ) {
@@ -151,7 +163,7 @@ public CommandAPICommand getExportCommand() {
151163 AdventureManagerImpl .getInstance ().sendMessageWithPrefix (sender , "Starting <aqua>export</aqua>." );
152164 DataStorageInterface dataStorageInterface = plugin .getStorageManager ().getDataSource ();
153165
154- Set <UUID > uuids = dataStorageInterface .getUniqueUsers (true );
166+ Set <UUID > uuids = dataStorageInterface .getUniqueUsers (false );
155167 Set <CompletableFuture <Void >> futures = new HashSet <>();
156168 AtomicInteger userCount = new AtomicInteger (0 );
157169 Map <UUID , String > out = Collections .synchronizedMap (new TreeMap <>());
@@ -200,7 +212,7 @@ public CommandAPICommand getExportCommand() {
200212 }
201213
202214 @ SuppressWarnings ("DuplicatedCode" )
203- public CommandAPICommand getImportCommand () {
215+ private CommandAPICommand getImportCommand () {
204216 return new CommandAPICommand ("import" )
205217 .withArguments (new StringArgument ("file" ))
206218 .executesConsole ((sender , args ) -> {
0 commit comments