Package net.minecraft
Class Util
java.lang.Object
net.minecraft.Util
- 
Nested Class SummaryNested Classes
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate static final ExecutorServiceprivate static final intprivate static final intprivate static final ExecutorServiceprivate static final DateTimeFormatterprivate static final ExecutorServiceprivate static final int(package private) static final org.slf4j.Loggerprivate static final Stringstatic final longstatic final UUIDstatic final com.google.common.base.Tickerstatic TimeSource.NanoTimeSourcestatic final FileSystemProvider
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic ExecutorServicestatic <T> CompletableFuture<T>blockUntilDone(Function<Executor, CompletableFuture<T>> p_214680_) static <T> TblockUntilDone(Function<Executor, T> p_214653_, Predicate<T> p_214654_) static voidcopyBetweenDirs(Path p_137564_, Path p_137565_, Path p_137566_) private static BooleanSuppliercreateDeleter(Path p_137501_) private static BooleanSuppliercreateFileCreatedCheck(Path p_137573_) private static BooleanSuppliercreateFileDeletedCheck(Path p_137562_) static <T> ToIntFunction<T>createIndexIdentityLookup(List<T> p_304758_) static <T> ToIntFunction<T>createIndexLookup(List<T> p_214687_) private static BooleanSuppliercreateRenamer(Path p_137503_, Path p_137504_) static StringdescribeError(Throwable p_137576_) private static com.mojang.datafixers.types.Type<?>doFetchChoiceType(com.mojang.datafixers.DSL.TypeReference p_137552_, String p_137553_) private static voidprivate static booleanexecuteInSequence(BooleanSupplier... p_137549_) private static <V> CompletableFuture<List<V>>fallibleSequence(List<? extends CompletableFuture<? extends V>> p_214632_, Consumer<Throwable> p_214633_) static com.mojang.datafixers.types.Type<?>fetchChoiceType(com.mojang.datafixers.DSL.TypeReference p_137457_, String p_137458_) static <T> TfindNextInIterable(Iterable<T> p_137467_, T p_137468_) static <T> TfindPreviousInIterable(Iterable<T> p_137555_, T p_137556_) static <T> com.mojang.serialization.DataResult<List<T>>static com.mojang.serialization.DataResult<int[]>static com.mojang.serialization.DataResult<long[]>fixedSize(LongStream p_287579_, int p_287631_) static longstatic Stringprivate static intstatic longstatic longgetNanos()static <T,E extends Throwable> 
 TgetOrThrow(com.mojang.serialization.DataResult<T> p_261812_, Function<String, E> p_261468_) static <T,E extends Throwable> 
 TgetPartialOrThrow(com.mojang.serialization.DataResult<T> p_313827_, Function<String, E> p_313841_) static Util.OSstatic <T extends Comparable<T>>
 StringgetPropertyName(Property<T> p_137454_, Object p_137455_) static intgetRandom(int[] p_214668_, RandomSource p_214669_) static <T> TgetRandom(List<T> p_214622_, RandomSource p_214623_) static <T> TgetRandom(T[] p_214671_, RandomSource p_214672_) static <T> Optional<T>getRandomSafe(List<T> p_214677_, RandomSource p_214678_) static <T> Optional<T>static ExecutorServiceioPool()static booleanstatic booleanisWhitespace(int p_289004_) static <T> Tstatic voidlogAndPauseIfInIde(String p_143786_) static voidlogAndPauseIfInIde(String p_200891_, Throwable p_200892_) static <T> Tstatic <T> Tstatic StringmakeDescriptionId(String p_137493_, ResourceLocation p_137494_) private static ExecutorServicemakeExecutor(String p_137478_) private static ExecutorServicemakeIoExecutor(String p_314465_, boolean p_314461_) static <T,U, R> BiFunction<T, U, R> memoize(BiFunction<T, U, R> p_143822_) static <T,R> Function<T, R> static Runnablestatic <T> Supplier<T>static ExecutorServicestatic intoffsetByCodepoints(String p_137480_, int p_137481_, int p_137482_) private static voidonThreadException(Thread p_137496_, Throwable p_137497_) static <T extends Throwable>
 TpauseInIde(T p_137571_) static <T> com.mojang.datafixers.Typed<T>readTypedOrThrow(com.mojang.datafixers.types.Type<T> p_312508_, com.mojang.serialization.Dynamic<?> p_312911_) static <T> com.mojang.datafixers.Typed<T>readTypedOrThrow(com.mojang.datafixers.types.Type<T> p_313853_, com.mojang.serialization.Dynamic<?> p_313851_, boolean p_313933_) private static booleanrunWithRetries(int p_137450_, String p_137451_, BooleanSupplier... p_137452_) static voidsafeReplaceFile(Path p_137506_, Path p_137507_, Path p_137508_) static booleansafeReplaceOrMoveFile(Path p_307599_, Path p_307197_, Path p_307407_, boolean p_212228_) static StringsanitizeName(String p_137484_, CharPredicate p_137485_) static <V> CompletableFuture<List<V>>sequence(List<? extends CompletableFuture<V>> p_137568_) static <V> CompletableFuture<List<V>>sequenceFailFast(List<? extends CompletableFuture<? extends V>> p_143841_) static <V> CompletableFuture<List<V>>sequenceFailFastAndCancel(List<? extends CompletableFuture<? extends V>> p_214685_) static voidstatic <T> voidshuffle(List<T> p_309187_, RandomSource p_214675_) static <T> List<T>shuffledCopy(it.unimi.dsi.fastutil.objects.ObjectArrayList<T> p_214612_, RandomSource p_214613_) static <T> List<T>shuffledCopy(T[] p_214682_, RandomSource p_214683_) private static voidshutdownExecutor(ExecutorService p_137532_) static voidstatic <K,V> SingleKeyCache<K, V> singleKeyCache(Function<K, V> p_270326_) static voidstatic voidthrowAsRuntime(Throwable p_137560_) toMap()static it.unimi.dsi.fastutil.ints.IntArrayListtoShuffledList(IntStream p_214659_, RandomSource p_214660_) static <T> List<T>toShuffledList(Stream<T> p_214662_, RandomSource p_214663_) static RunnablewrapThreadWithTaskName(String p_143788_, Runnable p_143789_) static <V> Supplier<V>wrapThreadWithTaskName(String p_183947_, Supplier<V> p_183948_) static <A,B> com.mojang.datafixers.Typed<B> writeAndReadTypedOrThrow(com.mojang.datafixers.Typed<A> p_311873_, com.mojang.datafixers.types.Type<B> p_312554_, UnaryOperator<com.mojang.serialization.Dynamic<?>> p_311990_) 
