程序包 net.minecraft
类 Util
java.lang.Object
net.minecraft.Util
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明private static final TracingExecutor
private static final int
private static final int
private static final TracingExecutor
private static final DateTimeFormatter
private static final TracingExecutor
static final int
(专用程序包) static final org.slf4j.Logger
private static final String
static final long
static final UUID
static final com.google.common.base.Ticker
static TimeSource.NanoTimeSource
static final FileSystemProvider
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static <T> Predicate
<T> allOf()
static <T> Predicate
<T> static <T> Predicate
<T> static <T> Predicate
<T> static <T> Predicate
<T> allOf
(Predicate<? super T> p_367355_, Predicate<? super T> p_368540_, Predicate<? super T> p_368292_) static <T> Predicate
<T> allOf
(Predicate<? super T> p_366665_, Predicate<? super T> p_362170_, Predicate<? super T> p_368098_, Predicate<? super T> p_368091_) static <T> Predicate
<T> allOf
(Predicate<? super T> p_364729_, Predicate<? super T> p_370126_, Predicate<? super T> p_365718_, Predicate<? super T> p_361334_, Predicate<? super T> p_364329_) static <T> Predicate
<T> static <T> Predicate
<T> anyOf()
static <T> Predicate
<T> static <T> Predicate
<T> static <T> Predicate
<T> static <T> Predicate
<T> anyOf
(Predicate<? super T> p_368986_, Predicate<? super T> p_367469_, Predicate<? super T> p_363214_) static <T> Predicate
<T> anyOf
(Predicate<? super T> p_366428_, Predicate<? super T> p_363267_, Predicate<? super T> p_367688_, Predicate<? super T> p_364700_) static <T> Predicate
<T> anyOf
(Predicate<? super T> p_364065_, Predicate<? super T> p_361450_, Predicate<? super T> p_368832_, Predicate<? super T> p_367216_, Predicate<? super T> p_367149_) static <T> Predicate
<T> static TracingExecutor
static <T> CompletableFuture
<T> blockUntilDone
(Function<Executor, CompletableFuture<T>> p_214680_) static <T> T
blockUntilDone
(Function<Executor, T> p_214653_, Predicate<T> p_214654_) static <T> List
<T> copyAndAdd
(List<T> p_329243_, T p_329663_) static <T> List
<T> copyAndAdd
(T p_330591_, List<T> p_336069_) static <K,
V> Map <K, V> copyAndPut
(Map<K, V> p_334319_, K p_335336_, V p_331863_) static void
copyBetweenDirs
(Path p_137564_, Path p_137565_, Path p_137566_) private static BooleanSupplier
createDeleter
(Path p_137501_) private static BooleanSupplier
createFileCreatedCheck
(Path p_137573_) private static BooleanSupplier
createFileDeletedCheck
(Path p_137562_) static <T> ToIntFunction
<T> createIndexIdentityLookup
(List<T> p_310693_) static <T> ToIntFunction
<T> createIndexLookup
(List<T> p_214687_) private static BooleanSupplier
createRenamer
(Path p_137503_, Path p_137504_) static String
describeError
(Throwable p_137576_) private static com.mojang.datafixers.types.Type
<?> doFetchChoiceType
(com.mojang.datafixers.DSL.TypeReference p_137552_, String p_137553_) private static void
private static boolean
executeInSequence
(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> T
findNextInIterable
(Iterable<T> p_137467_, T p_137468_) static <T> T
findPreviousInIterable
(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 long
static String
private static int
static long
static long
getNanos()
static Util.OS
static <T extends Comparable<T>>
StringgetPropertyName
(Property<T> p_137454_, Object p_137455_) static int
getRandom
(int[] p_214668_, RandomSource p_214669_) static <T> T
getRandom
(List<T> p_214622_, RandomSource p_214623_) static <T> T
getRandom
(T[] p_214671_, RandomSource p_214672_) static <T> Optional
<T> getRandomSafe
(List<T> p_214677_, RandomSource p_214678_) static <T> String
getRegisteredName
(Registry<T> p_336230_, T p_335370_) static <T> Optional
<T> static TracingExecutor
ioPool()
static <T> boolean
isSymmetrical
(int p_342989_, int p_344905_, List<T> p_342186_) static <T> T
static void
logAndPauseIfInIde
(String p_143786_) static void
logAndPauseIfInIde
(String p_200891_, Throwable p_200892_) static <T> T
static <T> T
static String
makeDescriptionId
(String p_137493_, ResourceLocation p_137494_) makeEnumMap
(Class<K> p_361919_, Function<K, V> p_363082_) private static TracingExecutor
makeExecutor
(String p_137478_) private static TracingExecutor
makeIoExecutor
(String p_309722_, boolean p_310621_) static int
static <T,
U, R> BiFunction <T, U, R> memoize
(BiFunction<T, U, R> p_143822_) static <T,
R> Function <T, R> static Runnable
static <T> Supplier
<T> static TracingExecutor
static int
offsetByCodepoints
(String p_137480_, int p_137481_, int p_137482_) private static void
onThreadException
(Thread p_137496_, Throwable p_137497_) static URI
parseAndValidateUntrustedUri
(String p_343758_) static <T extends Throwable>
TpauseInIde
(T p_137571_) static <T> com.mojang.datafixers.Typed
<T> readTypedOrThrow
(com.mojang.datafixers.types.Type<T> p_309502_, com.mojang.serialization.Dynamic<?> p_310749_) static <T> com.mojang.datafixers.Typed
<T> readTypedOrThrow
(com.mojang.datafixers.types.Type<T> p_309451_, com.mojang.serialization.Dynamic<?> p_312737_, boolean p_310890_) static void
private static boolean
runWithRetries
(int p_137450_, String p_137451_, BooleanSupplier... p_137452_) static void
safeReplaceFile
(Path p_137506_, Path p_137507_, Path p_137508_) static boolean
safeReplaceOrMoveFile
(Path p_311739_, Path p_310810_, Path p_310842_, boolean p_212228_) static String
sanitizeName
(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 void
static <T> void
shuffle
(List<T> p_309952_, 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_) static void
static <K,
V> SingleKeyCache <K, V> singleKeyCache
(Function<K, V> p_270326_) static void
static void
throwAsRuntime
(Throwable p_137560_) toMap()
static it.unimi.dsi.fastutil.ints.IntArrayList
toShuffledList
(IntStream p_214659_, RandomSource p_214660_) static <T> List
<T> toShuffledList
(Stream<T> p_214662_, RandomSource p_214663_) static <A,
B> com.mojang.datafixers.Typed <B> writeAndReadTypedOrThrow
(com.mojang.datafixers.Typed<A> p_309938_, com.mojang.datafixers.types.Type<B> p_312439_, UnaryOperator<com.mojang.serialization.Dynamic<?>> p_312172_)
-
字段详细资料
-
LOGGER
static final org.slf4j.Logger LOGGER -
DEFAULT_MAX_THREADS
private static final int DEFAULT_MAX_THREADS- 另请参阅:
-
DEFAULT_SAFE_FILE_OPERATION_RETRIES
private static final int DEFAULT_SAFE_FILE_OPERATION_RETRIES- 另请参阅:
-
MAX_THREADS_SYSTEM_PROPERTY
- 另请参阅:
-
BACKGROUND_EXECUTOR
-
IO_POOL
-
DOWNLOAD_POOL
-
FILENAME_DATE_TIME_FORMATTER
-
LINEAR_LOOKUP_THRESHOLD
public static final int LINEAR_LOOKUP_THRESHOLD- 另请参阅:
-
ALLOWED_UNTRUSTED_LINK_PROTOCOLS
-
NANOS_PER_MILLI
public static final long NANOS_PER_MILLI- 另请参阅:
-
timeSource
-
TICKER
public static final com.google.common.base.Ticker TICKER -
NIL_UUID
-
ZIP_FILE_SYSTEM_PROVIDER
-
thePauser
-
-
构造器详细资料
-
Util
public Util()
-
-
方法详细资料
-
toMap
-
toMutableList
-
getPropertyName
public static <T extends Comparable<T>> String getPropertyName(Property<T> p_137454_, Object p_137455_) -
makeDescriptionId
-
getMillis
public static long getMillis() -
getNanos
public static long getNanos() -
getEpochMillis
public static long getEpochMillis() -
getFilenameFormattedDateTime
-
makeExecutor
-
maxAllowedExecutorThreads
public static int maxAllowedExecutorThreads() -
getMaxThreads
private static int getMaxThreads() -
backgroundExecutor
-
ioPool
-
nonCriticalIoPool
-
shutdownExecutors
public static void shutdownExecutors() -
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_) -
runNamed
-
getRegisteredName
-
allOf
-
allOf
-
allOf
-
allOf
-
allOf
-
allOf
-
allOf
-
allOf
-
anyOf
-
anyOf
-
anyOf
-
anyOf
-
anyOf
-
anyOf
-
anyOf
-
anyOf
-
isSymmetrical
-
getPlatform
-
parseAndValidateUntrustedUri
-
getVmArguments
-
lastOf
-
findNextInIterable
-
findPreviousInIterable
-
make
-
make
-
makeEnumMap
-
sequence
public static <V> CompletableFuture<List<V>> sequence(List<? extends CompletableFuture<V>> p_137568_) -
sequenceFailFast
public static <V> CompletableFuture<List<V>> sequenceFailFast(List<? extends CompletableFuture<? extends V>> p_143841_) -
sequenceFailFastAndCancel
public static <V> CompletableFuture<List<V>> sequenceFailFastAndCancel(List<? extends CompletableFuture<? extends V>> p_214685_) -
fallibleSequence
private 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
-
runWithRetries
private static boolean runWithRetries(int p_137450_, String p_137451_, BooleanSupplier... p_137452_) -
safeReplaceFile
-
safeReplaceOrMoveFile
-
offsetByCodepoints
-
prefix
-
fixedSize
public static com.mojang.serialization.DataResult<int[]> fixedSize(IntStream p_137540_, int p_137541_) -
fixedSize
public static com.mojang.serialization.DataResult<long[]> fixedSize(LongStream p_287579_, int p_287631_) -
fixedSize
-
startTimerHackThread
public static void startTimerHackThread() -
copyBetweenDirs
public static void copyBetweenDirs(Path p_137564_, Path p_137565_, Path p_137566_) throws IOException - 抛出:
IOException
-
sanitizeName
-
singleKeyCache
-
memoize
-
memoize
-
toShuffledList
-
toShuffledList
public static it.unimi.dsi.fastutil.ints.IntArrayList toShuffledList(IntStream p_214659_, RandomSource p_214660_) -
shuffledCopy
-
shuffledCopy
public static <T> List<T> shuffledCopy(it.unimi.dsi.fastutil.objects.ObjectArrayList<T> p_214612_, RandomSource p_214613_) -
shuffle
-
blockUntilDone
public static <T> CompletableFuture<T> blockUntilDone(Function<Executor, CompletableFuture<T>> p_214680_) -
blockUntilDone
-
createIndexLookup
-
createIndexIdentityLookup
-
writeAndReadTypedOrThrow
public static <A,B> com.mojang.datafixers.Typed<B> writeAndReadTypedOrThrow(com.mojang.datafixers.Typed<A> p_309938_, com.mojang.datafixers.types.Type<B> p_312439_, UnaryOperator<com.mojang.serialization.Dynamic<?>> p_312172_) -
readTypedOrThrow
public static <T> com.mojang.datafixers.Typed<T> readTypedOrThrow(com.mojang.datafixers.types.Type<T> p_309502_, com.mojang.serialization.Dynamic<?> p_310749_) -
readTypedOrThrow
public static <T> com.mojang.datafixers.Typed<T> readTypedOrThrow(com.mojang.datafixers.types.Type<T> p_309451_, com.mojang.serialization.Dynamic<?> p_312737_, boolean p_310890_) -
copyAndAdd
-
copyAndAdd
-
copyAndPut
-