1414import com .artillexstudios .axvanish .config .Config ;
1515import com .artillexstudios .axvanish .config .Groups ;
1616import com .artillexstudios .axvanish .config .Language ;
17+ import com .destroystokyo .paper .profile .PlayerProfile ;
1718import dev .jorel .commandapi .CommandAPI ;
18- import dev .jorel .commandapi .CommandAPISpigotConfig ;
19+ import dev .jorel .commandapi .CommandAPIPaperConfig ;
1920import dev .jorel .commandapi .CommandTree ;
2021import dev .jorel .commandapi .arguments .LiteralArgument ;
2122import dev .jorel .commandapi .arguments .PlayerProfileArgument ;
@@ -35,8 +36,7 @@ public AxVanishCommand(AxVanishPlugin plugin) {
3536 }
3637
3738 public void load () {
38- CommandAPI .onLoad (new CommandAPISpigotConfig (this .plugin )
39- .skipReloadDatapacks (true )
39+ CommandAPI .onLoad (new CommandAPIPaperConfig (this .plugin )
4040 .setNamespace ("axvanish" )
4141 );
4242 }
@@ -93,13 +93,13 @@ public void register() {
9393 .then (new PlayerProfileArgument ("player" )
9494 .withPermission ("axvanish.command.toggle.other" )
9595 .executes ((sender , args ) -> {
96- OfflinePlayer offlinePlayer = args .getByClass ("player" , OfflinePlayer .class );
96+ PlayerProfile offlinePlayer = args .getByClass ("player" , PlayerProfile .class );
9797 if (offlinePlayer == null ) {
9898 return ;
9999 }
100100
101101 VanishSource source = sender instanceof Player player ? AxVanishAPI .instance ().getUserIfLoadedImmediately (player ) : ConsoleVanishSource .INSTANCE ;
102- AxVanishAPI .instance ().user (offlinePlayer .getUniqueId ()).thenAccept (user -> {
102+ AxVanishAPI .instance ().user (offlinePlayer .getId ()).thenAccept (user -> {
103103 if (source instanceof User senderUser ) {
104104 if (senderUser .group () != null && user .group () != null && senderUser .group ().priority () < user .group ().priority ()) {
105105 MessageUtils .sendMessage (sender , Language .prefix , Language .error .notHighEnoughGroup );
0 commit comments