- 
Field Details- 
LOGGERstatic final org.slf4j.Logger LOGGER
- 
DEFAULT_MAX_THREADSprivate static final int DEFAULT_MAX_THREADS- See Also:
 
- 
DEFAULT_SAFE_FILE_OPERATION_RETRIESprivate static final int DEFAULT_SAFE_FILE_OPERATION_RETRIES- See Also:
 
- 
MAX_THREADS_SYSTEM_PROPERTY- See Also:
 
- 
BACKGROUND_EXECUTOR
- 
IO_POOL
- 
DOWNLOAD_POOL
- 
FILENAME_DATE_TIME_FORMATTER
- 
LINEAR_LOOKUP_THRESHOLDprivate static final int LINEAR_LOOKUP_THRESHOLD- See Also:
 
- 
NANOS_PER_MILLIpublic static final long NANOS_PER_MILLI- See Also:
 
- 
timeSource
- 
TICKERpublic static final com.google.common.base.Ticker TICKER
- 
NIL_UUID
- 
ZIP_FILE_SYSTEM_PROVIDER
- 
thePauser
 
- 
- 
Constructor Details- 
Utilpublic Util()
 
- 
- 
Method Details- 
toMap
- 
getPropertyNamepublic static <T extends Comparable<T>> String getPropertyName(Property<T> p_137454_, Object p_137455_) 
- 
makeDescriptionId
- 
getMillispublic static long getMillis()
- 
getNanospublic static long getNanos()
- 
getEpochMillispublic static long getEpochMillis()
- 
getFilenameFormattedDateTime
- 
makeExecutor
- 
getMaxThreadsprivate static int getMaxThreads()
- 
backgroundExecutor
- 
ioPool
- 
nonCriticalIoPool
- 
shutdownExecutorspublic static void shutdownExecutors()
- 
shutdownExecutor
- 
makeIoExecutor
- 
throwAsRuntime
- 
onThreadException
- 
fetchChoiceType@Nullable public static com.mojang.datafixers.types.Type<?> fetchChoiceType(com.mojang.datafixers.DSL.TypeReference p_137457_, String p_137458_) 
- 
doFetchChoiceType@Nullable private static com.mojang.datafixers.types.Type<?> doFetchChoiceType(com.mojang.datafixers.DSL.TypeReference p_137552_, String p_137553_) 
- 
wrapThreadWithTaskName
- 
wrapThreadWithTaskName
- 
getPlatform
- 
getVmArguments
- 
lastOf
- 
findNextInIterable
- 
findPreviousInIterable
- 
make
- 
make
- 
sequencepublic static <V> CompletableFuture<List<V>> sequence(List<? extends CompletableFuture<V>> p_137568_) 
- 
sequenceFailFastpublic static <V> CompletableFuture<List<V>> sequenceFailFast(List<? extends CompletableFuture<? extends V>> p_143841_) 
- 
sequenceFailFastAndCancelpublic static <V> CompletableFuture<List<V>> sequenceFailFastAndCancel(List<? extends CompletableFuture<? extends V>> p_214685_) 
- 
fallibleSequenceprivate static <V> CompletableFuture<List<V>> fallibleSequence(List<? extends CompletableFuture<? extends V>> p_214632_, Consumer<Throwable> p_214633_) 
- 
ifElse
- 
name
- 
name
- 
logAndPauseIfInIde
- 
logAndPauseIfInIde
- 
pauseInIde
- 
setPause
- 
doPause
- 
describeError
- 
getRandom
- 
getRandom
- 
getRandom
- 
getRandomSafe
- 
createRenamer
- 
createDeleter
- 
createFileDeletedCheck
- 
createFileCreatedCheck
- 
executeInSequence
- 
runWithRetriesprivate static boolean runWithRetries(int p_137450_, String p_137451_, BooleanSupplier... p_137452_) 
- 
safeReplaceFile
- 
safeReplaceOrMoveFile
- 
offsetByCodepoints
- 
prefix
- 
fixedSizepublic static com.mojang.serialization.DataResult<int[]> fixedSize(IntStream p_137540_, int p_137541_) 
- 
fixedSizepublic static com.mojang.serialization.DataResult<long[]> fixedSize(LongStream p_287579_, int p_287631_) 
- 
fixedSize
- 
startTimerHackThreadpublic static void startTimerHackThread()
- 
copyBetweenDirspublic static void copyBetweenDirs(Path p_137564_, Path p_137565_, Path p_137566_) throws IOException - Throws:
- IOException
 
