mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-30 19:52:06 -07:00
Use random UUIDs instead of incrementing long for click callback ids (#9007)
This commit is contained in:
@@ -298,15 +298,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+
|
||||
+import io.papermc.paper.adventure.providers.ClickCallbackProviderImpl;
|
||||
+import io.papermc.paper.command.PaperSubcommand;
|
||||
+import net.kyori.adventure.text.Component;
|
||||
+import net.kyori.adventure.text.event.ClickCallback;
|
||||
+import net.kyori.adventure.text.event.ClickEvent;
|
||||
+import java.util.UUID;
|
||||
+import org.bukkit.command.CommandSender;
|
||||
+import org.checkerframework.checker.nullness.qual.NonNull;
|
||||
+import org.checkerframework.framework.qual.DefaultQualifier;
|
||||
+
|
||||
+import java.time.Duration;
|
||||
+
|
||||
+@DefaultQualifier(NonNull.class)
|
||||
+public final class CallbackCommand implements PaperSubcommand {
|
||||
+ @Override
|
||||
@@ -315,10 +311,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ final long id;
|
||||
+ final UUID id;
|
||||
+ try {
|
||||
+ id = Long.parseLong(args[0]);
|
||||
+ } catch (final NumberFormatException ignored) {
|
||||
+ id = UUID.fromString(args[0]);
|
||||
+ } catch (final IllegalArgumentException ignored) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
|
Reference in New Issue
Block a user