2019-11-07 13:03:04 -05:00
|
|
|
CLASS net/minecraft/class_156 net/minecraft/util/Util
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT A class holding various utility methods.
|
2022-06-21 14:24:55 -04:00
|
|
|
FIELD field_1128 nanoTimeSupplier Lnet/minecraft/class_7576$class_7577;
|
2022-01-19 12:26:32 -05:00
|
|
|
FIELD field_1129 LOGGER Lorg/slf4j/Logger;
|
2020-07-28 15:14:02 -04:00
|
|
|
FIELD field_18034 NEXT_WORKER_ID Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
FIELD field_18035 MAIN_WORKER_EXECUTOR Ljava/util/concurrent/ExecutorService;
|
2020-07-21 13:09:39 -04:00
|
|
|
FIELD field_24477 IO_WORKER_EXECUTOR Ljava/util/concurrent/ExecutorService;
|
2020-06-01 17:36:23 -04:00
|
|
|
FIELD field_25140 NIL_UUID Ljava/util/UUID;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT The "nil UUID" that represents lack of a UUID.
|
2021-06-05 05:32:32 -04:00
|
|
|
FIELD field_33859 JAR_FILE_SYSTEM_PROVIDER Ljava/nio/file/spi/FileSystemProvider;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT The file system provider for handling jar and zip files.
|
2021-09-24 08:06:56 -04:00
|
|
|
FIELD field_34891 MAX_PARALLELISM I
|
|
|
|
FIELD field_34892 MAX_BG_THREADS_PROPERTY Ljava/lang/String;
|
|
|
|
FIELD field_34893 missingBreakpointHandler Ljava/util/function/Consumer;
|
2022-02-22 11:29:15 -05:00
|
|
|
FIELD field_37250 TICKER Lcom/google/common/base/Ticker;
|
2022-07-20 12:53:33 -04:00
|
|
|
FIELD field_39824 DATE_TIME_FORMATTER Ljava/time/format/DateTimeFormatter;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT A locale-independent datetime formatter that uses {@code yyyy-MM-dd_HH.mm.ss}
|
|
|
|
COMMENT as the format string. Example: {@code 2022-01-01_00.00.00}
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_17974 ifPresentOrElse (Ljava/util/Optional;Ljava/util/function/Consumer;Ljava/lang/Runnable;)Ljava/util/Optional;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT If {@code optional} has value, calls {@code presentAction} with the value,
|
|
|
|
COMMENT otherwise calls {@code elseAction}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @return the passed {@code optional}
|
2021-02-27 05:57:26 -05:00
|
|
|
ARG 0 optional
|
|
|
|
ARG 1 presentAction
|
|
|
|
ARG 2 elseAction
|
2021-01-19 13:58:47 -05:00
|
|
|
METHOD method_18347 uncaughtExceptionHandler (Ljava/lang/Thread;Ljava/lang/Throwable;)V
|
|
|
|
ARG 0 thread
|
|
|
|
ARG 1 t
|
2021-09-16 15:04:31 -04:00
|
|
|
METHOD method_18349 getMainWorkerExecutor ()Ljava/util/concurrent/ExecutorService;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the main worker executor for miscellaneous asynchronous tasks}
|
2020-07-28 15:14:02 -04:00
|
|
|
METHOD method_18350 shutdownExecutors ()V
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_18839 debugRunnable (Ljava/lang/Runnable;Ljava/util/function/Supplier;)Ljava/lang/Runnable;
|
2019-04-17 12:23:22 -04:00
|
|
|
ARG 0 runnable
|
|
|
|
ARG 1 messageSupplier
|
2019-09-01 11:21:31 -04:00
|
|
|
METHOD method_20793 getLast (Ljava/util/List;)Ljava/lang/Object;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the last item of {@code list}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IndexOutOfBoundsException if {@code list} is empty
|
2019-09-01 11:21:31 -04:00
|
|
|
ARG 0 list
|
|
|
|
METHOD method_22320 throwOrPause (Ljava/lang/Throwable;)Ljava/lang/Throwable;
|
|
|
|
ARG 0 t
|
|
|
|
METHOD method_22321 getInnermostMessage (Ljava/lang/Throwable;)Ljava/lang/String;
|
|
|
|
ARG 0 t
|
2019-12-05 18:28:21 -05:00
|
|
|
METHOD method_24155 throwUnchecked (Ljava/lang/Throwable;)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Throws {@code t} if it's a {@link RuntimeException} (or any of its subclass), otherwise
|
|
|
|
COMMENT {@code t} wrapped in a RuntimeException.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>{@link Error} is wrapped as well, despite being unchecked.
|
2021-01-19 13:58:47 -05:00
|
|
|
ARG 0 t
|
2022-04-06 15:01:01 -04:00
|
|
|
METHOD method_27172 getRandom ([ILnet/minecraft/class_5819;)I
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return a random integer from {@code array}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IllegalArgumentException if {@code array} is empty
|
2020-04-08 16:48:41 -04:00
|
|
|
ARG 0 array
|
2022-04-07 10:14:42 -04:00
|
|
|
ARG 1 random
|
2022-04-06 15:01:01 -04:00
|
|
|
METHOD method_27173 getRandom ([Ljava/lang/Object;Lnet/minecraft/class_5819;)Ljava/lang/Object;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return a random item from {@code array}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IllegalArgumentException if {@code array} is empty
|
2020-04-08 16:48:41 -04:00
|
|
|
ARG 0 array
|
2022-04-07 10:14:42 -04:00
|
|
|
ARG 1 random
|
2020-07-21 13:09:39 -04:00
|
|
|
METHOD method_27760 backupAndReplace (Ljava/io/File;Ljava/io/File;Ljava/io/File;)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Copies {@code current} to {@code backup} and then replaces {@code current} with {@code newPath}.
|
2020-07-21 13:09:39 -04:00
|
|
|
ARG 0 current
|
|
|
|
ARG 1 newFile
|
|
|
|
ARG 2 backup
|
2020-04-25 20:29:03 -04:00
|
|
|
METHOD method_27761 moveCursor (Ljava/lang/String;II)I
|
|
|
|
COMMENT Moves the {@code cursor} in the {@code string} by a {@code delta} amount.
|
|
|
|
COMMENT Skips surrogate characters.
|
|
|
|
ARG 0 string
|
|
|
|
ARG 1 cursor
|
|
|
|
ARG 2 delta
|
2021-03-21 09:13:33 -04:00
|
|
|
METHOD method_27956 (Ljava/lang/Runnable;)Ljava/lang/Thread;
|
|
|
|
ARG 0 runnable
|
2020-07-21 13:09:39 -04:00
|
|
|
METHOD method_27957 attemptShutdown (Ljava/util/concurrent/ExecutorService;)V
|
|
|
|
ARG 0 service
|
2021-09-16 15:04:31 -04:00
|
|
|
METHOD method_27958 getIoWorkerExecutor ()Ljava/util/concurrent/ExecutorService;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the executor for disk or network IO tasks}
|
2020-07-21 13:09:39 -04:00
|
|
|
METHOD method_27959 createIoWorker ()Ljava/util/concurrent/ExecutorService;
|
|
|
|
METHOD method_28122 createWorker (Ljava/lang/String;)Ljava/util/concurrent/ExecutorService;
|
2020-09-11 13:43:33 -04:00
|
|
|
ARG 0 name
|
2021-03-21 09:13:33 -04:00
|
|
|
METHOD method_28123 (Ljava/lang/String;Ljava/util/concurrent/ForkJoinPool;)Ljava/util/concurrent/ForkJoinWorkerThread;
|
|
|
|
ARG 1 forkJoinPool
|
2020-07-28 15:14:02 -04:00
|
|
|
METHOD method_29187 getChoiceType (Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;
|
|
|
|
ARG 0 typeReference
|
|
|
|
ARG 1 id
|
2020-11-07 08:12:49 -05:00
|
|
|
METHOD method_29188 addPrefix (Ljava/lang/String;Ljava/util/function/Consumer;)Ljava/util/function/Consumer;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return a consumer that first prepends {@code prefix} to its input
|
|
|
|
COMMENT string and passes the result to {@code consumer}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @apiNote This is useful in codec-based deserialization when passing the
|
|
|
|
COMMENT error consumer to some methods, e.g. {@code
|
|
|
|
COMMENT Util.addPrefix("Could not parse Example", LOGGER::error)}.
|
2020-11-07 08:12:49 -05:00
|
|
|
ARG 0 prefix
|
|
|
|
ARG 1 consumer
|
2021-03-21 09:13:33 -04:00
|
|
|
METHOD method_29189 (Ljava/util/function/Consumer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
ARG 2 string
|
2023-05-04 07:11:24 -04:00
|
|
|
METHOD method_29190 decodeFixedLengthArray (Ljava/util/stream/IntStream;I)Lcom/mojang/serialization/DataResult;
|
2021-02-02 12:53:26 -05:00
|
|
|
ARG 0 stream
|
2020-06-14 14:23:42 -04:00
|
|
|
ARG 1 length
|
2020-07-28 15:14:02 -04:00
|
|
|
METHOD method_29191 getChoiceTypeInternal (Lcom/mojang/datafixers/DSL$TypeReference;Ljava/lang/String;)Lcom/mojang/datafixers/types/Type;
|
|
|
|
ARG 0 typeReference
|
|
|
|
ARG 1 id
|
2020-07-21 13:09:39 -04:00
|
|
|
METHOD method_29476 startTimerHack ()V
|
|
|
|
METHOD method_29775 relativeCopy (Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;)V
|
|
|
|
COMMENT Copies a file contained in the folder {@code src} to the folder {@code dest}.
|
|
|
|
COMMENT This will replicate any path structure that may exist between {@code src} and {@code toCopy}.
|
|
|
|
ARG 0 src
|
|
|
|
ARG 1 dest
|
|
|
|
ARG 2 toCopy
|
|
|
|
METHOD method_30309 replaceInvalidChars (Ljava/lang/String;Lnet/minecraft/class_5462;)Ljava/lang/String;
|
2021-03-21 09:13:33 -04:00
|
|
|
ARG 0 string
|
2020-07-21 13:09:39 -04:00
|
|
|
ARG 1 predicate
|
|
|
|
METHOD method_30622 attemptTasks (ILjava/lang/String;[Ljava/util/function/BooleanSupplier;)Z
|
|
|
|
ARG 0 retries
|
|
|
|
ARG 1 taskName
|
|
|
|
ARG 2 tasks
|
2021-03-21 09:13:33 -04:00
|
|
|
METHOD method_30623 (Lnet/minecraft/class_5462;I)Ljava/lang/String;
|
|
|
|
ARG 1 charCode
|
2020-07-21 13:09:39 -04:00
|
|
|
METHOD method_30624 deleteTask (Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
|
2021-05-07 23:39:34 -04:00
|
|
|
ARG 0 path
|
2020-07-21 13:09:39 -04:00
|
|
|
METHOD method_30625 renameTask (Ljava/nio/file/Path;Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
|
|
|
|
ARG 0 src
|
|
|
|
ARG 1 dest
|
|
|
|
METHOD method_30626 backupAndReplace (Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Copies {@code current} to {@code backup} and then replaces {@code current} with {@code newPath}.
|
2020-07-21 13:09:39 -04:00
|
|
|
ARG 0 current
|
|
|
|
ARG 1 newPath
|
|
|
|
ARG 2 backup
|
|
|
|
METHOD method_30627 attemptTasks ([Ljava/util/function/BooleanSupplier;)Z
|
2021-03-21 09:13:33 -04:00
|
|
|
ARG 0 tasks
|
2020-07-21 13:09:39 -04:00
|
|
|
METHOD method_30628 deletionVerifyTask (Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
|
2020-09-11 13:43:33 -04:00
|
|
|
ARG 0 path
|
2020-07-21 13:09:39 -04:00
|
|
|
METHOD method_30629 existenceCheckTask (Ljava/nio/file/Path;)Ljava/util/function/BooleanSupplier;
|
2020-09-11 13:43:33 -04:00
|
|
|
ARG 0 path
|
2022-04-06 15:01:01 -04:00
|
|
|
METHOD method_32309 getRandom (Ljava/util/List;Lnet/minecraft/class_5819;)Ljava/lang/Object;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return a random item from {@code list}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @throws IllegalArgumentException if {@code list} is empty
|
|
|
|
COMMENT
|
|
|
|
COMMENT @see #getRandomOrEmpty
|
2021-01-19 13:58:47 -05:00
|
|
|
ARG 0 list
|
2022-04-07 10:14:42 -04:00
|
|
|
ARG 1 random
|
2023-05-04 07:11:24 -04:00
|
|
|
METHOD method_33141 decodeFixedLengthList (Ljava/util/List;I)Lcom/mojang/serialization/DataResult;
|
2021-05-07 23:39:34 -04:00
|
|
|
ARG 0 list
|
2021-02-02 12:53:26 -05:00
|
|
|
ARG 1 length
|
2021-02-27 05:57:26 -05:00
|
|
|
METHOD method_33559 error (Ljava/lang/String;)V
|
|
|
|
ARG 0 message
|
2021-09-23 12:35:53 -04:00
|
|
|
METHOD method_33560 pause (Ljava/lang/String;)V
|
2021-09-24 08:06:56 -04:00
|
|
|
ARG 0 message
|
2021-02-27 05:57:26 -05:00
|
|
|
METHOD method_33787 debugRunnable (Ljava/lang/String;Ljava/lang/Runnable;)Ljava/lang/Runnable;
|
|
|
|
ARG 0 activeThreadName
|
|
|
|
ARG 1 task
|
|
|
|
METHOD method_33791 combineSafe (Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
|
|
|
|
COMMENT Combines a list of {@code futures} into one future that holds a list
|
|
|
|
COMMENT of their results.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>This version expects all futures to complete successfully and is not
|
|
|
|
COMMENT optimized in case any of the input futures throws.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @return the combined future
|
|
|
|
COMMENT @see #combine(List)
|
|
|
|
ARG 0 futures
|
|
|
|
COMMENT the completable futures to combine
|
2021-03-21 09:13:33 -04:00
|
|
|
METHOD method_34865 memoize (Ljava/util/function/BiFunction;)Ljava/util/function/BiFunction;
|
|
|
|
ARG 0 biFunction
|
|
|
|
METHOD method_34866 memoize (Ljava/util/function/Function;)Ljava/util/function/Function;
|
|
|
|
ARG 0 function
|
2021-06-01 11:39:22 -04:00
|
|
|
METHOD method_37153 (Ljava/nio/file/spi/FileSystemProvider;)Z
|
|
|
|
ARG 0 fileSystemProvider
|
2021-09-20 11:51:40 -04:00
|
|
|
METHOD method_37910 debugSupplier (Ljava/lang/String;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;
|
|
|
|
ARG 0 activeThreadName
|
|
|
|
ARG 1 supplier
|
2021-09-24 08:06:56 -04:00
|
|
|
METHOD method_38646 setMissingBreakpointHandler (Ljava/util/function/Consumer;)V
|
|
|
|
ARG 0 missingBreakpointHandler
|
2022-02-22 11:29:15 -05:00
|
|
|
METHOD method_38647 (Ljava/lang/String;)V
|
|
|
|
ARG 0 message
|
2021-09-24 08:06:56 -04:00
|
|
|
METHOD method_38648 getMaxBackgroundThreads ()I
|
2021-12-13 08:47:39 -05:00
|
|
|
METHOD method_39977 error (Ljava/lang/String;Ljava/lang/Throwable;)V
|
|
|
|
ARG 0 message
|
|
|
|
ARG 1 throwable
|
2022-03-23 06:37:54 -04:00
|
|
|
METHOD method_40082 (Ljava/util/List;Ljava/lang/Void;)Ljava/util/List;
|
|
|
|
ARG 1 void_
|
2022-04-06 15:01:01 -04:00
|
|
|
METHOD method_40083 getRandomOrEmpty (Ljava/util/List;Lnet/minecraft/class_5819;)Ljava/util/Optional;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return an {@link Optional} of a random item from {@code list}, or an empty optional
|
|
|
|
COMMENT if the list is empty}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @see #getRandom(List, Random)
|
2022-02-10 13:39:46 -05:00
|
|
|
ARG 0 list
|
2022-04-07 10:14:42 -04:00
|
|
|
ARG 1 random
|
2022-02-23 16:58:44 -05:00
|
|
|
METHOD method_41203 backupAndReplace (Ljava/io/File;Ljava/io/File;Ljava/io/File;Z)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Copies {@code current} to {@code backup} and then replaces {@code current} with {@code newPath}.
|
2022-02-23 16:58:44 -05:00
|
|
|
ARG 0 current
|
|
|
|
ARG 1 newPath
|
|
|
|
ARG 2 backup
|
|
|
|
ARG 3 noRestoreOnFail
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT if {@code true}, does not restore the current file when replacing fails
|
2022-02-23 16:58:44 -05:00
|
|
|
METHOD method_41204 backupAndReplace (Ljava/nio/file/Path;Ljava/nio/file/Path;Ljava/nio/file/Path;Z)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Copies {@code current} to {@code backup} and then replaces {@code current} with {@code newPath}.
|
2022-02-23 16:58:44 -05:00
|
|
|
ARG 0 current
|
|
|
|
ARG 1 newPath
|
|
|
|
ARG 2 backup
|
|
|
|
ARG 3 noRestoreOnFail
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT if {@code true}, does not restore the current file when replacing fails
|
2022-03-23 06:37:54 -04:00
|
|
|
METHOD method_41238 debugSupplier (Ljava/util/function/Supplier;Ljava/util/function/Supplier;)Ljava/util/function/Supplier;
|
|
|
|
ARG 0 supplier
|
|
|
|
ARG 1 messageSupplier
|
2022-04-13 12:50:51 -04:00
|
|
|
METHOD method_43027 copyShuffled (Lit/unimi/dsi/fastutil/objects/ObjectArrayList;Lnet/minecraft/class_5819;)Ljava/util/List;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the contents of {@code stream} copied to a list and then shuffled}
|
2022-04-19 06:06:11 -04:00
|
|
|
ARG 0 list
|
2022-04-07 10:14:42 -04:00
|
|
|
ARG 1 random
|
2022-04-13 12:50:51 -04:00
|
|
|
METHOD method_43028 shuffle (Lit/unimi/dsi/fastutil/objects/ObjectArrayList;Lnet/minecraft/class_5819;)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Shuffles {@code list}, modifying the passed list in place.
|
2022-04-19 06:06:11 -04:00
|
|
|
ARG 0 list
|
|
|
|
ARG 1 random
|
|
|
|
METHOD method_43251 shuffle (Ljava/util/stream/IntStream;Lnet/minecraft/class_5819;)Lit/unimi/dsi/fastutil/ints/IntArrayList;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the contents of {@code stream} copied to a list and then shuffled}
|
2022-04-19 06:06:11 -04:00
|
|
|
ARG 0 stream
|
|
|
|
ARG 1 random
|
|
|
|
METHOD method_43252 copyShuffled (Ljava/util/stream/Stream;Lnet/minecraft/class_5819;)Ljava/util/List;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the contents of {@code stream} copied to a list and then shuffled}
|
2022-04-19 06:06:11 -04:00
|
|
|
ARG 0 stream
|
|
|
|
ARG 1 random
|
|
|
|
METHOD method_43253 copyShuffled ([Ljava/lang/Object;Lnet/minecraft/class_5819;)Ljava/util/List;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the contents of {@code array} copied to a list and then shuffled}
|
2022-04-19 06:06:11 -04:00
|
|
|
ARG 0 array
|
2022-04-07 10:14:42 -04:00
|
|
|
ARG 1 random
|
2022-04-25 18:25:17 -04:00
|
|
|
METHOD method_43368 (Ljava/util/List;Ljava/lang/Void;)Ljava/util/List;
|
|
|
|
ARG 1 void_
|
2023-02-22 12:22:18 -05:00
|
|
|
METHOD method_43369 (Ljava/util/concurrent/CompletableFuture;Ljava/util/List;Ljava/lang/Throwable;)V
|
2022-04-25 18:25:17 -04:00
|
|
|
ARG 2 throwable
|
|
|
|
METHOD method_43370 combine (Ljava/util/List;Ljava/util/function/Consumer;)Ljava/util/concurrent/CompletableFuture;
|
|
|
|
ARG 0 futures
|
|
|
|
ARG 1 exceptionHandler
|
|
|
|
METHOD method_43371 (Ljava/util/List;[Ljava/util/concurrent/CompletableFuture;Ljava/util/function/Consumer;Ljava/util/concurrent/CompletableFuture;)V
|
|
|
|
ARG 3 future
|
|
|
|
METHOD method_43372 (Ljava/util/function/Consumer;Ljava/util/List;ILjava/lang/Object;Ljava/lang/Throwable;)V
|
|
|
|
ARG 3 value
|
|
|
|
ARG 4 throwable
|
|
|
|
METHOD method_43373 combineCancellable (Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
|
|
|
|
COMMENT Combines a list of {@code futures} into one future that holds a list
|
|
|
|
COMMENT of their results.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>The returned future is fail-fast; if any of the input futures fails,
|
|
|
|
COMMENT this returned future will be immediately completed exceptionally than
|
|
|
|
COMMENT waiting for other input futures. Additionally, all other futures will
|
|
|
|
COMMENT be canceled.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @return the combined future
|
|
|
|
COMMENT @see #combine(List)
|
|
|
|
COMMENT @see #combineSafe(List)
|
|
|
|
ARG 0 futures
|
2022-04-30 16:10:20 -04:00
|
|
|
METHOD method_43498 waitAndApply (Ljava/util/function/Function;Ljava/util/function/Predicate;)Ljava/lang/Object;
|
|
|
|
COMMENT Runs tasks using the prepare-apply model.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @apiNote This method takes a function that supplies an executor to use in the
|
|
|
|
COMMENT apply stage. Inside the function, callers should run the preparation,
|
|
|
|
COMMENT and use the passed executor for applying.
|
|
|
|
ARG 0 resultFactory
|
|
|
|
COMMENT a function that takes the apply-stage executor and returns the preliminary result
|
|
|
|
ARG 1 donePredicate
|
|
|
|
COMMENT a predicate that, given the result, checks whether applying has finished
|
|
|
|
METHOD method_43499 waitAndApply (Ljava/util/function/Function;)Ljava/util/concurrent/CompletableFuture;
|
|
|
|
COMMENT Runs tasks using the prepare-apply model, such as creation of a {@link
|
|
|
|
COMMENT net.minecraft.server.SaveLoader}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @apiNote This method takes a function that supplies an executor to use in the
|
|
|
|
COMMENT apply stage. Inside the function, callers should run the preparation,
|
|
|
|
COMMENT and use the passed executor for applying.
|
|
|
|
ARG 0 resultFactory
|
|
|
|
COMMENT a function that takes the apply-stage executor and returns the future
|
2022-05-12 13:27:32 -04:00
|
|
|
METHOD method_43658 lastIndexGetter (Ljava/util/List;)Ljava/util/function/ToIntFunction;
|
|
|
|
COMMENT {@return a function that, when given a value in {@code values}, returns the last
|
|
|
|
COMMENT index of the value in the list}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @implNote Unlike {@link java.util.List#lastIndexOf}, the returned function will
|
|
|
|
COMMENT return {@code 0} when given values not in the passed list.
|
|
|
|
ARG 0 values
|
2022-05-24 03:56:17 -04:00
|
|
|
METHOD method_44146 lastIndexGetter (Ljava/util/List;Ljava/util/function/IntFunction;)Ljava/util/function/ToIntFunction;
|
|
|
|
COMMENT {@return a function that, when given a value in {@code values}, returns the last
|
|
|
|
COMMENT index of the value in the list}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @implNote Unlike {@link java.util.List#lastIndexOf}, the returned function will
|
|
|
|
COMMENT return {@code 0} when given values not in the passed list.
|
|
|
|
ARG 0 values
|
|
|
|
ARG 1 mapCreator
|
|
|
|
COMMENT a function that, when given the size of {@code values},
|
|
|
|
COMMENT returns a map for storing the indices of the values
|
2022-07-20 12:53:33 -04:00
|
|
|
METHOD method_44893 getFormattedCurrentTime ()Ljava/lang/String;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the current time formatted using {@link #DATE_TIME_FORMATTER}}
|
2022-11-18 12:15:10 -05:00
|
|
|
METHOD method_47526 getResult (Lcom/mojang/serialization/DataResult;Ljava/util/function/Function;)Ljava/lang/Object;
|
|
|
|
COMMENT {@return the result wrapped in {@code result}}
|
|
|
|
ARG 0 result
|
|
|
|
ARG 1 exceptionGetter
|
2023-02-12 10:46:33 -05:00
|
|
|
METHOD method_48746 cachedMapper (Ljava/util/function/Function;)Lnet/minecraft/class_8105;
|
|
|
|
ARG 0 mapper
|
2023-05-11 12:22:00 -04:00
|
|
|
METHOD method_51822 decodeFixedLengthArray (Ljava/util/stream/LongStream;I)Lcom/mojang/serialization/DataResult;
|
|
|
|
ARG 0 stream
|
|
|
|
ARG 1 length
|
2023-05-18 07:15:52 -04:00
|
|
|
METHOD method_51893 isWhitespace (I)Z
|
|
|
|
COMMENT {@return whether {@code c} represents a space character}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @see Character#isWhitespace
|
|
|
|
COMMENT @see Character#isSpaceChar
|
|
|
|
ARG 0 c
|
|
|
|
METHOD method_51894 isBlank (Ljava/lang/String;)Z
|
|
|
|
COMMENT {@return whether {@code string} is {@code null}, empty, or composed entirely
|
|
|
|
COMMENT of {@linkplain #isWhitespace} spaces}
|
|
|
|
ARG 0 string
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_645 previous (Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the item preceding {@code object} in {@code iterable}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>If {@code object} is not in {@code iterable}, this returns the last item of the iterable.
|
|
|
|
COMMENT {@code object} is compared using the {@code ==} operator.
|
2021-03-21 09:13:33 -04:00
|
|
|
ARG 0 iterable
|
|
|
|
ARG 1 object
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_646 createTranslationKey (Ljava/lang/String;Lnet/minecraft/class_2960;)Ljava/lang/String;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the translation key constructed from {@code type} and {@code id}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>If {@code id} is {@code null}, {@code unregistered_sadface} is used as the ID.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @see Identifier#toTranslationKey(String)
|
2018-10-25 11:03:13 -04:00
|
|
|
ARG 0 type
|
|
|
|
ARG 1 id
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_648 getMeasuringTimeNano ()J
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the current time in nanoseconds, to be used for measuring a duration}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>This is not the Unix epoch time, and can only be used to determine the duration
|
|
|
|
COMMENT between two calls of this method.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @see #getMeasuringTimeMs
|
|
|
|
COMMENT @see #getEpochTimeMs
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_650 getValueAsString (Lnet/minecraft/class_2769;Ljava/lang/Object;)Ljava/lang/String;
|
2021-03-21 09:13:33 -04:00
|
|
|
ARG 0 property
|
|
|
|
ARG 1 value
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_651 getJVMFlags ()Ljava/util/stream/Stream;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return a stream of JVM flags passed when launching}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>The streamed strings include the {@code -X} prefix.
|
2019-11-07 13:03:04 -05:00
|
|
|
METHOD method_652 combine (Ljava/util/List;)Ljava/util/concurrent/CompletableFuture;
|
2021-02-27 05:57:26 -05:00
|
|
|
COMMENT Combines a list of {@code futures} into one future that holds a list
|
|
|
|
COMMENT of their results.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>The returned future is fail-fast; if any of the input futures fails,
|
|
|
|
COMMENT this returned future will be immediately completed exceptionally than
|
|
|
|
COMMENT waiting for other input futures.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @return the combined future
|
2022-04-25 18:25:17 -04:00
|
|
|
COMMENT @see #combineCancellable(List)
|
2021-02-27 05:57:26 -05:00
|
|
|
COMMENT @see #combineSafe(List)
|
2019-01-12 10:07:35 -05:00
|
|
|
ARG 0 futures
|
2021-02-27 05:57:26 -05:00
|
|
|
COMMENT the completable futures to combine
|
2019-12-02 08:47:40 -05:00
|
|
|
METHOD method_654 make (Ljava/lang/Object;Ljava/util/function/Consumer;)Ljava/lang/Object;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return {@code object} initialized with {@code initializer}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>This is useful when initializing static fields:
|
|
|
|
COMMENT <pre>{@code
|
|
|
|
COMMENT private static final Map<String, String> MAP = Util.make(new HashMap<>(), (map) -> {
|
|
|
|
COMMENT map.put("example", "hello");
|
|
|
|
COMMENT });
|
|
|
|
COMMENT }</pre>
|
2019-11-07 13:03:04 -05:00
|
|
|
ARG 0 object
|
|
|
|
ARG 1 initializer
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_655 identityHashStrategy ()Lit/unimi/dsi/fastutil/Hash$Strategy;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the {@link Hash.Strategy} that uses identity comparison}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>fastutil's "reference" object types should be used instead in most cases.
|
2019-12-02 08:47:40 -05:00
|
|
|
METHOD method_656 make (Ljava/util/function/Supplier;)Ljava/lang/Object;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the value supplied from {@code factory}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>This is useful when initializing static fields:
|
|
|
|
COMMENT <pre>{@code
|
|
|
|
COMMENT private static final Map<String, String> MAP = Util.make(() -> {
|
|
|
|
COMMENT Map<String, String> map = new HashMap<>();
|
|
|
|
COMMENT map.put("example", "hello");
|
|
|
|
COMMENT return map;
|
|
|
|
COMMENT });
|
|
|
|
COMMENT }</pre>
|
2019-11-07 13:03:04 -05:00
|
|
|
ARG 0 factory
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_658 getMeasuringTimeMs ()J
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the current time in milliseconds, to be used for measuring a duration}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>This is not the Unix epoch time, and can only be used to determine the duration
|
|
|
|
COMMENT between two calls of this method.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @see #getMeasuringTimeNano
|
|
|
|
COMMENT @see #getEpochTimeMs
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_659 getEpochTimeMs ()J
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the milliseconds passed since the Unix epoch}
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p>This should be used to display or store the current time. {@link #getMeasuringTimeMs}
|
|
|
|
COMMENT should be used for determining the duration between two calls.
|
|
|
|
COMMENT
|
|
|
|
COMMENT @see #getMeasuringTimeMs
|
|
|
|
COMMENT @see #getMeasuringTimeNano
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_660 next (Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the item succeeding {@code object} in {@code iterable}}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @implNote If {@code object} is {@code null}, this returns the first item of the iterable.
|
|
|
|
COMMENT If {@code object} is not in {@code iterable}, this enters into an infinite loop.
|
|
|
|
COMMENT {@code object} is compared using the {@code ==} operator.
|
2021-03-21 09:13:33 -04:00
|
|
|
ARG 0 iterable
|
|
|
|
ARG 1 object
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_664 toMap ()Ljava/util/stream/Collector;
|
2021-03-21 09:13:33 -04:00
|
|
|
METHOD method_666 (Ljava/lang/String;)Z
|
|
|
|
ARG 0 runtimeArg
|
2019-06-28 17:55:20 -04:00
|
|
|
METHOD method_668 getOperatingSystem ()Lnet/minecraft/class_156$class_158;
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT {@return the operating system instance for the current platform}
|
|
|
|
COMMENT
|
|
|
|
COMMENT @implNote This uses the {@code os.name} system property to determine the operating system.
|
|
|
|
COMMENT @apiNote This is used for opening links.
|
2022-03-16 17:24:28 -04:00
|
|
|
CLASS 2
|
2022-03-16 16:37:32 -04:00
|
|
|
FIELD field_29655 cache Ljava/util/Map;
|
2022-03-23 06:37:54 -04:00
|
|
|
METHOD apply (Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
ARG 1 object
|
2022-03-16 17:24:28 -04:00
|
|
|
CLASS 3
|
2022-02-21 11:09:06 -05:00
|
|
|
FIELD field_29657 cache Ljava/util/Map;
|
2022-03-23 06:37:54 -04:00
|
|
|
METHOD apply (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
ARG 1 a
|
|
|
|
ARG 2 b
|
|
|
|
METHOD method_34867 (Ljava/util/function/BiFunction;Lcom/mojang/datafixers/util/Pair;)Ljava/lang/Object;
|
|
|
|
ARG 1 pair
|
2022-03-16 17:24:28 -04:00
|
|
|
CLASS 4
|
2021-09-24 08:06:56 -04:00
|
|
|
METHOD onTermination (Ljava/lang/Throwable;)V
|
|
|
|
ARG 1 throwable
|
2019-12-02 08:55:18 -05:00
|
|
|
CLASS class_157 IdentityHashStrategy
|
2022-03-23 06:37:54 -04:00
|
|
|
METHOD equals (Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
ARG 1 o
|
|
|
|
ARG 2 o2
|
|
|
|
METHOD hashCode (Ljava/lang/Object;)I
|
|
|
|
ARG 1 o
|
2019-12-02 08:55:18 -05:00
|
|
|
CLASS class_158 OperatingSystem
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT An enum representing the operating system of the current platform.
|
|
|
|
COMMENT This defines the behavior for opening links.
|
|
|
|
COMMENT The current one can be obtained via {@link Util#getOperatingSystem}.
|
2021-09-25 21:14:23 -04:00
|
|
|
FIELD field_34894 name Ljava/lang/String;
|
|
|
|
METHOD <init> (Ljava/lang/String;ILjava/lang/String;)V
|
|
|
|
ARG 3 name
|
|
|
|
METHOD method_38649 getName ()Ljava/lang/String;
|
2019-12-02 08:55:18 -05:00
|
|
|
METHOD method_669 open (Ljava/net/URL;)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Opens {@code url}. If this points to an HTTP(S) URL, it is usually opened using
|
|
|
|
COMMENT the system's default browser. Otherwise, it is opened directly.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p><strong>Always validate the passed URL's schema</strong> as some values can
|
|
|
|
COMMENT execute code.
|
2019-12-02 08:55:18 -05:00
|
|
|
ARG 1 url
|
|
|
|
METHOD method_670 open (Ljava/lang/String;)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Opens {@code uri}. If this points to an HTTP(S) URI, it is usually opened using
|
|
|
|
COMMENT the system's default browser. Otherwise, it is opened directly.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p><strong>Always validate the passed URI's schema</strong> as some values can
|
|
|
|
COMMENT execute code.
|
2021-03-21 09:13:33 -04:00
|
|
|
ARG 1 uri
|
2019-12-02 08:55:18 -05:00
|
|
|
METHOD method_672 open (Ljava/io/File;)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Opens {@code file}.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p><strong>Do not pass untrusted file to this method</strong> as some values can
|
|
|
|
COMMENT execute code.
|
2021-03-21 09:13:33 -04:00
|
|
|
ARG 1 file
|
2019-12-02 08:55:18 -05:00
|
|
|
METHOD method_673 open (Ljava/net/URI;)V
|
2022-09-21 13:30:05 -04:00
|
|
|
COMMENT Opens {@code uri}. If this points to an HTTP(S) URI, it is usually opened using
|
|
|
|
COMMENT the system's default browser. Otherwise, it is opened directly.
|
|
|
|
COMMENT
|
|
|
|
COMMENT <p><strong>Always validate the passed URI's schema</strong> as some values can
|
|
|
|
COMMENT execute code.
|
2021-03-21 09:13:33 -04:00
|
|
|
ARG 1 uri
|
2019-12-02 08:55:18 -05:00
|
|
|
METHOD method_674 getURLOpenCommand (Ljava/net/URL;)[Ljava/lang/String;
|
|
|
|
ARG 1 url
|