- 
sanitizeName
- 
singleKeyCache
- 
memoize
- 
memoize
- 
toShuffledList
- 
toShuffledListpublic static it.unimi.dsi.fastutil.ints.IntArrayList toShuffledList(IntStream p_214659_, RandomSource p_214660_) 
- 
shuffledCopy
- 
shuffledCopypublic static <T> List<T> shuffledCopy(it.unimi.dsi.fastutil.objects.ObjectArrayList<T> p_214612_, RandomSource p_214613_) 
- 
shuffle
- 
blockUntilDonepublic static <T> CompletableFuture<T> blockUntilDone(Function<Executor, CompletableFuture<T>> p_214680_) 
- 
blockUntilDone
- 
createIndexLookup
- 
createIndexIdentityLookup
- 
getOrThrowpublic static <T,E extends Throwable> T getOrThrow(com.mojang.serialization.DataResult<T> p_261812_, Function<String, E> p_261468_) throws E- Throws:
- E extends Throwable
 
- 
getPartialOrThrowpublic static <T,E extends Throwable> T getPartialOrThrow(com.mojang.serialization.DataResult<T> p_313827_, Function<String, E> p_313841_) throws E- Throws:
- E extends Throwable
 
- 
writeAndReadTypedOrThrowpublic static <A,B> com.mojang.datafixers.Typed<B> writeAndReadTypedOrThrow(com.mojang.datafixers.Typed<A> p_311873_, com.mojang.datafixers.types.Type<B> p_312554_, UnaryOperator<com.mojang.serialization.Dynamic<?>> p_311990_) 
- 
readTypedOrThrowpublic static <T> com.mojang.datafixers.Typed<T> readTypedOrThrow(com.mojang.datafixers.types.Type<T> p_312508_, com.mojang.serialization.Dynamic<?> p_312911_) 
- 
readTypedOrThrowpublic static <T> com.mojang.datafixers.Typed<T> readTypedOrThrow(com.mojang.datafixers.types.Type<T> p_313853_, com.mojang.serialization.Dynamic<?> p_313851_, boolean p_313933_) 
- 
isWhitespacepublic static boolean isWhitespace(int p_289004_) 
- 
isBlank
 
-